Clear Filters
Clear Filters

Line detection in an image!!

20 views (last 30 days)
khushboo chhikara
khushboo chhikara on 1 May 2018
I want to the line to be a single line that when i use it further it wont detect the boundaries.
im = rgb2gray(imread('white_3.jpg'));
H = fspecial('Gaussian',[2 2],15);
im = imfilter(im,H);
imshow(im);title('Original image');
sim = edge(im, 'sobel');
se = strel('disk', 2);
sim = imdilate(sim, se);
sim = bwareaopen(sim, 50);
sim = imerode(sim, se);
figure,imshow(sim);title('after Sobel');
%h = waitbar(0,'Sewing....');
[B,L] = bwboundaries(sim,'noholes');
imshow(label2rgb(L, @white, [1.5 .5 .5]))
% imwrite(L,'new.jpg')
hold on
for k = 1:length(B)
boundary = B{k};
h1=plot(boundary(:,2), boundary(:,1), 'w', 'LineWidth',0.05)
%waitbar((.5+(k/length(B))/2),h);
end
i want this to be a single line of size 0.15 with no boundaries.

Answers (2)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH on 1 May 2018
Edited: JESUS DAVID ARIZA ROYETH on 1 May 2018
imo = rgb2gray(imread('white_3.jpg'));
se = strel('line',17,5);
sim = imdilate(imo, se);
se2 = strel('disk', 1);
sim = imdilate(sim, se2);
sim = bwareaopen(sim,350);
sim=bwmorph(sim, 'skel', inf);
figure
imshow(sim)

gyssell dayanna contreras rodriguez
how to design a program that finds the number of times that the vowels present in the full name (or any sentence) that the user provides are repeated. The output should be in the form of character or string arrangement. can you pliss help me

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!