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

Function serializeCamera

cpp/common/visualization/serialization.cpp:67–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67nlohmann::json serializeCamera(const spectacularAI::Camera &camera) {
68 float near = 0.01f, far = 100.0f;
69 const Matrix3d &intrinsics = camera.getIntrinsicMatrix();
70 const Matrix4d &projectionMatrixOpenGL = camera.getProjectionMatrixOpenGL(near, far);
71
72 nlohmann::json json;
73 json["intrinsics"] = intrinsics;
74 json["projectionMatrixOpenGL"] = projectionMatrixOpenGL;
75 return json;
76}
77
78void serializePointCloud(const std::string &filename, std::shared_ptr<spectacularAI::mapping::PointCloud> pointCloud) {
79 std::ofstream outputStream(filename.c_str(), std::ios::out | std::ios::binary | std::ios::trunc);

Callers 2

serializeVioOutputMethod · 0.85

Calls 2

getIntrinsicMatrixMethod · 0.80

Tested by

no test coverage detected