reduce_object_model_3d_by_view — Remove points from a 3D object model by projecting it to a virtual view and removing all points outside of a given region.
reduce_object_model_3d_by_view(Region : : ObjectModel3D, CamParam, Pose : ObjectModel3DReduced)
reduce_object_model_3d_by_view projects the points of ObjectModel3D into the image plane given by Pose and CamParam and reduces the 3D object model to the points lying inside the region given in Region. In particular, the points are first transformed with the pose and then projected using the camera parameters. Only those points that are located inside the specified region are copied to the new 3D object model. Faces of a mesh are only contained in the output 3D object model if all corner points are within the region.
Note that if a 3D object model is no longer needed or should be overwritten, the memory has to be freed first by calling the operator clear_object_model_3d.
Region in the image plane.
Handle of the 3D object model.
Internal camera parameters.
Number of elements: CamParam == 8 || CamParam == 10 || CamParam == 12 || CamParam == 14
3D pose of the world coordinate system in camera coordinates.
Number of elements: Pose == 7
Handle of the reduced 3D object model.
gen_object_model_3d_from_points (200*(rand(100)-0.5), \ 200*(rand(100)-0.5), \ 200*(rand(100)-0.5), ObjectModel3D) gen_circle (Circle, 240, 320, 60) CamParam := [0,0,1,1,320,240,640,480] Pose := [0,0,1,0,0,0,0] reduce_object_model_3d_by_view (Circle, ObjectModel3D, CamParam, \ Pose, ObjectModel3DReduced) dev_get_window (WindowHandle) visualize_object_model_3d (WindowHandle, [ObjectModel3D, \ ObjectModel3DReduced], CamParam, Pose, \ ['color_0', 'point_size_1'], ['blue',6], \ , , , PoseOut)
reduce_object_model_3d_by_view returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.