What is the java equivalent?
I'm trying to implement the below piece of code in JAVA; however, I cannot find a replacement for Vec3f. Any hint on it?
Mat samples( img.rows * img.cols, 3, CV_32FC1 );
int index = 0;
for( int y = 0; y < img.rows; y++ ) {
Vec3f * row = float_img.ptr(y);
for( int x = 0; x < img.cols; x++ )
samples.at<Vec3f>(index++, 0) = row[x];
}
return samples;
Thank you!
you probably should not attempt do do anything per-pixel from java.
what is the context of this ? what is it doing ?
(maybe wecan help you to find a more "high-level" replacement.)
I'm trying to generate a Mat from my RGB image to train EM algorithm. Thus, it is creating a sample vector.
could you add, how "samples" is initialized ?
I added it on the code.