Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv mat.at<cv::vec4b> convert to java

Hello I have opencv code written on objective-c I dont know how to convert it on java..

The objective c code looks like this.

cv::Math image2 = .....

for(int x = image2.cols; x >= 0; --x){ for(int y = 0; y < image2.rows; y++) { int red = image2.at<cv::vec4b>(y,x)[0]; int green = image2.at<cv::vec4b>(y,x)[1]; int blue = image2.at<cv::vec4b>(y,x)[2];

//to set the pixel
 //image2.at<cv::Vec4b>(y,x)[0] = 100;
 //image2.at<cv::Vec4b>(y,x)[1] = 0;
 //image2.at<cv::Vec4b>(y,x)[2] = 200;

} }

Any help? I need java version of this code.

opencv mat.at<cv::vec4b> convert to java

Hello I have opencv code written on objective-c I dont know how to convert it on java..

The objective c code looks like this.

cv::Math image2 = .....

.....

for(int x = image2.cols; x >= 0; --x){ for(int y = 0; y < image2.rows; y++) { int red = image2.at<cv::vec4b>(y,x)[0]; image2.at<cv::Vec4b>(y,x)[0]; int green = image2.at<cv::vec4b>(y,x)[1]; image2.at<cv::Vec4b>(y,x)[1]; int blue = image2.at<cv::vec4b>(y,x)[2];

image2.at<cv::Vec4b>(y,x)[2];
 //to set the pixel
 //image2.at<cv::Vec4b>(y,x)[0] = 100;
  //image2.at<cv::Vec4b>(y,x)[1] = 0;
 //image2.at<cv::Vec4b>(y,x)[2] = 200;
 }
}

} }

Any help? I need java version of this code.