How to extract red color plane in OpenCV C++
How to extract red color plane in OpenCV C++?
How to extract red color plane in OpenCV C++?
easy!
Mat src=imread("my.png");
Mat planes[3];
split(src,planes); // planes[2] is the red channel
Is it applicable for android programming in Java with openCv? if not then can you please suggest me the alternative for this code, Thank you.
Thank you Sir for reply, I managed to write the code, and convert the related 3 channels from matrix form to bitmap form but code is not working. The app just show dialog box [Unfortunaly app has stopped].
prefer to use void cv::extractChannel (InputArray src, OutputArray dst, int coi )
cv::Mat out; cv::extractChannel(in, out, 0) // Supposing RGB channel with red first out....
src: http://docs.opencv.org/master/d2/de8/group__core__array.html#gacc6158574aa1f0281878c955bcf35642
Thank you :)
I have used this one and it worked well:
IplImage* frame_r = cvCreateImage(size, IPL_DEPTH_8U, 1);
IplImage* frame_g = cvCreateImage(size, IPL_DEPTH_8U, 1);
IplImage* frame_b = cvCreateImage(size, IPL_DEPTH_8U, 1);
cvSplit(frame, frame_b, frame_g, frame_r, NULL);
What you are doing isn't C++ code but using the old C-style API. Keep in mind that the support for the old API will start to get less and less, since people are stimulated to use the newer, more clear C++ interfacing of OpenCV.
Sir how to subtract among three planes example r-g+b
That is just a simple operator. I think you can subtract and add matrices. Have you tried
Mat temp = red - green + blue;
This should work for your needs!
Asked: 2013-05-18 11:22:41 -0600
Seen: 39,615 times
Last updated: May 21 '13
How to use InRange at Different Color Space and Range.
How to get minimus & maximum bounds of the color space
how can convert rgb to cie l*a*b with cpp
i want to convert from rgb to lab
What's the best way to segment different coloured blobs?
Should add color profile embedder in next version
Percentage of color in a frame of video