Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does cvtColor handle non-linearities in the sRGB color space? #4973

Open
opencv-pushbot opened this issue Jul 27, 2015 · 3 comments
Open

Does cvtColor handle non-linearities in the sRGB color space? #4973

opencv-pushbot opened this issue Jul 27, 2015 · 3 comments

Comments

@opencv-pushbot
Copy link
Contributor

Transferred from http://code.opencv.org/issues/4293

|| Ying Xiong on 2015-04-24 15:45
|| Priority: Normal
|| Affected: None
|| Category: imgproc, video
|| Tracker: Feature
|| Difficulty: 
|| PR: 
|| Platform: None / None

Does cvtColor handle non-linearities in the sRGB color space?

I am wondering whether OpenCV has functions to handle the non-linearities in the sRGB color space.

Say I want to convert an JPEG image from sRGB color space into XYZ color space. As specified in this [Wiki page](https://en.wikipedia.org/wiki/SRGB#Specification_of_the_transformation), one needs to first undo the nonlinearities to convert to linear RGB space, and then multiply with the 3x3 color transform matrix. However, I couldn't find any such discussions in the [cvtColor](http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html#cvtcolor) documentation. Did I miss something?

Thanks a lot in advance!

History

Vadim Pisarevsky on 2015-05-25 11:14
-   Category set to imgproc, video
@PetterS
Copy link

PetterS commented Feb 7, 2017

Yes, OpenCV needs a lot of improvement in the gamma area. http://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/

@MarxSoul55
Copy link

It would be nice to note that as such in the documentation. For example, note here, where nothing is stated about gamma correction. The fact that the conversion starts with a linear transformation reinforces an assumption that the conversion doesn't perform any sort of gamma correction. When I have more free time, I will try to contribute and fix the issue myself.

On a related note, can you clarify the usage of conversion codes beginning with LRGB or LBGR such as COLOR_LBGR2Lab? Does the L mean the function will expect linear values for RGB/BGR instead of gamma-encoded values?

Thanks in advance! ❤️

@lindemeier
Copy link

lindemeier commented Apr 23, 2020

It is also not clear how cv::imshow and cv::imdecode behave. Some documentation would be very appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants