Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce sub images based on bounding boxes #95

Open
ngan-cassie opened this issue Jul 21, 2021 · 3 comments
Open

Produce sub images based on bounding boxes #95

ngan-cassie opened this issue Jul 21, 2021 · 3 comments

Comments

@ngan-cassie
Copy link

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.

@maju116
Copy link
Owner

maju116 commented Jul 22, 2021

@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).

@ngan-cassie
Copy link
Author

@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?
image_crop

@maju116
Copy link
Owner

maju116 commented Jul 26, 2021

@ngan-cassie to get width and height simply subtract: xmax-xmin and ymax-ymin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants