Setting VFOV and HFOV based on aspect ratio is invalid

srgriffiths
Posts: 36
Joined: Tue Aug 04, 2015 7:51 pm

Setting VFOV and HFOV based on aspect ratio is invalid

Postby srgriffiths » Thu Dec 13, 2018 5:57 pm

It states in the documentation that "If HorizontalFOV is not specified, the horizontal field-of-view will be automatically calculated based on the display aspect ratio." or conversely if "if VerticalFOV is not specified, the vertical field-of-view will be automatically calculated based on the display aspect ratio."

This is problematic. It is not correct to compute VFOV from aspect ratio. VFOV != HFOV / AR (aspect ratio)

AR = image_width_pixels / image_height_pixels;
AR does not equal HFOV/VFOV.

<<<This is correct>>>
focal_length_pixels = image_width_pixels / (2.0*tan(HFOV*0.5));
VFOV = atan2(sensor_height_meters*0.5, focal_length_pixels )*2.0;

I believe this is causing an inaccuracy in the view that I'm getting from prepar3d.

I'm I missing something?

srgriffiths
Posts: 36
Joined: Tue Aug 04, 2015 7:51 pm

Re: Setting VFOV and HFOV based on aspect ratio is invalid

Postby srgriffiths » Thu Dec 13, 2018 8:46 pm

<<<minor correction. This is correct>>>
focal_length_pixels = image_width_pixels / (2.0*tan(HFOV*0.5));
VFOV = atan2(image_height_pixels *0.5, focal_length_pixels )*2.0;


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 5 guests