I tried blurring the image which has helped a bit on both the hough and edge, still not exactly what I am looking for. Is there a way to remove the excess edges on the edge image, like the two little lines underneath the base or the little lines inside the object? Also why doesn't the hough see the sides of the base or the tip top as a line? https://imgur.com/a/B3U0O
Trying to properly outline an object in an image
1 回表示 (過去 30 日間)
古いコメントを表示
Hey everyone. I am currently trying to get a clean outline of an image in Matlab https://imgur.com/a/KbptL. Problem is I am getting gaps in my edge call and my the lines from my Hough call is all over the place. https://imgur.com/a/ngbHv
I have been searching the net for answers and playing around with thresholds but nothing really seems to help and 90% of the previously asked questions similar to mine are answered by the same guy saying "look at my thing" that doesn't help at all.
I just want to end up with a clean outline of the object so I can take measurements on it. Could anyone tell me what I could do to get a cleaner image or connect the lines in my edge detection. Or maybe recomend me something new all together to get the measurement data I want.
clear
clc
close all
I = imread('tback.jpg');
G = rgb2gray(I);
G = imcrop(G,[150 1 800 700]);
E = edge(G, 'Roberts'); imshow(E) [H, theta, rho] = hough(E); figure, imshow(H,[]);
peaks = houghpeaks(H,60,'Threshold',40);
figure, imshow(G,[]), hold on
lines = houghlines(E,theta,rho,peaks,'Fillgap',10,'Minlength',5);
for k = 1:length(lines)
xy = [lines(k).point1; lines(k).point2];
line(xy(:,1), xy(:,2),'LineWidth',1,'Color','r');
end
This what I have so far. Roberts gave me my best image so far.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Image Processing and Computer Vision についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!