Table of Contents

Class CameraParameters

네임스페이스
easyar
어셈블리
EasyAR.Sense.dll

camera parameters. image 크기, focal length, principal point, camera 유형, device natural orientation 기준 camera 회전 각도를 포함합니다.

public class CameraParameters : RefBase, IDisposable
상속
CameraParameters
구현
상속된 멤버

생성자

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

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

매개 변수

imageSize
focalLength
principalPoint
cameraDeviceType
cameraOrientation

메서드

Clone()

public CameraParameters Clone()

cameraDeviceType()

camera device 유형. default camera, back camera 또는 front camera입니다. 데스크톱 장치는 모두 default camera이고, 모바일 장치는 back camera와 front camera를 구분합니다.

public virtual CameraDeviceType cameraDeviceType()

cameraModelType()

Camera model.

public virtual CameraModelType cameraModelType()

cameraOrientation()

device natural orientation에서 camera image를 표시할 때 필요한 시계 방향 회전 각도입니다. 범위는 [0, 360)입니다. Android 휴대폰과 일부 Android 태블릿은 90도입니다. Android 글래스와 일부 Android 태블릿은 0도입니다. 기존 iOS 장치는 모두 90도입니다.

public virtual int cameraOrientation()

createWithDefaultIntrinsics(Vec2I, CameraDeviceType, int)

default camera intrinsics로 CameraParameters를 생성합니다. default camera intrinsics(focal length 및 principal point)는 image 크기에 따라 자동으로 계산되지만 특별히 정확하지는 않습니다.

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

매개 변수

imageSize
cameraDeviceType
cameraOrientation

equalsTo(CameraParameters)

두 parameter 세트가 같은지 판단합니다.

public virtual bool equalsTo(CameraParameters other)

매개 변수

other

focalLength()

Focal length. camera의 equivalent optical center에서 CCD 평면까지의 거리를 너비와 높이 방향의 unit pixel density로 나눈 값입니다. 단위는 픽셀입니다.

public virtual Vec2F focalLength()

getResized(Vec2I)

camera image 크기가 변경된 후의 동등한 CameraParameters를 가져옵니다.

public virtual CameraParameters getResized(Vec2I imageSize)

매개 변수

imageSize

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

screen coordinate system ([0, 1]^2)에서 image coordinate system ([0, 1]^2)으로 변환합니다. 두 coordinate system 모두 x는 오른쪽, y는 아래쪽을 향하고 origin은 왼쪽 위 모서리에 있습니다.

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

매개 변수

viewportAspectRatio
screenRotation
combiningFlip
manualHorizontalFlip
screenCoordinates

imageHorizontalFlip(bool)

image에 horizontal flipping이 필요한지 계산합니다. image 렌더링 시 먼저 회전한 다음 flipping합니다. cameraDeviceType이 front camera이면 flipping이 자동으로 수행됩니다. manualHorizontalFlip을 전달하면 그 위에 수동 flipping을 한 번 더 적용할 수 있습니다.

public virtual bool imageHorizontalFlip(bool manualHorizontalFlip)

매개 변수

manualHorizontalFlip

imageOrientation(int)

image가 screen에 맞춰 정렬되도록 screen을 기준으로 시계 방향으로 회전해야 하는 각도를 계산합니다. screenRotation은 natural orientation을 기준으로 한 screen image의 시계 방향 회전 각도입니다. iOS의 경우: * UIInterfaceOrientationPortrait: screenRotation = 0 * UIInterfaceOrientationLandscapeRight: screenRotation = 90 * UIInterfaceOrientationPortraitUpsideDown: screenRotation = 180 * UIInterfaceOrientationLandscapeLeft: screenRotation = 270 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)

매개 변수

screenRotation

imageProjection(float, int, bool, bool)

camera background image를 렌더링하는 데 필요한 orthographic projection matrix를 계산하여 image rectangle coordinate system ([-1, 1]^2)의 점을 clip coordinate system ([-1, 1]^4)으로 변환합니다. z축 주위의 회전도 포함하며, 정의되지 않은 두 차원은 변경되지 않습니다. orthographic projection matrix의 형식은 OpenGL과 동일합니다. matrix는 Direct3D처럼 왼쪽에서 곱하지 않고, 점의 동차 좌표에 오른쪽에서 곱합니다. 데이터는 row-major 순서로 배열되며 OpenGL의 column-major와 반대입니다. clip coordinate system 및 normalized device coordinate system의 정의는 OpenGL 기본값과 동일합니다.

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

매개 변수

viewportAspectRatio
screenRotation
combiningFlip
manualHorizontalFlip

principalPoint()

Principal point. camera의 principal optical axis가 CCD 평면과 만나는 지점에서 image 왼쪽 위 모서리까지의 픽셀 좌표입니다. 단위는 픽셀입니다.

public virtual Vec2F principalPoint()

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

virtual objects를 렌더링하는 데 필요한 perspective projection matrix를 계산하여 camera coordinate system의 점을 clip coordinate system ([-1, 1]^4)으로 변환합니다. z축 주위의 회전도 포함합니다. perspective projection matrix의 형식은 OpenGL과 동일합니다. matrix는 Direct3D처럼 왼쪽에서 곱하지 않고, 점의 동차 좌표 column vector에 오른쪽에서 곱합니다. 데이터는 row-major 순서로 배열되며 OpenGL의 column-major와 반대입니다. clip coordinate system 및 normalized device coordinate system의 정의는 OpenGL 기본값과 동일합니다.

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

매개 변수

nearPlane
farPlane
viewportAspectRatio
screenRotation
combiningFlip
manualHorizontalFlip

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

image coordinate system ([0, 1]^2)에서 screen coordinate system ([0, 1]^2)으로 변환합니다. 두 coordinate system 모두 x는 오른쪽, y는 아래쪽을 향하고 origin은 왼쪽 위 모서리에 있습니다.

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

매개 변수

viewportAspectRatio
screenRotation
combiningFlip
manualHorizontalFlip
imageCoordinates

size()

image 크기.

public virtual Vec2I size()

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

custom camera intrinsics로 CameraParameters를 생성합니다. camera intrinsics(focal length, principal point, distortion coefficients)와 camera model을 지정해야 합니다. 지원되는 camera model은 CameraModelType을 참고하십시오. 참고: 이 인터페이스는 신중하게 사용하십시오. 입력 데이터가 잘못되면 객체 생성이 실패하고 empty가 반환될 수 있습니다.

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

매개 변수

imageSize
cameraParamList
cameraModel
cameraDeviceType
cameraOrientation