android - Get white pixels and save it to array in java opencv -
i try white pixel in binary image , save coodinate of pixel array of matrix 2x1. this:
//x y //2 3 //7 8 //13 16 //24 26 //78 103 //22 14 //16 18
i use opencv in android , white pixel in binary image , save coodinate of pixel array handle. don't know how save array , array in opencv suitable(matofpoint,matofpoint2f,matofint...)
here code, lack
size binaryimage_size = binaryimage.size(); double[] pixel_white = new double[0]; //just use 1 channel matoffloat pointpositions = new matoffloat(); for(int i=0;i<binaryimage.height;i++) { for(int j=0;jbinaryimage.width;j++) { pixel_white = binaryimage.get(i,j); if(pixel_white[0]>0) { // maybe use pointpositions.push_back(point(i,j)); wrong //which implementation should here? } } }
Comments
Post a Comment