You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
509 B
Matlab
13 lines
509 B
Matlab
function param=hough_find_peaks(H,T,R,S)
|
|
if ~isempty(T)
|
|
%for straight lines use the inbuilt matlab function to find peaks and parameters
|
|
P=houghpeaks(H,100,'threshold',2);
|
|
for l=1:size(P,1)
|
|
amplitude(l)=H(P(l,1),P(l,2));
|
|
end
|
|
param=[T(P(:,2));R(P(:,1));amplitude];
|
|
else
|
|
Hbin=imregionalmax(H); %non-maximum suppression
|
|
Hconnected = bwconncomp(Hbin); %divide remaining peaks into separate components
|
|
param=extract_coords(H,Hconnected,T,R,S); %find parameters associated with each peak
|
|
end |