Filter löschen
Filter löschen

How to change the pixels values along the boundary?

1 Ansicht (letzte 30 Tage)
Ratna
Ratna am 7 Aug. 2012
I have a black and white image, it has different sized white dots all along the edges. I want to change the dots along the top and bottom side of the image to black, without changing the left and right side dots of the image. Is there any way to do this?

Antworten (1)

Image Analyst
Image Analyst am 8 Aug. 2012
Yes. I'm assuming you have a binary (logical, black and white) image, not a grayscale image. Save the right and left columns from row 2 to the end row-1. Then write zeros into those columns. Then call imclearborder(), then write those saved columns back into the resulting image. It's only 7 lines (not including comments), but write back if you can't figure it out.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by