PalaniKasi
Posts: 52
Joined: Mon Dec 14, 2015 1:51 pm

How to get blue images from saturation image using opencv

Tue May 17, 2016 9:52 am

Dear guys
I want to extract blue spots from saturation image in Opencv ..I have no idea about what is the threshold value for getting blue from saturation..

Regards,
Palanikasi

PiGraham
Posts: 3671
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: How to get blue images from saturation image using openc

Tue May 17, 2016 10:49 am

I assume you have converted to HSV or HSI colour space.
The colour (e.g. blue rather than yellow, red etc) is in the Hue component.
Saturation encodes how strongly coloured a pixel is, not what colour it is.

For low values of intensity saturation values are undefined (noise).
For low values of saturation Hue is undefined (noise). You may need to Threshold first for I>I_min then S>S_min then for H_low<H>H_hi.

You could examine pixel values in each component for pixels of your target colour.
You could code adjustable thresholds and vary the values until you get a suitable result.

PalaniKasi
Posts: 52
Joined: Mon Dec 14, 2015 1:51 pm

Re: How to get blue images from saturation image using openc

Tue May 17, 2016 11:00 am

I have attached the image where i should count the blue ones
Attachments
udm1.jpg
udm1.jpg (17.66 KiB) Viewed 682 times

PiGraham
Posts: 3671
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: How to get blue images from saturation image using openc

Tue May 17, 2016 3:30 pm

What have you tried so far?

Return to “C/C++”