Are image morphological operations invalid for RGB images?
조회 수: 4 (최근 30일)
이전 댓글 표시
Most (if not all) of the morphological operations (e.g. imdilate, imerode, imtophat, imbothat) specify that the input image should be grayscale or binary. However, using an RGB image does not yield an error. Why is this? Is it ill-advised to use these functions with RGB (or other 3D) images?
댓글 수: 0
채택된 답변
Image Analyst
2015년 10월 10일
It treats it like a 3D volumetric image, like a CT or MRI image, not like a 2D color image. However, it can operate color plane - by - color plane like I think you want, if you give it a kernel that is flat (no extent in the Z direction). You just have to know what you're doing. Usually doing morphological operations on the RGB color channels does not make sense and can produce color artifacts, whereas for a volumetric image it does make sense.
댓글 수: 2
Image Analyst
2015년 10월 10일
Well if it works and you're happy with the results, then fine. But you may find that how well objects "survive" that filtering very much depends on the relative size of your object and your filtering window width. You may also find some share artifacts and some extra noise than some other methods might give. The bottom hat filter is the morphological closing minus the original image. Basically it's assuming the local max will be the background image and this can be noisier than say, fitting a smoothed or regression function. But it's easy, and if it works, then use it.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!