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

Function point_cloud_data_frame_to_ply

python/cli/process/process.py:189–207  ·  view source on GitHub ↗
(df, out_fn)

Source from the content-addressed store, hash-verified

187 return sumVels / n
188
189def point_cloud_data_frame_to_ply(df, out_fn):
190 with open(out_fn, 'wt') as f:
191 f.write('\n'.join([
192 'ply',
193 'format ascii 1.0',
194 'element vertex %d' % len(df),
195 'property float x',
196 'property float y',
197 'property float z',
198 'property uint8 red',
199 'property uint8 green',
200 'property uint8 blue',
201 'end_header'
202 ]) + '\n')
203 for _, row in df.iterrows():
204 r = []
205 for prop in 'xyz': r.append(row[prop])
206 for prop in 'rgb': r.append(int(row[prop]))
207 f.write(' '.join([str(v) for v in r]) + '\n')
208
209def convert_distortion(cam):
210 coeffs = cam.get('distortionCoefficients', None)

Callers 1

process_mapping_outputFunction · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected