赞
踩
-
- dev_close_window ()
- dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
-
- xResolution:=0.0025
- yResolution:=0.0025
- zResolution:=0.001
- read_image (IntputImage, 'C:/Users/alber/Desktop/2023-08-15_16-38-24-982_/Sta5_002.tif')
- zoom_image_factor (IntputImage, IntputImage, 1,4, 'constant')
- get_domain (IntputImage, Domain)
- *获取该区域的最大最小值
- min_max_gray (Domain, IntputImage, 0, Min, Max, Range)
- *去除无效数据
- threshold (IntputImage, Region,-1.2, Max)
- reduce_domain (IntputImage, Region, ImageReduced)
-
- get_image_size (ImageReduced, Width, Height)
- convert_image_type (ImageReduced, ImageConvertedX, 'real')
- *生成xy坐标的图像映射,乘以分辨率就是xy的相对值
- gen_image_surface_first_order (ImageSurface, 'real', 1, 0, 0, 0, 0, Width, Height)
- gen_image_surface_first_order (ImageSurface1, 'real', 0, 1, 0, 0, 0, Width, Height)
- scale_image (ImageSurface, X, xResolution, 0)
- scale_image (ImageSurface1, Y, yResolution, 0)
-
- *创建3D模型
- xyz_to_object_model_3d (Y,X,ImageReduced, ObjectModel3D)
- write_object_model_3d (ObjectModel3D, 'ply', 'C:/Users/alber/Desktop/abc.ply', [], [])
- disp_object_model_3d (WindowHandle, [ObjectModel3D], [], [], ['color_0','alpha'], ['green',0.7])
用Z轴来矫正
-
- select_points_object_model_3d (ObjectModel3D, 'point_coord_x', 2.73, 3.2, ObjectModel3DThresholded)
- select_points_object_model_3d (ObjectModel3DThresholded, 'point_coord_y', 1, 3.4, ObjectModel3DThresholded)
- fit_primitives_object_model_3d (ObjectModel3DThresholded, ['primitive_type','fitting_algorithm'], ['plane','least_squares_tukey'], ObjectModel3DOut)
-
- * 这一步很重要
- get_object_model_3d_params (ObjectModel3DOut, 'primitive_parameter_pose', pose)
-
-
- *用Z轴来矫正
- * 将旋转的角度转转回去
- pose[3]:=-pose[3]
- pose[4]:=-pose[4]
- pose[5]:=-pose[5]
- write_object_model_3d (ObjectModel3DThresholded, 'ply', 'C:/Users/alber/Desktop/abc3333.ply', [], [])
- *
- rigid_trans_object_model_3d (ObjectModel3DThresholded, pose, ObjectModel3DRigidTrans)
- write_object_model_3d (ObjectModel3DRigidTrans, 'ply', 'C:/Users/alber/Desktop/abc3333afffff.ply', [], [])
-
-
- rigid_trans_object_model_3d (ObjectModel3D, pose, ObjectModel3DRigidProdUCE)
- write_object_model_3d (ObjectModel3DRigidProdUCE, 'ply', 'C:/Users/alber/Desktop/ABC_CR.ply', [], [])
1、将原始姿态pose ->matrix1
2、将指定的姿态pose 2->matrix2
3、svd 矩阵分解,计算出两个姿态的差接矩阵M
4、矩阵-》pose
5、rigid_trans_object_model_3d
矫正前:
矫正后:
:
-
- dev_close_window ()
- dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
-
- xResolution:=0.0025
- yResolution:=0.0025
- zResolution:=0.001
- read_image (IntputImage, 'C:/Users/alber/Desktop/2023-08-15_16-38-24-982_/Sta5_002.tif')
- zoom_image_factor (IntputImage, IntputImage, 1,4, 'constant')
- get_domain (IntputImage, Domain)
- *获取该区域的最大最小值
- min_max_gray (Domain, IntputImage, 0, Min, Max, Range)
- *去除无效数据
- threshold (IntputImage, Region,-1.2, Max)
- reduce_domain (IntputImage, Region, ImageReduced)
-
- get_image_size (ImageReduced, Width, Height)
- convert_image_type (ImageReduced, ImageConvertedX, 'real')
- *生成xy坐标的图像映射,乘以分辨率就是xy的相对值
- gen_image_surface_first_order (ImageSurface, 'real', 1, 0, 0, 0, 0, Width, Height)
- gen_image_surface_first_order (ImageSurface1, 'real', 0, 1, 0, 0, 0, Width, Height)
- scale_image (ImageSurface, X, xResolution, 0)
- scale_image (ImageSurface1, Y, yResolution, 0)
-
- *创建3D模型
- xyz_to_object_model_3d (Y,X,ImageReduced, ObjectModel3D)
- write_object_model_3d (ObjectModel3D, 'ply', 'C:/Users/alber/Desktop/abc.ply', [], [])
- disp_object_model_3d (WindowHandle, [ObjectModel3D], [], [], ['color_0','alpha'], ['green',0.7])
-
-
-
- select_points_object_model_3d (ObjectModel3D, 'point_coord_x', 2.73, 3.2, ObjectModel3DThresholded)
- select_points_object_model_3d (ObjectModel3DThresholded, 'point_coord_y', 1, 3.4, ObjectModel3DThresholded)
- fit_primitives_object_model_3d (ObjectModel3DThresholded, ['primitive_type','fitting_algorithm'], ['plane','least_squares_tukey'], ObjectModel3DOut)
-
- * 这一步很重要
- get_object_model_3d_params (ObjectModel3DOut, 'primitive_parameter_pose', pose)
-
-
- *用Z轴来矫正
- * 将旋转的角度转转回去
- pose[3]:=-pose[3]
- pose[4]:=-pose[4]
- pose[5]:=-pose[5]
- write_object_model_3d (ObjectModel3DThresholded, 'ply', 'C:/Users/alber/Desktop/abc3333.ply', [], [])
- *
- rigid_trans_object_model_3d (ObjectModel3DThresholded, pose, ObjectModel3DRigidTrans)
- write_object_model_3d (ObjectModel3DRigidTrans, 'ply', 'C:/Users/alber/Desktop/abc3333afffff.ply', [], [])
-
-
- rigid_trans_object_model_3d (ObjectModel3D, pose, ObjectModel3DRigidProdUCE)
- write_object_model_3d (ObjectModel3DRigidProdUCE, 'ply', 'C:/Users/alber/Desktop/ABC_CR.ply', [], [])
- select_points_object_model_3d (ObjectModel3DRigidProdUCE, 'point_coord_y', 3.5, 3.501, ObjectModel3DThresholded1)
-
-
- object_model_3d_to_xyz (X1, Y1, Z, ObjectModel3DRigidProdUCE, 'from_xyz_map', pose, pose)
- * 画出roi
- gen_region_line (ROI_0, 1125.4, 1025.4, 1125.4, 1081.84)
- get_region_points (ROI_0, Rows, Columns)
- get_grayval (Z, Rows, Columns, Grayval)
- xr:=Columns*0.0025
- yr:=Rows*0.0025
-
- * 不能拟合直线
- gen_object_model_3d_from_points(xr, yr, Grayval, ObjectModel3D2)
- fit_primitives_object_model_3d (ObjectModel3D2, 'primitive_type', 'all', ObjectModel3DOut1)
- get_object_model_3d_params (ObjectModel3DOut1, 'num_lines', GenParamValue)
- Grayval:=Grayval+10
- gen_contour_polygon_xld (Contour, xr, Grayval)
-
- fit_line_contour_xld (Contour, 'tukey', -1, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
-
-
- *第二段
- gen_region_line (ROI_1, 1125.4, 1338.49, 1125.4, 1412.09)
- get_region_points (ROI_1, Rows1, Columns1)
- get_grayval (Z, Rows1, Columns1, Grayval1)
- Grayval1:=Grayval1+10
- xr1:=Columns1*0.0025
- yr1:=Rows1*0.0025
- gen_contour_polygon_xld (Contour2, xr1, Grayval1)
- fit_line_contour_xld (Contour2, 'tukey', -1, 0, 5, 2, RowBegin1, ColBegin1, RowEnd1, ColEnd1, Nr1, Nc1, Dist1)
-
- gen_contour_polygon_xld (Contour2, xr, Grayval)
- * 计算两条直线的交点
- intersection_lines ( RowBegin, ColBegin, RowEnd, ColEnd, RowBegin1, ColBegin1, RowEnd1, ColEnd1, Row, Column, IsOverlapping)
-
-
-
-
-
-
object_model_3d_to_xyz (X1, Y1, Z, ObjectModel3DRigidProdUCE, 'from_xyz_map', pose, pose)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。