I have a very simple math problem, but I cannot seem to figure it out. I need to calculate what portion of the ground will be visible when viewed from a UAV mounted camera. I believe I have it solved for looking straight down, but the camera is on a gimbal and will have a full range of motion in all axes.
The inputs to the problem will be the Altitude (m), camera focal length (mm), camera sensor x length (mm), camera sensor y length (mm), and the angle of tilt in each plane.
Here is what I have for when the camera is pointed straight down (Note: this gives me the length of each side of ground coverage. Ideally, I would like to have each point, in this case, the four corners of the rectangle.)
float cameraX; // camera sensor x size (mm)
float cameraY; // camera sensor y size (mm)
float cameraF; // camera focal length (mm); common lengths: 150mm (wide angle), 300mm (normal)
float altitude; // high above ground (m)
float ax;
float ay;
void calculateGroundCoverage() {
ax = (altitude / cameraF) * cameraX;
ay = (altitude / cameraF) * cameraY;
}
void printGroundCoverage() {
System.out.print("x: " + cameraX + ", y: " + cameraY + ", f: " + cameraF + ", alt: " + altitude + "\t");
System.out.println("footprint: " + ax + "m x " + ay + "m");
}