Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
For a kind of OCR-ish task, I need to find bboxes of all "objects" in 2D image. Then I can use slicing to extract sub-images as virtual piddles. Suppose there's an image with 3 "objects":
And segmented:
That's quite fast. And then:
That gives bboxes in data structure I want. But it's too slow - tens of seconds for some-megapixel image and hundred of "objects", before I even began to use these data. I wonder if it can be faster. Maybe to skip creating of a mask ($s == $_), i.e. hundred of them. Plus, the whichND gives a piddle of _all_ indexes - when all I want is a bounding box. Maybe there's a way to e.g. efficiently collapse a dimension looking for required index in segmented image ($s, above). I feel I'm missing something obvious. Any ideas? In reply to PDL: Looking for efficient way to extract sub-images, by finding bounding boxes of "objects" by vr
|
|