Code for measuring the vertical lines:
clc
clear all
close all
warning off
x=rgb2gray(imread('Hor.JPG'));
x=imbinarize(x);
SE = strel('line',20,90);
s=imerode(x,SE);
s=imdilate(s,SE);
imshowpair(x,s,'montage');
Code for measuring the horizontal lines:
clc
clear all
close all
warning off
x=rgb2gray(imread('Hor.JPG'));
x=imbinarize(x);
SE = strel('line',20,0);
s=imerode(x,SE);
s=imdilate(s,SE);
imshowpair(x,s,'montage');
Code for measuring the approximate slope of unknown straight line:
clc
clear all
close all
x=rgb2gray(imread('Hor.JPG'));
x=imbinarize(x);
imshow(x);
for i=10:75
SE = strel('line',20,i);
s=imerode(x,SE);
s=imdilate(s,SE);
imshowpair(x,s,'montage');
title(i);
pause;
end
#ImageProcessing #MATLAB #ComputerVision
On this page of the site you can watch the video online Shape based object extraction using Morphological Operation | MATLAB with a duration of hours minute second in good quality, which was uploaded by the user Knowledge Amplifier 26 June 2020, share the link with friends and acquaintances, this video has already been watched 874 times on youtube and it was liked by 15 viewers. Enjoy your viewing!