Skip to content

Add m4e pixel patch - #94

Merged
TrevorBurgoyne merged 3 commits into
mainfrom
feature/m4e
Jul 21, 2026
Merged

Add m4e pixel patch#94
TrevorBurgoyne merged 3 commits into
mainfrom
feature/m4e

Conversation

@TrevorBurgoyne

@TrevorBurgoyne TrevorBurgoyne commented Jul 21, 2026

Copy link
Copy Markdown
Member

M4E Pixel Pitch — Derivation

Value added

DJI_PIXEL_PITCH["M4E"] = {5280: 3.28e-06} (meters), keyed by image width, for
the Wide (mapping) camera only.

Derivation

From the DJI Matrice 4E spec sheet (Wide camera):

  • Image Sensor: 4/3-inch CMOS (nominal active width ≈ 17.3 mm)
  • Max Photo Size: 5280 × 3956 px
pixel pitch = 17.3 mm / 5280 px ≈ 3.28 µm = 3.28e-06 m

The already-supported M3E (Mavic 3 Enterprise) shares the identical sensor
(4/3" CMOS, 20 MP) and image size (5280 × 3956) and is also coded as 3.28e-06.

Caveat / scope

This value applies only to the Wide camera. The M4E's Medium Tele (1/1.3"
48 MP, width 8064) and Telephoto (1/1.5" 48 MP, width 8192) lenses report the
same Image Model (M4E) but have different pixel pitches. Because we have no
sample images for those lenses, they are intentionally not supported:
pixel_pitch_meters() resolves the M4E entry by image width and raises a
ParsingError for any non-Wide width. When sample data is available, add the
8064 / 8192 width keys to DJI_PIXEL_PITCH["M4E"] to enable them.

Lenses can also be distinguished via FocalLengthIn35mmFilm (24 = Wide,
70 = Medium Tele, 168 = Telephoto).

Why?

  • currently parser.focal_length_pixels() fails with KeyError: 'M4E'

PR Checklist

  • Merged latest master
  • Updated version number

Breaking Changes

@hennels hennels left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and makes sense to me.
I'm a little scared that images from the other lenses you mention will silently just produce bad data in the current state. It is probably worth setting something up to cause an explicit error for the other lenses of the M4E to be sure that doesn't happen. Or just support all of them at the same time.

@TrevorBurgoyne
TrevorBurgoyne requested a review from hennels July 21, 2026 20:38

@hennels hennels left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for adding the error.

@TrevorBurgoyne
TrevorBurgoyne merged commit 1bec7ab into main Jul 21, 2026
1 check passed
@TrevorBurgoyne
TrevorBurgoyne deleted the feature/m4e branch July 21, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants