Hi, Is there a way to obtain the positions (coordinates) of objects that were found with find_objects() function (in nd_image)? Specifically what I'm looking for is the coordinates of the bounding box (for a 2d array it would be upper-left and lower-right). Regards, Bob
Is there a way to obtain the positions (coordinates) of objects that were found with find_objects() function (in nd_image)? Specifically what I'm looking for is the coordinates of the bounding box (for a 2d array it would be upper-left and lower-right).
The find_objects() functions returns for each object the slices that define the bounding box of each object. The slices are a tuple of slice objects, one slice object for each axis. The start and stop attributes of slice objects can be used to find exact position and size along each axis. Cheers, Peter
participants (2)
-
Bob Klimek
-
Peter Verveer