mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
added calib calc
added bool to check if calib is done
This commit is contained in:
@@ -35,4 +35,10 @@ public class CameraValues {
|
||||
HorizontalFocalLength = ImageWidth / (2 * FastMath.tan(HorizontalView /2));
|
||||
VerticalFocalLength = ImageWidth / (2 * FastMath.tan(VerticalView /2));
|
||||
}
|
||||
public double CalculatePitch(double PixelY, double centerY){
|
||||
return (FastMath.toDegrees((FastMath.atan(PixelY - centerY) / VerticalFocalLength)) * -1);
|
||||
}
|
||||
public double CalculateYaw(double PixelX, double centerX){
|
||||
return FastMath.toDegrees(FastMath.atan(PixelX - centerX) / HorizontalFocalLength);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user