Colour based segmentation

版本 1.2.0.0 (100.6 KB) 作者: Michala
Compute the area of the given color (color band) in the image
1.7K 次下载
更新时间 2014/2/28

查看许可证

The script computes how many [%] of the image the chosen colour (colour band) occupies.
Input: you have to know the RGB numbers (or bands) of the colour of interest.
The colour bands better capture the colour fluctuations.
Output: [%] of the image that are occupied by the given color(s). Images of Red, Blue, and Green masks of the original colour image, histograms of red, blue, and green parts of the image, distribution of the size of the blobs, mask excluding the small blobs, mask with the filled holes, comaprison of the original and final image, summary table: number of the blobs, their areas [pixel], and their colour. The resultant table is saved in *.xls file - blobs' area, colour, colour bands (user input), minimal size of the blobs (user input), [%] of the image covered by the chosen colour.

Notes:
1) you can decide whether you want to get rid of small blobs of the colour areas (area smaller than given "user-input" value will be excluded)
2) you are asked if you want to fill the holes in the blobs found.
3) use "imtool" to explore the RBG colors in the image

Image source: Rocks under the Microscope
www.earth.ox.ac.uk/~oesis/micro/

Literature:
1) rgb table: http://www.rapidtables.com/web/color/RGB_Color.htm
2) bwareaopen - http://www.mathworks.ch/ch/help/images/ref/bwareaopen.html
3) matlab webinar: http://www.mathworks.ch/videos/medical-imaging-workflows-with-matlab-81850.html?form_seq=conf924&confirmation_page&wfsid=5335062

引用格式

Michala (2024). Colour based segmentation (https://www.mathworks.com/matlabcentral/fileexchange/45679-colour-based-segmentation), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2011b
兼容任何版本
平台兼容性
Windows macOS Linux
致谢

参考作品: sublabel, SimpleColorDetection()

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.2.0.0

28.2.2014 (V13)- Create new folder for the results, automatically save images, headers in the xls file, saving the xls file (decision window), histogram of the size distribution.

1.1.0.0

An example image was added to the submission - the default values in the pop-up windows lead to the result presented in the screenshot of this submission.

1.0.0.0