Line detection in an image!!

6 vues (au cours des 30 derniers jours)
khushboo chhikara
khushboo chhikara le 1 Mai 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.

Réponses (2)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH le 1 Mai 2018
Modifié(e) : JESUS DAVID ARIZA ROYETH le 1 Mai 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

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by