Remove unwanted lines from an image

sir, i attached my picture with this. in that i want to remove the horizontal and vertical line and a slanting line attached to horizontal line. how can i? plz help me

Respuestas (2)

Thorsten
Thorsten el 2 de Jul. de 2015
I = im2double(imread('Untitled.png'));
I = im2bw(I(:,:,1), 0.5);
L = bwlabel(I);
I(L== L(167, 10)) = 0;
Image Analyst
Image Analyst el 2 de Jul. de 2015
Try this:
rgbImage = imread('untitled.png');
subplot(3,1,1);
imshow(rgbImage);
axis on;
title('Color Image', 'FontSize', 22);
binaryImage = rgbImage(:,:,1) > 128;
subplot(3,1,2);
imshow(binaryImage);
title('Binary Image', 'FontSize', 22);
axis on;
Now get rid of lines.
% Erase top line
binaryImage(1,:) = false;
% Erase bottom thick line and edge line.
binaryImage(165:end,:) = false;
% Erase left border line
binaryImage(:,1:2) = false;
% Erase right thick line and edge line
binaryImage(:, 211:end) = false;
subplot(3, 1, 3);
imshow(binaryImage);
title('Cleaned Binary Image', 'FontSize', 22);
axis on;

7 comentarios

Parth Dethaliya
Parth Dethaliya el 18 de Abr. de 2020
Can this be automated, because I wants to use it in more number of images and their may also vary. So a direct cropping/assigning 0 values to selected pixels won't work!
Please help
Image Analyst
Image Analyst el 18 de Abr. de 2020
Yes. See the FAQ.
calvin Li
calvin Li el 24 de Abr. de 2023
hi Image Analyst Sir,
could you please indicate which FAQ in the FAQ link since I can't find any related one? thanks
BRs
Calvin
Image Analyst
Image Analyst el 24 de Abr. de 2023
@calvin Li, all browsers that I've ever seen will let you just click on the "the FAQ" link and will take you there. Also if you hover over that link, it will show you the link URL address in a status bar or tooltip string somewhere.
Since your browser doesn't have that feature, or your didn't know about it, here is the full link below:
calvin Li
calvin Li el 25 de Abr. de 2023
Hi Image Analyst Sir,
Sorry, the statement is not that i can not find the link but i can not find the answer about the automaticly remove unwanted line from image. as the attached, there are some number and english charaters w/ a interference curve. Just like Parth Dethaliya has mentioned. I want to remove the curves by matlab but didn't find any solution to achieve the goal. if you have any suggestion, please let us know. thanks
Image Analyst
Image Analyst el 25 de Abr. de 2023
Sorry, I'm not interested in helping people defeat captchas.
calvin Li
calvin Li el 26 de Abr. de 2023
It's OK. Understood your mindset. Thanks

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 2 de Jul. de 2015

Comentada:

el 26 de Abr. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by