常州电工培训

常州电工证

常州变频器培训

常州触摸屏培训

江苏和讯自动化设备有限公司欢迎您!
  • 和讯PLC,电工培训中心优势,名师团队一对一教学.
热门课程
联系方式
  • 常州和讯自动化培训中心
  • 常州市新北区太湖东路府琛大厦2号楼307-1室,307-2室(常州万达广场对面)
  • 电话:0519-85602926
  • 手机:15861139266 13401342299
当前位置:网站首页 > 技术资料 技术资料
图像进行缺陷检测-机器视觉学习-PLC编程学习
日期:2023-4-26 15:33:57人气:  标签:常州机器视觉学习-常州PLC编程学习

图像进行缺陷检测


*检测所有测试图像上的纹理缺陷。

NumImages := 7

for Index := 1 to NumImages by 1

    read_image (TestImage, 'carpet/carpet_' + Index$'02')

    * 

    *检测当前图像

    apply_texture_inspection_model (TestImage, NoveltyRegion, TextureInspectionModel, TextureInspectionResultID)

    *得到新颖性图像和区域

    get_texture_inspection_result_object (NovScoreImage, TextureInspectionResultID, 'novelty_score_image')

    get_texture_inspection_result_object (NovRegion, TextureInspectionResultID, 'novelty_region')

    * 显示单个金字塔层数的结果

    count_obj (NovScoreImage, Number)

    for Level := 1 to Number by 1

        CurrentWindow := WindowHandles[Level - 1]

        dev_set_window (CurrentWindow)

        dev_clear_window ()

        select_obj (NovScoreImage, NovScoreImageL, Level)

        select_obj (NovRegion, NovRegionL, Level)

        get_image_size (NovScoreImageL, Width, Height)

        dev_set_part (0, 0, Height - 1, Width - 1)

        dev_display (NovScoreImageL)

         Legend := 'Novelty region (level ' + Levels[Level - 1] + ')'

        dev_set_color ('red')


大林上位机机器视觉,_常州电工培训_常州PLC培训_常州机器视觉培训_常州上位机培训_常州工业机器人培训,最适合电工及plc编程人员学习的上位机机器视觉课程 大林老师:15861139266(微信同号)


        dev_set_line_width (2)

        * 

        dev_display (NovRegionL)

        dev_disp_text (['Novelty score image (level ' + Levels[Level - 1] + ')','Novelty threshold: ' + NoveltyThreshold[Level - 1]$'.1f'], 'window', 12, 12, 'black', [], [])

        dev_disp_text (Legend, 'window', WindowHeight - 50, 12, ['red','white'], ['box_color','shadow'], ['black','false'])

        endfor

            * 显示结果

             dev_set_window (WindowHandle4)

    dev_display (TestImage)

    dev_set_line_width (2)

    dev_set_color ('red')

    dev_display (NoveltyRegion)

    area_center (NoveltyRegion, Area, Row, Column)

    if (Area > 100)

        dev_disp_text ('Not OK', 'window', 12, 12, 'white', 'box_color', 'red')

    else

        dev_disp_text ('OK', 'window', 12, 12, 'white', 'box_color', 'forest green')

    endif

 if (Index < NumImages)

        dev_disp_text ('Press Run (F5) to continue', 'window', 'bottom', 'right', 'black', [], [])

        stop ()

    endif

endfor













本文网址:

相关信息:
  • 没有资料
版权所有 CopyRight 2006-2017 江苏和讯自动化设备有限公司 电话:0519-85602926 地址:常州市新北区太湖东路府琛大厦2号楼307-1室,307-2室
苏ICP备14016686号-2 技术支持:常州鹤翔网络
本站关键词:常州电工培训 常州电工证 常州变频器培训 常州触摸屏培训 网站地图 网站标签
在线与我们取得联系