22 C
Canberra
Sunday, April 26, 2026

ios – AVCaptureDevice.exposurePointOfInterest readback doesn’t match set worth on iPad Professional M4 / M3(UltraWide)and Gen2,3,4(TrueDepth) utilizing resizeAspectFill


Setting:

  • Gadgets: iPad Professional 11″ M4, iPad Air 11″ M3, iPad Professional 11″ Gen2/3/4

  • Language: Swift

  • Framework: AVFoundation

  • Entrance digital camera: UltraWide (M4/M3), TrueDepth (Gen2–4)

  • Video gravity: .resizeAspectFill


Background

I’m setting an publicity focal point utilizing coordinates outlined in captured picture pixel area.

  • Enter level: (1170, 1370)

Picture sizes:

  • Gen2/3/4: 2316 × 3088

  • M3/M4: 3024 × 4032

Preview sizes:

  • Gen2/3/4: 834 × 1194

  • M4: 834 × 1210

  • M3: 820 × 1180


What I do

First, I convert picture pixel coordinates to preview layer coordinates, then use captureDevicePointConverted(fromLayerPoint:).

let devicePoint = previewLayer.captureDevicePointConverted(fromLayerPoint: layerPoint)

Studying again publicity level

After seize, I convert again:

let layerPoint = previewLayer.layerPointConverted(fromCaptureDevicePoint: exposurePoint)

This ends in:


Remark

Evidently captureDevicePointConverted(fromLayerPoint:) doesn’t carry out a linear mapping when utilizing .resizeAspectFill.

My understanding is that:


Questions

  1. Does captureDevicePointConverted(fromLayerPoint:) account for .resizeAspectFill cropping, making it unsuitable for direct pixel mapping?

  2. Is it appropriate to compute publicity factors immediately utilizing normalized coordinates (pixel / picture dimension) as a substitute of utilizing preview layer conversion?

  3. Is exposurePointOfInterest at all times expressed in full sensor normalized coordinates (0–1), impartial of preview settings?

  4. Does this conduct differ between UltraWide (M3/M4) and TrueDepth cameras?

  5. Is there official documentation describing appropriate coordinate mapping for this situation?


Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles