When I am displaying the pixel values of an image (a RGB image converted to grayscale) using "display" function in matlab, I found that the pixel values are less than 1 (all values are between 0 and 1). Whereas when I do the same in opencv, I am getting higher values. Why the change in values happen ? Open CV code and matlab code is as follows:
for (int i = 0; i < img1.rows; i++)
{
for (int j = 0; j < img1.cols; j++)
{
cout << (unsigned int)img1.at<uchar>(i, j) << endl;
}
}
Matlab code:
gI=rgb2gray(I);
imshow(gI);