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.pswp.cn/news/254903.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/254903.shtml
英文地址,請注明出處:http://en.pswp.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…