ziguanggxr
初学者
初学者
  • 最后登录2014-03-14
  • 发帖数1
  • 金币56枚
  • 贡献勋章0枚
阅读:6115回复:15

halcon命令注解

楼主#
更多 发布于:2014-03-14 19:21
read_image (WaferDies, 'wafer_dies')
read_image (图片在程序中的名称, '图片在计算机中的名称')

reopen_window_fit (WaferDies, 700, 0, 0, WindowHandle)
reopen_window_fit (图片在程序中的名称, 700, 0, 0, WindowHandle)

init_font (WindowHandle, -1, 2)
和字体有关的一个命令


get_window_extents (WindowHandle, _, _, WindowWidth, WindowHeight)
设置窗口大小和位置

dev_update_all ('off')
把所有的dev_update从'on'设到'off',这似乎是设定文本显示的滚动与否

dev_set_draw ('margin')
定义区域填充模式。如果DrawMode设置为'fill',输出地区被填满,如果设置为'margin',只有轮廓显示出来。

get_image_pointer1 (WaferDies, _, _, Width, Height)
get_image_pointer1 ( Image : : : Pointer, Type, Width, Height )
 
Access the pointer of a channel.
The operator get_image_pointer1 returns a pointer to the first channel of the image Image. Additionally, the image type (Type = 'byte', 'int2', 'uint2', etc.) and the image size (width and height) are returned. Consequently, a direct access to the image data in the HALCON database via the pointer is possible from the programming language in which HALCON is used. An image is stored in HALCON linearized in row major order, i.e., line by line.
 

指令get_image_pointer1返回一个图像WaferDies的第一通道的指针。此外,图像类型(Type ='byte','INT2','uint2'等)和图像尺寸(宽度和高度)返回。因此,直接通过访问指针来获取HALCON的数据库中的图像数据,在使用了HALCON语言的程序中是可行的。图像在HALCON以线性行模式存储,也就是一行一行的。

dev_display (WaferDies)
在活动图形窗口显示一个图像对象(图像,地区或XLD)。这相当于对一个窗口内的变量变双击图标。

write_message (WindowHandle, -1, -1, 'Image of a wafer', true)
write_message (WindowHandle, WindowHeight - 30, -1, 'Press \'Run\' to continue', true)
在窗口上写文字

stop ()
停止

*
* 1. Determine the size of the dies by using auto correlation 确定大小用自相关
*




rft_generic (WaferDies, ImageFFT, 'to_freq', 'none', 'complex', Width)
rft_generic ( Image : ImageFFT : Direction, Norm, ResultType, Width : )
rft_generic用于计算快速傅立叶变换输入图像的形象。相反,fft_generic,fft_image和fft_image_inv,一个事实,即在正向输入图像变换是实值图像(即不是一个复杂的图像)使用。在这种情况下,复杂的输出图像具有冗余。在图像的右半部分的值是在图像的左半部分的相应值的复共轭。因此,运行时和可节省内存仅计算和存储的复杂图像的左半边。与resultType参数可用于指定结果的图像类型逆变换(方向='from_freq')。在正变换(方向='to_freq'),与resultType必须设置为'complex'。参数方向确定是否应进行变换到频域空间域或进入回来。为方向='to_freq'输入图像必须有一个实数型,即一个复杂的图像可能无法用作输入。所有图片,可以变成一个真正的图像类型转换类型的支持。在这种情况下,输出是一个尺寸(W / 2 +1)* H,其中W和H是宽度和高度复杂的图像输入图像。在这种模式下,指数-1用于变换(见fft_generic)。为方向='from_freq',输入图像必须是复杂的。在这种情况下,输入图像的大小不足以决定输出图像的大小。这必须通过设置宽度为一个有效的值,即2 *的W - 2或2 *的W - 1,其中W是复杂的图像的宽度。在这种模式下,指数1用于在变换。正火因子可设置规范,并且可以利用的量,'none', 'sqrt'和'n'。用户必须确保参数相一致。这意味着,用于规范因素向前和向后转换必须宽* h时产量成倍增加。

correlation_fft (ImageFFT, ImageFFT, CorrelationFFT)
correlation_fft ( ImageFFT1, ImageFFT2 : ImageCorrelation : : )
correlation_fft计算了傅立叶变换在频域输入图像的相关性。其相关的计算方法是乘以的ImageFFT2复共轭ImageFFT1。应当指出,为了实现在空间域的相关性的正确比例,经营者fft_generic或 Norm ='none'必须用于正变换和fft_generic或rft_generic与Norm ='n'为rft_generic逆变换。如果ImageFFT1和ImageFFT2含有相同数量的图像,相应的图像相关成对。否则,ImageFFT2只能包含一个单一的形象。在这种情况下,为每一个相关性的ImageFFT1与ImageFFT2形象。

