Effacer les filtres
Effacer les filtres

Remove Black Lines Using HoughLines Function

2 vues (au cours des 30 derniers jours)
Angga Lisdiyanto
Angga Lisdiyanto le 14 Sep 2016
Commenté : Image Analyst le 15 Sep 2016
Hi, i want to remove a black lines on image by using houghlines function.
I want like this :
  1. Detect and remove all horizontally lines with all pixel which bounds with it.
  2. Detect and remove vertically lines.
Here is process's looks like :
Is this possible?
Please help me...
Many thanks before... :)
  4 commentaires
Angga Lisdiyanto
Angga Lisdiyanto le 15 Sep 2016
So this is not possible... :(
Walter Roberson
Walter Roberson le 15 Sep 2016
It is probably possible.

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
Image Analyst le 15 Sep 2016
How general and flexible does this need to be? Will you have other images? If so, will they be translated, rotated, or have different number or thickness of lines? If the lines are always in the same place, you just use a template to whiten everything in the template. Or you can try houghlines. There is demo code in the help. We assume you've tried it though you did not show us your code.
Your only question is "is this possible?", so the answer to that would be "Yes." Good luck. Write back with your code if you still need help, but only after you've read this link.
  2 commentaires
Angga Lisdiyanto
Angga Lisdiyanto le 15 Sep 2016
Thanks for helping. :)
  1. There is no other images.
  2. The line's thickness issame with handwritting's thickness.
  3. My code :
I = imread('scan2.jpg');
I=rgb2gray(I); %ubah gambar menjadi grayscale
figure;imshow(I);
level = graythresh(I);
I=im2bw(I, level); %ubah gambar ke black & white sekitar 0,75%
figure;imshow(I);
mask = ~im2bw(I);
rp = regionprops(mask, 'PixelIdxList', 'Eccentricity', 'Orientation');
% menentukan tinggi eccentricity dan orientations pada 90 dan 0 derajat
rp = rp([rp.Eccentricity] > 0.90 ...
& ([rp.Orientation] < 2 | [rp.Orientation] > 88));
mask(vertcat(rp.PixelIdxList)) = false;
figure;imshow(mask);
mask = bwmorph(mask,'thin',2);
figure;imshow(mask);
Image Analyst
Image Analyst le 15 Sep 2016
Ok, but where is your call to houghlines?

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by