cleanup
This commit is contained in:
@ -57,7 +57,7 @@ print("gopro fov : horizontal = %7.3f, vertical = %7.3f, diagonal = %7.3f (deg
|
|||||||
gopro_fov_vertical,
|
gopro_fov_vertical,
|
||||||
gopro_fov_diagonal))
|
gopro_fov_diagonal))
|
||||||
|
|
||||||
print("\n--- rectilinear re-projection, preserving vertical fov ---\n")
|
print("\n--- rectilinear re-projection ---\n")
|
||||||
|
|
||||||
rectilinear_focal_length = lambda radius: radius * math.tan(math.radians(90.0 - equidistant_angle(radius)))
|
rectilinear_focal_length = lambda radius: radius * math.tan(math.radians(90.0 - equidistant_angle(radius)))
|
||||||
|
|
||||||
@ -73,14 +73,14 @@ print("linear focal: horizontal = %7.3f, vertical = %7.3f, diagonal = %7.3f (mm)
|
|||||||
rectilinear_radius = lambda angle, focal_length: focal_length * math.tan(math.radians(angle))
|
rectilinear_radius = lambda angle, focal_length: focal_length * math.tan(math.radians(angle))
|
||||||
rectilinear_angle = lambda radius, focal_length: math.degrees(math.atan(radius / focal_length))
|
rectilinear_angle = lambda radius, focal_length: math.degrees(math.atan(radius / focal_length))
|
||||||
|
|
||||||
preserved_fov_horizontal = 2.0 * rectilinear_angle(gopro_radius_horizontal, rectilinear_focal_length_vertical)
|
rectilinear_fov_horizontal = 2.0 * rectilinear_angle(gopro_radius_horizontal, rectilinear_focal_length_vertical)
|
||||||
preserved_fov_vertical = 2.0 * rectilinear_angle(gopro_radius_vertical, rectilinear_focal_length_vertical)
|
rectilinear_fov_vertical = 2.0 * rectilinear_angle(gopro_radius_vertical, rectilinear_focal_length_vertical)
|
||||||
preserved_fov_diagonal = 2.0 * rectilinear_angle(gopro_radius_diagonal, rectilinear_focal_length_vertical)
|
rectilinear_fov_diagonal = 2.0 * rectilinear_angle(gopro_radius_diagonal, rectilinear_focal_length_vertical)
|
||||||
|
|
||||||
print("linear fov : horizontal = %7.3f, vertical = %7.3f, diagonal = %7.3f (deg)" % (
|
print("linear fov : horizontal = %7.3f, vertical = %7.3f, diagonal = %7.3f (deg)" % (
|
||||||
preserved_fov_horizontal,
|
rectilinear_fov_horizontal,
|
||||||
preserved_fov_vertical,
|
rectilinear_fov_vertical,
|
||||||
preserved_fov_diagonal))
|
rectilinear_fov_diagonal))
|
||||||
|
|
||||||
print("\n--- shader parameters ---\n")
|
print("\n--- shader parameters ---\n")
|
||||||
|
|
||||||
@ -93,13 +93,14 @@ const float rectilinear_focal_length = %.6f;""" % (
|
|||||||
rectilinear_focal_length_vertical)
|
rectilinear_focal_length_vertical)
|
||||||
)
|
)
|
||||||
|
|
||||||
print("\n--- filter parameters 4K ---\n")
|
# print("\n--- filter parameters 4K ---\n")
|
||||||
|
#
|
||||||
width_scale = rectilinear_focal_length_vertical / rectilinear_focal_length_horizontal
|
# width_scale = rectilinear_focal_length_vertical / rectilinear_focal_length_horizontal
|
||||||
|
#
|
||||||
output_height = 2160
|
# output_height = 2160
|
||||||
output_width = int(round((output_height / 7.0) * 8.0 * width_scale))
|
# output_width = int(round((output_height / gopro_array_vertical) * gopro_array_horizontal * width_scale))
|
||||||
|
#
|
||||||
print("resize: width = %d, height = %d" % (
|
# print("resize: width = %d, height = %d, ratio = %f" % (
|
||||||
output_width,
|
# output_width,
|
||||||
output_height))
|
# output_height,
|
||||||
|
# output_width / output_height))
|
||||||
|
|||||||
Reference in New Issue
Block a user