rft_generic (CorrelationFFT, Correlation, 'from_freq', 'n', 'real', Width)



* Exclude local maxima at the image border. It is sufficient
* to extract the maxima in the upper left quarter of the image because
* the autocorrelation is an even function.
排除局部极大值在图像边界。它足以在上提取图像的左边季度极大,因为自相关是偶函数。

gen_rectangle1 (Rectangle, 1, 1, Height/2, Width/2)

gen_rectangle1 ( : Rectangle : Row1, Column1, Row2, Column2 : )
 
Create a rectangle parallel to the coordinate axes.
The operator gen_rectangle1 generates one or more rectangles parallel to the coordinate axes which are described by the upper left corner (Row1, Column1) and the lower right corner (Row2, Column2). More than one region can be created by passing a tuple of corner points. The coordinate system runs from (0,0) (upper left corner) to (Width-1,Height-1). See get_system and reset_obj_db in this context.
创建一个矩形平行于坐标轴。
操作员 gen_rectangle1生成一个或多个矩形平行于坐标是由左上角(Row1, Column1)和右下角 (Row2, Column2)中所述轴。一个以上的地区可以通过创建一个元组的角点。系统运行的坐标从(0,0)(左上角)至(宽度- 1,身高- 1)。看到这方面get_system和reset_obj_db。

reduce_domain (Correlation, Rectangle, CorrelationReduced)
reduce_domain ( Image, Region : ImageReduced : : )
 
Reduce the domain of an image.
The operator reduce_domain reduces the definition domain of the given image to the indicated region. The new definition domain is calculated as the intersection of the old definition domain with the region. Thus, the new definition domain can be a subset of the region. The size of the matrix is not changed.
 
降低图像的领域。
操作员reduce_domain减少了给定图像的定义域到指定的区域。新的定义域是计算为与该地区的旧定义域的交集。因此,新的定义域可以是该地区的一个子集。矩阵的大小是没有改变。
*
* Extract the local maxima of the auto correlation function
提取的自相关函数的局部极大值

local_max_sub_pix (CorrelationReduced, 'gauss', 2, 5000000, Row, Col)
local_max_sub_pix ( Image : : Filter, Sigma, Threshold : Row, Col )
 
Subpixel precise detection of local maxima in an image.
local_max_sub_pix extracts local maxima from the image Image with subpixel precision. To do so, in each point the input image is approximated by a quadratic polynomial in x and y and subsequently the polynomial is examined for local maxima. The partial derivatives, which are necessary for setting up the polynomial, are calculated either with various Gaussian derivatives or using the facet model, depending on Filter. In the first case, Sigma determines the size of the Gaussian kernels, while in the second case, before being processed the input image is smoothed by a Gaussian whose size is determined by Sigma. Therefore, 'facet' results in a faster extraction at the expense of slightly less accurate results. A point is accepted to be a local maximum if both eigenvalues of the Hessian matrix are smaller than -Threshold. The eigenvalues correspond to the curvature of the gray value surface.
 
亚像素精确的检测图像中的局部最大值。

local_max_sub_pix提取物与亚像素精度的图像Image 局部极大值。为此,在每个点的输入图像近似为二次多项式在x和y以及随后的多项式是局部最大值检查。偏导数,这是设立多项式必要的,是计算出来的各种衍生工具或使用高斯面模型筛选而定。在第一种情况下,适马决定了高斯核的大小,而在第二种情况下,在所处理的输入图像是由高斯,其大小是由西格玛确定平滑。因此,在一个不太准确的结果稍快费用提取'面'的结果。一个点是接受的,如果是本地最大的Hessian矩阵特征值均小于门限。特征值对应的灰度值表面曲率。

*
* Get the size of the dies
* Find maximum that is closest to the origin. This maximum
* corresponds to the opposite rectangle corner of the die.
获取大小的模具。查找最大值最接近原点。对应于这个最大的模具矩形对面角落。

distance_pp (gen_tuple_const(|Row|,0), gen_tuple_const(|Col|,0), Row, Col, Distance)
distance_pp ( : : Row1, Column1, Row2, Column2 : Distance )
 
Calculate the distance between two points.
The operator distance_pp calculates the distance between pairs of points according to the following formula:
   Distance = sqrt((Row1-Row2)^2+(Column1-Column2)^2)
The result is returned in Distance.
 
