Rose-Hulman Robotics Team

Changeset 682

Show
Ignore:
Timestamp:
02/20/10 13:56:44 (2 years ago)
Author:
taborts
Message:

added function to find bottoms in a mask

Files:
1 modified

Legend:

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

    r680 r682  
    99 
    1010%fn = 'images/elphel/cam-000094.jpeg'; 
    11 %fn = 'images/elphel/cam-000081.jpeg'; 
     11fn = 'images/elphel/cam-000081.jpeg'; 
    1212 
    1313fprintf('Running on %s... ', fn); 
     
    109109mask = imclose(mask, se); 
    110110 
     111tempMask=mask*-1+1; 
     112bottomlist=bottomFind(tempMask); 
     113imshow(tempMask); 
     114hold on; 
     115scatter(bottomlist(:,1),-bottomlist(:,2)); 
     116 
     117 
    111118line_mask = texture; 
    112119for threshold = .42 
    113120    line_mask(texture > threshold & mask == 0) = 1; 
    114121    line_mask(texture <= threshold | mask ~= 0) = 0; 
    115     imtool(line_mask); 
     122    figure; 
     123    imshow(line_mask); 
    116124end 
    117125%keyboard; 
     
    178186 
    179187end 
    180  
     188function bottomlist = bottomFind(bw) 
     189list=zeros(size(bw,2),2); 
     190temp=bw; 
     191for i = 1:size(bw,2) 
     192temp(1,:)=1; 
     193list(i,2)=find(temp(:,i)==1,1,'last'); 
     194list(i,1)=i; 
     195end 
     196bottomlist=list; 
     197end