halcon車刀崩邊檢測

在這里插入圖片描述
在這里插入圖片描述

在這里插入圖片描述

list_files ('新建文件夾', 'files', Files)
read_image (Image, Files[0])
dev_close_window ()
get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width/1.5, Height/1.5, 'black', WindowHandle)
dev_set_draw ('margin')
dev_set_colored (12)
for Index:=0 to |Files|-1 by 1read_image (Image, Files[Index])
edges_sub_pix (Image, Edges, 'canny', 1, 70, 100)
select_contours_xld (Edges, SelectedContours, 'contour_length', 50, 2000, -0.5, 0.5)
union_adjacent_contours_xld (SelectedContours, UnionContours, 10, 1, 'attr_keep')
smooth_contours_xld (UnionContours, SmoothedContours, 5)
smallest_rectangle2_xld (SmoothedContours, Row2, Column1, Phi, Length1, Length2)
gen_rectangle2 (Rectangle, Row2, Column1, Phi, Length1, Length2)
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_rotate (HomMat2DIdentity, -Phi, Row2, Column1, HomMat2DRotate)
* hom_mat2d_scale (HomMat2DRotate, 1.5, 1.5, 256, 256, HomMat2DScale)
affine_trans_contour_xld (SmoothedContours, ContoursAffinTrans, HomMat2DRotate)segment_contours_xld (SmoothedContours, ContoursSplit, 'lines_circles', 5, 4, 2)
select_shape_xld (ContoursSplit, SelectedXLD, ['circularity','contlength'], 'or', [0.01,0], [1,50])
union_adjacent_contours_xld (SelectedXLD, CircleXld, 10, 1, 'attr_keep')
select_shape_xld (CircleXld, SelectedXLD3, 'contlength', 'and', 0, 200)
obj_diff (CircleXld, SelectedXLD3, CircleXld)
obj_diff (ContoursSplit, SelectedXLD, LinesXld)
concat_obj (LinesXld, SelectedXLD3, LinesXld)
union_adjacent_contours_xld (LinesXld, LinesXld, 10, 1, 'attr_keep')gen_empty_obj (SelectedXLD2)
gen_empty_obj (SelectedXLD1)fit_circle_contour_xld (CircleXld, 'geotukey', -1, 0, 0, 3, 2, Row, Column, Radius, StartPhi, EndPhi, PointOrder)
if(|Row|>0)
gen_circle_contour_xld (ContCircle, Row, Column, Radius, 0, 6.28318, 'positive', 1)distance_cc (ContCircle, CircleXld, 'point_to_segment', DistanceMin, DistanceMax)
difference_closed_contours_xld (CircleXld, ContCircle, ContoursDifference)
difference_closed_contours_xld (ContCircle, CircleXld, ContoursDifference1)
select_shape_xld (ContoursDifference1, SelectedXLD2, ['rect2_len2','compactness'], 'and', [1,0], [50,50])
select_shape_xld (ContoursDifference, SelectedXLD1, ['rect2_len2','compactness'], 'and', [1,0], [50,50])
endiffit_line_contour_xld (LinesXld, 'tukey', -1, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
segment_contours_xld (LinesXld, ContoursSplitLines, 'lines_circles', 5, 5, 1)
select_shape_xld (ContoursSplitLines, SelectedXLDLines,  ['circularity','contlength'], 'or', [0.015,0], [1,30])smallest_rectangle2_xld (SelectedXLDLines, Row3, Column2, Phi1, Length11, Length21)
gen_region_contour_xld (SelectedXLDLines, Region, 'filled')
dilation_circle (Region, RegionDilation, 3.5)dev_display (Image)
dev_display (SelectedXLD2)
dev_display (SelectedXLD1)
dev_display (SelectedXLDLines)
dev_display (RegionDilation)
stop()
endfor

在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/254144.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/254144.shtml
英文地址,請注明出處:http://en.pswp.cn/news/254144.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

FFMPEG解碼264文件步驟

本文以H264視頻流為例,講解解碼流數據的步驟。 為突出重點,本文只專注于討論解碼視頻流數據,不涉及其它(如開發環境的配置等)。如果您需要這方面的信息,請和我聯系。 準備變量 定義AVCodecContext。如果…

Storm概念學習系列之storm的特性

不多說,直接上干貨! storm的特性 Storm 是一個開源的分布式實時計算系統,可以簡單、可靠地處理大量的數據流。 Storm支持水平擴展,具有高容錯性,保證每個消息都會得到處理,而且處理速度很快(在一…

Confluence 6 配置服務器基礎地址示例

2019獨角獸企業重金招聘Python工程師標準>>> 如果 Confluence 的安裝是沒有安裝在非根目錄路徑(這個是上下文路徑),然后服務器基礎 URL 地址應該包括上下文地址。例如,你的 Confluence 正在運行在下面的地址&#xff1…

BootstrapValidator驗證

bootstrap:能夠增加兼容性的強大框架. 因為項目需要數據驗證,看bootstrapValidator 還不錯,就上手一直,完美兼容,話不多說。 需要引用css: bootstrap.min.css bootstrapValidator.min.css js: jquery-1.10.…

基于ARM9的視頻采集傳輸系統

http://www.ic37.com/htm_tech/2007-11/77189_618093.htm

halcon找矩形頂點的一種方法

主程序: read_image (Image11, 11)*畫仿射矩形 dev_set_color (green) draw_rectangle2 (3600, Row, Column, Phi, Length1, Length2)*生成仿射矩形xld gen_rectangle2_contour_xld (Rectangle, Row, Column, Phi, Length1, Length2) *找頂點工具(基于卡…

老男孩linux運維50期

一、自我介紹:我是來自老男孩Linux運維脫產50期的楊國峰,我以前是學軟件編碼的,但在大學里基本沒怎么學,每一門課都一知半解的,甚至有些連軟件都不會裝,在校期間,我對JAVA、網頁設計等都不感興趣…

博客收藏

http://www.dreamfairy.cn/blog/category/unity3d/轉載于:https://www.cnblogs.com/wantnon/p/5989843.html

移動開發平臺性能比較

jquerymobile是一個mobile平臺下的js框架,跟phonegap沒有一毛錢關系.phonegap實際上在國內占有率不高的,非常多人為了體驗喜歡做傳統的原生手機應用. 而Webapp如今的占有率越來越少,由于越來越多的人不喜歡用手機瀏覽器去體驗專門為移動平臺搭建的站點.我認為你的比較對象應該是…

H264關于RTP協議的實現

完整的C/S架構的基于RTP/RTCP的H.264視頻傳輸方案。此方案中,在服務器端和客戶端分別進行了功能模塊設計。服務器端:RTP封裝模塊主要是對H.264碼流進行打包封裝;RTCP分析模塊負責產牛和發送RTCP…

華為數通HCIE面試題目解密系列之RSTP邊緣端口

以下是華為數通面試考試的一道真題,原題如下; 請舉例說明 stp 的 edge port 的作用,用在什么場景,并且使用 edge port 會碰到什么問題,怎么解決和防止? 提到邊緣端口,我們是在NP課程的交換部分第一次接觸&a…

VS2013 Pro版本密鑰

Visual Studio Professional 2013 KEY(密鑰): XDM3T-W3T3V-MGJWK-8BFVD-GVPKY 轉載于:https://www.cnblogs.com/Mysterious/p/5990358.html

Django:視圖和URL配置

一、視圖1.在mysite文件夾下。創建views.py文件(文件名稱沒有特別的要求);from django.http import HttpResponsedef hello(request):return HttpResponse("Hello world")2.改動mysite文件夾下的urls.py文件;from djang…

u-boot 詳細介紹 .

Bootloader 對于計算機系統來說,從開機上電到操作系統啟動需要一個引導過程。嵌入式Linux系統同樣離不開引導程序,這個引導程序就叫作Bootloader。6.1.1 Bootloader介紹Bootloader是在操作系統運行之前執行的一段小程序。通過這段小程序,我們…

apicloud使用指南

ApiCloud ApiCloud平臺介紹 ApiCloud首頁在線教程文檔ApiCloud是一個國內的Hybird APP平臺,提供Hybird APP一站式開發服務。可以將使用HTML、CSS和JS制作的應用直接編譯為能在安卓和IOS平臺上運行的APP。另外,其所提供的代碼托管和在線編譯服務&#xff…

halcon對光源打光不均勻進行平場矯正

* Image Acquisition 01: Code generated by Image Acquisition 01 *******預處理,生成RGB三通道的平場矯正的圖像 *1.繪制檢測ROI *2.對檢測的ROI進行平場矯正 *3.平場矯正方法采用均值對減方法 read_image (ImageWhite, C:/Users/Administrator/Desktop/平場矯正/…

一般面試題

1.瀏覽器訪問一個網頁的整個過程,附帶連接協議? 2.tcp和upd的區別? 3.tcp報頭? 4.網絡協議的7層和5層分別是什么? 5.ipv6的知識? 6.網絡分包? 7.求素數的改進方法?轉載于:https://ww…

Python 執行代碼的兩種方式

1、交互執行即黑屏命令行執行 優點:即時調時程序,調試方便 缺點:無法永久無法保存代碼 2、即文件存儲代碼執行Python代碼文件 優點:可以永久保存代碼 缺點:調試不方便轉載于:https://www.cnblogs.com/liuxiaowei/p/7163473.html

金屬圓柱求取傾斜角度

方法1: count_seconds (Seconds1)read_image (Image, 9_7750_f3d301de6764d94.jpg)get_image_size (Image, Width, Height)dev_open_window (0, 0, Width, Height, black, WindowHandle)dev_display (Image)rgb1_to_gray (Image, GrayImage)dev_display (GrayImage)…

編程開發之--java多線程學習總結(2)同步代碼塊

1、第一種解決辦法:同步代碼塊,關鍵字synchronized package com.lfy.ThreadsSynchronize;/*** 1、使用同步代碼塊* 語法:synchronized (同步鎖) {//需要同步操作的代碼 }同步鎖:為了保證每個線程都能正常的執行原子操作&a…