ryouchinsa / Rectlabel-support

RectLabel is an offline image annotation tool for object detection and segmentation.
https://rectlabel.com
507 stars 73 forks source link

Bounding box labels shift by approximately half a pixel #174

Closed hjedwardkim closed 3 years ago

hjedwardkim commented 3 years ago

Upon opening an image with its annotations (bounding box labels in this case), all the labels are shifted slightly by approximately half a pixel right and half a pixel down. This phenomena is replicable by several labellers of my team.

ryouchinsa commented 3 years ago

Thanks for writing the issue. Could you show us the screenshot to understand the details? If you could give us an example image and annotation file, it would be very helpful.

hjedwardkim commented 3 years ago

rectlabel-bug.zip

Sure thing. Attached you will find a before and after screenshot zoom of the label, a screen recording replicating the issue, the JPG image, and the XML annotation of the picture in question. In our team's image set, this seems to occur with all bounding box labels.

ryouchinsa commented 3 years ago

Thanks for the details.

It is the floating-point rounding error.

When we read/write the annotation file, we have to convert between integer coordinates and floating-point coordinates. To restore the exact floating-point coordinates, you can use "Save as floating-point values" on the settings dialog. https://rectlabel.com/help#others

To obtain the integer coordinates from floating-point coordinates in your application, round it by yourself. xi = roundf(xf)

Let us know your opinion.

others

hjedwardkim commented 3 years ago

Okay thank you for the response. I will have everyone have their settings saved to save as floating-point values in the future.

ryouchinsa commented 3 years ago

Currently If you need our support to fix this problem, please let us know.