emberlightvfx / gyroflow-to-csv Goto Github PK
View Code? Open in Web Editor NEWConvert your GyroFlow stabilization to a CSV file
License: MIT License
Convert your GyroFlow stabilization to a CSV file
License: MIT License
Hi,
In latest dev build, and soon to be v1.5.1, I've changed the format of the extended data a bit. Instead of using bincode
I now use standard CBOR
, which should be easier to parse
If version
== 3, then gyro_data = cbor2.decoder.loads(raw)
This was needed because we now have additional data from certain files, like per-frame offset, per-frame exposure time and hopefully soon per-frame lens profile information. Adding all these additional information using bincode
would be pretty hard to parse in external tools, so I decided to switch to CBOR, which has parsers in all languages
raw_imu
and quaternions
fields were removed from gyro_source
. Instead, there's now file_metadata
there which contains:
pub struct FileMetadata {
pub imu_orientation: Option<String>,
pub raw_imu: Vec<telemetry_parser::util::IMUData>,
pub quaternions: BTreeMap<i64, Quaternion<f64>>,
pub gravity_vectors: Option<BTreeMap<i64, Vector3<f64>>>,
pub image_orientations: Option<BTreeMap<i64, Quaternion<f64>>>,
pub detected_source: Option<String>,
pub frame_readout_time: Option<f64>,
pub frame_rate: Option<f64>,
pub camera_identifier: Option<CameraIdentifier>,
pub lens_profile: Option<serde_json::Value>,
pub lens_positions: Option<BTreeMap<i64, f64>>,
pub has_accurate_timestamps: bool,
pub additional_data: serde_json::Value,
pub per_frame_time_offsets: Vec<f64>,
pub per_frame_data: Vec<serde_json::Value>,
}
// definition of telemetry_parser::util::IMUData
pub struct IMUData {
pub timestamp_ms: f64,
pub gyro: Option<[f64; 3]>,
pub accl: Option<[f64; 3]>,
pub magn: Option<[f64; 3]>
}
// definition of CameraIdentifier
pub struct CameraIdentifier {
pub brand: String,
pub model: String,
pub lens_model: String,
pub lens_info: String,
pub focal_length: Option<f64>,
pub camera_setting: String,
pub fps: usize,
pub video_width: usize,
pub video_height: usize,
pub additional: String,
pub identifier: String
}
Additionally, I added:
synced_imu_timestamps
- array of timestamps for every IMU sample, with added interpolated offsetssynced_imu_timestamps_with_per_frame_offset
- same as above + per frame time offset, which involves exposure time and custom VSYNC offset from the file metadata - this is the final offset. The timestamps represent middle of the frame, ie. in case of 59.94 video, 0 is the middle row of first frame, 16.68 middle row of the second frame etc.adaptive_zoom_fovs
- per frame smoothed FOV for adaptive zoomSo instead of interpolating the offsets on your side in python, you can just use imu.timestamp = synced_imu_timestamps_with_per_frame_offset[imu_index]
file_metadata = cbor2.decoder.loads(zlib.decompress(decode(data['gyro_source']['file_metadata'])))
synced_imu_timestamps_with_per_frame_offset = cbor2.decoder.loads(zlib.decompress(decode(data['gyro_source']['synced_imu_timestamps_with_per_frame_offset'])))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.