Bonjour !
je voudrais savoir comment connaitre les coordonnées (rho et theta) des maximums (peaks) que j'ai calculer à l'aide de la fonction 'houghpeaks' .et merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 I = imread('cameraman.tif'); rotI = imrotate(I,33,'crop'); fig1 = imshow(rotI); BW = edge(rotI,'canny'); figure, imshow(BW); [H,theta,rho] = hough(BW); figure, imshow(imadjust(mat2gray(H)),[],'XData',theta,'YData',rho,... 'InitialMagnification','fit'); xlabel('\theta (degrees)'), ylabel('\rho'); axis on, axis normal, hold on; colormap(hot) P = houghpeaks(H,5,'threshold',ceil(0.3*max(H(:)))); x = theta(P(:,2)); y = rho(P(:,1)); plot(x,y,'s','color','black');
Partager