@@ -372,7 +372,16 @@ Public Class UCVirtualTrackerItem
372372 ' The PS4 Cam requires precomputed distortion.
373373 Dim mConstCameraDistortion As ClassSerivceConst.ClassCameraDistortion.STRUC_CAMERA_DISTORTION_ITEM = Nothing
374374 If (bIsPlayStationCamera) Then
375- If (ClassSerivceConst.ClassCameraDistortion.GetKnownDistortionByType(ClassSerivceConst.ClassCameraDistortion.ENUM_CAMERA_DISTORTION_TYPE.PS4CAM, mConstCameraDistortion)) Then
375+ Dim iCameraByResolution = ClassSerivceConst.ClassCameraDistortion.ENUM_CAMERA_DISTORTION_TYPE.GENERIC
376+ Select Case (iResolutionWidth)
377+ Case 640
378+ iCameraByResolution = ClassSerivceConst.ClassCameraDistortion.ENUM_CAMERA_DISTORTION_TYPE.PS4CAM_SD
379+ Case 1920
380+ iCameraByResolution = ClassSerivceConst.ClassCameraDistortion.ENUM_CAMERA_DISTORTION_TYPE.PS4CAM_HD
381+ End Select
382+
383+ If (iCameraByResolution <> ClassSerivceConst.ClassCameraDistortion.ENUM_CAMERA_DISTORTION_TYPE.GENERIC AndAlso
384+ ClassSerivceConst.ClassCameraDistortion.GetKnownDistortionByType(iCameraByResolution, mConstCameraDistortion)) Then
376385 Dim bCorrectDistort As Boolean = (
377386 CSng (mConfigCameraDistortion.iFocalLengthX) = CSng (mConstCameraDistortion.iFocalLengthX) AndAlso
378387 CSng (mConfigCameraDistortion.iFocalLengthY) = CSng (mConstCameraDistortion.iFocalLengthY) AndAlso
@@ -397,21 +406,22 @@ Public Class UCVirtualTrackerItem
397406 Dim bCorrectDistort As Boolean = False
398407 Dim iBadTypes = {
399408 ClassSerivceConst.ClassCameraDistortion.ENUM_CAMERA_DISTORTION_TYPE.PSEYE,
400- ClassSerivceConst.ClassCameraDistortion.ENUM_CAMERA_DISTORTION_TYPE.PS4CAM
409+ ClassSerivceConst.ClassCameraDistortion.ENUM_CAMERA_DISTORTION_TYPE.PS4CAM_SD,
410+ ClassSerivceConst.ClassCameraDistortion.ENUM_CAMERA_DISTORTION_TYPE.PS4CAM_HD
401411 }
402412 For Each iType In iBadTypes
403413 ' Dont allow PSEye and PS4Cam calibrations
404414 If (ClassSerivceConst.ClassCameraDistortion.GetKnownDistortionByType(iType, mConstCameraDistortion)) Then
405415 bCorrectDistort = (
406- CSng (mConfigCameraDistortion.iFocalLengthX) = CSng (mConstCameraDistortion.iFocalLengthX) AndAlso
407- CSng (mConfigCameraDistortion.iFocalLengthY) = CSng (mConstCameraDistortion.iFocalLengthY) AndAlso
408- CSng (mConfigCameraDistortion.iPrincipalX) = CSng (mConstCameraDistortion.iPrincipalX) AndAlso
409- CSng (mConfigCameraDistortion.iPrincipalY) = CSng (mConstCameraDistortion.iPrincipalY) AndAlso
410- CSng (mConfigCameraDistortion.iDistortionK1) = CSng (mConstCameraDistortion.iDistortionK1) AndAlso
411- CSng (mConfigCameraDistortion.iDistortionK2) = CSng (mConstCameraDistortion.iDistortionK2) AndAlso
412- CSng (mConfigCameraDistortion.iDistortionK3) = CSng (mConstCameraDistortion.iDistortionK3) AndAlso
413- CSng (mConfigCameraDistortion.iDistortionP1) = CSng (mConstCameraDistortion.iDistortionP1) AndAlso
414- CSng (mConfigCameraDistortion.iDistortionP2) = CSng (mConstCameraDistortion.iDistortionP2))
416+ CSng (mConfigCameraDistortion.iFocalLengthX) = CSng (mConstCameraDistortion.iFocalLengthX) AndAlso
417+ CSng (mConfigCameraDistortion.iFocalLengthY) = CSng (mConstCameraDistortion.iFocalLengthY) AndAlso
418+ CSng (mConfigCameraDistortion.iPrincipalX) = CSng (mConstCameraDistortion.iPrincipalX) AndAlso
419+ CSng (mConfigCameraDistortion.iPrincipalY) = CSng (mConstCameraDistortion.iPrincipalY) AndAlso
420+ CSng (mConfigCameraDistortion.iDistortionK1) = CSng (mConstCameraDistortion.iDistortionK1) AndAlso
421+ CSng (mConfigCameraDistortion.iDistortionK2) = CSng (mConstCameraDistortion.iDistortionK2) AndAlso
422+ CSng (mConfigCameraDistortion.iDistortionK3) = CSng (mConstCameraDistortion.iDistortionK3) AndAlso
423+ CSng (mConfigCameraDistortion.iDistortionP1) = CSng (mConstCameraDistortion.iDistortionP1) AndAlso
424+ CSng (mConfigCameraDistortion.iDistortionP2) = CSng (mConstCameraDistortion.iDistortionP2))
415425
416426 If (bCorrectDistort) Then
417427 Exit For
0 commit comments