halcon 3D hom_mat3d_rotate简单测试

        半年公司不行,公司有想法,所以就让部门领导逼着员工自己提离职,为了让我们自己走,先是公司出各种考核,查上个月的业绩,给我掉部门,然后就是加工作量,这不,让我一个人翻译halcon 的3D算子到PCL。

pcl 姿态变换 之 旋转平移_pcl 坐标旋转_Σίσυφος1900的博客-CSDN博客

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轴

 

  X轴:

Z轴:

扫描二维码关注公众号,回复: 15571707 查看本文章
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)

猜你喜欢

转载自blog.csdn.net/weixin_39354845/article/details/130927046