在HDevelop中
dev_close_window ()
read_image (Image, 'D:/bb/tu/4.jpg')
rgb1_to_gray(Image,Image1)
threshold (Image1, Region,[80,87,206,195] , [90,100, 228,205])
select_obj (Region, ObjectSelected, 1)
*从区域集中选择一个区域
write_object (ObjectSelected, 'D:/bb/tu/ss.hobj')
*保存区域
*参数1:区域
在QtCreator中
HObject ho_Image, ho_Image1, ho_Region, ho_ObjectSelected;
ReadImage(&ho_Image, "D:/bb/tu/4.jpg");
Rgb1ToGray(ho_Image, &ho_Image1);
Threshold(ho_Image1, &ho_Region, (((HTuple(80).Append(87)).Append(206)).Append(195)),
(((HTuple(90).Append(100)).Append(228)).Append(205)));
SelectObj(ho_Region, &ho_ObjectSelected, 1);
//从区域集中选择一个区域
WriteObject(ho_ObjectSelected, "D:/bb/tu/ss.hobj");
//保存区域
//参数1:区域