计算两点之间的距离。经营者之间的distance_pp计算按下列公式点对距离:距离=开方((第ROW1 - ROW2行)^ 2 +(column1的- COLUMN2列)^ 2)的结果是在距离返回。

tuple_gen_const ( : : Length, Const : Newtuple )
 
Generate a tuple of a specific length and initialize its elements.
tuple_gen_const generates a new tuple in Newtuple. The input parameter Length determines the number of elements for the new tuple. Thus Length may only consist of a single number. If Length contains a floating point number, this may only represent an integer value (without fraction). The data type and value of each element of the new generated tuple is determined by the input parameter Const that may only consist of a single element. All elements in Newtuple have got the same data type and value as the single element in Const.
 
生成元组的一个特定的长度和初始化它的元素.
 tuple_gen_const生成一个Newtuple新的tuple。输入参数的长度决定的元素为新的元组数目。因此长度可能只包含一个数字。如果长度包含一个浮点数,这可能仅仅代表一个整数(无分数)。数据类型和新产生的每个元组元素的值是由输入参数常量,可能只包含一个元素。在Newtuple所有元素都得到了相同的数据类型作为常量单一元素和价值。


SortedIndex := sort_index(Distance)
tuple_sort_index ( : : Tuple : Indices )
 
Sorts the elements of a tuple and returns the indices of the sorted tuple.
tuple_sort_index sorts all elements of Tuple in ascending order and returns the indices of the elements of the sorted tuple (in relation to the input tuple Tuple) with Indices. As a precondition the single elements of Tuple must be comparable. Thus Tuple must either exclusively consist of strings or it must only contain (integer or floating point) numbers. In the latter case integers and floating point numbers may be mixed.
 
排序的元素,并返回一个元组的元组的排序指标。
tuple_sort_index升序所有元组元素,并返回该元素的元组指数的排序与指数(有关输入元组元组)。作为一个先决条件的元组的单一元素必须具有可比性。因此,元组必须要么完全由字符串或它必须只包含(整数或浮点)号码。在后一种情况整数和浮点数可以混合使用。

Row1 := Row[SortedIndex[0]]
Col1 := Col[SortedIndex[0]]
DiagonalLength := sqrt(Row1*Row1 + Col1*Col1)
tuple_sqrt ( : : T : Sqrt )
 
Compute the square root of a tuple.
tuple_sqrt computes the square root of the input tuple T. The square root is always returned as a floating point number. The square root of a string is not allowed.
 
计算一个元组的平方根。
tuple_sqrt计算输入元组T的平方根是始终作为一个浮点数返回平方根。字符串的平方根是不允许的。

Phi := atan2(Row1,Col1)
tuple_atan2 ( : : Y, X : ATan )
 
Compute the arctangent of a tuple for all four quadrants.
tuple_atan2 computes the arctangent of the input tuples Y/X while treating all four quadrants correctly. The arctangent is always returned as a floating point number. The arctangent of a string is not allowed.
 计算一个元组所有四个象限反正切。
tuple_atan2计算输入的反正切值组是/ X,同时正确地对待所有四个象限。总是返回的反正切为浮点数。字符串的反正切值是不允许的。


DieWidth := DiagonalLength * cos(Phi)
DieHeight := DiagonalLength * sin(Phi)

*
* The center, the first maximum, and the second maximum
* together define the orientation and the size of the dies.
该中心的第一个最大,第二个最大的共同定义的方向和大小的模具。

dev_set_color ('blue')
dev_set_color ( : : ColorName : )
 
Set one or more output colors.
dev_set_color defines the colors for region and line oriented output in the graphics windows. The available colors can be queried with the operator query_color. The “colors” 'black' and 'white' are available for all screens. If colors are used that are not displayable on the screen, HALCON can choose a similar, displayable color of the output. For this, set_check(::'~color':) must be called.
The defined colors are used until dev_set_color or dev_set_colored is called.
Colors are defined for all graphics windows in contrast to the operator set_color.
 
Attention
If dev_set_color should be used for exported Code (C++), please note the description of set_color due to the different semantics in C++.
设置一个或多个输出的色彩。

dev_set_color定义区域和图形化输出Windows行的颜色。可用的颜色可以查询与运营商query_color。 “颜色”'黑'和'白'是可用于所有的屏幕上。如果颜色使用的是屏幕上没有显示的,HALCON的可以选择一个类似的,输出显示的颜色。为此,set_check (::'~颜色的:)必须被调用。定义的颜色使用,直至dev_set_color或dev_set_colored被调用。颜色定义为与此相反的操作set_color所有的图形窗口。
注意
如果dev_set_color出口代码应使用(C + +中),请记下set_color说明由于不同的语义在C + +。


gen_cross_contour_xld (Crosses, Row, Col, 8, 0.785398)
gen_cross_contour_xld ( : Cross : Row, Col, Size, Angle : )
 
Generate one XLD contour in the shape of a cross for each input point.
gen_cross_contour_xld generates an XLD contour in the shape of a cross for each input point (Row,Col). Conceptually, the contour consists of two lines of length Size, which intersect exactly in the input point. Their orientation is determined by Angle. The cross is returned in Cross. If there are multiple points to be processed, their coordinates must be passed as tuples.
 
生成一个XLD在为每一个输入点十字形的轮廓。
gen_cross_contour_xld产生在为每一个输入点(行,列)十字XLD轮廓。从概念上讲,外形由两条线的长度大小,在相交点的准确输入。他们的方向是确定的视角。跨跨中返回。如果有多个点进行处理,他们的坐标必须为元组通过。

gen_ellipse_contour_xld (Circle, Row1, Col1, 0, 8, 8, 0, 6.28318, 'positive', 1.5)
gen_ellipse_contour_xld(:ContEllipse:Row,Column,Phi,Radius1,Radius2,StartPhi,EndPhi,PointOrder,Resolution:)
 
Creation of an XLD contour corresponding to an elliptic arc.
gen_ellipse_contour_xld creates one or more elliptic arcs or closed ellipses. Ellipses are specified by their center (Row, Column), the orientation of the main axis Phi, the length of the larger half axis Radius1, and the length of the smaller half axis Radius2. In addition to that, elliptic arcs are characterized by the angle of the start point StartPhi, the angle of the end point EndPhi, and the point order PointOrder along the boundary. Both angles refer to the coordinate system of the ellipse, i.e. relative to the main axis and in a mathematical positive direction. Thus, the two main poles correspond to the angles 0 and PI, the two minor poles to the angles PI/2 and 3*pi/2. To create a closed ellipse the values 0 and 2*PI (with positive point order) have to be passed to the operator. All angles Phi, StartPhi, EndPhi take arbitrary values and are mapped internally to the interval [0,2*PI]. The resolution of the resulting contours ContEllipse is controlled via Resolution containing the maximum Euclidean distance between neighboring contour points.
 
一个XLD轮廓对应一个椭圆弧.

gen_ellipse_contour_xld创作创建一个或多个圆弧或椭圆封闭椭圆。由他们指定的椭圆形中心(Row, Column),该椭圆的主轴线沿Phi方向,规模较大的半轴Radius1的长度和较小的半主轴轴Radius2长度。除此之外,椭圆弧的特点是对角StartPhi起点,在终点EndPhi角,沿边界点顺序PointOrder。这两个角涉及到椭圆的坐标系统,即相对于主轴线,并在数学积极的方向。因此,这两个主极对应于角度0和PI,这两个极点的角度轻微的PI / 2和3 *π/ 2。要创建一个封闭的椭圆值0和2 *PI(在正面点顺序)要传递给经营者。各个角度Phi, StartPhi, EndPhi 采取任意值,并映射到内部区间[0,2 *PI]。由此产生的ContEllipse是通过Resolution包含的最大的欧几里德空间距离控制轮廓点轮廓。

dev_display (Correlation)
dev_display ( Object : : : )
 
Displays image objects in the current graphics window.
dev_display displays an image object (image, region, or XLD) in the active graphics window. This is equivalent to a double click on an icon variable inside the variable window.
 
Attention
If dev_display should be used for exported Code (C++), please note the description of disp_obj due to the different semantics in C++.
 
Parameters
当前图形窗口中显示图像对象。
dev_display在窗口中显示一个图形图像主动对象(图像,地区或XLD)。这相当于在一个窗口内的变量变双击图标。
注意
如果dev_display应注意对出口代码使用(C + +中),请记下disp_obj由于不同的语义描述,在C + +。

dev_display (Crosses)
dev_display (Circle)
dev_set_color ('green')
dev_display (Rectangle)

write_message (WindowHandle, -1, -1, 'Autocorrelation, region of interest, and local maxima', true)
write_message (WindowHandle, WindowHeight - 30, -1, 'Press \'Run\' to continue', true)
stop ()

*
* Visualize the extracted size of the dies
可视化提取图片大小


gen_rectangle2_contour_xld (Die, Height/2, Width/2, 0, DieWidth/2, DieHeight/2)

gen_rectangle2_contour_xld(:Rectangle : Row, Column, Phi, Length1, Length2 : )
 
Create an XLD contour in the shape of a rectangle.
gen_rectangle2_contour_xld creates one or more XLD contours in the shape of a rectangle with arbitrary orientation. The rectangle has the center (Row, Column), the orientation Phi, and the half edge lengths Length1 and Length2. The angle Phi must be given in radians and specifies the angle between the horizontal axis and the edge with the half length Length1 in the mathematically positive direction (counterclockwise). More than one XLD contour can be created by passing a tuple of rectangle parameters.
 
创建一个矩形的形状XLD轮廓。
gen_rectangle2_contour_xld中创建一个矩形形状任意方向的一个或多个XLD轮廓。该矩形的中心(Row, Column),方向Phi,半长边Length1 和Length2。Phi 角度必须以弧度,并指定之间的水平轴,与半长长度1在数学正方向(逆时针方向)边缘角。不止一个XLD轮廓可以通过创建一个矩形参数元组。

reopen_window_fit (WaferDies, 700, 0, 0, WindowHandle)
init_font (WindowHandle, -1, 2)
dev_display (WaferDies)
dev_set_color ('blue')
dev_display (Die)
write_message (WindowHandle, -1, -1, 'Extracted die size', true)
write_message (WindowHandle, WindowHeight - 30, -1, 'Press \'Run\' to continue', true)
stop ()

*
* 2. Determine the position of the dies by using shape-based matching
*
2。确定位置通过使用基于形状匹配die图片

LineWidth := 7
LineWidthFraction := 0.6
*
* Generate an artificial model image of the lines between the dies
生成die图片之间的行人工模范形象

gen_image_const (Template, 'byte', Width, Height)

gen_image_const ( : Image : Type, Width, Height : )
 
Create an image with constant gray value.
The operator gen_image_const creates an image of the indicated size. The height and width of the image are determined by Height and Width. HALCON supports the following image types:
  'byte'         (1 byte per pixel, value area: 0..255)
  'int1'         (1 byte per pixel, signed)
  'int2'         (2 bytes per pixel, signed)
  'uint2'        (2 bytes per pixel, unsigned)
  'int4'         (4 bytes per pixel, signed)
  'real'         (4 bytes per pixel)
  'complex'      (two 'real' matrices)
  'vector_field' (two 'real' matrices)
  'dir'          (1 byte per pixel, value area: 0..180))
  'cyclic'       (1 byte per pixel; cyclic value area: 0..255)).
The default value 0 is set via the operator set_system('init_new_image',<'true'/'false'>).

创建具有恒定灰度值的图像。

操作员gen_image_const创建一个指定大小的图片。高度和宽度的图像是由高度和宽度。 HALCON的支持下列图像类型:

scale_image (Template, Template, 1, 128)
scale_image ( Image : ImageScaled : Mult, Add : )
 
Scale the gray values of an image.
The operator scale_image scales the input images (Image) by the following transformation:
                     g' := g * Mult + Add
If an overflow or an underflow occurs the values are clipped.
This operator can be applied, e.g., to map the gray values of an image, i.e., the interval [GMin,GMax], to the maximum range [0:255]. For this, the parameters are chosen as follows:
      Mult = 255 / (GMax-GMin)         Add  = - Mult*GMin
The values for GMin and GMax can be determined, e.g., with the operator min_max_gray.
Please note that the runtime of the operator varies with different control parameters. For frequently used combinations special optimizations are used. Additionally, special optimizations are implemented that use fixed point arithmetic (for int2 and uint2 images), and further optimizations that use SIMD technology (for byte, int2, and uint2 images). The actual application of these special optimizations is controlled by the system parameters 'int_zooming' and 'mmx_enable' (see set_system). If 'int_zooming' is set to 'true', the internal calculation is performed using fixed point arithmetic, leading to much shorter execution times. However, the accuracy of the transformed gray values is slightly lower in this mode. The difference to the more accurate calculation (using 'int_zooming' = 'false') is typically less than two gray levels. If 'mmx_enable' is set to 'true'(and the SIMD instruction set is available), the internal calculations are performed using fixed point arithmetic and SIMD technology. In this case the setting of 'int_zooming' is ignored.
 
Attention
Note that SIMD technology performs best on large, compact input regions. Depending on the input region and the capabilities of the hardware the execution of scale_image might even take significantly more time with SIMD technology than without. In this case, the use of SIMD technology can be avoided by set_system(::'mmx_enable','false':).
 
