フィルターのクリア

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.
  1 件のコメント
Syed Amer
Syed Amer 2018 年 1 月 19 日
Thanks, i'll try and see what happens

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by