필터 지우기
필터 지우기

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

조회 수: 4 (최근 30일)
Syed Amer
Syed Amer 2018년 1월 17일
댓글: Syed Amer 2018년 1월 19일
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.

답변 (1개)

Image Analyst
Image Analyst 2018년 1월 18일
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.

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by