gyroflow / gyroflow

Video stabilization using gyroscope data
https://gyroflow.xyz
GNU General Public License v3.0
6.58k stars 281 forks source link

Calibrator: Allow for multiple zoom values, could be interpolated later #28

Open AdrianEddy opened 2 years ago

AdrianEddy commented 2 years ago

For example Sony saves focal length per every frame, so we can calibrate a few focal lengths on a zoom lens (eg. 28mm, 35mm, 70mm) and then interpolate between them on every frame. This will allow to support videos where user zooms in and out

AdrianEddy commented 1 year ago

With latest dev build and Sony cameras, there is support for zoom lenses, ie. zoom can be changing throughout the video.

If you're using Blackmagic, it also works, but the focal lengths reported by the camera are not smooth (they are whole values, without fractions), so with Blackmagic you won't be able to dynamically change zoom during the video, but you can have one lens profile which will automatically adapt to your current zoom value.

In order to use that, you need to calibrate a few focal lengths manually, then take first lens profile, edit it and add interpolations section by copying the camera_matrix and distortion_coeffs from other profiles/focal lengths.

Example here: https://github.com/gyroflow/lens_profiles/blob/main/Sony/Sony_a7sIII_Tamron%2028-200_4k_16by9_3840x2160-59.94fps.json#L75-L95

Hevinxue commented 2 months ago

Great to see theres a solution for zooming lens. Is it possible in the future to integrate multi-focal-length calibration using one input calib video? (Or a merging section to merge multiple calibration results

AdrianEddy commented 2 months ago

with Sony it's all automatic now. Other cameras don't provide focal length per frame (well, blackmagic does but not suitable for zooming)

Hevinxue commented 2 months ago

Great. gonna try it later. Wonderful work really appreciate it.