Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Re: how to put bounding box over detected regions?
On Feb 6, 1:35 am, vijay <vijayans...@gmail.com> wrote: > hi friends, > > i have a segmented image and the segmented features are > white and the remaining are made zero. I want to put bounding box over > each region separately. how i can do this? > > the link to image ishttps://picasaweb.google.com/vijayansiva/Idl#5570459623606 388546 > > thanks in advance. You probably want to use label_region.
On Feb 6, 5:57 am, Gray <grayliketheco...@gmail.com> wrote: > On Feb 6, 1:35 am, vijay <vijayans...@gmail.com> wrote: > >> hi friends, > >> i have a segmented image and the segmented features are >> white and the remaining are made zero. I want to put bounding box over >> each region separately. how i can do this? > >> the link to image ishttps://picasaweb.google.com/vijayansiva/Idl#5570459623606 388546 > >> thanks in advance. > > You probably want to use label_region. Yeah, Label_Region in conjunction with the reverse indices output from Histogram. This would work, assuming you have a procedure DRAWBOX that draws bounding boxes. regs = label_region(image) hist = histogram(regs, reverse_indices = r, min = 1, omax = n_regs) for i = 0, omax - 1 do begin coords1d = r[r[i]:r[i+1]-1] coords2d = array_indices(image, coords1d) lower_left = min(coords2d, dimension = 2, max = upper_right) drawbox, lower_left, upper_right endfor