HALCON輪廓整理


*輪廓的創建,區域邊緣生成輪廓,提取,分割,合並
*畫圓生成圓輪廓
draw_circle (3600, Row, Column, Radius)
gen_circle_contour_xld (ContCircle, Row, Column, Radius, 0, 6.28318, 'positive', 1)
*畫矩形生成矩形輪廓
draw_rectangle2 (3600, Row1, Column1, Phi, Length1, Length2)
gen_rectangle2_contour_xld (Rectangle, Row1, Column1, Phi, Length1, Length2)
*生成箭頭輪廓
gen_arrow_contour_xld (Arrow, Row, Column, Row1, Column1, 25, 50)
*生成十字叉輪廓
gen_cross_contour_xld (Cross, Row, Column, 25, 0)
*畫一個區域並將將區域邊緣生成輪廓
draw_region (Region, 3600)
gen_contour_region_xld (Region, Contours, 'border')
*區域生成骨骼,骨骼轉輪廓
skeleton (Region, Skeleton)
gen_contours_skeleton_xld (Skeleton, Contours1, 1, 'filter')
*圖像邊緣提取得到輪廓
read_image (Image, 'fabrik')
threshold_sub_pix (Image, Border, 128)
*帶通濾波:濾波器是提取出圖像,白的更白,黑的更黑
bandpass_image (Image, ImageBandpass, 'lines')
threshold_sub_pix (ImageBandpass, Border, 128)
*索蓓爾放大器,把邊緣區域變亮,不是邊緣的都變暗,也是梯度值變化,就是保留梯度值變化的位置
sobel_amp (ImageBandpass, EdgeAmplitude, 'sum_abs', 3)
threshold_sub_pix (EdgeAmplitude, Border, 128)
*高通濾波器:梯度值低和高的變化會變亮
highpass_image (EdgeAmplitude, Highpass, 9, 9)
*亞像素提取輪廓,通過過濾器和梯度變化率來獲取邊緣
edges_sub_pix (Image, Edges, 'canny', 1, 20, 40)
*從最大寬度和提取線的對比度計算出lines_gauss的參數Sigma、Low和High。
calculate_lines_gauss_parameters (8, [12,0], Sigma, Low, High)
*精確的抽出線,返回亞像素輪廓,三平滑系數,四五閾值范圍,越小線越多,第六個參數標識提
*取亮線還是暗線,七,是否提取線的寬度(如果獲取線的寬度,則線提前的位置越寬則顯示的線就越寬)
lines_gauss (Highpass, Lines, Sigma, Low, High, 'light', 'true', 'bar-shaped', 'true')
circularity_xld (Lines, Circularity)//獲取圓度
length_xld (Lines, Length)//獲取長度
area_center_xld (Lines, Area, Row2, Column2, PointOrder)//獲取面積中心點
*輪廓等高線過濾
select_contours_xld (Lines, SelectedContours, 'contour_length', 20, 200, -0.5, 0.5)
*輪廓幾何形狀過濾
select_shape_xld (SelectedContours, SelectedXLD, 'area', 'and', 150, 99999)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM