Rose-Hulman Robotics Team

Changeset 688

Show
Ignore:
Timestamp:
02/21/10 17:37:10 (2 years ago)
Author:
taborts
Message:

it works! ish

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/2010-image-rec/hist_test.m

    r687 r688  
    88    %fn = 'images/course-walk/cimg4921.jpg'; 
    99    %fn = 'images/elphel/cam-000078.jpeg'; 
    10     %$fn = 'images/elphel/cam-000086.jpeg'; % Hard image 
     10    %fn = 'images/elphel/cam-000086.jpeg'; % Hard image 
    1111    %fn = 'images/course-walk/cimg4989.jpg'; 
    12  
     12    fn = 'images/elphel-09/test29.jpg'; 
    1313    %fn = 'images/elphel/cam-000094.jpeg'; 
    14     fn = 'images/elphel/cam-000081.jpeg'; 
     14    %fn = 'images/elphel/cam-000081.jpeg'; 
    1515end 
    1616 
     
    4444fprintf('Blurring sobel\n'); 
    4545texture = imresize(edges, .25); 
    46 %texture = filter2(fspecial('average', 3), texture); 
     46texture = filter2(fspecial('average', 3), texture); 
    4747texture(texture > 1) = 1; 
    4848 
     
    154154fprintf('Hough transform\n'); 
    155155 
    156 [H,T,R] = hough(line_mask); 
     156[H,T,R] = hough(line_mask,'RhoResolution',1,'ThetaResolution',1); 
    157157figure('Name','Hough peaks'); 
    158158imshow(H,[],'XData',T,'YData',R,'InitialMagnification','fit'); 
    159159xlabel('\theta'), ylabel('\rho'); 
    160160axis on, axis normal, hold on; 
    161 P  = houghpeaks(H,5,'NHoodSize',[161,161]); %ceil(0.3*max(H(:)))); 
     161P  = houghpeaks(H,2,'NHoodSize',[161,161],'Threshold',ceil(0.5*max(H(:)))); 
    162162x = T(P(:,2));  
    163163y = R(P(:,1)); 
     
    178178end 
    179179 
    180 if ~show_points 
     180if ~show_images 
    181181    print('-depsc', [fn '-hough-lines.eps']); 
    182182end