Table of Contents

Class CameraParameters

Espace de noms
easyar
Assembly
EasyAR.Sense.dll

camera parameters, incluant la taille de l'image, focal length, principal point, le type de camera et l'angle de rotation de la camera par rapport a la device natural orientation.

public class CameraParameters : RefBase, IDisposable
Héritage
CameraParameters
Implémente
Membres hérités

Constructeurs

CameraParameters(Vec2I, Vec2F, Vec2F, CameraDeviceType, int)

public CameraParameters(Vec2I imageSize, Vec2F focalLength, Vec2F principalPoint, CameraDeviceType cameraDeviceType, int cameraOrientation)

Paramètres

imageSize
focalLength
principalPoint
cameraDeviceType
cameraOrientation

Méthodes

Clone()

public CameraParameters Clone()

cameraDeviceType()

Type de camera device. Default camera, back camera ou front camera. Les appareils desktop sont tous default camera, tandis que les appareils mobiles distinguent back camera et front camera.

public virtual CameraDeviceType cameraDeviceType()

cameraModelType()

Camera model.

public virtual CameraModelType cameraModelType()

cameraOrientation()

L'angle de rotation horaire requis lors de l'affichage de la camera image dans la device natural orientation. La plage est [0, 360). Les telephones Android et certaines tablettes Android sont a 90 degres. Les lunettes Android et certaines tablettes Android sont a 0 degre. Les appareils iOS existants sont tous a 90 degres.

public virtual int cameraOrientation()

createWithDefaultIntrinsics(Vec2I, CameraDeviceType, int)

Cree CameraParameters avec les default camera intrinsics. Les default camera intrinsics (focal length et principal point) sont calcules automatiquement a partir de la taille de l'image, mais ils ne sont pas particulierement precis.

public static CameraParameters createWithDefaultIntrinsics(Vec2I imageSize, CameraDeviceType cameraDeviceType, int cameraOrientation)

Paramètres

imageSize
cameraDeviceType
cameraOrientation

equalsTo(CameraParameters)

Determine si deux ensembles de parameters sont egaux.

public virtual bool equalsTo(CameraParameters other)

Paramètres

other

focalLength()

Focal length. La distance entre l'optical center equivalent de la camera et le plan CCD divisee par la unit pixel density dans les directions largeur et hauteur. L'unite est le pixel.

public virtual Vec2F focalLength()

getResized(Vec2I)

Obtient des CameraParameters equivalents apres le changement de taille de la camera image.

public virtual CameraParameters getResized(Vec2I imageSize)

Paramètres

imageSize

imageCoordinatesFromScreenCoordinates(float, int, bool, bool, Vec2F)

Transforme du screen coordinate system ([0, 1]^2) vers l'image coordinate system ([0, 1]^2). Dans les deux coordinate system, x pointe vers la droite, y vers le bas, et l'origin se trouve dans le coin superieur gauche.

public virtual Vec2F imageCoordinatesFromScreenCoordinates(float viewportAspectRatio, int screenRotation, bool combiningFlip, bool manualHorizontalFlip, Vec2F screenCoordinates)

Paramètres

viewportAspectRatio
screenRotation
combiningFlip
manualHorizontalFlip
screenCoordinates

imageHorizontalFlip(bool)

Calcule si l'image doit etre retournee horizontalement. Lors du rendu de l'image, la rotation est appliquee d'abord, puis le flipping. Lorsque cameraDeviceType est front camera, le flipping est effectue automatiquement; manualHorizontalFlip peut etre transmis pour appliquer un flipping manuel supplementaire.

public virtual bool imageHorizontalFlip(bool manualHorizontalFlip)

Paramètres

manualHorizontalFlip

imageOrientation(int)

Calcule l'angle horaire selon lequel l'image doit etre tournee par rapport au screen afin de s'aligner sur le screen. screenRotation est l'angle de rotation horaire de la screen image par rapport a la natural orientation. Pour iOS: * UIInterfaceOrientationPortrait: screenRotation = 0 * UIInterfaceOrientationLandscapeRight: screenRotation = 90 * UIInterfaceOrientationPortraitUpsideDown: screenRotation = 180 * UIInterfaceOrientationLandscapeLeft: screenRotation = 270 Pour Android: * Surface.ROTATION_0: screenRotation = 0 * Surface.ROTATION_90: screenRotation = 90 * Surface.ROTATION_180: screenRotation = 180 * Surface.ROTATION_270: screenRotation = 270