规模图像的灰度值。
在输入图像(影像)由以下变换算scale_image规模:
克':=克* +新增的MULT
如果发生溢出或下溢值被剪切。这个操作符可以应用,例如,映射的图像,即在区间[GMin,GMax],灰度值的最大范围[0:255]。为此,参数的选择如下:
= 255的MULT /(GMax - GMin)添加= - * GMin的MULT
GMin和GMax值可确定的,如与经营者min_max_gray。请注意,该操作运行时使用不同的控制参数不同。为经常使用的特殊的优化组合使用。此外,特殊的优化实现使用固定点算法(uint2为INT2和图像),并使用单指令多数据技术(字节,整合酶,并uint2图像)进一步优化。这些特殊的优化控制的实际应用,系统参数的int_zooming'和'mmx_enable'(见set_system)。如果'int_zooming'设置为'true',内部计算是使用固定点算法,从而大大缩短执行时间。但是,转换后的灰度值的精确度在这种模式下略有降低。到更精确的计算差异(使用'int_zooming'='假')通常小于两个灰色的水平。如果'mmx_enable'设置为'true'(和SIMD指令集可用),内部计算是用固定点算法和SIMD技术。在这种情况下,'int_zooming'设置将被忽略。
注意
请注意,表现最好的SIMD技术在大,结构紧凑输入地区。根据输入地区和硬件上scale_image执行,甚至可能采取的SIMD技术比没有更多的时间的能力。在这种情况下,使用SIMD技术可避免set_system(::'mmx_enable','假':)。


RefRow := round(0.5*Height)
RefCol := round(0.5*Width)
for Row := -0.5 to 0.5 by 1
    for Col := -0.5 to 0.5 by 1
        gen_rectangle2_contour_xld (Rectangle, RefRow + Row*DieHeight, RefCol + Col*DieWidth, 0, 0.5*DieWidth - 0.5*LineWidth, 0.5*DieHeight - 0.5*LineWidth)
gen_rectangle2_contour_xld ( : Rectangle : Row, Column, Phi, Length1, Length2 : )
 
Create an XLD contour in the shape of a rectangle.
gen_rectangle2_contour_xld creates one or more XLD contours in the shape of a rectangle with arbitrary orientation. The rectangle has the center (Row, Column), the orientation Phi, and the half edge lengths Length1 and Length2. The angle Phi must be given in radians and specifies the angle between the horizontal axis and the edge with the half length Length1 in the mathematically positive direction (counterclockwise). More than one XLD contour can be created by passing a tuple of rectangle parameters.
 
Parameters

        paint_xld (Rectangle, Template, Template, 0)
paint_xld ( XLD, Image : ImageResult : Grayval : )
 
Paint XLD objects into an image.
paint_xld paints the XLD objects XLD of type contour or polygon with the constant gray values Grayval into each channel of the background image given in Image and returns the result in ImageResult. Open contours of XLD objects are closed and their enclosed regions are filled up. The rim of the subpixel XLD objects is painted onto the background image using anti-aliasing. Note that only objects without crossings or touching segments are painted correctly.
Grayval contains the gray values for painting the XLD objects. These gray values can either be specified for each channel once, valid for all XLD objects, or for each XLD object separately. To define the latter, group the channel gray values g of each XLD object and concatenate them to a tuple according to the order of the XLD objects, e.g., for a three channel image:
  [g(channel1,xld1), g(channel2,xld1), g(channel3,xld1), g(channel1,xld2), ... ].  
    endfor
endfor
gen_rectangle2_contour_xld (Rectangle, RefRow, RefCol, 0, 0.5*LineWidthFraction*LineWidth, DieHeight)
paint_xld (Rectangle, Template, Template, 0)
gen_rectangle2_contour_xld(Rectangle,RefRow,RefCol,0,DieWidth,0.5*LineWidthFraction*LineWidth)
paint_xld (Rectangle, Template, Template, 0)
gen_rectangle2 (ROI, RefRow, RefCol, 0, DieWidth+5, DieHeight+5)

gen_rectangle2 ( : Rectangle : Row, Column, Phi, Length1, Length2 : )
 
Create a rectangle of any orientation.
The operator gen_rectangle2 generates one or more rectangles with the center (Row, Column) , the orientation Phi and the half edge lengths Length1 and Length2. The orientation is given in arc measure and indicates the angle between the horizontal axis and Length1 (mathematically positive). The coordinate system runs from (0,0) (upper left corner) to (Width-1,Height-1). See get_system and reset_obj_db in this context. More than one region can be created by passing one tuple of corner points.
 
Attention
The gray values of the output objects are undefined.
 
