When connecting Android camera frames to a vision SDK, first check the data layout. Then identify where rotation, cropping, scaling and mirroring occur. A normal preview does not prove that the model received correct pixels or that detection boxes map to the correct display positions.
Format names do not replace image-plane layout checks
For images with multiple color planes, record each image plane's row stride, pixel stride and valid data range. Do not assume that rows and pixel samples have no padding. Android image-plane documentation defines the byte distances between adjacent rows and pixel samples separately. Check copying or conversion against the actual format and SDK interface. A preview alone is insufficient evidence.
Define data lifetime for asynchronous tasks
Image documentation states that accessing previously obtained plane buffers after closing the image has undefined behavior. If an asynchronous task needs data after image closure, close the image only after copying all required data into an application-owned buffer. Reuse those buffers according to task-completion conditions. Copying alone does not replace format and bounds checks.
Record image coordinates and display coordinates separately
| Processing stage | Definition needed | Evidence to retain |
|---|---|---|
| Original input | Image dimensions, format and crop region | Original frame and valid area |
| Model input | Order of rotation, scaling or cropping | Image and parameters submitted to the SDK |
| Result coordinates | Origin, units and corresponding image | Result values and image version |
| Preview overlay | Display dimensions, borders or cropping, and mirroring | Display region and position comparison |
A correct display does not verify the entire pipeline
See Android preview documentation for sensor orientation, device orientation and preview dimensions. Check the actual SDK contract and tests to establish whether it already handles rotation or mirroring. Avoid applying a transform twice. Compare model input, results and overlays for the same frame. Without original input evidence, keep the input path unverified. This article explains processing methods; no new device tests were performed.
Related services: Android, mobile and embedded vision SDKs, project consultation.