Changeset 72 for birds/createmilbirds_19cl.m
- Timestamp:
- 07/09/13 15:27:17 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
birds/createmilbirds_19cl.m
r71 r72 46 46 bagid = []; 47 47 for i=1:B 48 i 49 48 50 %load the signal; 49 51 [signal,fs] = wavread(fullfile(dpath,'src_wavs',names{i}(2:end))); … … 59 61 60 62 % run over blobs: 61 im = abs(S); 62 thisx = zeros(Nseg,7); 63 absim = abs(S); 64 realim = real(S); 65 imagim = imag(S); 66 67 maskfeats = nan(Nseg,3); 68 absfeats = nan(Nseg, 7); 69 realfeats = nan(Nseg,7); 70 imagfeats = nan(Nseg,7); 71 63 72 for j=1:Nseg 73 74 64 75 ix = (bloblab==j); 76 65 77 % compute/add some blob-properties: 66 thisx(j,:) = [props(j).Area, props(j).Centroid, props(j).BoundingBox]; 78 % thisx(j,:) = [props(j).Area, props(j).Centroid, props(j).BoundingBox]; 79 80 pixtotal = sum(sum(ix)); 81 pixheight = max(sum(ix,1)); 82 pixwidth = max(sum(ix,2)); 83 84 maskfeats(j,:) = [pixtotal pixheight pixwidth]; 85 86 87 seg = absim(ix); 88 absfeats(j,1) = mean(seg); 89 absfeats(j,2) = std(seg); 90 91 absfeats(j,3) = quantile(seg(:),0); 92 absfeats(j,4) = quantile(seg(:),0.25); 93 absfeats(j,5) = quantile(seg(:),0.5); 94 absfeats(j,6) = quantile(seg(:),0.75); 95 absfeats(j,7) = quantile(seg(:),1); 96 97 seg = realim(ix); 98 realfeats(j,1) = mean(seg); 99 realfeats(j,2) = std(seg); 100 101 realfeats(j,3) = quantile(seg(:),0); 102 realfeats(j,4) = quantile(seg(:),0.25); 103 realfeats(j,5) = quantile(seg(:),0.5); 104 realfeats(j,6) = quantile(seg(:),0.75); 105 realfeats(j,7) = quantile(seg(:),1); 106 107 seg = imagim(ix); 108 imagfeats(j,1) = mean(seg); 109 imagfeats(j,2) = std(seg); 110 111 imagfeats(j,3) = quantile(seg(:),0); 112 imagfeats(j,4) = quantile(seg(:),0.25); 113 imagfeats(j,5) = quantile(seg(:),0.5); 114 imagfeats(j,6) = quantile(seg(:),0.75); 115 imagfeats(j,7) = quantile(seg(:),1); 116 117 67 118 % don't forget: 68 %bagid(end+1) = i; 69 70 bagid = [bagid i]; 119 bagid(end+1) = i; 120 71 121 72 122 end 73 x{i} = thisx;123 x{i} = [maskfeats absfeats realfeats imagfeats]; 74 124 75 125 %Get the labels right for the training bags:
Note: See TracChangeset
for help on using the changeset viewer.