SimpleColorDetectio​nByHue()

バージョン 1.2.0.0 (23.3 KB) 作成者: Image Analyst
Detect colored regions in an image via thresholding in HSV color space.
ダウンロード: 22.6K
更新 2015/12/19

ライセンスの表示

This script is a demo that shows you how to find objects of a certain color in an image. For this example I'm using the standard onion, peppers, or kids image that ships with the Image Processing Toolbox. You can also select one of your own color images instead if you wish. Then I separate the image into its component hue, saturation, and value color bands. I ask you what color you want to find (red, green, yellow, white). I compute thresholds, and ultimately find a mask for the regions of the color you specified. Prompts will guide you through the demo step by step. I multiply this mask by the original image to show the image with only the requested color showing and everything else blacked out.
If you want to do any measurements of the objects, I refer you to my blob measurement demo file at http://www.mathworks.com/matlabcentral/fileexchange/25157
Requires the Image Processing Toolbox. Tested with MATLAB release R2014a.

引用

Image Analyst (2024). SimpleColorDetectionByHue() (https://www.mathworks.com/matlabcentral/fileexchange/28512-simplecolordetectionbyhue), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2015b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
謝辞

ヒントを得たファイル: Image Segmentation Tutorial, SimpleColorDetection()

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.2.0.0

Updated code to use line() instead of stem(), because MATLAB R2015b release did not like how I had used stem(), even though old releases were happy with it.

1.1.0.0

Updated to handle bug in bar() introduced between R2010a and R2014b. Also added ability to choose color to find.

1.0.0.0