public virtual int imageOrientation(int screenRotation)

Paramètres

screenRotation

imageProjection(float, int, bool, bool)

Calcule la orthographic projection matrix necessaire au rendu de la camera background image, en transformant les points de l'image rectangle coordinate system ([-1, 1]^2) vers le clip coordinate system ([-1, 1]^4), y compris la rotation autour de l'axe z, tandis que les deux dimensions non definies restent inchangees. La orthographic projection matrix a la meme forme qu'OpenGL: la matrix est multipliee a droite par les coordonnees homogenes du point, et non a gauche comme dans Direct3D. Les donnees sont organisees en ordre row-major, oppose a l'ordre column-major d'OpenGL. Les definitions du clip coordinate system et du normalized device coordinate system sont identiques aux valeurs par defaut d'OpenGL.

public virtual Matrix44F imageProjection(float viewportAspectRatio, int screenRotation, bool combiningFlip, bool manualHorizontalFlip)

Paramètres

viewportAspectRatio
screenRotation
combiningFlip
manualHorizontalFlip

principalPoint()

Principal point. Les coordonnees en pixels depuis le point d'intersection du principal optical axis de la camera sur le plan CCD jusqu'au coin superieur gauche de l'image. L'unite est le pixel.

public virtual Vec2F principalPoint()

projection(float, float, float, int, bool, bool)

Calcule la perspective projection matrix necessaire au rendu des virtual objects, en transformant les points du camera coordinate system vers le clip coordinate system ([-1, 1]^4), y compris la rotation autour de l'axe z. La perspective projection matrix a la meme forme qu'OpenGL: la matrix est multipliee a droite par le column vector des coordonnees homogenes du point, et non a gauche comme dans Direct3D. Les donnees sont organisees en ordre row-major, oppose a l'ordre column-major d'OpenGL. Les definitions du clip coordinate system et du normalized device coordinate system sont identiques aux valeurs par defaut d'OpenGL.

public virtual Matrix44F projection(float nearPlane, float farPlane, float viewportAspectRatio, int screenRotation, bool combiningFlip, bool manualHorizontalFlip)

Paramètres

nearPlane
farPlane
viewportAspectRatio
screenRotation
combiningFlip
manualHorizontalFlip

screenCoordinatesFromImageCoordinates(float, int, bool, bool, Vec2F)

Transforme de l'image coordinate system ([0, 1]^2) vers le screen coordinate system ([0, 1]^2). Dans les deux coordinate system, x pointe vers la droite, y vers le bas, et l'origin se trouve dans le coin superieur gauche.

public virtual Vec2F screenCoordinatesFromImageCoordinates(float viewportAspectRatio, int screenRotation, bool combiningFlip, bool manualHorizontalFlip, Vec2F imageCoordinates)

Paramètres

viewportAspectRatio
screenRotation
combiningFlip
manualHorizontalFlip
imageCoordinates

size()

Taille de l'image.

public virtual Vec2I size()

tryCreateWithCustomIntrinsics(Vec2I, List<float>, CameraModelType, CameraDeviceType, int)

Cree CameraParameters avec des custom camera intrinsics. Les camera intrinsics (focal length, principal point, distortion coefficients) et le camera model doivent etre specifies. Pour les camera model pris en charge, reportez-vous a CameraModelType. Remarque: utilisez cette interface avec prudence. Des donnees d'entree incorrectes peuvent faire echouer la creation de l'objet et retourner empty.

public static Optional<CameraParameters> tryCreateWithCustomIntrinsics(Vec2I imageSize, List<float> cameraParamList, CameraModelType cameraModel, CameraDeviceType cameraDeviceType, int cameraOrientation)

Paramètres

imageSize
cameraParamList
cameraModel
cameraDeviceType
cameraOrientation