欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
HALCON基礎知識

HALCON

1. 語(yǔ)法范式 Syntax Style 

1.1. 基本格式

1.1.1. 算子格式

算子(輸入圖像參數:輸出圖像參數:輸入控制參數:輸出控制參數)

其中四個(gè)參數任意一個(gè)可以為空

e.g.1.threshold(Image Region MinGrayMaxGray : ) 

** threshold算子,1 Image Para input : Image ; 2 Image Para output :Region ; 

**3 Control Para input : MinGray ,  MaxGray 4 Control Para output :無(wú)

2.get_image_pointer1(Image : : : PointerTypeWidthHeight) 

** threshold算子,1 Image Para input : Image ; 2 Image Para output :無(wú)

**  3 Control Para input : 無(wú) 4 Control Para output : PointerTypeWidthHeight

1.1.2. 程序結構

HDEV即HALCON Develop,相當于VC中sln,solution。dev下面有很多窗口。

dev_update_pc

Switches the update of the PC during program execution on or off.

dev_update_time

Switch time measurement for operators on or off.

dev_update_var

Switches the update of the variable window during program execution on or off.

dev_update_window

Switches the automatic output of iconic output objects into the graphics window during program execution on or off. 

1.1.3. 符號

這里主要列出一些和C/C++含義不同的符號,以及HALCON中一些重要符號。

編號

符號

符號含義

1

*

注釋符號

2

:=

賦值符號,和C中不同

3

=

邏輯符號,判斷相等,相對于C中的==

4

\

轉義符號,至少可以在用于換行的轉義,\+Enter就可以續行了

5

$

變量指示符號,e.g. +Distance$'.3'表示將變量Distance寫(xiě)成3個(gè)字長(cháng)的字符串形式

6

F1

Help文檔,直接看算子

7

F2

回滾到程序頭

8

F3/F4

激活/注銷(xiāo)此行代碼

9

F5

運行程序

10

F6

單步執行

11

F10

設置斷點(diǎn)

1.2. 讀寫(xiě)文件I/O

1.2.1.  控制變量的I/O

HACLON的輸入,輸出寫(xiě)法相當靈活。下面三個(gè)列子分別是常量字符串,格式化的浮點(diǎn)數,和一個(gè)tuple的輸出

*字符串和單個(gè)浮點(diǎn)數的輸出,甚至不需要fnew_line來(lái)寫(xiě)下一行,直接用\n,在一般的文本編輯器里就能有比較好的格式。 注意不用寫(xiě)百分號'%d'

'd',3d'表示始終為3位輸出,'10.3f'表示始終為10位輸出,其中小數位占3

fwrite_string(FileHandle,'\tR1\tx1\ty1\tR2\tx2\ty2\td1\td2\td3\n')

fwrite_string(FileHandle, '\n'+id++R1'10.3f'+x110.3f+y1'10.3f'+\

                   R210.3f+x2'10.3f'+y2$'10.3f'+\

                  d110.3f+d2'10.3f'+d3$'10.3f')

*在同一行中輸出按'7.3f'的格式輸出UpRows的所有元素,元素之間有個(gè)空格

fnew_line(FileHandle)

fwrite_string(FileHandle,UpRows$'7.3f'+' ') /

1.2.2.  圖像變量的I/O

Path:= 'I:/Work/ritz/Piece/data/data_0528/'

read_image (Image, Path+'hgtest1__'+i$'d')

dump_window (WindowHandle, 'png', 'C:/Documents and Settings/Administrator/桌面/sadaharu2_gray.png')

write_image (Amp, 'png', 0 , 'C:/Documents and Settings/Administrator/桌面/sadaharu2_canny2.png')

write_region(Margin,'C:/Documents and Settings/Administrator/桌面/sadaharu2_canny3.tif') 

1.3. 圖像或形狀的生成與顯示

這條主要是為了區分三個(gè)系列的函數,gen_ , draw_ 和 disp_

gen_  gen系列跨度很大,一般屬于Creation范疇,生成的可以是圖像image,匹配模板model,區域region,輪廓Contour,亞像素級輪廓Contour XLD,濾波器filter,HALCON內部描述文件descr(如標定板的表述caltab10mm.descr)等。下面展示的是一些容易混淆的gen_circle等,都是生成區域,屬于Table of Contents/Regions/Creation:

gen_circle

Create a circle.

gen_ellipse

Create an ellipse.

gen_rectangle2

Create a rectangle of any orientation.

以畫(huà)圓為例,含有Row,Col,R,且這些都是輸入量:

gen_circle( : Circle RowColumnRadius : ) 

draw_ 屬于Table of Contents/Graphics/Drawing和我們平常理解的不同,這里的draw是指交互式地在窗口上畫(huà)圖,而不是直接按參數畫(huà)圖

draw_circle

Interactive drawing of a circle.

draw_ellipse

Interactive drawing of an ellipse.

draw_line

Draw a line.

以畫(huà)圓為例,雖然也有Row,Col,R,但這些都是輸出量:

draw_circle( : : WindowHandle RowColumnRadius) 

disp_ 屬于Table of Contents/Graphics/Output

disp_arc

Displays circular arcs in a window.輸出顯示一段弧

disp_arrow

Displays arrows in a window.輸出顯示一個(gè)箭頭

disp_circle

Displays circles in a window.

disp_cross

Displays crosses in a window.

以畫(huà)弧為例,雖然也有CRow,CCol,而且這些都是輸入的控制參數:

disp_arc( : : WindowHandleCenterRowCenterColAngleBeginRowBeginCol : ) 

