The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: cut the edges of image
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 2
Registered: 10/31/13
cut the edges of image
Posted: Nov 4, 2013 3:55 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I want to cut the edges of different binary images to delete the white pixels on the border.
Then resize the images to the original size.

My idea is to make the image smaller with imcrop and then add black pixels with padarray.

n_new = n-50;
smallImage = imcrop(image, [n-n_new 0 n_new m]);
noborderImage = imclearborder(smallImage, 4);
newImage = padarray(noborderImage, [0 25] );

The image gets the same size as desired. But the white pixels on the image moved to the left.

Can anyone tell me what is wrong? Or is there another way to make the pixels near the border black?


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.