Eliminate all vertical and diagonal lines in matlab

조회 수: 1 (최근 30일)
sufian ahmed
sufian ahmed 2017년 6월 9일
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.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by