MCPcopy Create free account
hub / github.com/SpectacularAI/sdk / blurScore

Function blurScore

python/cli/process/process.py:169–187  ·  view source on GitHub ↗
(WToC, vCam, vAngCam, targetFrame, exposureTime)

Source from the content-addressed store, hash-verified

167 return vCam, vAngCam
168
169def 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
189def point_cloud_data_frame_to_ply(df, out_fn):
190 with open(out_fn, 'wt') as f:

Callers 1

process_mapping_outputFunction · 0.85

Calls 1

getIntrinsicMatrixMethod · 0.80

Tested by

no test coverage detected