I am a beginner in opencv. I am using opencv v2.1. I have converted an RGB image to HSV image. Now I want to obtain single channels Hue, Value and Saturation separately. What should I do? I have seen similar questions here but No-one answered that. Kindly help.
相关问题
- How to get the background from multiple images by
- Try to load image with Highgui.imread (OpenCV + An
- CV2 Image Error: error: (-215:Assertion failed) !s
- Is it a bug of opencv RotatedRect?
- How do I apply a perspective transform with more t
相关文章
- How do I append metadata to an image in Matlab?
- opencv fails to build with ipp support enabled
- Code completion is not working for OpenCV and Pyth
- Face unlock code in Android open source project?
- Python open jp2 medical images - Scipy, glymur
- How to compile a c++ application using static open
- On a 64 bit machine, can I safely operate on indiv
- Converting PIL Image to GTK Pixbuf
Here it is for a Mat:
You can access the same way you were accessing for RGB image where 1st channel will be for H, 2nd channel for S and 3rd channel for V.
If you are using OpenCV 2.1, you must be using IplImage then, right? like if your HSV image is
IplImage *src
.cvSplit function splits a multichannel array into several single channels. Correct me if I am wrong. I would recommend using OpenCV 2.4. It has structs like cvMat which are very easy to handle just like 2D arrays.
EDIT: If you are using Mat then you can separate the channels out easily. Let's say your hsv mat is
Mat img_hsv
. Then :See if you can work out with this.
Solution for Python: