Skip to main content
←API Reference ←com.nianticspatial.nsdk.utils ←ImageMath

reprojection


Declaration​

fun reprojection(aspect: Float, fovRadians: Float, zNear: Float, zFar: Float, referenceView: FloatArray, targetView: FloatArray, backProjectionDistance: Float = 0.9f): Matrix

Summary​

Returns a 3×3 homography matrix (android.graphics.Matrix) that reprojects image coordinates
from a reference camera view into a target camera view.


This is typically used to transform 2D image-space coordinates (normalized in [0..1])
from one camera perspective to another, e.g. for aligning visual overlays between AR frames.

Returns​

A 3×3 homography matrix represented as an android.graphics.Matrix.

Parameters​

NameTypeSummary
aspectFloat
The image aspect ratio (width / height).
fovRadiansFloat
The vertical field of view in radians.
zNearFloat
The near clipping plane distance.
zFarFloat
The far clipping plane distance.
referenceViewFloatArray
The reference camera's 4×4 view matrix as a FloatArray (length 16), in OpenGL-style column-major order. This can typically be acquired from ARCore using camera.getViewMatrix(viewMatrix, 0).
targetViewFloatArray
The target camera's 4×4 view matrix, same format and origin as referenceView.
backProjectionDistanceFloat
Non-linear depth at which to reproject (between zNear and zFar). A value of 0.0 corresponds to the near plane, 1.0 to the far plane. Recommended value: 0.9.