![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/188031/image.png)
Line detection in an image!!
21 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
JESUS DAVID ARIZA ROYETH
2018-5-1
编辑:JESUS DAVID ARIZA ROYETH
2018-5-1
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/188031/image.png)
0 个评论
gyssell dayanna contreras rodriguez
2018-10-24
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!