Halcon深度学习-企业项目实战(芯片贴合外观缺陷检测)

本文档详细介绍了使用Halcon进行深度学习的芯片贴合外观缺陷检测项目,包括项目需求分析,缺陷图片收集,图像标注,深度学习代码实现,训练结果展示,以及C#引擎加载模型的Demo。提供了相关的下载资源链接。
摘要由CSDN通过智能技术生成

1、项目需求

缺陷说明:

在这里插入图片描述

2、收集相关的缺陷图片:

OK图片地址:

链接:CSDN下载地址
备注:其他下载地址私信联系

NG图片地址:

链接:SCDN下载地址
备注:其他下载地址私信联系

3、缺陷图片分析、标注图像:

标注过程视频地址:

标注文件地址:

链接: SCDN下载地址
备注:其他下载地址私信联系

4、Halcon深度学习代码:

CSDN下载地址

总体代码

dev_update_off ()

*读数据
read_dict ('123.hdict', [], [], DictHandle)
*Xml
* Xml_To_Dict_DeepBool ('Train_Images/JPEGImages', 'Train_Images/Temp', 'Xml', DictHandle)

*Dict_To_Xml
* Dict_To_Xml_DeepBool (DictHandle, 'Voc', 'Temp')

*by_num
* Cut_Images_bynum (DictHandle, 2, 2, 'png', 255, DictHandle)
*by_size
* Cut_Images_bysize (DictHandle, 800, 800, 'png', 255, DictHandle)

*[570,517,3]
*数据预处理
Data_preprocessing_Rectangle1 (1376, 928, 3, 'compact', DictHandle, 0, 'bmp', 255)

*训练
Data_Train_Rectangle1 (1, 0.0005, 0.9, 200, 0.0001, 1, false, 'gpu', [], [])

*模型评估
Data_Evaluate_Rectangle1 (0.5, 2, true, 0.7, 0.2, 0.5)

*推理初始化
Data_Infer_Init_Rectangle1 (1, 0.5, true, 0.2, 0.7, DLModelHandle, DLPreprocessParam)

dev_get_window (WindowHandle)
*Data_Infer_Online
get_dict_tuple (DictHandle,'class_names' , class_names)
 
list_files ('NG', ['files','follow_links'], ImageFiles)
tuple_regexp_select (ImageFiles, ['\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima|hobj)$','ignore_case'], ImageFiles)
for Index := 0 to |ImageFiles| - 1 by 1
    read_image (Image, ImageFiles[Index])
    Data_Infer_OnLine_Rectangle1 (Image, Rectangle, DictHandle, DLPreprocessParam, DLModelHandle, \
                                  bbox_row1, bbox_col1, bbox_row2, bbox_col2, bbox_class_id, bbox_confidence)
    ifelse (|bbox_class_id|)
        gen_rectangle1 (Rectangle, bbox_row1, bbox_col1, bbox_row2, bbox_col2)
        dev_clear_window ()
        dev_display (Image)
        boundary (Rectangle, Rectangle, 'inner')
        dev_disp_text (class_names[bbox_class_id]+'  :  '+bbox_confidence, 'image', bbox_row1, bbox_col1, 'red', 'box', 'false')
        dev_display (Rectangle)
    else
        dev_disp_text ('OK', 'image', 200, 200, 'red', 'box', 'false')
    endif

*     dump_window_image (Image1, WindowHandle)
*     tuple_split (ImageFiles[Index], '\\', Substrings)
*     write_image (Image1, 'jpg', 0, 'Data_Infer_Result/'+Substrings[|Substrings|-1])
endfor

5、训练结果展示:

已训练模型下载:

演示效果:

6、C# 引擎加载Halcon深度学习Demo:

7、项目资料下载地址:

链接:

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

deep-bool

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值