Remove Black Lines Using HoughLines Function

4 ビュー (過去 30 日間)
Angga Lisdiyanto
Angga Lisdiyanto 2016 年 9 月 14 日
コメント済み: Image Analyst 2016 年 9 月 15 日
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 件のコメント
Angga Lisdiyanto
Angga Lisdiyanto 2016 年 9 月 15 日
So this is not possible... :(
Walter Roberson
Walter Roberson 2016 年 9 月 15 日
It is probably possible.

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2016 年 9 月 15 日
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 件のコメント
Angga Lisdiyanto
Angga Lisdiyanto 2016 年 9 月 15 日
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 2016 年 9 月 15 日
Ok, but where is your call to houghlines?

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by