Mobile Development 13 min read

Resolving Near-Field Blur on iPhone Pro Max via Camera Switching and Microscopy Capability

The iPhone 13/14 Pro Max near‑field blur was fixed by the Paizhil Tao team by replacing the deprecated AVCaptureDevice call with AVCaptureDeviceDiscoverySession, calibrating videoZoomFactor thresholds and leveraging the virtualDeviceSwitchOverVideoZoomFactors API to automatically switch between wide, telephoto and ultra‑wide lenses under suitable zoom, lighting and focus conditions, thereby restoring close‑up image clarity and boosting recognition performance.

DaTaobao Tech
DaTaobao Tech
DaTaobao Tech
Resolving Near-Field Blur on iPhone Pro Max via Camera Switching and Microscopy Capability

Recent iPhone 13/14 Pro Max models exhibit blurred images when third‑party apps perform near‑field focusing. The “Paizhil Tao” iOS camera team investigated the issue and decomposed it into three goals: zoom factor, illumination level, and focus position.

Background knowledge includes imaging principles such as focal length, focus mechanisms (manual/auto), optical vs. digital zoom, and multi‑camera systems (wide, telephoto, ultra‑wide, dual‑wide, triple‑camera). The lack of micro‑distance capability on some devices is due to sensor size and camera hardware.

Problem analysis identified three layers to address: link implementation, performance, and adaptation. The key step in the link is generating an AVCaptureDevice . The legacy devicesWithMediaType: method is deprecated; the new AVCaptureDeviceDiscoverySession must be used with appropriate deviceTypes , mediaType , and position .

Supported device types include:

AVCaptureDeviceTypeBuiltInWideAngleCamera
AVCaptureDeviceTypeBuiltInTelephotoCamera
AVCaptureDeviceTypeBuiltInUltraWideCamera
AVCaptureDeviceTypeBuiltInDualCamera
AVCaptureDeviceTypeBuiltInDualWideCamera
AVCaptureDeviceTypeBuiltInTripleCamera
AVCaptureDeviceTypeBuiltInTrueDepthCamera

Automatic camera switching requires the conditions of acceptable zoom factor, lighting, and focus position. The videoZoomFactor property controls image cropping and magnification; values between 1.0 and the device’s videoMaxZoomFactor are allowed.

Two solution approaches were tested. Approach 1 manually adjusted the zoom factor (1–3.5×) and observed seamless switching between the main and ultra‑wide lenses. Approach 2 leveraged the virtualDeviceSwitchOverVideoZoomFactors API (iOS 13+), which provides the exact zoom thresholds for virtual device transitions:

@property(nonatomic, readonly) NSArray
*virtualDeviceSwitchOverVideoZoomFactors API_AVAILABLE(ios(13.0), macCatalyst(14.0));

Both methods produced consistent lens‑switching behavior, confirming the feasibility of the solution.

Performance testing showed a modest increase in CPU and memory usage, which can be mitigated with selective activation and tighter memory management.

Adaptation logic selects the appropriate deviceTypes list based on hardware capabilities (single, dual, triple cameras) and iOS version (e.g., AVCaptureDeviceTypeBuiltInDualWideCamera requires iOS 13+). A feature flag controls rollout to ensure stability.

After integration, the micro‑distance capability significantly improved image clarity for close‑up product scans, boosting recognition accuracy and recall rates.

In summary, the team resolved the near‑field blur issue by updating the camera acquisition pipeline, using modern AVFoundation APIs, and fine‑tuning zoom thresholds, delivering a better user experience for the “Paizhil Tao” app.

mobile developmentPerformanceiOSAVCaptureDeviceCameraMicroscopy
DaTaobao Tech
Written by

DaTaobao Tech

Official account of DaTaobao Technology

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.