photonvision icon indicating copy to clipboard operation
photonvision copied to clipboard

3d bounding box is distorted when top box is behind camera

Open gerth2 opened this issue 1 year ago • 3 comments

Describe the bug Strange distortion for apriltag bounding boxes that are very close

image

all good

image

Still fine

image

oop

To Reproduce Steps to reproduce the behavior:

Calibrate 3d on any camera

Get an apriltag very close to the camera

Screenshots / Videos see above

Platform:

  • pi3

Additional context I'm assuming this is because Calib3d.projectPoints does not handle the negative X real world points case well? Everything else is a floating point number so it shouldn't be that bad?

gerth2 avatar Feb 11 '24 23:02 gerth2

Yeah, a brief googling indicates that this breaks things. How do we draw the wire frame field for simulation? That has lines out of the camera FOV

mcm001 avatar Feb 12 '24 15:02 mcm001

In some cases the distortion values you get from calibrateCamera result in a distortion function that is non-monotonic and the image (or projected points) can “wrap around”…So this could be what you are seeing. Maybe.

https://forum.opencv.org/t/projectpoints-point-visibility-with-distortion/7055/3

mcm001 avatar Feb 12 '24 16:02 mcm001