Effacer les filtres
Effacer les filtres

Eliminate all vertical and diagonal lines in matlab

3 vues (au cours des 30 derniers jours)
sufian ahmed
sufian ahmed le 9 Juin 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.

Réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by