Filter out different colors from image
Hello, I do have the following image. This represents a wheel profile with several colored markings. My aim is to filter out these colored lines, get the color and the position in y coordinate on the wheel. puu.sh/uFthR/4669730c31.bmp
(The image quality is way better in an original image, couldnt upload such a big image)
There can be other colors like red, green blue, yellow, brown, even white, but not black, purple... and so on. Up to 10 different colors.
I would like to create a function where I can put min and max values for RGB and using this range, it should create a mask where I then can use HoughLinesP to get the colored line.
I thought of that as the best way to get these colored lines. If anyone has a better idea on how I could solve this problem, please let me know, I am very new to OpenCV and image processing in general.
I already got some progress on finding at least some of the colors using a post from stackoverflow (I cant post links yet)
But unfortunately I was getting problems already when looking for yellow color lines. Since I also need to find white lines, I am not entirely sure, if this way is the best way to use.
So that is why I ask you guys, if there is maybe a better way on finding different color lines in that kind of image.
Thank you in advance :)
You can try to sum rows to find color values. Then you can classify pixel
Not sure if I got that correctly.
Wouldn't it be enough to convert the Mat to HSV, define two Scalars with min and max Hue Saturation and Value and use inRange to filter the color with the specific range out? Then i should have an image with only the color I specified where i can simply get the line from it? Question is, how accurate is this...
Or is that a waste of time?
"Waste of time?" I'm agree with you .