IEEERobotics / bot

Robot code for 2014.
BSD 2-Clause "Simplified" License
17 stars 10 forks source link

OpenCV providing incorrect co-ordinates to QR codes. #457

Open AhmedSamara opened 8 years ago

AhmedSamara commented 8 years ago

So using the solvePnP technique, we are getting incorrect values for the XYZ vector from the camera to the code.

This only happens on some computers. It happens on the BeagleBone, and on @BrettGoldbach Ubuntu laptop, but not on my fedora laptop.

Recalibrating the camera helped a little bit but not a lot.

We think the issue is related to the resolution of the camera.

On my laptop, where the bug did not happen, the resolution of the imshow was wrong.

It looks like the solvePnP complications are all done on the assumption that it's a 480x480 camera.

There are also some issues with different versions of openCV not working the same way. When running on the desktop, we never had to configure the resolution of the camera manually, but on the BeagleBone, we had to configure that just to get it to run.

It looks like there are still some configuration settings that we're not setting.

mynameis7 commented 8 years ago

If you are using 2 different versions of OpenCV, you need to write the version specific code in an if statement and check against the modules version variable.

http://www.pyimagesearch.com/2015/08/10/checking-your-opencv-version-using-python/