Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: cut the edges of image
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Barbara

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

Hi

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?

Thanks
Barbara



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.