Skip to content
Generates bounding box annotations from segmentation maps for computer vision. #1) Gets images from a folder (segmentation or id maps) #2) Generates bounding boxes of the form x1, y1, x2, y2 for upright bounding boxes (bottem left coordinate and top right coordinate in pixels #3) Saves data to csv file #4) Displays the sources and bounding box i…
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
0001_box.png
0002_box.png
0003_box.png
0004_box.png
BoundingBoxFromSegmentationMapGitHub.py
README.md
img1.png
img2.png
img3.png
img4.png

README.md

BoundingBoxFromSegmentationMap

Generates bounding box annotations from segmentation maps for computer vision. Capable of generating bounding boxes even if multiple of the same class in the image.




Examples. Set to look for red objects. See limitations below.

#1) Gets images from a folder (segmentation or id maps)

#2) Generates bounding boxes of the form x1, y1, x2, y2 for upright bounding boxes (bottem left coordinate and top right coordinate in pixels

#3) Saves data to csv file

#4) Displays the sources and bounding box images (optional)

#5) Saves the bounding box images to file (optional)

##limitations: #only segments one colour at a time, but could be adapted if you want #if instances of a colour/class in a segmentation image are too close together such that their bounding boxes would overlap, then only one of them is detected/recorded

The code borrows heavily from https://docs.opencv.org/3.4/da/d0c/tutorial_bounding_rects_circles.html

And also from https://stackoverflow.com/questions/25349178/calculating-percentage-of-bounding-box-overlap-for-image-detector-evaluation

You can’t perform that action at this time.