PhotonVision / photonvision

PhotonVision is the free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition.
https://photonvision.org
GNU General Public License v3.0
264 stars 180 forks source link

Undistort pitch/yaw using opencv #1250

Closed mcm001 closed 3 months ago

mcm001 commented 6 months ago

Takes anywhere from 1ms to 0.01ms on my Ryzen 4800h laptop. Since we only undistort one point I imagine it's super fast and most of that is JNI overhead

TODO

amquake commented 5 months ago
  • test signs of pitch/yaw are still right

That should be tested here, no?

https://github.com/PhotonVision/photonvision/blob/534d00f8520a689d977e11bea7f63077263cf36a/photon-core/src/test/java/org/photonvision/vision/target/TargetCalculationsTest.java#L71-L88

mcm001 commented 5 months ago

Yeah, but I had to flip the sign of the expected pitch and yaw in my unit test since I think it looked like crosshair location and target center location were flipped previously

amquake commented 5 months ago

Ah, yea. The testYawPitchBehavior() test I linked seems to have it right regardless, though. Does addressing my first comment fix that issue in testYawPitchCalc() then-- reverting the sign changes in the object point creation and negating the yaw/pitch signs in the assertion?