Pixel Value is different in 2.4.9 vs 3.0.0 (Bug #3904)


Added by allan b over 10 years ago. Updated almost 10 years ago.


Status:Cancelled Start date:2014-09-13
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:highgui-images
Target version:-
Affected version:branch 'master' (3.0-dev) Operating System:Windows
Difficulty: HW Platform:x64
Pull request:

Description

I am getting different values at the pixel level when using 2.4.9 vs 3.0.0

The values are different when looking at the image pixels via integers or when converted to a float / double.

Mat img;
Mat d_img;
img = imread("a_file.jpg");
img.convertTo(d_img, CV32FC3, 1.0 / 255.0);

for (int i = 0; i < d_img.rows; i++)
{
   for (int j = 0; j < d_img.cols; j++)
   {
      //float or double same error 
      //also different values if I peek into the int version of the image.
      double d_blue = d_img.at<Vec3cf>(i,j)[0];
      double d_green = d_img.at<Vec3cf>(i,j)[1];
      double d_red = d_img.at<Vec3cf>(i,j)[2];

      cout << d_blue << " " << d_green << " " << d_red << endl;
   }
}

Associated revisions

Revision 0e8bfff3
Added by Vadim Pisarevsky almost 10 years ago

Merge pull request #3904 from SeninAndrew:2.4

History

Updated by Dmitry Retinskiy over 10 years ago

Vadim, could you check this?
Thanks.

  • Description changed from I am getting different values at the pixel level when using 2.4.9 vs 3.0.0 ... to I am getting different values at the pixel level when using 2.4.9 vs 3.0.0 ... More
  • Status changed from New to Open

Updated by Vadim Pisarevsky almost 10 years ago

jpeg is lossy format that may produce slightly different images with different codecs, different versions of libjpeg etc. If you need bit-exact results, use tiff, png or other lossless image compression formats

  • Status changed from Open to Cancelled
  • Category changed from core to highgui-images

Also available in: Atom PDF