From 1385b3e6f35dacd8736d6fe40f88bf1a9a3cb72f Mon Sep 17 00:00:00 2001 From: Roz K Date: Wed, 17 Sep 2025 20:59:34 +0200 Subject: [PATCH] pixel scale for frame widening --- gopro_8:7/compute_gopro_8:7.py | 36 --------------------------------- gopro_8:7/unfish_gopro_8:7.glsl | 3 ++- 2 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 gopro_8:7/compute_gopro_8:7.py diff --git a/gopro_8:7/compute_gopro_8:7.py b/gopro_8:7/compute_gopro_8:7.py deleted file mode 100644 index 2c7df8e..0000000 --- a/gopro_8:7/compute_gopro_8:7.py +++ /dev/null @@ -1,36 +0,0 @@ -# RozK -# Computes fisheye removal parameters for GoPro 11+, 8:7 ratio, without hypersmooth, -# keeping the vertical FOV and widening the frame to preserve the diagonal FOV - -# https://www.bobatkins.com/photography/technical/field_of_view.html -# https://community.gopro.com/s/article/HERO11-Black-Mini-Digital-Lenses-FOV-Information?language=fr - -import math - -frame_width = 8 -frame_height = 7 -input_ratio = frame_width / frame_height - -input_vertical_fov = 108.0 -input_diagonal_fov = 156.0 - -input_vertical_length = math.radians(input_vertical_fov * 0.5) -input_diagonal_length = math.radians(input_diagonal_fov * 0.5) - -output_horizontal_length = math.sqrt((input_diagonal_length ** 2) / (input_vertical_length ** 2)) -output_diagonal_length = math.hypot(output_horizontal_length, input_vertical_length) -output_diagonal_fov = math.degrees(math.atan(output_diagonal_length)) * 2.0 - -output_ratio = 1.0 / (output_horizontal_length / input_vertical_length) - -print("Output FOV = %f" % output_diagonal_fov) -print("Output Ratio = %f" % output_ratio) -print("= Resolutions =====================") - -def width_rounded_8(height): - width = int(round(height * input_ratio)) - return ((width + 4) // 8) * 8 - -print("HD = %i x 720" % width_rounded_8(720)) -print("Full HD = %i x 1080" % width_rounded_8(1080)) -print("4K = %i x 2160" % width_rounded_8(2160)) diff --git a/gopro_8:7/unfish_gopro_8:7.glsl b/gopro_8:7/unfish_gopro_8:7.glsl index eb6099e..88b8db4 100644 --- a/gopro_8:7/unfish_gopro_8:7.glsl +++ b/gopro_8:7/unfish_gopro_8:7.glsl @@ -21,6 +21,7 @@ uniform float pts; const vec2 sensor_dimensions = vec2(5.949440, 5.205760); const float fisheye_focal_length = 2.92; const float rectilinear_focal_length = 2.102263; +const vec2 pixel_scale = vec2(0.871558, 1.0); const int subsampling = 4; // constants @@ -37,7 +38,7 @@ vec2 sensor_to_texture; void initialize() { texture_center = myResolution * 0.5; - texture_to_sensor = (sensor_dimensions / myResolution); + texture_to_sensor = (sensor_dimensions / myResolution) * pixel_scale; sensor_to_texture = (myResolution / sensor_dimensions); }