在HDevelop中
dev_close_window ()
read_image (W, 'D:/bb/tu/8.jpg')
rgb1_to_gray (W, GrayImage)
****截取模板图像:O字母****
gen_rectangle1 (Rectangle, 30, 378, 89, 440)
reduce_domain (GrayImage, Rectangle, ImageReduced)
****创建模板****
create_ncc_model(ImageReduced, 'auto', -0.2, 0.2, 0.1, 'use_polarity', ModelID)
*创建NCC模板
write_ncc_model (ModelID, 'D:/bb/tu/SS.ncm')
*保存NCC模板
*参数1:模板句柄
在QtCreator中
HObject ho_W, ho_GrayImage, ho_Rectangle, ho_ImageReduced;
HTuple hv_ModelID;
ReadImage(&ho_W, "D:/bb/tu/8.jpg");
Rgb1ToGray(ho_W, &ho_GrayImage);
//***截取模板图像:O字母****
GenRectangle1(&ho_Rectangle, 30, 378, 89, 440);
ReduceDomain(ho_GrayImage, ho_Rectangle, &ho_ImageReduced);
//***创建模板****
CreateNccModel(ho_ImageReduced, "auto", -0.2, 0.2, 0.1, "use_polarity", &hv_ModelID);
//创建NCC模板
WriteNccModel(hv_ModelID, "D:/bb/tu/SS.ncm");
//保存NCC模板
//参数1:模板句柄