创建任何方向的矩形。
操作员gen_rectangle2生成一个或多个中心(行,列),方向和半披边长度长度1和Length2矩形。给出的方向,并指出在弧形测量水平轴之间的长度1(数学正)的角度。系统运行的坐标从(0,0)(左上角)至(宽度- 1,身高- 1)。看到这方面get_system和reset_obj_db。一个以上的地区可以通过创建一个元组的角点。
注意
输出的对象灰度值是不确定的。

reduce_domain (Template, ROI, TemplateReduced)
reduce_domain ( Image, Region : ImageReduced : : )
 
Reduce the domain of an image.
The operator reduce_domain reduces the definition domain of the given image to the indicated region. The new definition domain is calculated as the intersection of the old definition domain with the region. Thus, the new definition domain can be a subset of the region. The size of the matrix is not changed.
 
操作员reduce_domain减少了给定图像的定义域到指定的区域。新的定义域是计算为与该地区的旧定义域的交集。因此,新的定义域可以是该地区的一个子集。矩阵的大小是没有改变。
create_shape_model (TemplateReduced, 'auto', 0, 0, 'auto', 'auto', 'ignore_local_polarity', 'auto', 5, ModelID)
dev_display (Template)
dev_set_color ('blue')
dev_display (ROI)
write_message (WindowHandle, -1, -1, 'Template of 4 adjacent dies', true)
write_message (WindowHandle, WindowHeight - 30, -1, 'Press \'Run\' to continue', true)
stop ()
*
* Find the best instance of the artifical model in the original image
在原始图像的人工模型中找到的最佳实例

MinScore := 0.7
Greediness := 0.5
NumMatches := 1
find_shape_model (WaferDies, ModelID, 0, 0, MinScore, NumMatches, 0.5, 'least_squares', 0, Greediness, MatchRow, MatchColumn, MatchAngle, MatchScore)
find_shape_model ( Image : : ModelID, AngleStart, AngleExtent, MinScore, NumMatches, MaxOverlap, SubPixel, NumLevels, Greediness : Row, Column, Angle, Score)
*

get_shape_model_contours (ModelContours, ModelID, 1)
vector_angle_to_rigid (0, 0, 0, MatchRow, MatchColumn, MatchAngle, HomMat2D)
vector_angle_to_rigid ( : : Row1, Column1, Angle1, Row2, Column2, Angle2 : HomMat2D )
 
Compute a rigid affine transformation from points and angles.

affine_trans_contour_xld (ModelContours, ContoursAffinTrans, HomMat2D)
affine_trans_contour_xld ( Contours : ContoursAffinTrans : HomMat2D : )
 
Apply an arbitrary affine 2D transformation to XLD contours.
套用一个任意二维仿射变换到XLD轮廓。

dev_display (WaferDies)
dev_set_color ('blue')
dev_display (ContoursAffinTrans)
write_message (WindowHandle, -1, -1, 'Best match', true)
write_message (WindowHandle, WindowHeight - 30, -1, 'Press \'Run\' to continue', true)
stop ()
*
* 3. Compute the cutting lines based on the size
* and the position of the dies
*
计算切割线的规模和基础的图片die的位置

dev_clear_window ()
dev_display (WaferDies)
dev_set_color ('blue')
NumRowMax := ceil(Height / DieHeight)
tuple_ceil ( : : T : Ceil )
 
Compute the ceiling function of a tuple.
tuple_ceil computes the ceiling function of the input tuple T, i.e., the smallest integer greater than or equal to T. The ceiling function is always returned as a floating point number. The ceiling function of a string is not allowed.
计算一个元组上限函数。
tuple_ceil计算输入元组t,即最小整数大于或等于T的上限函数始终作为一个浮点数返回上限函数。字符串的上限函数是不允许的。
 

NumColMax := ceil(Width / DieWidth)
for RowIndex := -NumRowMax to NumRowMax by 1
    RowCurrent := MatchRow + RowIndex * DieHeight
gen_contour_polygon_xld (CuttingLine, [RowCurrent, RowCurrent], [0,Width-1])
gen_contour_polygon_xld ( : Contour : Row, Col : )
 
Generate an XLD contour from a polygon (given as tuples).
gen_contour_polygon_xld generates an XLD contour Contour from a polygon given in the tuples Row and Col. This operator is useful if contours have been obtained from routines outside the core library, but higher level operators, e.g., polygon approximation and extraction of parallels, are to be performed on the contours.

