Conversation
The Avata 360 writes the same library messages as the Osmo 360 (DewarpParams, PanoDewarpParams, Quaternion, the scalar wrappers), but numbers ClipMeta, StreamMeta, FrameMeta and FrameMetaOfCamera its own way. Read with the Osmo numbering an Avata clip has no calibration (it is at StreamMeta 5, not 6), takes its IMU rate (ClipMeta 8) for the digital focal length, its flat_res for the sensor size, and loses its attitude (FrameMetaOfCamera 22 and 23, not 9 and 10). So nothing stitched. DjmdDecoder now maps each schema's field numbers onto the canonical (Osmo 360) ones before its single set of switch statements, so present bits and Types.h keep one meaning on every camera. The ClipMeta header names the schema; frames after the first carry no header, so MetadataTrack passes sample 0's schema to every later decode. This replaces the post-pass that read only the Avata's colour mode. camera_stream_meta.color_mode is the same library ColorMode as the Osmo's StreamMeta 4, so every value is now trusted as on the Osmo (HLG reads as HLG, not Unknown). Every other behaviour that test pinned is kept: D-Log M and Normal, StreamMeta ahead of ClipMeta, a missing 2.4 is Unknown with a warning, and the Osmo numbering for any other proto name. The Avata's single fused attitude batch (IMU field 4) stands in when the three-batch message brings none. osvtool probe prints the schema used.
…look DJI Studio 1.0.0.24724 bundles "DJI Avata 360 D-Log M to Rec.709 V1.cube" (filter LOG_Avata360_DLogM) beside the Osmo 360 one. It is a different file: the Osmo 360, Pocket 3 and Avata 2 LUTs are byte-identical, the Avata 360's is not. So the Avata 360 fit can be made exactly the way the Osmo 360's was, from the neutral axis and the whole cube of DJI's own file. The first Avata 360 fit (#1) was made before the file was found, from DJI Studio's export of one indoor clip under a BT.709-OETF display model. OpenOSV renders Rec.709 as HLG-in-709 plus a look, so that curve lands 0.5 to 1.4 stops away from the scale every other OpenOSV curve uses, and through osvtool it measures 7.35 dE2000 mean from DJI's Avata 360 LUT (p95 13.0). The Osmo 360 fit measures 2.52 (p95 6.50). - kDlogMAvata360: scripts/fit_dlogm.py --from-cube on the Avata 360 file. Above grey it sits within 2 % of kDlogMOsmo360 (code 1.0 -> 3.63 vs 3.76); its toe is deeper. - kNativeToRec2020_Avata360: scripts/fit_primaries.py on all 35937 entries, full-cube RMS 0.0567 HLG code (Pocket 3 matrix 0.1119). Every implied primary has positive luminance, and the red is at x = 0.705 where #1's was at x = 4.15. - kLookDjiRec709Avata360: scripts/fit_look.py, which gains --curve and --matrix for a camera other than the Osmo 360. makeLookParams and setLook take the camera fit and use that camera's look, shaper and matrix; the Osmo 360 and the legacy fits keep exactly the look they had. Through osvtool (the kernel, 33^3 bake), Avata 360 D-Log M against DJI's Avata 360 LUT: 1.68 dE2000 mean, p95 3.66, max 6.34, neutral axis 0.18 mean. For scale, the Osmo 360 fit measures 1.23 against its own file. Osmo 360 renders are unchanged: 1.231 / 2.798 / 6.117, as before.
Horizon Leveling decomposes each pose as yaw * pitch * roll about the body's +Y, the lens axis. That is well conditioned for a camera held with its lenses level, which is every Osmo 360 clip, and degenerate for one flown with a lens up and a lens down, which is the Avata 360's 360 mode: +Y sits within a few degrees of vertical on every frame, the Euler decomposition is in gimbal lock, and the heading follows the direction of the tilt. In a synthetic lens-up clip a 5 degree tilt swings the levelled view by more than 30 degrees. levellingMount measures, over the clip's whole attitude track, how vertical the lens axis is. Closer to the horizon than to vertical on average, it is the identity, and levelling is bit-for-bit what it was (tested on random handheld poses and on the sample clip). Otherwise it is the quarter turn about +X that levels about the body's horizontal Z axis, with the upper lens as up. With it the same clip holds its heading to within 0.5 degrees through every tilt and still turns with the aircraft. The importer and osvtool measure it where they build the attitude track.
Source Settings (the importer dialog and the effect), the Resolve source
and the saved user defaults gain "Avata 360" as the D-Log M Curve, value
3: PrefsDlogmFit is persisted, so it is appended and every saved project
reads as before. It selects the Avata 360 curve, primaries and Rec.709
look; Osmo 360 stays the default.
luts/ gains the Avata 360 set beside the Osmo 360 / Pocket 3 one:
DJI_Avata360_DLogM_to_{Rec2100_PQ,Rec2100_HLG}_<style> for the five
Transfer Function (HDR) styles and _to_Rec709_{DJI_Look,OpenOSV_Standard}.
gen_luts.ps1 bakes one set per DJI D-Log M LUT, each with its own --fit,
and its -Fit now picks which sets to write or check. The Osmo 360 tables
are byte-identical. test_cube regenerates all 24 and pins their grey and
white anchors.
…nd levelling CHANGELOG, docs/COLOR.md, docs/FORMAT.md, docs/LEGAL.md and NOTICE now describe the Avata 360 as it is: read in its own field numbering (a table of where it differs from the Osmo 360), coloured by fits to DJI's own Avata 360 LUT with the measured results, the DJI_Avata360 LUT set, and levelling about the horizontal axis on a lens-up rig. The first Avata 360 fit from #1 is credited and its replacement explained. The README says Avata 360 clips open and are not yet tested on footage here.
|
Thank you for this PR, and for the kind credit. I tested Short version: 1. probe
The cause: the Avata records have no 2. render As is, it stops with To get further I patched two things locally:
With those, the stitch holds up:
3. --stab smooth-horizon As is, it fails with With that and the default convention ( A lead, from one static clip only: Heading steadiness: I can't judge it. This clip is almost static; the attitude moves at most 2° over 10.6 s. 4. Forward axis To test Without stabilisation, the default reframe (yaw 0, pitch 0) looks straight at the ground, since it faces the master lens and that lens points down. 5. Other
6. Correction: the attitude is in the .OSV too An earlier version of this section said the per-frame attitude was only in the
So nothing needs the LRF. "AttitudeTrack: no usable samples" may come from reading fields 22/23 rather than from missing data. Sorry for the noise. I've left out screenshots because the footage shows my home and my neighbours' houses. I can send frames privately if that would help. |
Follows #1. That PR made the Avata 360's colour mode readable and added a first curve. This one makes Avata 360 clips open, stitch and reframe in osvtool, Premiere and Resolve, and refits the colour to DJI's own Avata 360 LUT.
Why Avata 360 clips had "no calibration"
The Avata 360 writes the same library messages as the Osmo 360 (
DewarpParams,PanoDewarpParams,Quaternion, the scalar wrappers). It numbers the fields ofClipMeta,StreamMeta,FrameMetaandFrameMetaOfCameradifferently. Read with the Osmo numbering, an Avata clip:PanoDewarpParamsis at StreamMeta 5, not 6;flat_resfor the sensor size;DjmdDecodernow maps each schema's field numbers onto the canonical Osmo 360 ones before its single set of switch statements. SoTypes.hand thepresentbits mean the same on every camera. TheClipMetaheader names the schema. Later frames carry no header, soMetadataTrackpasses sample 0's schema to them.osvtool probeprints the schema it used, anddocs/FORMAT.mdhas a table of where the Avata 360 differs.This replaces #1's colour-mode post-pass. Every case its test pinned still holds, except one.
camera_stream_meta.color_modeis the same libraryColorModeas the Osmo's StreamMeta 4, so HLG now reads as HLG instead of Unknown.Colour: DJI does ship an Avata 360 LUT
DJI Studio 1.0.0.24724 bundles
DJI Avata 360 D-Log M to Rec.709 V1.cube(filterLOG_Avata360_DLogM). It is not the Osmo 360 file: the Osmo 360, Pocket 3 and Avata 2 LUTs are one byte-identical file, and the Avata 360's is its own. So the Avata 360 gets the same three fits the Osmo 360 has, made the same way from its own file:kDlogMAvata360fit_dlogm.py --from-cube: neutral RMS 0.0223 HLG codekNativeToRec2020_Avata360fit_primaries.py: full-cube RMS 0.0567 (Pocket 3 matrix 0.1119); every implied primary has positive luminancekLookDjiRec709Avata360fit_look.py(new--curve/--matrix): 1.683 dE2000 mean, p95 3.657makeLookParamsandsetLooktake the camera fit, so--fit avata360renders Rec.709 through the Avata 360's own look. The Osmo 360 and the legacy fits keep the look they had. Through osvtool (the kernel, 33³ bake), Avata 360 D-Log M against DJI's Avata 360 LUT:avata360, this PRosmo360(the default)avata360from #1For scale,
osmo360against the Osmo 360 file measures 1.23 / 2.80 / 6.12.#1's curve was fitted to DJI Studio's export under a BT.709-OETF model. OpenOSV renders Rec.709 as HLG-in-709 plus a look, so on that scale the curve sat 0.5 to 1.4 stops below the others above grey. @debsahu, thank you for the groundwork. The decoder fix and the plumbing are yours; only the constants moved.
Plug-ins and LUTs
PrefsDlogmFit::Avata360 = 3is appended, so saved projects read as before. Osmo 360 stays the default.luts/gains aDJI_Avata360set: PQ and HLG in all five HDR styles, plus Rec.709 with the DJI look or OpenOSV's.gen_luts.ps1bakes one set per DJI D-Log M LUT. The Osmo tables are byte-identical, andtest_cuberegenerates and anchors all 24.The drone difference: Horizon Leveling on a lens-up rig
The Avata 360 flies with one lens up and one down, so the body's +Y (the lens axis) is vertical. Levelling decomposes yaw, pitch and roll about +Y, which puts it in gimbal lock: in a synthetic lens-up clip, a 5° tilt swung the view by more than 30°.
levellingMountmeasures, over the whole attitude track, how vertical the lens axis is:Tests
On Windows with MSVC, CPU only:
[cuda],[gpu],[opencl]and[metal]excluded.gen_luts.ps1 -Checkpasses.The new tests cover the full Avata schema (calibration, focal length, attitude, schema hint), per-camera looks, the kernel against DJI's whole Avata 360 LUT (
[dji-lut], skipped without DJI Studio), and the levelling mount.Not verified here
There is no Avata 360 footage in this repository. @debsahu, when you have a moment, could you try this branch on your clips?
osvtool probe <clip>should sayAvata 360 schema, list the calibration slots, and show a sensible digital focal length.osvtool render <clip> --out f.pngshould give a clean seam. If the seam is off, the sensor-to-stream scaling or the extrinsic convention may differ from the Osmo's.--stab smooth-horizonshould give a level horizon with a steady heading.Which horizontal axis counts as "forward" on the aircraft is the one choice this PR cannot settle without footage. If the default view faces backwards, one sign in
levellingMountflips it.