How to get more than one bounding box value from a single segmented-image for a given value? [closed]

asked 2018-10-25 05:59:31 -0600

I am trying to fetch all the bounnding boxes values for a given segmented-image for a particular value.

For example: I have a single semantic-segmented image which contains pedestrians, van, car, traffic light etc. The class value for traffic light is 81 in that image. But the challenging is that in that image there are nearly 6 traffic light and I want to extract all the 6 bounding box values for that image.

What i have tried so far, I used regionprops from skimage and filtered the labels values equal to 81 and retrieved the bbox (bounding box) value for that image. But i could retrieve only 1 bounding box value.

I want to retrieve all the 6 bounding box value for a single image.

I am writing in python language. It would be very great if anyone can help or suggest me here..

update: (minimal code)

img = io.imread("170927_071756318_Camera_5_bin.png")
for region in regionprops(img):
    if(region.label == 81):
        bboxes = region.bbox
        print(bboxes)
edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by berak
close date 2018-10-25 13:07:02.310824

Comments

and how would this be related to opencv ? (we can't help you with arbitrary python problems)

berak gravatar imageberak ( 2018-10-25 06:07:24 -0600 )edit