In Java:
I am reading an image using JAI:
BufferedImage image = javax.imageio.ImageIO.read(new File("path to JPG image"));
Then, I look at the rgb value of the pixel (0,2):
System.out.println("pixel[0][2]="+(new Color(image.getRGB(2, 0))));
In C++ OpenCV:
Mat image = imread("path to the same JPG image");
image.convertTo(image, CV_32S);
cout <<" r value of pixel[0][2] "<< image.at<Vec3i>(0, 2)[2] << "\n";
The values are different: r value in Java is 156 and in C++ is 155. Why?