Effacer les filtres
Effacer les filtres

How to threshold a color range in image processing[HSV]?

4 vues (au cours des 30 derniers jours)
Syed Amer
Syed Amer le 17 Jan 2018
Commenté : Syed Amer le 19 Jan 2018
I want to selectively choose a specific color set from an image and set all the other values that don't fall in this range as zero like the one in the colorThresholder App (but that is an app, i need a function or a code segement)
I can choose a specific set of values as shown below
Consider a range defined by the vairables min and max as min = [h1 s1 v1] and max = [h2 s2 v2] now i want an image to let all the values in this color set(i.e. hue from h1->h2, similarly s1->s2 and v1->v2) to be set as 1 and the rest to be set as 0s. Previously i was able to achieve this in python using the following code: x = cv2.inRange(inputimage, min, max) I have been searching for and equivalent function and even trying to make my own but to no avail I would be grateful if someone can help me out.

Réponses (1)

Image Analyst
Image Analyst le 18 Jan 2018
Grab the blue handles and move the threshold bars to segment the image the way you want. Then click on the Export button and select Export Function.
  1 commentaire
Syed Amer
Syed Amer le 19 Jan 2018
Thanks, i'll try and see what happens

Connectez-vous pour commenter.

Catégories

En savoir plus sur Image Segmentation and Analysis dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by