OpenCV
4.5.5
Open Source Computer Vision
|
There are more than 150 color-space conversion methods available in OpenCV. But we will look into the most widely used one: RGB \(\leftrightarrow\) Gray.
We use the function: cv.cvtColor (src, dst, code, dstCn = 0)
src | input image. |
dst | output image of the same size and depth as src |
code | color space conversion code(see cv.ColorConversionCodes). |
dstCn | number of channels in the destination image; if the parameter is 0, the number of the channels is derived automatically from src and code. |
For RGB \(\rightarrow\) Gray conversion we use the code cv.COLOR_RGBA2GRAY.
Checks if array elements lie between the elements of two other arrays.
We use the function: cv.inRange (src, lowerb, upperb, dst)
src | first input image. |
lowerb | inclusive lower boundary Mat of the same size as src. |
upperb | inclusive upper boundary Mat of the same size as src. |
dst | output image of the same size as src and cv.CV_8U type. |