Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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?

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!

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?

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!

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!