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.

답변 (2개)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2018년 5월 1일
편집: JESUS DAVID ARIZA ROYETH 2018년 5월 1일

0 개 추천

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)

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by