( from: CameraModelId, to: CameraModelId, params: number[], threshold: number )
| 107 | } |
| 108 | |
| 109 | function performConversion( |
| 110 | from: CameraModelId, |
| 111 | to: CameraModelId, |
| 112 | params: number[], |
| 113 | threshold: number |
| 114 | ): ConversionResult { |
| 115 | const perspectiveResult = convertPerspectiveCameraModel(from, to, params, threshold); |
| 116 | if (perspectiveResult) { |
| 117 | return perspectiveResult; |
| 118 | } |
| 119 | |
| 120 | const fisheyeResult = convertFisheyeCameraModel(from, to, params, threshold); |
| 121 | if (fisheyeResult) { |
| 122 | return fisheyeResult; |
| 123 | } |
| 124 | |
| 125 | return { |
| 126 | type: 'incompatible', |
| 127 | reason: `Conversion from ${getModelName(from)} to ${getModelName(to)} not implemented`, |
| 128 | }; |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * Validate conversion accuracy by computing reprojection error. |
no test coverage detected