removing border pixels in a binary image
古いコメントを表示
Hello all, below is a binary image

i want to remove the border pixels as shown in red (i used paint to highlight ) in the below image

I cannot use imclearborder for this task as it eliminates any pixel attactched to the border too. So i was thinking we could write a loop and set the first and last white oixel in each row to zero. I am not quite sure how to write the loop. Can anyone help me with this problem?
9 件のコメント
KALYAN ACHARJYA
2020 年 5 月 13 日
編集済み: KALYAN ACHARJYA
2020 年 5 月 13 日
No need of "for loop" here, may be multiple logic required. As the expected ROI is not clearly distinguishable from other regions in the image (in shapes or sizes)
Apply the morphological operation, it may help. Please sure it is possible to accomplished.
Rik
2020 年 5 月 13 日
You could maybe start with imclose.
Apoorva Maiya
2020 年 5 月 13 日
Rik
2020 年 5 月 13 日
Ah, sorry I misspoke. You can use imopen to separate the outer line from the other structures. One of the problems is that your outer line is not a single pixel wide, so simply removing the rightmost and leftmost white pixels will not help.
Apoorva Maiya
2020 年 5 月 14 日
Walter Roberson
2020 年 5 月 14 日
I wonder if skeletonization would help for your purpose?
Also see imtophat and imbottomhat
Apoorva Maiya
2020 年 5 月 14 日
Apoorva Maiya
2020 年 5 月 15 日
Apoorva Maiya
2020 年 5 月 17 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Morphological Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
