Home > front end >  Why do I get completely different hue values for blue markers in openCV?
Why do I get completely different hue values for blue markers in openCV?

Time:10-03

I'm trying to detect color body markers. So I draw white and blue dots on the skin. My problem is that some blue markers get completely different H values from other blue markers. Here is an example image:

Blue and white body markers

In this image, there are blue markers near white ones. When I color pick the left blue marker I get an HSV value of [135,26,99] (I use opencv, and this is an expected value of blue). When I pick the right blue marker I get an HSV value of [10,94,81]

Visually to me, they look similar, but they are in completely different H range, which make it hard to detect. I thought HSV was designed for exactly for this. Any suggestion how I can detect these markers?

CodePudding user response:

That's because those "blue" markers are basically gray.

See, their saturation is zero, meaning they have no color!

You need to correct your white balance so they're actually blue, not gray.

You do that by pointing the camera at something white/gray and adjusting white balance so that area is actually white/gray, instead of having some tint.

Look at this saturation plane: screenshot of a screenshot of an upscaled screenshot of a screenshot and so on

Here's the thing balanced using that dim beige area at the top which I assume is a random grayish thing in the room.

balanced

see, now these blobs have slightly better saturation:

enter image description here

Since your picture is of such poor quality, anything you derive from it will also be bad.

  • Related