SimpleColorDetectio​n()

バージョン 1.4.0.0 (20.5 KB) 作成者: Image Analyst
Script to do simple color detection in RGB color space. Finds red objects in the image.
ダウンロード: 21.3K
更新 2018/2/17

ライセンスの表示

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 canoe 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 red, green, and blue color bands. I compute thresholds, and ultimately find a mask for the red objects. 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 red objects showing and everything else blacked out. This script can be adapted to find other colors (white, green, blue, yellow, etc.)
If you want to do any measurements of the red 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 R2008b and R2010a.

引用

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

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

Community Treasure Hunt

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

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

Fixed calls to stem() and surface() that were no longer compatible with release R2017b. However, it should work in all previous versions as well.

1.3.0.0

Now allows non-indexed monochrome images (simple gray level images with no stored colormap), and gracefully handles cases where there are no red blobs at all.

1.2.0.0

Expanded screenshot, and fixed small bug that happened when you were using your own image instead of demo images.

1.1.0.0

Added measurements of area, mean Red value, mean Green value, and mean Blue value for each red blob that was found.

1.0.0.0