Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
cut the edges of image

Subject: cut the edges of image

From: Barbara

Date: 4 Nov, 2013 08:55:10

Message: 1 of 1


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?


Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us