Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked Jan 8 '16

zvonimirb gravatar image

How to get OpenCV to store HSV in Matlab notation [0-1]?

I am working on transferring a working Matlab project to C++/OpenCV, but I'm encountering a problem while converting from BGR to HSV, since the project is intended to work with small numbers that Matlab uses to store HSV values.

If i just do a normalization to the HSV matrix (Hue/179, Saturation/255, Value/255) I will lose a part of data that could be important in the image recognition later on.

Is there a better way to convert from BGR - HSV without losing part of the data? Has anyone encountered this problem? What is the most efficient way solve it?

Thanks

Zvonimir

click to hide/show revision 2
No.2 Revision

How to get OpenCV to store HSV in Matlab notation [0-1]?

I am working on transferring a working Matlab project to C++/OpenCV, but I'm encountering a problem while converting from BGR to HSV, since the project is intended to work with small numbers that Matlab uses to store HSV values.

If i just do a normalization to the HSV matrix (Hue/179, Saturation/255, Value/255) I will lose a part of data that could be important in the image recognition later on.

Is there a better way to convert from BGR - HSV without losing part of the data? Has anyone encountered this problem? What is the most efficient way solve to it?

Thanks

Zvonimir