Borrar filtros
Borrar filtros

Eliminate all vertical and diagonal lines in matlab

3 visualizaciones (últimos 30 días)
sufian ahmed
sufian ahmed el 9 de Jun. de 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.

Respuestas (0)

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by