2016-10-26 3 views
0

3D 시력을 시뮬레이트하기 위해 각 눈에 하나씩 두 개의 동영상을 스트리밍하는 Google 골판지 용 앱을 개발 중입니다. 나는 각 프레임에 적용될 양안 왜곡을 시뮬레이트하기 위해 google vr sdk만을 사용하려고하지만 실제로는 왜곡을 적용하는 this example에서 명확하지 않습니다. 이 예제에서 google vr은 양안 왜곡을 적용합니까?

/** 
* Draws a frame for an eye. 
* 
* @param eye The eye to render. Includes all required transformations. 
*/ 
@Override 
public void onDrawEye(Eye eye) { 
    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); 
    ... 
    // Apply the eye transformation to the camera. 
    Matrix.multiplyMM(mView, 0, eye.getEyeView(), 0, mCamera, 0); 

    // Set the position of the light 
    Matrix.multiplyMV(mLightPosInEyeSpace, 0, mView, 0, LIGHT_POS_IN_WORLD_SPACE, 0); 

    // Build the ModelView and ModelViewProjection matrices 
    // for calculating cube position and light. 
    float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR); 
    Matrix.multiplyMM(mModelView, 0, mView, 0, mModelCube, 0); 
    Matrix.multiplyMM(mModelViewProjection, 0, perspective, 0, mModelView, 0); 
    drawCube(); 

    // Draw the rest of the scene. 
    ... 
} 

이 코드

은과 같이 설명되어 있습니다 :

  • 보물 눈 공간으로 제공 :

    이 이벤트의 순서입니다.

  • 투영 행렬을 적용합니다. 지정된 눈에 렌더링 된 장면을 제공합니다.
  • Google VR SDK는 자동으로 왜곡을 적용하여 최종 장면을 렌더링합니다.

그러나이 세 번째 단계는 실제로 설명되지 않습니다. 실사 영상을 사용하여 렌더링 및 이미지를 제작하지 않기 때문에 왜곡이 적용되는 코드 부분 만 사용해야하지만이 문제가 얼마나 정확한지는 분명하지 않습니다.

아무도 아이디어가있는 경우 알려 주시기 바랍니다.

답변

0

공개 왜곡 getApproximateInverseDistortion (maxRadius 플로트 numCoefficients를 INT)

최소 제곱 끼움 계수 역 왜곡 오브젝트를 작성.

이것은 응용 프로그램 측 사용자 정의 왜곡을 구현하기위한 것입니다. 반환 된 객체에서 .getCoefficients()를 사용하여 역 왜곡 함수의 계수를 검색합니다.

이것은 대략적인 역수로, 반환 된 객체에서 .distort()를 사용하면 원본에서 distortInverse() 메서드를 사용하는 것보다 빠르지 만 정확도가 떨어집니다. 유용한 결과를 얻으려면 입력 왜곡이 0..maxRadius 범위에서 정상적으로 작동해야합니다.

50도 반각 FOV (총 100도)의 예제에서는 inverse.distort (r)가 r = 0 ... maxFovHalfAngle 범위에서 distortion.distortInverse (r)와 거의 같은 역 왜곡을 만듭니다.

상세 정보 : https://developers.google.com/vr/android/reference/com/google/vr/sdk/base/Distortion

https://www.baekdal.com/insights/why-pretty-much-all-360-vr-videos-get-it-wrong