Halcon 3D hom_mat3d_rotate simple test

        The company can’t do it in half a year. The company has ideas, so the department leaders forced the employees to resign. In order to let us go, the company first issued various assessments, checked the performance of the previous month, and let me drop the department, and then increased the workload. , No, let me translate the 3D operator of halcon to PCL by myself.

Rotation and translation of pcl attitude transformation_pcl coordinate rotation_Σίσυφος1900's Blog-CSDN Blog

create_pose

 create_pose (0.1, 0.1, 0.1, 90, 80, 90, 'Rp+T', 'gba', 'point', Pose1)

 read_object_model_3d

read_object_model_3d ('pipe_joint', 'm', [], [], ObjectModel3D, Status)

hom_mat3d_rotate  

   y-axis

 

  X axis:

Z axis:

dev_update_off ()
dev_close_window ()
dev_open_window_fit_size (0, 0, 640, 480, [], [], WindowHandle)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
create_pose (0.1, 0.1, 0.1, 90, 80, 90, 'Rp+T', 'gba', 'point', Pose1)
* 
* Read 3D object model
read_object_model_3d ('pipe_joint', 'm', [], [], ObjectModel3D, Status)
* 
Instructions[0] := 'Rotate: Left button'
Instructions[1] := 'Zoom:   Shift + left button'
Instructions[2] := 'Move:   Ctrl  + left button'
* 
gen_cam_par_area_scan_division (0.01, 0.0, 0.00001, 0.00001, 320, 240, 640, 480, CamParam)
hom_mat3d_identity (HomMat3DIdentity)
* 绕着Y轴旋转 0.78弧度
cos_r:=cos(0.78)
sin_r:=sin(0.78)
hom_mat3d_rotate (HomMat3DIdentity, 0.78, 'x', 0, 0, 0, HomMat3DRotate_X)

hom_mat3d_rotate (HomMat3DIdentity, 0.78, 'z', 0, 0, 0, HomMat3DRotate_Z)

* 绕着Y轴旋转,其平面是Z0X 
hom_mat3d_rotate (HomMat3DIdentity, 0.78, 'y', 0, 0, 0, HomMat3DRotate)
* 
affine_trans_object_model_3d (ObjectModel3D, HomMat3DRotate, ObjectModel3DAffineTrans)
* 
visualize_object_model_3d (WindowHandle, ObjectModel3DAffineTrans, CamParam, [], ['color','disp_pose'], ['green','true'], 'A 3D object model', '', Instructions, Pose)
* 
* Calculate the axis-aligned bounding box.
smallest_bounding_box_object_model_3d (ObjectModel3DAffineTrans, 'axis_aligned', PoseBox, Length1, Length2, Length3)
gen_box_object_model_3d (PoseBox, Length1, Length2, Length3, BoundingBoxes)
visualize_object_model_3d (WindowHandle, [ObjectModel3DAffineTrans,BoundingBoxes], CamParam, Pose, ['color_0','color_1','alpha_1','disp_pose'], ['green','yellow',0.5,'true'], 'Axis-aligned bounding boxes', '', Instructions, Pose)
* 
* Calculate the oriented bounding box.
smallest_bounding_box_object_model_3d (ObjectModel3DAffineTrans, 'oriented', PoseBoxOri, Length1Ori, Length2Ori, Length3Ori)
gen_box_object_model_3d (PoseBoxOri, Length1Ori, Length2Ori, Length3Ori, BoundingBoxesOriented)
visualize_object_model_3d (WindowHandle, [ObjectModel3DAffineTrans,BoundingBoxesOriented], CamParam, Pose, ['color_0','color_1','alpha_1','disp_pose'], ['green','yellow',0.5,'true'], 'Oriented bounding boxes', '', Instructions, Pose)

Guess you like

Origin blog.csdn.net/weixin_39354845/article/details/130927046