# hough peaks not symmetric for rectangle

1 visualización (últimos 30 días)
Michael scheinfeild el 8 de Jul. de 2014
Respondida: Michael scheinfeild el 9 de Jul. de 2014
hello i use hough transform for rectangle the peaks should be symetric. but they are not symmetric around theta angle based on
%%just test
close all;clear;
m=zeros(200,300);
m=logical(m);
m(50,30:190)=1;
m(100,30:190)=1;
m(50:100,30)=1;
m(50:100,190)=1;
%m=imrotate(m,45);
stats=regionprops(m,'BoundingBox');
bx = stats.BoundingBox;
m=imcrop(m,bx);
figure(1),imagesc(m)
[H, T, R] = hough(m);
figure(2)
'InitialMagnification','fit');
title('Hough Transform of Image');
xlabel('\theta'), ylabel('\rho');
axis on, axis normal, hold on;
colormap(hot);
Hv=H(:);
mxH = 0.2*max(Hv);
ii=find(Hv>=mxH);
[aa bb] = ind2sub(size(H),ii);
figure(4),imagesc(T,R,H),hold on,plot(T(bb),R(aa),'gs','MarkerSize',10,'MarkerFaceColor',[0.5,0.5,0.5]);
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Anand el 8 de Jul. de 2014
The symmetry should hold only for rectangles centered at the origin. I just skimmed the paper, but it seems to describe a technique where the search space is centered around the peak you are currently looking at. In MATLAB, the origin is at the top left pixel in the image.
When the rectangle is at the center, rho1=-rho2 and rho3=-rho4. This is not the case when the rectangle isn't centered at the origin.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Más respuestas (1)

Michael scheinfeild el 9 de Jul. de 2014
yes you right i suppose i need to write the hough transform by myself with moving window , i suppose the center should be at center of mass of the shape
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Categorías

Más información sobre Image Category Classification en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by