(WToC, vCam, vAngCam, targetFrame, exposureTime)
| 167 | return vCam, vAngCam |
| 168 | |
| 169 | def blurScore(WToC, vCam, vAngCam, targetFrame, exposureTime): |
| 170 | import numpy as np |
| 171 | sumVels = 0 |
| 172 | n = 0 |
| 173 | for mpObs in targetFrame.sparseFeatures: |
| 174 | pW = mpObs.position |
| 175 | pCam = (WToC @ [pW.x, pW.y, pW.z, 1])[:3] |
| 176 | pointVelCam = vCam + np.cross(vAngCam, pCam) |
| 177 | vPix = targetFrame.cameraPose.camera.getIntrinsicMatrix()[:2,:2] @ (pointVelCam[:2] / np.maximum(pCam[2], 1e-6)) |
| 178 | n += 1 |
| 179 | sumVels += np.linalg.norm(vPix) |
| 180 | |
| 181 | if exposureTime > 0: |
| 182 | sumVels *= exposureTime |
| 183 | |
| 184 | # print('blur score %g (n = %d)' % (float(sumVels) / max(n, 1), n)) |
| 185 | |
| 186 | if n == 0: return 1e6 |
| 187 | return sumVels / n |
| 188 | |
| 189 | def point_cloud_data_frame_to_ply(df, out_fn): |
| 190 | with open(out_fn, 'wt') as f: |
no test coverage detected