Ask Your Question
0

OpenCV RGB to HSV wrong colors, detection by color

asked Feb 5 '15

Nemesis gravatar image

updated Feb 5 '15

berak gravatar image

Hi, I am working on project what detect hematoma from skin. I am having issue with color after convertion from RGB to HSV. My algorithm detect hematoma by its color.

With some images I have good results like here:

Original img: http://imgur.com/WHiOWdj Result img: http://imgur.com/PujbnHa

But with some images i have bad result like this:

Original img: http://imgur.com/OshB99r Result img: http://imgur.com/CuNzAId

The same original image after convertion to HSV: http://imgur.com/lkVwtCs

Do you have any ideas how to fix it?

Thanks

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered Feb 5 '15

Before answering for your question first make an application to find the right HSV values for your Function. You can refer this example.

Now use the HSV Range : Min: (140,20,0) Max: (180,200,200) for filtering that color alone. Also please read this faq.

Preview: (hide)

Comments

thank you for yout answer. I was using just H value and I solve it by binarize both H and S images and with an AND operation I execute filtering. But I have done some tests and I found out that my simple binarization threshold( planes[0], img, 108, 255,THRESH_BINARY ); with set values are not so good with other images. Is there some smart threshold that can calculate it automatically from input image?

Nemesis gravatar imageNemesis (Feb 7 '15)edit

Question Tools

1 follower

Stats

Asked: Feb 5 '15

Seen: 2,279 times

Last updated: Feb 05 '15