cvtcolor: bgr2lab gives wrong results (Bug #2418)
Description
cvtcolor seems to give strange results.
i have the example from [1].
compile and run it with opencv 2.1 and openc 2.4:
opencv 2.1:
<snip>
Lab values (manual):
(0,0): [83.7238,-1.75598,-1.24705]
(0,1): [88.9813,-1.58356,-1.12647]
(1,0): [82.5057,-0.684003,-1.21557]
(1,1): [86.9301,-0.626327,-1.11432]
Lab values (OpenCV):
(0,0): [83.7238,-1.75598,-1.24689]
(0,1): [88.9813,-1.58361,-1.12629]
(1,0): [82.5057,-0.683993,-1.21541]
(1,1): [86.9301,-0.626326,-1.11417]
</snap>
opendv 2.4:
<snip>
Lab values (manual):
(0,0): [83.7238,-1.756,-1.24705]
(0,1): [88.9813,-1.58358,-1.12646]
(1,0): [82.5057,-0.684003,-1.21557]
(1,1): [86.9301,-0.626327,-1.11432]
Lab values (OpenCV):
(0,0): [66.6524,-3.1321,-2.25586]
(0,1): [76.621,-3.13923,-2.22741]
(1,0): [64.4254,-1.19385,-2.18648]
(1,1): [72.6396,-1.16524,-2.13424]
</snap>
Anybody knows what's going on here?
History
Updated by Ilya Lavrenov over 12 years ago
Hello,
That's because as a code parameter the OpenCV function you use CV_BGR2Lab (sBGR to Lab),
but your code performs LBGR to Lab (CV_LBGR2Lab) conversion and as a result some discrepancy.
- Status changed from Open to Cancelled
- Assignee changed from Vadim Pisarevsky to Ilya Lavrenov
Updated by Mr. Luk over 12 years ago
Hi,
Please forgive my ignorance, but I can not find anything on CV_LBGR2Lab in the official documentation [1]. Maybe add the lines of the release notes [2] to the docs?
Is there a way to reopen this bug, or do I need to fill a new one concerning the documentation?
[1] http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html#void%20cvtColor%28InputArray%20src,%20OutputArray%20dst,%20int%20code,%20int%20dstCn%29
[2] http://opencv.willowgarage.com/wiki/OpenCV%20Change%20Logs