Thresholding operation on HSV Image

I wish to do thresholding operation on a HSV Image converted from an RGB image. Is there any function like imtool()for RGB images that display the HSV Values of a pixel?

Réponses (3)

Image Analyst
Image Analyst le 4 Fév 2014

1 vote

Yes. My demo "Simple color detection by hue" in my File Exchange does that. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 Also there is an interactive thresholding application.

1 commentaire

Image Analyst
Image Analyst le 5 Fév 2014
You can use impixelinfo() to have the value of the three channel image that's being displayed show up in a little static text box as you mouse around. The image can be RGB, grayscale, or HSV. Let me know if you can't figure it out. You may have to play around with the 'Position' option to see the text.

Connectez-vous pour commenter.

kartheek
kartheek le 4 Fév 2014

0 votes

Dear Analyst
Thank you for your answer. But, is there a way where we can see the instantaneous values of H,S,V in the same way we can get values of R,G,B when I hover the cursor over the pixels using imtool()? coz, I want H,S,V values for only a particular region of image

4 commentaires

Jeff E
Jeff E le 4 Fév 2014
Have you tried using the rgb2hsv function to convert your image to an HSV image? You can then use the imtool function as you would with an RGB image. True, the image will look a little weird, but you will get the desired functionality with the red channel = hue , green = saturation , blue = value. Try it with a RGB color wheel to start with and see if it makes sense.
kartheek
kartheek le 5 Fév 2014
I have used rgb2hsv(). but the values it is showing are less than 1. Do I have to use the RGB to HSV Conversion formula again to get my original HSV values?
Image Analyst
Image Analyst le 5 Fév 2014
No. What original HSV values? As far as I know there is only one hsv image, and it has values between 0 and 1, like it should. Exactly what are you expecting?
JESU
JESU le 27 Juil 2023
channel1Min = 0.825;
channel1Max = 0.451;
% Create mask based on chosen histogram thresholds
sliderBW = ( (H(:,:,1) >= channel1Min) | (H(:,:,1) <= channel1Max) );
BW = sliderBW;

Connectez-vous pour commenter.

Image Analyst
Image Analyst le 27 Juil 2023

0 votes

You can use the Color Thresholder app on the Apps tab of the tool ribbon to interactively threshold the color image by moving sliders.

Catégories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by