Remove unwanted area of image ?

5 views (last 30 days)
Jenifer NG
Jenifer NG on 6 Oct 2022
Commented: Jenifer NG on 14 Oct 2022
Hi Everyone,
I want to remove unwanted area of an image by apply image processing. But i stuck to remove area after thresholding.
Could anyone help ?
Bellow is my step.
Img = imread('image.png')
img = im2gray(img)
img = img<150
imshow(img)
Thanks and Regards!
Han

Accepted Answer

Matt J
Matt J on 6 Oct 2022
A=im2gray(imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1147135/image.png'));
A(205:260,:)=[];
imshow(A)
  5 Comments
Jenifer NG
Jenifer NG on 6 Oct 2022
Oh it work for me also.
I used wrong image
Thanks you

Sign in to comment.

More Answers (1)

Taru
Taru on 7 Oct 2022
Hi,
Try the below code, it performs image matrix manipulation to get the required output.
img=imread('image.png');
im2=img>150;
sz=size(img)
row=sz(1,1);
col=sz(1,2);
psz=0;
for i=1:row
if im2(i,:)==im2(1,:)
psz=psz+1;
end
end
patchsize=psz;
nimg=[img(1:sz/2-patchsize,:);img(1:patchsize,:);img(sz/2+patchsize:end,:)];
imshow(nimg)
  3 Comments
Jenifer NG
Jenifer NG on 14 Oct 2022
Thanks you so much!
I got it

Sign in to comment.

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!