Issue in Mat type in Android+OpenCV
double[] labels = {0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}; Mat labelsMat = new Mat(10,1, CvType.CV_32FC1); labelsMat.put(10, 1, labels); Log.d("Value of labels Mat is:: ",""+labelsMat.get(10, 1));
It's printing Null for labelsMat. Can anyone please tell me where i'm doing wrong?
oh, dear, - indexing in c++/java goes from 0 to size-1, so
labelsMat.get(9, 0)
is the last valid itemStill it's printing null.
also you can't
put(10,1,labels)
do you see it now ? try:(hmm, maybe it's a good idea, to take a break from this, get a book on java basics, try the first 20 project-euler problems, or such ?)
Thank you for your answer as well as suggestion.