Paper-Chart-Extraction-Project / ChartExtractor

ChartExtractor uses computer vision to convert images of paper charts to digital data.
https://paper-chart-extraction-project.github.io/ChartExtractor/
GNU General Public License v3.0
3 stars 1 forks source link

Fixed bug in tile_annotations. #18

Closed RyanDoesMath closed 5 months ago

RyanDoesMath commented 5 months ago

There exists a bug in tile_annotations where the annotation's coordinates were simply not getting corrected based on which tile they belonged to. This would cause a box to be in pixels that didn't exist in the image.

To solve this, there is a new method for BoundingBox that sets the box's values called set_box. Under the hood this just returns a new object with the new values (and the same category). Keypoint was updated to have the same function, and although it doesn't strictly need to, it also returns a whole new Keypoint. Also added a correct_keypoint method that does much the same thing as set_box does for BoundingBox. Note that you can change the bounding box of a keypoint with the same method set_box such that it is an invalid keypoint (keypoint is not in the box), but you cannot change its keypoint via set_keypoint in a way that makes it invalid.