How to apply morphological operations like clearing border and removing small objects using matlab for color image?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a color image obtained after using k-means cluster and I want to apply morphological operations like cleaning border,filling holes and remove small object using matlab but thsese operation works only on grayscale or binar image in matlab! Any suggestions please!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/193923/image.jpeg)
댓글 수: 0
답변 (1개)
Image Analyst
2018년 8월 16일
Since you seem to have a masked image, since large parts are perfectly black, you must already have a binary image mask. So just use it on that mask before applying the mask to the color image.
댓글 수: 4
Image Analyst
2018년 8월 21일
If you'd rather, then you can use the kmeans indexes and reshape to get the mask. See my attached demo.
참고 항목
카테고리
Help Center 및 File Exchange에서 Modify Image Colors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!