Ask Your Question
1

detect colored bars from an object

asked 2014-03-09 07:01:02 -0600

madmax gravatar image

Hi,

I am trying to filter for the colored bars like you can see in this image:

image description

Right now I try with a mean()over the rgb image and crop all under this threshold.
But then it looks like this:

image description

Do you have any idea what I could do better or other methods for getting the color?
Or should I just search for the colors? (There are about 10 colors that can occur)

edit retag flag offensive close merge delete

Comments

2

You can use the HSV-color wheel here to choose correct color.

Haris gravatar imageHaris ( 2014-03-09 22:55:47 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
4

answered 2014-03-09 07:26:28 -0600

wuling gravatar image

updated 2014-03-09 10:29:02 -0600

Hi try to use inRangelink text and cvcolor to coverter color space like hsv,cym etc to solve this problem

edit flag offensive delete link more

Comments

To filter all but the color bars or to filter for each color that can occur?

madmax gravatar imagemadmax ( 2014-03-09 13:06:59 -0600 )edit

There are two soluation here: 1. in color space(RGB ,HSV,CYM.......): use inRange 2. separate each color channel that easy to handle: use threshold. you can use filter to reduce some noise.

wuling gravatar imagewuling ( 2014-03-09 19:48:01 -0600 )edit

Just as a remark. The RBG (or BGR for OpenCV) is the worst color space for efficient color thresholding. I suggest using the HSV color space like suggested!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-03-10 10:03:54 -0600 )edit

Yes, for color detection I am using HSV already, but was wondering how I could segment the bars best.

madmax gravatar imagemadmax ( 2014-03-10 12:10:39 -0600 )edit
2

answered 2014-03-10 19:18:57 -0600

wuling gravatar image

updated 2014-03-10 20:46:09 -0600

when you decide to use hsv color space then drawing histogram and try in error to get threshold value Remember that the in each color space min, & max. threshold value may fail in 0<=min<=max<=255 or 0~min & max~255. Finally you use morphology like erode,dilate,region filling etc,and get the shape you want.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-03-09 07:01:02 -0600

Seen: 993 times

Last updated: Mar 09 '14