halcon-write_shape_model保存形状模板
作者:互联网
在HDevelop中
dev_close_window () read_image (Image, 'D:/bb/tu/1.jpg') rgb1_to_gray (Image, GrayImage) edges_sub_pix (GrayImage, Edges, 'canny', 1, 20, 40) select_shape_xld (Edges, SelectedXLD, 'contlength', 'and', 130, 137.8) create_shape_model_xld (SelectedXLD, 'auto', -0.2, 0.2, 0.05, 'auto', 'ignore_local_polarity', 5, ModelID) *创建XLD轮廓模板 write_shape_model (ModelID, 'D:/bb/tu/ss.shm') *保存形状模板 *参数1:模板句柄 *参数2:文件名 * 扩展名是:shm
在QtCreator中
HObject ho_Image, ho_GrayImage, ho_Edges, ho_SelectedXLD; HTuple hv_ModelID;
ReadImage(&ho_Image, "D:/bb/tu/1.jpg"); Rgb1ToGray(ho_Image, &ho_GrayImage); EdgesSubPix(ho_GrayImage, &ho_Edges, "canny", 1, 20, 40); SelectShapeXld(ho_Edges, &ho_SelectedXLD, "contlength", "and", 130, 137.8); CreateShapeModelXld(ho_SelectedXLD, "auto", -0.2, 0.2, 0.05, "auto", "ignore_local_polarity", 5, &hv_ModelID); //创建XLD轮廓模板 WriteShapeModel(hv_ModelID, "D:/bb/tu/ss.shm"); //保存形状模板 //参数1:模板句柄 //参数2:文件名 // 扩展名是:shm
标签:Image,SelectedXLD,halcon,write,shape,Edges,ho,模板,GrayImage 来源: https://www.cnblogs.com/liming19680104/p/16061852.html