Skip to main content
API Reference SwiftyNsdk NsdkObjectDetectionSession

modelToImageTransform

Returns an affine transform that maps coordinates from the model's frame to the image frame,...

Declaration

func modelToImageTransform(forPhysicalOrientation orientation: UIInterfaceOrientation) -> CGAffineTransform?

Summary

Returns an affine transform that maps coordinates from the model's frame to the image frame,
accounting for the model image being rotated to align with gravity, while the source image
is always oriented in landscape.
- Parameter orientation: The gravity aligned interface orientation.
- Returns: A CGAffineTransform to convert model coordinates to image coordinates,
or nil if the model frame size, source frame size, or orientation is unavailable.


ON THIS PAGE