2. 數據結構 Data Structure

2.1. Tuple元組

HALCON中的元組是一個(gè)涵蓋范圍很廣的數據結構,可以表示各種整形浮點(diǎn),也可以表示字符串。

2.1.1. tuple的函數

① Tuple的長(cháng)度

tuple_length( : : Tuple Length) 

e.g.tuple_length( RowsEdges, LengthEdge),還有一種更簡(jiǎn)單的方法,

② Tuple按index取元素

tuple_select( : : TupleIndex Selected) 

e.g.tuple_select( RowsEdges, 0,RowSelectedPoint)

tuple_select_range( : : TupleLeftindexRightindex Selected) 

 Select several elements of a tuple between the left index and the right index.

③ Tuple的初始化,包含分配內存需要的長(cháng)度以及初始值

tuple_gen_const

gen_tuple_const(NumHoles,0)

2.1.2. tuple的操作符

tuple的操作除了調用函數,還可以直接訪(fǎng)問(wèn)元素,或者使用操作符

① Tuple的長(cháng)度

Length:= |Tuple|

e.g.LengthEdge1 := |RowsEdges| 

② Tuple按index取元素

e.g.RowSelectedPoint := RowsEdges[0]

2.2. 常見(jiàn)圖像變量數據結構及相互轉換

Image,Region, Contour ,XLD,幾何圖形

2.2.1. Image 
 Region

① Image 

 Region

 threshold(Image Region MinGrayMaxGray : )

Bin_threshold,char_threshold,dual_threshold,dyn_threshold,fast_threshold,hysteresis_threshold,threshold_sub_pix

var_threshold Threshold an image by local mean and standard deviation analysis

watersheds_threshold— Extract watershed basins from an image using a threshold.

② Image 

 Region

reduce_domain(ImageRegion ImageReduced : : ) 

Reduce the domain of an image.提取ROI中的圖像部分

region_to_bin(Region BinImage ForegroundGrayBackgroundGrayWidthHeight : ) 

Convert a region into a binary byte-image。將區域轉化為二值圖

region_to_label(Region ImageLabel TypeWidthHeight : ) Convert regions to a label image.

region_to_mean(RegionsImage ImageMean : : ) 

 Paint regions with their average gray value.  結合原圖Image將區域內所有像素點(diǎn)轉換為它的中值。

2.2.2. Region 
 Contour 

① Region 

 Contour 

 

gen_circle_contour_xld

Create XLD contours corresponding to circles or circular arcs.

gen_contour_nurbs_xld

Transforms a NURBS curve into an XLD contour.

gen_contour_polygon_rounded_xld

Generate a XLD contour with rounded corners from a polygon (given as tuples).

gen_contour_polygon_xld

Generate an XLD contour from a polygon (given as tuples).

gen_contour_region_xld

Generate XLD contours from regions.

gen_contours_skeleton_xld

Convert a skeleton into XLD contours.

gen_cross_contour_xld

Generate one XLD contour in the shape of a cross for each input point.

gen_ellipse_contour_xld

Creation of an XLD contour corresponding to an elliptic arc.

gen_nurbs_interp

Create control data of a NURBS curve that interpolates given points.

gen_parallels_xld

Extract parallel XLD polygons.

gen_polygons_xld

Approximate XLD contours by polygons.

gen_rectangle2_contour_xld

Create an XLD contour in the shape of a rectangle.

mod_parallels_xld

Extract parallel XLD polygons enclosing a homogeneous area.

 

3. 函數理解 Understanding the Basic but Essential Functions

3.1. edges_sub_pix

edges_sub_pix (Image, Edges, 'canny', 0.9, 20, 40)

edges_sub_pix(Image Edges FilterAlphaLowHigh : ) 

主要介紹Canny邊緣檢測,同hysteresis_threshold,Canny邊緣檢測時(shí)不是單個(gè)閾值,而是有個(gè)“遲滯效應”設置了雙閾值。

hysteresis_threshold performs a hysteresis threshold operation (introduced by Canny) on an image. All points in the input image Image having a gray value larger than or equal to High are immediately accepted (“secure” points). Conversely, all points with gray values less than Low are immediately rejected. “Potential” points with gray values between both thresholds are accepted if they are connected to “secure” points by a path of “potential” points having a length of at most MaxLength points. This means that “secure” points influence their surroundings (hysteresis).

4. 經(jīng)驗談 Special Tips

4.1. 多使用help 文檔中的Content Table有問(wèn)題何不往上翻一級

“不是路上真面目,只緣身在此山中”。解決一個(gè)問(wèn)題,就和了解一個(gè)山峰所有真正的登山路一樣,當我們在山腰中時(shí),自然是很難了解這條路是否能直通山頂的,而當我們處在一個(gè)比這座峰更高的一個(gè)位置時(shí),很自然就可以觀(guān)察或者自己構造出一條比較好的登山路。這就是看往上一級,才看Content Table的作用,在這樣一個(gè)更高的視野我們就可以找到在這個(gè)范圍內的其他的路,也許剛好可以登上這座峰。如:

Table of Contents/Filter/smooth_image,

eliminate_min_max : Smooth an image in the spatial domain to suppress noise.

 

 

本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
Halcon在機器視覺(jué)中的典型應用
halcon-長(cháng)度和角度測量
《HALCON機器視覺(jué)與算法原理編程實(shí)踐》第10章 邊緣檢測
分揀螺釘
【Halcon】輪廓處理
halcon第十四講:基于形狀的模板匹配
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久