platypus
platypus copied to clipboard
Produce sub images based on bounding boxes
Hi I'm currently using this package to detect daily objects in Haiti. As this model is only used on 80 classes, I wonder is there anyway I can cut out sub images from bounding boxes without the labels (like image segmentation but without classification)? I plan to feed those sub images into another image classification model.
@ngan-cassie if you want to cut images based on bounding boxes you can use imager
or magick
packages using box coordinates (xmin, xmax, ymin, ymax).
@maju116 thank you for your suggestion! I looked into magick package and found image_crop function. However I don't know how to calculate the box's width and height and left padding based on box coordinates. Do you have any resources that can help me understand better which part of the image these coordinates point to exactly so that I can calculate width and height based on that?
@ngan-cassie to get width
and height
simply subtract: xmax-xmin
and ymax-ymin