Remove Black Lines Using HoughLines Function

조회 수: 1 (최근 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?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by