Bounding box coordinates for Trim
See original GitHub issueIs your feature request related to a problem? Please describe
I have a binary image with black background and white object. I need a high performance method to extract the bounding box for the white object. It is acceptable for bounding box to always be parallel to the edges.
I tried MinimumBoundingBox()
, but it is too slow due to Rotating Calipers algorithm to recover angled bounding boxes (which I anyway grow to edge parallel bounding box).
I tried using Trim()
which is performant, but it doesn’t provide the bounding box coordinates. On the command line there is a way to get Trim to return the bounding box info.
Describe the solution you’d like
A fast edge parallel minimum bounding box method. Alternatively, a version of Trim() to return bounding box coordinates relative to original image.
Describe alternatives you’ve considered
MinimumBoundingBox and Trim
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How would I trim a bounding box?
1 Answer. Since you are using the [H] float placement (supplied by float ), it isn't actually a float. So you can just...
Read more >Trim Bounding Box Center
Gives you the details of how many pixels would be trimmed horizontally and vertically if you were to use trim, this is great...
Read more >Calculate Bounding box coordinates from a rotated rectangle
I have the coordinates of the top left point of a rectangle as well as its width, height and rotation from 0 to...
Read more >Block trim and bounding box
Block trim and bounding box. ... I want to update a block trim lisp from MelFranks. ... (vlax-get-property(eval x)'Coordinates)
Read more >BoundingBox | Rhino 3-D modeling
The BoundingBox command creates a rectilinear box object (polyline or polysurface) that encloses selected objects.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for reporting this. The problem is that in your example a warning is raised but the native code is not getting a pointer due to a bug in Magick.NET. This warning is raised because the bounding box is 0x0. This will return
null
in the next release of Magick.NET instead.Works great. Thanks for the super quick resolution!