RYYCy bayer pattern to RGB image - opencv

I am looking for a solution to convert images with an RYYCy (Red, Yellow, Yellow, Cyan) bayer pattern to RGB. So far, I could only find solutions for different combinations of RGGB.
Does someone know a solution or open-source implementation? Or is there a straight-forward way to first convert RYYCy to RGGB and then apply the debayering?
Thanks in advance guys!

Related

RGB to Munsell/Hue-and-Tone Conversion

I want to convert colors from RGB to Hue and Tone(Chroma and Value) 130 System. I've searched but it seems there is no direct way for that, and no python library is available. Some references says RGB should be first convert to sRGB and after that we could generalize Munsell(Chroma, Value and Hue) to reach Hue and Tone from it. Another approach says we should convert RGB to XYZ and then extract Munsell and use it to make Hue and tone version. Some other approaches just quantize the RGB histogram and do not explain how exactly. Is there any clear way to do that? If anyone knows please help.

Best way to find HSV values

I am going to apply a HSV threshold to the image below in order to extract the tennis ball. But I could not figure out the best way to find the correct HSV values of the ball. Which method/software do you suggest to me? (I am using Ubuntu) Also according to your experiences which min/max values do you prefer to me? (±10? ±5?)
Regards
You can use Gimp to get needed color. The tool is called Color Picker. It also shows HSV values. Here's screenshot of your image:
Have you considered to use Hough CircleDoc ?
I think in this case it would be much more indicted, because the colors in your image aren't so clear

Detect red color in different illumination or background

I can't find the best way to detect red color in different illumination or background.
I found that there's YCbCr color space which is good for red or blue color detection (actually I need to detect blue color too). The problem is that I can't figure out which threshold to use in different lightning. For example in sunny weather this threshold equals 210 (from 255), when in cloudly weather this threshold equals 130.
I use OpenCV library to implement this.
Thanks for any help or advice.
Yes, HSV is usually used for such purpose. In HSV you can tell that whatever is brightness etc, red is what is needed. I also recommend to look into two places. One is simple tutorial http://aishack.in/tutorials/tracking-colored-objects-in-opencv/ and another is to take a book Learning OpenCV and use examples of histograms from there. They do exactly what you need. Using HSV and Histograms makes your solution solid.
HSV color space should be more robust to change of illumination.

Color detection opencv

Using opencv, can a detection of a certain colour(Between a certain range of rgb values) be carried out in an image or a video frame?
You need to the define the treshold in RGB, and process the pixels in the image (hopefully not the whole image but a smaller region of interest, maybe a moving foreground shape) that fit to the deffinition. Something similar to what is discussed here.
I am understanding that you know the color(or colors) you want to detect a priori.
I hope this helps.
Yes, better convert the image to HSV and try the 'InRangeS' function. Here is an example to track two different colors at same time:
https://github.com/abidrahmank/OpenCV-Python/blob/master/Other_Examples/multi_color_two_object.py
Hope it helps.
Yes - but it's easier in HSV color space. Tutorials here

Image Processing - Which OpenCV algorithm will fit my needs?

I started to work on a small hobbyist program recently in the area of image processing, and I'm kind of a noob with image processing but I'm trying to figure out at least some aspects of it.
What I want to be able to do is separate between objects in an image by their color (preferably in a real-time video feed), and then recognize their color.
I read a little about OpenCV and also about some of the different algorithms.
I even started to work a little with the canny algorithm, but I'm not sure this is the algorithm I should begin with for my need, as it detects edges of objects regardless of their color.
Even if it is the algorithm I should use, what would be the best method to recognize the colors of the objects it marked for me?
I hope I made myself clear enough.
Thanks a lot!
Understand colour spaces - RGB is almost always the worst source to do image processing on.
Start with HSL and HSV
To separate or to make a color transparent (for instance to remove it) is very simple with OpenCV... I posted an answer (see the link below) which should help you (or maybe solve your problem).
Here is the code I posted
Moreover, the answer from Martin Beckett is absolutely right, RGB is not a good color space to evaluate a color, you can use HSV, the hue value in degree tells you the proper color (something you could compare from a wavelength in a light spectrum) while S and V code a sort of intensity (what I say is to simplify in order to explain that in many cases to use Hue to segment color images is enough).
Even if it is the algorithm I should use, what would be the best
method to recognize the colors of the objects it marked for me?
The type of algorithm you are searching for is called color segmentation... Here is a tutorial which could help you as well.
Welcome to image processing community,
Julien,
For starter you should learn about image array operation, for example using OpenCV function inRange to filter colors by minimum to maximum color range. Another option is by splitting multi-channel array (in this case R, G and B) to 3 different single-channel for further examination. Hope its help

Resources