i'm pretty new matlab, heres situation. have satellite image of ocean, bit of land , boats in it. using thresholding make binary mask , bwlabel have managed create set of labels match boats on water. here superimposed image of labels on boats (and land) can see mean:

as can see image, labels encompass boats dimmer sidelobes either side of them. need find way create new set of labels cover boats , not sidelobes. can't use brighter threshold, have lots of images boats of varying brightness, of dimmer side lobes of other boats.
so guess i'm asking is, there way extract coloured sections image, analyse them further (by thresholding individual segments, or using histograms or whatever) create new set of labels containing boats, keep locations of these new labels respect original image intact can superimpose them onto original image again? if so, how?
thanks!
several questions here.
1. is there way extract colored sections image?
yes.
let label image obtained bwlabel l , original image i. then, s = regionprops(l,'boundingbox'); give bounding box associated each region in l. use i2 = imcrop(i,s(2).boundingbox); extract region in s(2). you'll have check whether s(2) corresponds label 2 in l (if not, fixing trivial).
2. analyse them further (by thresholding individual segments, or using histograms or whatever) create new set of labels containing boats.
not straightforward. highly dependent on images. can play matlab's default thresholding functions make work. assume obtain binary masks each cropped image (e.g. ib1).
3. keep locations of these new labels respect original image intact can superimpose them onto original image again?
yes. since have set of bounding boxes s replace new mask in l.
l(round(s(1).boundingbox(2):s(1).boundingbox(2)+s(1).boundingbox(4)),... round(s(1).boundingbox(1):s(1).boundingbox(1)+s(1).boundingbox(3))) = ib1;
where i1 improved mask. don't forget set non-zero values in mask label index when assigning l.
for more on why round used, look here.
Comments
Post a Comment