Compare commits
23 Commits
main
...
e950314ca1
| Author | SHA1 | Date | |
|---|---|---|---|
|
e950314ca1
|
|||
|
702d80b9a2
|
|||
|
8dcfd2d52d
|
|||
|
213ea05243
|
|||
|
8474d73ac1
|
|||
|
c91c9d44d9
|
|||
|
d346c69f69
|
|||
|
8c60a46945
|
|||
|
b5d9b30ee9
|
|||
|
a0cba047e5
|
|||
|
71cca0589e
|
|||
|
67b60b0e69
|
|||
|
79b66d47ee
|
|||
|
64e693fe4a
|
|||
|
f5b429217c
|
|||
|
d74f3dfe67
|
|||
|
f7540d5bca
|
|||
|
676e63eae5
|
|||
|
acd59515aa
|
|||
|
d7f0cb427d
|
|||
|
95175afb5d
|
|||
|
1385b3e6f3
|
|||
|
e6c417f0f6
|
12
README.md
12
README.md
@ -4,7 +4,7 @@ Shaders for Avidemux with OpenGL support
|
|||||||
|
|
||||||
## GoPro fisheye removal v2.0
|
## GoPro fisheye removal v2.0
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### gopro_8:7 - Fisheye removal for GoPro 11+, 8:7 ratio, 4K, HyperSmooth off
|
### gopro_8:7 - Fisheye removal for GoPro 11+, 8:7 ratio, 4K, HyperSmooth off
|
||||||
|
|
||||||
@ -13,12 +13,12 @@ Shaders for Avidemux with OpenGL support
|
|||||||
- New method based on sensor size and focal length
|
- New method based on sensor size and focal length
|
||||||
- Accurate frame widening
|
- Accurate frame widening
|
||||||
- Fisheye aware subsampling
|
- Fisheye aware subsampling
|
||||||
- Rec.709 colorspace conversion
|
- Rec.709 colorspace conversion _(requires to patch and rebuild Avidemux)_
|
||||||
|
|
||||||
#### Content
|
#### Content
|
||||||
|
|
||||||
- avidemux.patch
|
- avidemux.patch
|
||||||
Optional patch to use GL_NEAREST instead of GL_LINEAR for the luminance channel (the shader is implementing bilinear interpolation with colorspace conversion).
|
A patch to use GL_NEAREST instead of GL_LINEAR for the luminance channel (the shader is implementing bilinear interpolation with colorspace conversion).
|
||||||
|
|
||||||
- unfish_gopro_8:7.py
|
- unfish_gopro_8:7.py
|
||||||
Script to compute the parameters
|
Script to compute the parameters
|
||||||
@ -44,9 +44,3 @@ _For commercial OS's, figure out the paths yourself, then edit the preset to fix
|
|||||||
- Select "Custom/preset_gopro_8:7" in the menu
|
- Select "Custom/preset_gopro_8:7" in the menu
|
||||||
- Modify and/or add filters
|
- Modify and/or add filters
|
||||||
- Save the video
|
- Save the video
|
||||||
|
|
||||||
#### Shader options
|
|
||||||
|
|
||||||
- #define color_conversion: comment out to disable gamma correction for the luminance channel
|
|
||||||
- #define texture_filtering: comment out to disable custom bilinear filtering for the luminance channel
|
|
||||||
- #define rotate_180: uncomment to rotate the image by 180 degrees
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ adm.addVideoFilter(
|
|||||||
"shaderLoader", "shaderFile=/opt/rk/avidemux/unfish_gopro_8:7.glsl")
|
"shaderLoader", "shaderFile=/opt/rk/avidemux/unfish_gopro_8:7.glsl")
|
||||||
adm.addVideoFilter(
|
adm.addVideoFilter(
|
||||||
"swscale",
|
"swscale",
|
||||||
"width=2468",
|
"width=2832",
|
||||||
"height=2160",
|
"height=2160",
|
||||||
"algo=2",
|
"algo=2",
|
||||||
"sourceAR=0",
|
"sourceAR=0",
|
||||||
|
|||||||
@ -37,6 +37,7 @@ uniform float pts;
|
|||||||
// parameters
|
// parameters
|
||||||
|
|
||||||
const vec2 sensor_size = vec2(5.949440, 5.205760);
|
const vec2 sensor_size = vec2(5.949440, 5.205760);
|
||||||
|
const vec2 rectilinear_scale = vec2(1.147370, 1.0);
|
||||||
const float equidistant_focal_length = 2.920000;
|
const float equidistant_focal_length = 2.920000;
|
||||||
const float rectilinear_focal_length = 2.102263;
|
const float rectilinear_focal_length = 2.102263;
|
||||||
|
|
||||||
@ -55,7 +56,7 @@ vec2 sensor_to_texture;
|
|||||||
|
|
||||||
void initialize() {
|
void initialize() {
|
||||||
texture_center = myResolution * 0.5;
|
texture_center = myResolution * 0.5;
|
||||||
texture_to_sensor = (sensor_size / myResolution);
|
texture_to_sensor = (sensor_size / myResolution) * rectilinear_scale;
|
||||||
#ifdef rotate_180
|
#ifdef rotate_180
|
||||||
texture_to_sensor *= -1.0;
|
texture_to_sensor *= -1.0;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -87,19 +87,26 @@ print("linear fov : horizontal = %7.3f, vertical = %7.3f, diagonal = %7.3f (deg
|
|||||||
|
|
||||||
print("\n--- shader parameters ---\n")
|
print("\n--- shader parameters ---\n")
|
||||||
|
|
||||||
|
output_size_horizontal = 2.0 * rectilinear_radius(gopro_fov_horizontal * 0.5)
|
||||||
|
output_size_vertical = gopro_size_vertical
|
||||||
|
|
||||||
|
output_scale_horizontal = output_size_horizontal / gopro_size_horizontal
|
||||||
|
|
||||||
print("""// parameters\n
|
print("""// parameters\n
|
||||||
const vec2 sensor_size = vec2(%.6f, %.6f);
|
const vec2 sensor_size = vec2(%.6f, %.6f);
|
||||||
|
const vec2 rectilinear_scale = vec2(%.6f, 1.0);
|
||||||
const float equidistant_focal_length = %.6f;
|
const float equidistant_focal_length = %.6f;
|
||||||
const float rectilinear_focal_length = %.6f;""" % (
|
const float rectilinear_focal_length = %.6f;""" % (
|
||||||
gopro_size_horizontal, gopro_size_vertical,
|
gopro_size_horizontal, gopro_size_vertical,
|
||||||
|
output_scale_horizontal,
|
||||||
gopro_focal_length,
|
gopro_focal_length,
|
||||||
rectilinear_focal_length_vertical)
|
rectilinear_focal_length_vertical)
|
||||||
)
|
)
|
||||||
|
|
||||||
print("\n--- output size ---\n")
|
print("\n--- filters parameters ---\n")
|
||||||
|
|
||||||
def print_output_array(array_vertical):
|
def print_output_array(array_vertical):
|
||||||
array_horizontal = (array_vertical / gopro_array_vertical) * gopro_array_horizontal
|
array_horizontal = (array_vertical / gopro_array_vertical) * gopro_array_horizontal * output_scale_horizontal
|
||||||
print("resize: width = %d, height = %d" % (
|
print("resize: width = %d, height = %d" % (
|
||||||
round(array_horizontal / 4.0) * 4,
|
round(array_horizontal / 4.0) * 4,
|
||||||
array_vertical))
|
array_vertical))
|
||||||
|
|||||||
Reference in New Issue
Block a user