HALCON示例程序surface_scratch.hdev提取划痕

小哥哥小姐姐觉得有用点个赞呗!
在这里插入图片描述

HALCON示例程序surface_scratch.hdev提取划痕

示例程序源码(加注释)

  • 关于显示类函数解释
    dev_update_off ()
    dev_close_window ()
    read_image (Image, ‘surface_scratch’)
    get_image_size (Image, Width, Height)
    dev_open_window_fit_image (Image, 0, 0, Width, Width, WindowID)
    set_display_font (WindowID, 16, ‘mono’, ‘true’, ‘false’)
    dev_set_draw (‘margin’)
    dev_set_line_width (4)
    dev_display (Image)
    Message := ‘This program shows the extraction of’
    Message[1] := ‘surface scratches via local thresholding’
    Message[2] := ‘and morphological post-processing’
    disp_message (WindowID, Message, ‘window’, 12, 12, ‘black’, ‘true’)
    disp_continue_message (WindowID, ‘black’, ‘true’)
    stop ()
  • 使用动态阈值进行分割
    mean_image (Image, ImageMean, 7, 7)
    dyn_threshold (Image, ImageMean, DarkPixels, 5, ‘dark’)
  • 分割连通域
    connection (DarkPixels, ConnectedRegions)
    dev_set_colored (12)
    dev_display (Image)
    dev_display (ConnectedRegions)
    Message := ‘Connected components after image segmentation’
    Message[1] := ‘using a local threshold.’
    disp_message (WindowID, Message, ‘window’, 12, 12, ‘black’, ‘true’)
    disp_continue_message (WindowID, ‘black’, ‘true’)
    stop ()
  • 面积筛选
    select_shape (ConnectedRegions, SelectedRegions, ‘area’, ‘and’, 10, 1000)
    dev_display (Image)
    dev_display (SelectedRegions)
    disp_message (WindowID, ‘Large Regions’, ‘window’, 12, 12, ‘black’, ‘true’)
    disp_continue_message (WindowID, ‘black’, ‘true’)
    stop ()
    open_zoom_window (0, round(Width / 2), 2, 303, 137, 496, 3, WindowHandleZoom)
    dev_set_color (‘blue’)
    dev_display (Image)
    dev_display (SelectedRegions)
    set_display_font (WindowHandleZoom, 16, ‘mono’, ‘true’, ‘false’)
    disp_message (WindowHandleZoom, ‘Fractioned scratches’, ‘window’, 12, 12, ‘black’, ‘true’)
    disp_continue_message (WindowHandleZoom, ‘black’, ‘true’)
    stop ()
  • 合并区域
    union1 (SelectedRegions, RegionUnion)
  • 膨胀区域
    dilation_circle (RegionUnion, RegionDilation, 3.5)
    dev_display (Image)
    dev_display (RegionDilation)
    Message := ‘Region of the scratches after dilation’
    disp_message (WindowHandleZoom, Message, ‘window’, 12, 12, ‘black’, ‘true’)
    disp_continue_message (WindowHandleZoom, ‘black’, ‘true’)
    stop ()
  • 提取区域骨架
    skeleton (RegionDilation, Skeleton)
    connection (Skeleton, Errors)
    dev_set_colored (12)
    dev_display (Image)
    dev_display (Errors)
    Message := ‘Fractioned scratches merged via morphology’
    disp_message (WindowHandleZoom, Message, ‘window’, 12, 12, ‘black’, ‘true’)
    disp_continue_message (WindowHandleZoom, ‘black’, ‘true’)
    stop ()
    close_zoom_window (WindowHandleZoom, Width, Height)
    select_shape (Errors, Scratches, ‘area’, ‘and’, 50, 10000)
    select_shape (Errors, Dots, ‘area’, ‘and’, 1, 50)
    dev_display (Image)
    dev_set_color (‘red’)
    dev_display (Scratches)
    dev_set_color (‘blue’)
    dev_display (Dots)
    Message := ‘Extracted surface scratches’
    Message[1] := ‘Not categorized as scratches’
    disp_message (WindowID, Message, ‘window’, 440, 310, [‘red’,‘blue’], ‘true’)

处理思路

这个例子是主要讲解了金属划痕提取。

后记

大家有什么问题可以向我提问哈,我看到了第一时间回复,希望在学习的路上多多结交良师益友。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/254903.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

MySQL--SQL中的安全问题

---恢复内容开始--- 1) SQL 注入简介 SQL 注入(SQL Injection) 就是利用某些数据库的外部接口将用户数据插入到实际的数据库操作语言(SQL)当中,从而达到入侵数据库乃至操作系统的目的。他的产生主要是由程序对用户输入的数据没有进行严格的过滤,导致非法…

伺服驱动器的 三环控制 电流环 速度环 位置环

运动伺服一般都是三环控制系统,从内到外依次是电流环速度环位置环。 1、电流环:电流环的输入是速度环PID调节后的那个输出,我们称为“电流环给定”吧,然后呢就是电流环的这个给定和“电流环的反馈”值进行比较后的差值在电流环内做…

理解LSTM/RNN中的Attention机制

转自:http://www.jeyzhang.com/understand-attention-in-rnn.html,感谢分享! 导读 目前采用编码器-解码器 (Encode-Decode) 结构的模型非常热门,是因为它在许多领域较其他的传统模型方法都取得了更好的结果。这种结构的模型通常将…

linux下基于jrtplib库的实时传送实现