生成一个多边形XLD轮廓(元组提供)。
gen_contour_polygon_xld生成的元组从Row和上校,这是有用的,如果经营者的轮廓已获得来自外界的核心库例程,但较高的基层操作人员,如多边形逼近与平行提取给予一个XLD轮廓多边形轮廓,是被上进行的轮廓。
 

    dev_display (CuttingLine)
endfor
for ColIndex := -NumColMax to NumColMax by 1
    ColCurrent := MatchColumn + ColIndex * DieWidth
    gen_contour_polygon_xld (CuttingLine, [0,Height-1], [ColCurrent,ColCurrent])
    dev_display (CuttingLine)
endfor
write_message (WindowHandle, -1, -1, 'Resulting cutting lines', true)
write_message (WindowHandle, WindowHeight - 30, -1, '  Program terminated   ', true)
read_image(WaferDies,'C:/ProgramFiles/MVTec/HALCON/examples/machine_vision_book/wafer_dicing/wafer_dies.png')
dangpoyouhun
技术员
技术员
  • 最后登录2017-11-27
  • 发帖数43
  • 金币180枚
  • 贡献勋章0枚
  • 社区居民
沙发#
发布于:2014-08-12 10:48
楼主好强大!谢谢了!!!
ydf521
技术员
技术员
  • 最后登录2017-12-05
  • 发帖数38
  • 金币126枚
  • 贡献勋章0枚
  • 社区居民
板凳#
发布于:2014-09-22 21:40
Good,好论坛!!!!
cenjinghang
技术员
技术员
  • 最后登录2015-05-24
  • 发帖数31
  • 金币119枚
  • 贡献勋章0枚
地板#
发布于:2015-04-30 11:23
楼主好厉害,感谢分享,有用!
fox6961
技术员
技术员
  • 最后登录2017-08-31
  • 发帖数25
  • 金币113枚
  • 贡献勋章0枚
  • 社区居民
  • 忠实会员
4楼#
发布于:2015-05-01 13:14
谢谢了!!!谢谢了!!!
yuezhang1202
初学者
初学者
  • 最后登录2017-10-18
  • 发帖数9
  • 金币48枚
  • 贡献勋章0枚
  • 社区居民
5楼#
发布于:2015-05-06 08:45
很不错,楼主有心了!
chengpcn
初学者
初学者
  • 最后登录2015-08-20
  • 发帖数7
  • 金币34枚
  • 贡献勋章0枚
6楼#
发布于:2015-08-13 21:16
哥,还有更多的吗,新手学习
carle林
初学者
初学者
  • 最后登录2016-10-02
  • 发帖数5
  • 金币37枚
  • 贡献勋章0枚
  • 社区居民
7楼#
发布于:2015-09-07 10:45
楼主厉害,万分感谢,得赶紧记下了~
mjm2015
助理工程师
助理工程师
  • 最后登录2018-01-09
  • 发帖数61
  • 金币357枚
  • 贡献勋章0枚
  • 社区居民
  • 忠实会员
8楼#
发布于:2015-09-07 13:23
楼主,赶紧记下,学习了!!
genshibawuyue
初学者
初学者
  • 最后登录2016-04-26
  • 发帖数7
  • 金币40枚
  • 贡献勋章0枚
  • 社区居民
9楼#
发布于:2016-04-24 18:51
必须背熟了,感谢楼主的无私奉献。
michaeliao
技术员
技术员
  • 最后登录2017-12-05
  • 发帖数42
  • 金币172枚
  • 贡献勋章0枚
  • 社区居民
10楼#
发布于:2016-04-30 01:51
这个值得保留,特别是我这种初学者
grant
初学者
初学者
  • 最后登录2016-04-30
  • 发帖数2
  • 金币18枚
  • 贡献勋章0枚
11楼#
发布于:2016-04-30 10:10
楼主好强大!谢谢了!!!
ivyhope
工程师
工程师
  • 最后登录2017-12-20
  • 发帖数343
  • 金币1073枚
  • 贡献勋章0枚
  • 社区居民
12楼#
发布于:2017-12-14 11:40
楼主好厉害,感谢分享~~~~
guoyufei
助理工程师
助理工程师
  • 最后登录2018-01-19
  • 发帖数49
  • 金币310枚
  • 贡献勋章0枚
  • 社区居民
13楼#
发布于:2018-01-12 16:38
强!强!强!!!!1
baoshu
初学者
初学者
  • 最后登录2018-01-16
  • 发帖数16
  • 金币66枚
  • 贡献勋章0枚
  • 社区居民
14楼#
发布于:2018-01-12 21:37
虽然只有一部分,不过还是照着英文资料翻译的,比其他资料解释的完整点,挺不错
上一页
游客

返回顶部