Changeset 61


Ignore:
Timestamp:
06/17/13 17:14:24 (11 years ago)
Author:
vcheplygina
Message:
 
Location:
birds
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • birds/domilbirds.m

    r60 r61  
    2828% measure something:
    2929x = regionprops(bwlabel(mask),abs(S));
    30 y = x([x.Area]>10)
     30y1 = x([x.Area]>10)
    3131
    3232
     
    4545
    4646figure(6); clf; imagesc(mask); axis xy;    %Looks pretty similar, but less small blobs
    47 % measure something:
    48 x = regionprops(bwlabel(mask),abs(s2));
    49 y = x([x.Area]>10)
     47
     48labeledx = bwlabel(mask);
     49Nseg = max(unique(labeledx)); %Segment labels, segment 0 is background
     50
     51absim = abs(S);
     52realim = real(S);
     53imagim = imag(S);
     54
     55
     56maskfeats = nan(Nseg,3);
     57absfeats = nan(Nseg, 7);
     58
     59
     60for i=1:Nseg
     61   
     62    ix = (labeledx == i);
     63   
     64    pixtotal = sum(sum(ix));
     65    pixheight = max(sum(ix,1));
     66    pixwidth = max(sum(ix,2));
     67
     68    maskfeats(i,:) = [pixtotal pixheight pixwidth];
     69   
     70   
     71    seg = absim(ix);
     72    absfeats(i,1) = mean(seg);
     73    absfeats(i,2) = std(seg);
     74   
     75    absfeats(i,3) = quantile(seg(:),0);
     76    absfeats(i,4) = quantile(seg(:),0.25);
     77    absfeats(i,5) = quantile(seg(:),0.5);
     78    absfeats(i,6) = quantile(seg(:),0.75);
     79    absfeats(i,7) = quantile(seg(:),1);
     80   
     81end
     82
     83mildata = [maskfeats absfeats];
    5084
    5185
Note: See TracChangeset for help on using the changeset viewer.