linux 下基于jrtplib库的实时传送实现一、RTP 是进行实时流媒体传输的标准协议和关键技术实时传输协议(Real-time Transport Protocol,PRT)是在 Internet 上处理多媒体数据流的一种网络协议,利用它能够在一对一(unicas…

[BZOJ2326] [HNOI2011] 数学作业 (矩阵乘法)

Description Input Output Sample Input Sample Output HINT Source Solution 递推式长这样:$f[n]f[n-1]*10^kn$ 对于每一段位数个数相同的$n$(如$10\sim99,100\sim999,23333\sim66666,1018701389\sim2147483647$),$k$是个定值 然…

HALCON示例程序texture.hdev检测树木

小哥哥小姐姐觉得有用点个赞呗! HALCON示例程序texture.hdev检测树木 示例程序源码(加注释) 关于显示类函数解释 dev_close_window () Interactive : 0 dev_close_window () read_image (MreutHill, ‘mreut_y’) get_image_size (MreutH…

1、python基础速成

基础模块 def prt(age,name):#函数定义 print("%s is %d 年龄 old"%(name,age)) if __name__"__main__":#程序入口 print("Hello World") prt(45,"gaici") 获取输入:使用input()函数 nameinput("you name &#x…

老男孩博客园杨海潮MySQL--MySQL机构逻辑2

转载于:https://blog.51cto.com/yanfeilai528/2103403

法国标致雪铁龙汽车公司采用通快碟片激光器进行焊接

发布日期:2011-10-14 来源:光电新闻网 发布人:星之球科技 摘要:3月11日消息,十一个碟片激光器(disk laser)将安装在标致雪铁龙集团的工厂,这家法国汽车制造商准备使用4千瓦的激光器…

h.264 rtp打包

(2011-05-27 08:44:13) 转载标签: 杂谈 payload,H.264 RTP payload 格式 on 2011-2-18 in 博文摘选 | 0 Comment 1. 网络抽象层单元类型 (NALU) NALU 头由一个字节组成, 它的语法如下: --------------- |0|1|2|3|4|5|6|7| -------- |F|NRI| Type | --------------…

jquery live hover绑定方法

$(".select_item span").live({mouseenter:function(){$(this).addClass("hover");},mouseleave:function(){$(this).removeClass("hover");} }); 注意:jquery1.9以上版本不支持live,新方法为on 转载于:https://www.cnblo…

HALCON示例程序vessel.hdev血管的分割与测量

小哥哥小姐姐觉得有用点个赞呗! HALCON示例程序vessel.hdev血管的分割与测量 示例程序源码(加注释) 关于显示类函数解释 dev_update_window (‘off’) dev_close_window () dev_open_window (0, 0, 512, 512, ‘black’, WindowID) set_d…

电子凸轮

CAM功能是按照一种人为预先设定的曲线关系(可以在线修改,对SEW的变频/伺服控制器而言)来运动的控制应用。 100%速度前馈的位置控制这个观点偶不敢苟同.典型的一些应用。比如:全自动包装机械上,移动锯,其实大家说的电子齿轮,指的就是一种可以调节主从速度比的同步应用…

浙南联合训练赛20180414

这次题目的代码都不长,CF的一贯风格 A - Game CodeForces - 513A Two players play a simple game. Each player is provided with a box with balls. First players box contains exactly n1 balls and second players box contains exactly n2balls. In one move…

原生JS实现苹果菜单

今天分享下用原生JS实现苹果菜单效果,这个效果的重点有以下几点 图标中心点到鼠标的距离的算法 利用比例计算图标的宽度 代码地址:https://github.com/peng666/blogs/blob/gh-pages/menus/index.html 在线测试地址:http://peng666.github.io/…

Gym 100090D Insomnia

从 n 变到 1&#xff0c;有多少种方案&#xff1f; 打表记忆化。 1 #include <bits/stdc.h>2 3 using namespace std;4 5 int n;6 int dp[1000005];7 int dfs(int n) {8 if(n1)9 return 1; 10 if(dp[n]>0) 11 return dp[n]; 12 int cnt0;…

halcon rectangle1_domain缩减图像域为矩形

目录rectangle1_domain&#xff08;算子&#xff09;描述参数rectangle1_domain&#xff08;算子&#xff09; rectangle1_domain - 将图像的域缩小为矩形。 rectangle1_domain&#xff08;Image&#xff1a;ImageReduced&#xff1a;Row1&#xff0c;Column1&#xff0c;Row…

PC+运动控制卡的控制方案

PC运动控制卡的控制方案&#xff1a; 采用PC&#xff0b;运动控制卡作为上位控制可充分利用计算机资源&#xff0c;用于运动过程、运动轨迹都比较复杂&#xff0c;且柔性比较强的机器和设备。从用户使用的角度来看&#xff0c;基于PC机的运动控制卡主要是硬件接口&#xff08;输…

IP/TCP/UDP/RTP/RTCP 包结构图

IP 包头结构: TCP 包头结构: UDP 包头结构: RTP 包头结构: RTCP 包头结构:

你可能不知道的java、python、JavaScript以及jquary循环语句的区别

一.概述 java循环语句分为四种形式&#xff0c;分别是 while, do/while, for, foreach&#xff1b; python中循环语句有两种&#xff0c;while&#xff0c;for&#xff1b; JavaScript中循环语句有四种&#xff0c;while&#xff0c;do/while&#xff0c;for&#xff0c;for/in…