Error when decoding a jpeg file (Bug #4046)


Added by Ernest Galbrun over 10 years ago. Updated almost 10 years ago.


Status:Cancelled Start date:2014-12-04
Priority:Normal Due date:
Assignee:- % Done:

0%

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

Description

I have stumbled upon a quite disturbing issue while trying to compare my algorithm with a standard Matlab algorithm. The problem is that when reading my input image which is a jpeg image, I don't have the same data. The data are not very different, but they differ enough so that it is measurable.

Here is the image I am using : http://imgur.com/QwGMsgl

I am reading it using cv::imread with the latest master commit on git.

The 4th pixel of the 1st row is :
- (114,84,170) for Matlab or MS Paint
- (116,83,170) for OpenCV

Do you have an idea how I could check who is right and who is wrong here, and a pointer as to where I can correct it if OpenCV is at fault ?


History

Updated by Maksim Shabunin over 10 years ago

Hi, I can not reproduce you issue. I've tried the following code (on linux):

Mat img = cv::imread("QwGMsgl - Imgur.jpg");
std::cout << img(Rect(3,0,1,1)) << std::endl;

And it printed [170, 84, 114]
Please, provide additional information about your platform and JPEG library used (you can find it in cmake output).

Updated by Yida Wang about 10 years ago

Different decompression algorithm in OpenCV and Matlab with jpeg iamges

Updated by Ankit Dhiman about 10 years ago

Yes, you can check who is right.
1.) Get a raw image file (uncompressed image data). Android 5.0 Nexus 5 or Nexus 6 let's you take an image in raw format. You can get dataset from Internet as well.
2.) Read this image file. (Call it orgImage)
3.) Save this image file in JPEG format.
4.) Read the saved file. (Call it jpegImage)
5.) Compute the square error between orgImage and jpegImage. That'll give you an idea whose method is better.

I think there should not be any difference because JPEG is a standard algorithm.

Updated by Vadim Pisarevsky almost 10 years ago

looks like the bug can not be reproduced

  • Status changed from New to Cancelled

Also available in: Atom PDF