MCPcopy Create free account
hub / github.com/colmap/colmap / WritePoints3DBinary

Function WritePoints3DBinary

src/colmap/scene/reconstruction_io_binary.cc:448–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448void WritePoints3DBinary(const Reconstruction& reconstruction,
449 std::ostream& stream) {
450 THROW_CHECK(stream.good());
451
452 WriteBinaryLittleEndian<uint64_t>(&stream, reconstruction.NumPoints3D());
453
454 for (const point3D_t point3D_id :
455 ExtractSortedIds(reconstruction.Points3D())) {
456 const Point3D& point3D = reconstruction.Point3D(point3D_id);
457
458 WriteBinaryLittleEndian<point3D_t>(&stream, point3D_id);
459 WriteBinaryLittleEndian<double>(&stream, point3D.xyz(0));
460 WriteBinaryLittleEndian<double>(&stream, point3D.xyz(1));
461 WriteBinaryLittleEndian<double>(&stream, point3D.xyz(2));
462 WriteBinaryLittleEndian<uint8_t>(&stream, point3D.color(0));
463 WriteBinaryLittleEndian<uint8_t>(&stream, point3D.color(1));
464 WriteBinaryLittleEndian<uint8_t>(&stream, point3D.color(2));
465 WriteBinaryLittleEndian<double>(&stream, point3D.error);
466
467 WriteBinaryLittleEndian<uint64_t>(&stream, point3D.track.Length());
468 for (const TrackElement& track_el : point3D.track.Elements()) {
469 WriteBinaryLittleEndian<image_t>(&stream, track_el.image_id);
470 WriteBinaryLittleEndian<point2D_t>(&stream, track_el.point2D_idx);
471 }
472 }
473}
474
475void WritePoints3DBinary(const Reconstruction& reconstruction,
476 const std::filesystem::path& path) {

Callers 3

WriteBinaryMethod · 0.85
WritePoints3DMethod · 0.85
WritePoints3DMethod · 0.85

Calls 3

ExtractSortedIdsFunction · 0.85
LengthMethod · 0.80
NumPoints3DMethod · 0.45

Tested by 2

WritePoints3DMethod · 0.68
WritePoints3DMethod · 0.68