Lele was written in 2021
h精编con与C混合编程数字识别精编
示例:数字识别
要识别的图片:
halcon源码:
1: *读取图片
2: read_image(Image,'D:/MyFile/halcon/数字识别/')
3:
4: *图像处理
5: decompose3(Image, ImageR, ImageG, ImageB)
6: threshold (ImageG, Regions, 0, 183)
7: connection (Regions, Connection)
8:
9: select_shape (Connection, SelectedRegions, 'area', 'and', , 7500)
10:
11: read_ocr_class_mlp('',OCRHandle)
12: do_ocr_multi_class_mlp(SelectedRegions,ImageG,OCRHandle, Class, Confidence)
halcon导出的C#代码:
1: pg*|BMP文件|*.bmp*|TIFF文件|*.tiff*";
30:
31: = true;
32:
33: = 1;
34:
35: if () ==
36:
37: {
38:
39: ImagePath = ;
40:
41: , ImagePath);
42:
43: = true;
44:
45: }
46: }
47:
48: private void btnRecognitionNumber_Click(object sender, EventArgs e)
49: {
50: ();
51: = 52:
53: = false;
54: }
55: }
56:
57: //halcon导出的类
58: public partial class HDevelopExport
59: {
60: public HTuple hv_ExpDefaultWinHandle;
61:
62: HObject ho_Image, ho_ImageR, ho_ImageG, ho_ImageB;
63: HObject ho_Regions, ho_Connectio
h精编con与C混合编程数字识别精编 来自淘豆网www.taodocs.com转载请标明出处.