Filter löschen
Filter löschen

Eliminate all vertical and diagonal lines in matlab

3 Ansichten (letzte 30 Tage)
sufian ahmed
sufian ahmed am 9 Jun. 2017
Here is my code:
clear all;close all;clc;
%Input Image
A = imread('C:\Users\efu\Desktop\5.png');
% figure, imshow(A);
C=medfilt2(A,[3 5]);
% figure,imshow(C);
D=imfill(C);
% figure,imshow(D);
%Image obtained using MATLAB function 'edge'
E=edge(D,'canny',[0.01 .02],3);
figure,imshow(E);title('Image obtained using MATLAB function');
image=E;
img=im2bw(image);
% imshow(img)
se = strel('line',3,0);
zz = imerode(img,se);
figure,imshow(zz);
After canny edge detection:
After Eroding:
Here the problem is that after eroding all horizontal edges are broken, but i dont want that. i want to extract all horizontal lines without breaking,besides want to remove all vertical and diagonal lines. please someone modify the code or give me any resource so that i can do the task.

Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by