12 PrintCloudViewerVersion();
26 utility::LogInfo(
" --depth file : Add a point cloud converted from a depth image.");
27 utility::LogInfo(
" --depth_camera file : Use with --depth, read a json file that stores");
33 utility::LogInfo(
" --render_option file : Read a json file of rendering settings.");
34 utility::LogInfo(
" --view_trajectory file : Read a json file of view trajectory.");
35 utility::LogInfo(
" --camera_trajectory file : Read a json file of camera trajectory.");
36 utility::LogInfo(
" --auto_recording [i|d] : Automatically plays the animation, record");
49 int main(
int argc,
char **argv) {
61 std::vector<std::shared_ptr<ccHObject>> geometry_ptrs;
67 argc, argv,
"--window_name",
"ViewGeometry");
68 std::string mesh_filename =
70 std::string pcd_filename =
72 std::string lineset_filename =
74 std::string voxelgrid_filename =
76 std::string image_filename =
78 std::string depth_filename =
80 std::string depth_parameter_filename =
82 std::string render_filename =
84 std::string view_filename =
87 argc, argv,
"--camera_trajectory");
88 bool show_coordinate_frame =
98 if (!mesh_filename.empty()) {
106 if (!pcd_filename.empty()) {
116 if (!lineset_filename.empty()) {
123 if (!voxelgrid_filename.empty()) {
130 if (!image_filename.empty()) {
137 if (!depth_filename.empty()) {
139 if (depth_parameter_filename.empty() ||
142 "Failed to read intrinsic parameters for depth image.");
166 if (!render_filename.empty()) {
174 if (!view_filename.empty()) {
178 if (!view_control.LoadTrajectoryFromJsonFile(view_filename)) {
182 }
else if (!camera_filename.empty()) {
191 if (!view_control.LoadTrajectoryFromCameraTrajectory(
192 camera_trajectory)) {
194 "Failed converting camera trajectory to view "
205 argc, argv,
"--auto_recording");
207 visualizer.
Play(
true,
false,
true);
208 }
else if (mode ==
"d") {
209 visualizer.
Play(
true,
true,
true);
211 visualizer.
Play(
true,
false,
true);
ccPointCloud * pointcloud_ptr
int main(int argc, char **argv)
ccMesh & ComputeVertexNormals(bool normalized=true)
Function to compute vertex normals, usually called before rendering.
static std::shared_ptr< ccPointCloud > CreateFromDepthImage(const cloudViewer::geometry::Image &depth, const cloudViewer::camera::PinholeCameraIntrinsic &intrinsic, const Eigen::Matrix4d &extrinsic=Eigen::Matrix4d::Identity(), double depth_scale=1000.0, double depth_trunc=1000.0, int stride=1, bool project_valid_depth_only=true)
Factory function to create a pointcloud from a depth image and a camera model.
unsigned size() const override
void SetIntrinsics(int width, int height, double fx, double fy, double cx, double cy)
Set camera intrinsic parameters.
Contains both intrinsic and extrinsic pinhole camera parameters.
PinholeCameraIntrinsic intrinsic_
PinholeCameraIntrinsic object.
Eigen::Matrix4d_u extrinsic_
Camera extrinsic parameters.
double point_size_
Point size for PointCloud.
bool show_coordinate_frame_
Whether to show coordinate frame.
void Play(bool recording=false, bool recording_depth=false, bool close_window_when_animation_ends=false)
virtual bool HasGeometry() const
RenderOption & GetRenderOption()
Function to retrieve the associated RenderOption.
virtual bool AddGeometry(std::shared_ptr< const ccHObject > geometry_ptr, bool reset_bounding_box=true)
Function to add geometry to the scene and create corresponding shaders.
void DestroyVisualizerWindow()
Function to destroy a window.
void Run()
Function to activate the window.
bool CreateVisualizerWindow(const std::string &window_name="CloudViewer", const int width=640, const int height=480, const int left=50, const int top=50, const bool visible=true)
Function to create a window and initialize GLFW.
ViewControl & GetViewControl()
Function to retrieve the associated ViewControl.
std::shared_ptr< ccMesh > CreateMeshFromFile(const std::string &filename, bool print_progress)
std::shared_ptr< geometry::Image > CreateImageFromFile(const std::string &filename)
std::shared_ptr< geometry::LineSet > CreateLineSetFromFile(const std::string &filename, const std::string &format="auto", bool print_progress=false)
std::shared_ptr< geometry::VoxelGrid > CreateVoxelGridFromFile(const std::string &filename, const std::string &format="auto", bool print_progress=false)
std::shared_ptr< ccPointCloud > CreatePointCloudFromFile(const std::string &filename, const std::string &format, bool print_progress)
bool ReadIJsonConvertible(const std::string &filename, cloudViewer::utility::IJsonConvertible &object)
int GetProgramOptionAsInt(int argc, char **argv, const std::string &option, const int default_value=0)
void SetVerbosityLevel(VerbosityLevel level)
bool ProgramOptionExists(int argc, char **argv, const std::string &option)
std::string GetProgramOptionAsString(int argc, char **argv, const std::string &option, const std::string &default_value="")
Generic file read and write utility for python interface.