*1、創建模板(獲取要做模板區域的圖像)
?? *create_shape_model (ImageReduced, 4, 0, rad(360), rad(1), 'none', 'use_polarity', 30, 10, ModelID)
*2、獲取形狀模型---第二步(為了顯示找的的模板)
?? *get_shape_model_contours (ShapeModel, ModelID, 1)
*3、查找模板
?? *find_shape_model (ImageCheck, ModelID, 0, rad(360), 0.7, 1, 0.5, 'least_squares', 4, 0.7, RowCheck, ColumnCheck, AngleCheck, Score)
*4、仿射變換,確定變換矩陣
?? ?*1)第一種方法,獲取變換矩陣HomMat2D;
?? ? ? *vector_angle_to_rigid (0, 0, 0, RowCheck, ColumnCheck, AngleCheck, HomMat2D)
?? ? ? *affine_trans_contour_xld (ShapeModel, ShapeModelTrans, HomMat2D)
?? ?*2)第二種方法,獲取變換矩陣HomMat2DRotate
?? ? ? *hom_mat2d_identity (HomMat2DIdentity)
?? ? ? *hom_mat2d_translate (HomMat2DIdentity, RowCheck, ColumnCheck, HomMat2DTranslate)
?? ? ? *hom_mat2d_rotate (HomMat2DTranslate, AngleCheck, RowCheck, ColumnCheck, HomMat2DRotate)
?? ? ? *affine_trans_contour_xld (ShapeModel, ShapeModelTrans, HomMat2DRotate)
*5、通過確定的變換矩陣執行其他檢測內容;如測量:首先要對要進行測量區域的中心點進行變換;
?? *affine_trans_pixel (HomMat2DRotate, Rect1Row, Rect1Col, Rect1RowCheck, Rect1ColCheck)