文档库 最新最全的文档下载
当前位置:文档库 › Halcon学习笔记

Halcon学习笔记

Halcon学习笔记
Halcon学习笔记

Halcon学习笔记

1、Halcon的自我描述

Program Logic

Each program consists of a sequence of HALCON operators

The program can be structured into procedures

The sequence can be extended by using control operators like if, for, repeat, or while The results of the operators are passed via variables

No implicit data passing is applied

Input parameters of operators can be variables or expressions

Output parameters are always variables

HDevelop has no features to design a graphical user interface

An HDevelop program is considered as a prototypic solution of the vision part of an application

HDevelop is typically not used for the final application

由此可以看出,Halcon的定位是一个类库,有着完整、快速实现函数,同时提供了HDevelop 作为快速开发的图形化(IDE)界面;但是,Halcon程序并不是一个完整的最终应用软件,它没有用户界面,也不提供显示的数据(公用的数据格式)。

Halcon的初学者也应当从参考Halcon的程序入手,熟悉Halcon类库,也即HDevelop-Based Programming;在此基础上,进入ORClass-Oriented Programming。这也是Halcon推荐的开发方式:

The vision part is solved with HDevelop,and the application is developed with C++ or Visual Basic。

2、HDevelop界面的学习

通过阅读Halcon的PPT,学到了下面一些有用的信息:

文件——浏览示例,可以看到很多有用的例子;

程序窗体中,可以浏览与编辑Procedues(过程),这个其实就是自定义函数咯~还可以自己修改这些过程,并添加说明文档;

F4——将函数语句注释掉;F3——激活;

本地过程(Local Procedue)与外部过程(Externel Procedue)

3、基本语法结构

Halcon的语法结构

类似于Pascal 与Visual Basic,大部分的语句是Halcon提供的算子,此外也包含了少部分的控制语句;

不允许单独声明变量;

提供自动的内存管理(初始化、析构及OverWrite),但句柄则需要显示释放;

C++(算子模式)

通过代码导出,以C++为例,默认导出为算子型的语法结构,而非面向对象的;在此模式下,全部函数声明为全局类型,数据类型只需要用Hobject、HTuple两类类型进行声明;

C++(面向对象)

可以以面向对象的方式重写代码,也即利用类及类的成员函数;

在这种模式下,控制变量的类型仍未HTuple,而图形数据可以由多种类型,如HImage等;其他语言(略)

4、Halcon数据结构

两类参数:图形参数Iconic (image, region, XLD)与控制参数Control (string, integer, real, handle),在Halcon算子的参数中,依次为:输入图形参数、输出图形参数、输入控制参数、输出控制参数;并且其输入参数不会被算子改变。

图形参数Iconic:

Images

Multiple channels

Arbitrary region of interest

Multiple pixel types(byte, (u)int1/2/4,real, complex, direction, cyclic, vector_field) byte, uint2 //灰度图像的标准编码

int1, int2 //Difference of two images or derivates with integer precision(??)int4

//两幅灰度图的频谱

direction //图片边缘的梯度方向

real //边缘提取及特定灰度值的轮廓

complex //图片频率分布

cyclic //Assigning one "gray" value to each color(??)

vector_field //连续图形的光学流分布

Regions

Efficient data structure (runlength encoding)

Extensive set of operators

Fastest morphology on the market

图形编码中,需要了解row 和run 两个术语;也是Halcon Region存储的方式

E x tended L ine D escription (XLD)

Subpixel accurate line and edge detection

Generic point list based data structure

Handling of contours, polygons, lines, parallels, etc.

此外,Halcon支持的类型还包括图形元组、控制变量元组及句柄:

元组的概念,使得可以用一个变量传递数个对象,可以由重载后的函数来进行处理;图形元组的下标从1开始,控制变量元组下标从0开始;句柄则可以用来描述窗体、文件等等,句柄不能是常量。

5、Halcon语言

输入控制参数可以是表达式,但图形参数、输出参数均应为变量;

String类型变量由单引号’括起来;此外还有一些特殊字符;

Boolean型变量包括true ( = 1 )、false ( = 0 ) ;不为零的整数将被认为true;但绝大多数的Halcon函数接受字符串型的表达:’true’‘false’,而非逻辑型表达;

函数返回常量用于标识错误:

H_MSG_TRUE no error 2

H_MSG_FALSE l ogical false 3

H_MSG_FAIL operator did not succeed 5

可以放在try…catch…endtry块中,也可以用dev_error_var()与dev_set_check() 来捕获;

控制语句结构:(与一般语言略有不同,它们也有输入输出变量)

if ... endif / if ... else ... endif / if ... elseif ... else ... endif

for ... endfor

while ... endwhile

repeat ... until

此外,也有关键字break、continue、return、exit、stop 用来控制语句的执行;

赋值语句在Halcon中也被当作函数来使用:

标准赋值

assign(Expression, ResultVariable) //编辑形式,永远都是输入在前,输出在后 ResultVariable := Expression //代码形式

元组插入赋值

insert(Tuple, NewValue, Index, Tuple) //编辑形式

Tuple[Index] := NewValue //代码形式

控制变量元组操作

[t,t] concatenation of tuples

|t| number of elements

t[i] selection of an element

t[i:j] selection of a part of a tuple

subset(t1,t2) selection from t1 by indices in t2

图形元组操作对应函数

[] gen_empty_obj ()

|t| count_obj (p, num)

[t1,t2] concat_obj (p1, p2, q)

t[i] select_obj (p, q, i+1)

t[i:j] copy_obj (p, q, i+1, j-i+1)

subset(t1,t2) select_obj (p, q, t2+1)

元组的数学运算,如:A * B,令m = |A|, n = |B|;

若m、n不相等,且都大于1,则错误;否则返回三种情况:

m=n=1,返回一个值;

m=n>1,返回一个包含m个数的元组,值为两元组各对于值的操作结果;

m>1,n=1,返回一个包含m个数的元组,值为第二个数与第一元组各值的操作结果;Halcon 的数学运算

算术运算

a / a division

a % a rest of the integer division

a * a m ultiplication

v + v addition and concatenation of strings

a - a subtraction

-a negation

位运算

lsh(i,i) left shift

rsh(i,i) right shift

i band i bit-wise and

i bor i bit-wise or

i bxor i bit-wise xor

bnot i bit-wise complement

字符串操作

v$s conversion to string //字符串的格式化,有很丰富的参数 v + v concatenation of strings and addition

strchr(s,s) search character in string

strstr(s,s) search substring

strrchr(s,s) search character in string (reverse)

strrstr(s,s) search substring (reverse)

strlen(s) length of string

s{i} selection of one character

s{i:i} selection of substring

split(s,s) splitting to substrings

比较操作符

t < t less than

t > t greater than

t <= t less or equal

t >= t greater or equal

t = t equal

t # t not equal

逻辑操作符

not l negation

l and l logical ’and’

l or l logical ’or’

l xor l logical ’xor’

数学函数

sin(a) sine of a

cos(a) cosine of a

tan(a) tangent of a

asin(a) arc sine of a in the interval [-π/2, π/ 2], a ∈ [-1, 1]

acos(a) arc cosine a in the interval [-π/2, π/2], a ∈ [-1, 1]

atan(a) arc tangent a in the interval [-π/2, π/2], a ∈ [-1, 1]

atan2(a,b) arc tangent a/b in the interval [-π, π]

sinh(a) hyperbolic sine of a

cosh(a) hyperbolic cosine of a

tanh(a) hyperbolic tangent of a

exp(a) exponential function

log(a) natural logarithm, a> 0

log10(a) decade logarithm, a> 0

pow(a1,a2) power

ldexp(a1,a2) a1 pow(2,a2)

其他操作(统计、随机数、符号函数等)

min(t) minimum value of the tuple

max(t) maximum value of the tuple

min2(t1,t2) element-wise minimum of two tuples

max2(t1,t2) element-wise maximum of two tuples

find(t1,t2) indices of all occurrences of t1 within t2

rand(i) create random values from 0..1 (number specified by i)

sgn(a) element-wise sign of a tuple

sum(t) sum of all elements or string concatenation

cumul(t) cumulative histogram of a tuple

mean(a) mean value

deviation(a) standard deviation

sqrt(a) square root of a

deg(a) convert radians to degrees

rad(a) convert degrees to radians

real(a) convert integer to real

int(a) convert a real to integer

round(a) convert real to integer

number(v) convert string to a number

is_number(v) test if value is a number

abs(a) absolute value of a (integer or real)

fabs(a) absolute value of a (always real)

ceil(a) smallest integer value not smaller than a

floor(a) largest integer value not greater than a

fmod(a1,a2) fractional part of a1/a2, with the same sign as a1

sort(t) sorting in increasing order

uniq(t) eliminate duplicates of neighboring values(typically used in combination with sort)

sort_index(t) return index instead of values

median(t) Median value of a tuple (numbers)

select_rank(t,v) Select the element (number) with the given rank

inverse(t) reverse the order of the values

subset(t1,t2) selection from t1 by indices in t2

remove(t1,t2) Remove of values with the given indices

environment(s) value of an environment variable

ord(a) ASCII number of a character

chr(a) convert an ASCII number to a character

ords(s) ASCII number of a tuple of strings

chrt(i) convert a tuple of integers into a string

6、Halcon名称解释

Operator: A procedure of the HALCON library used in HDevelop or one of the language interfaces.

Procedure (of HDevelop): A subroutine defined for the use inside HDevelop.

Region: Result of a segmentation like threshold. In other systems called blob, area, binary image, or island. Implemented using runlength encoding.

XLD: Extended Line Description. Universal data structure used to handle contour based data. Mainly used in the context of subpixel precise measurement.

Domain: Part of the image which is used for processing. In other systems called ROI

(region of interest).

Channel: One image matrix of a multi-spectral image. One example is the red channel of an RGB image.

Iconic data: Overall term for images, regions, and XLD data. In object oriented languages (C++ and COM) and in HDevelop iconic data is represented by a polymorphic

data type. In object oriented languages iconic data is also called iconic object.

Control data: All non iconic data. Examples are single values (integer, real, and string), coordinates, arrays of values.

Tuple: an array of values where each element can be of a different type. One can have both iconic and control tuples.

HALCON object: Synonym for Iconic object / data

Image acquisition interface: Interface between the frame grabber /camera driver (SDK) and the HALCON library. The Image acquisition interface is a DLL which is dynamically

loaded when calling open_framegrabber.

Language interface: Software that enables the programmer to use the HALCON library in a given language (e.g., C++).

Extension Package: A mechanism that enables the user to fully integrate user-defined procedures into the HALCON environment. The extension package concept gives full

access to the internal data structures of HALCON.

License file: File “license.dat“ in the directory “license“. This file is used together with hardware components (dongle or Ethernet card) to check if a correct license is

available.

Help files: Files in the directory “help“ which are used to get online information about all HALCON operators. This is extensively used by HDevelop.

Shape-Based Matching: Finding of an object in an image based on a predefined model.

The shape based matching uses features to quickly locate objects very precisely.

Variation Model: A method to do print checking by presenting multiple good patterns to the system. The variation model learns the normal variation a good pattern and

based on this information can detect real defects.

Measure Tool: A set of operators to find the exact location of edges along lines or circular arcs. Other systems call the similar tool, e.g., caliper.

Accuracy: The deviation from the true value

Precision: The standard deviation of the measurement

7、Halcon函数

典型函数

Filtering (noise, smoothing, edge, bit, arithmetic, enhancement)

Segmentation (thresholding, topology, region growing, classification, comparison)

Region processing

Morphology

Feature extraction

Edge detection

Color processing and classification

OCR / OCV

Bar code / data code

Measurement

Rectification

Gray value matching

8、Halcon HDevEngine

HDevEngine允许用户在应用程序中直接调用Halcon程序(*.hdvp),适用范围包括C++、COM、.NET语言。具体功能为:

载入并执行Halcon程序(HDevelop programs)

载入、删除、执行HDevelop过程(HDevelop procedures)

查询以载入的HDevelop过程的接口

将正确的参数值传递给HDevelop过程,执行并获得结果

重新实现了HDevelop的某些内部算子(operator),例如dev_display

HDevEngine错误处理

在C++中,使用HDevEngine需要包括头文件#include "HDevEngineCpp.h",并包含附加的可执行文件hdevenginecpp.lib,具体见示例。

利用HDevEngine,可以很方便得实现多线程。

9、Halcon数据结构(2)

Halcon中,Image = Channel + Domain , 像素点存放在Channel矩阵中,根据ROI来描述Image。Image相关操作:

输入:从文件、从设备

生成:外部图像数据、空内存区域;

显示:disp_image()图像首通道灰度图;disp_color() 彩色图;disp_channel()某特定通道;disp_obj() 自动判别类别;

缩放:set_part() 设置显示区域;set_part_style() 设置显示参数;

3D显示:(略)

Rules to Display Gray Images没特别懂

边界点的处理:镜像、常数、延续、周期(略):

域的局限性:一些算子总是要处理周围的矩形区域,比如mean_image(),并且总是先处理小的区域;

测量工具中的ROIs比较特殊,这种ROIs并不依附于Image上,而是在算子gen_measure_*()后产生,并且也只能是任意朝向的矩形、圆弧形区域;

处理多通道图像:

分割:Gray operators仅适用第一通道,Color operators: 使用前三个通道,Multi channel operator会使用全部通道;

//对“Gray operators仅适用第一通道”的解释:实际上,灰度图,就是用第一通道

(Red)像素点值所构建出来的那幅图。

过滤:所有通道被处理时均使用相同的参数,并且结果的通道数与处理的图片相同;

可以将域的处理结果,与原图像结合在一起作为输入图像;

通道处理:count_channels(),decompose*(), compose*(), access_channel(), append_channel(), channels_to_image(), image_to_channels()

图像金字塔中,第一个图像为最大的图像,各图像有各自的区域

标准图形(Shape):circle、ellipse、rectangle1、rectangle2、line、polygon

特殊区域图形:gen_grid_region(): grid、lines、points, gen_checker_region()

图像处理:

修改:set_grayval() : Modify one or more pixels of the input image;paint_gray(): Paint part of an image into another image; overpaint_gray(): Paint part of an image into the

input image; paint_region(): Paint the region with a constant gray value into an image;

overpaint_region() : Paint the region with a constant gray value into the input image 复制:crop_part(): Crop a rectangle, given by upper left corner and size;

crop_rectangle1(): Crop a rectangle, given by upper left and lower right corner;

crop_domain(): Crop area of the smallest rectangle1 of the domain; crop_domain_rel():

Like crop_domain but with the possibility to change the size of bounding box;

change_format(): Limit the size of the image at the lower or the right part; get_grayval():

Access one or multiple pixel values

Tile: tile_images(), tile_images_offset(), tile_channels()

10、Halcon数据结构(3)

区域运算:

并:union1()、union2();

交:intersection();

差:difference();

补:complement();

图形显示参数设置:

显示模式:set_draw(); 参数:margin、filled

线宽线形:set_line_width(); set_line_style();

颜色:set_color(); set_colored(); set_rgb(); set_gray();

显示图形:set_shape(); 参数:original、outer circle、inner circle、rectangle1、rectangle2、ellipse、icon

set_icon

11、Halcon数据结构(4)

关于XLD,简要写一下:

图像均用像素点保存,而像素点是整型的,不连续的;Halcon做了拓展,定义了亚像素(subpixel)的对象:xld;其实xld已经用过了,比如提取边缘、构建轮廓等等,xld在模板匹配、图形校准等多方面有重要的用途。

12、色彩color

在视网膜底部,有三类感光细胞,它们分别探测不同频率的光,产生RGB神经冲动,并把这些神经冲动传递下去;经过另外的细胞的处理,转换成1个亮度通道、两个色彩通道。

The RGB stimulus is converted to a luminance and 2 chrominance channels

所以,RGB图是原始的感光图,而人眼的感觉,却不是RGB三通道的叠加;更直观地描述人的感觉,需要用到其他的色彩空间,比如hsv空间。

不同频率的光,会产生不同的颜色;而光只有三种颜色,这是因为人眼只有三种光感受器。所以有,任何光产生的颜色,都能够由这三种纯色来合成,这就是光的三元色。

对于相机来说,能够检测到的光谱范围比人眼要宽泛,比如红外相机等;为了获得人眼类似的图像,可以加上过滤装置,滤去超出400-700nm范围的光线。

13、色彩空间及Halcon颜色处理

CCD彩色相机有R、G、B三种感光芯片,捕捉不同颜色,然后转换为RGB三通道。

颜色空间:

RGB Red、Green、Blue三色通道,对光来说,犹如在黑暗中点亮各分色。

CMY Cyan、Magenta、Yellow 三颜色通道,犹如在白纸上图颜料

YUV、YIQ Y描述亮度、其余两通道描述颜色(的差值),用于电视转播

ARgYb 与上类似,A描述亮度,其余两者描述颜色差值

I1i2i3 与上类似,i1描述亮度

HSI Hue、Saturation、Intensity 分别描述颜色、饱和度、亮度

HSV 与上类似,这里的V描述亮度,方法与上不同

HSL 与HSI类似,L描述亮度,但Hue与之不同

HIS 与HIS类似

Uniform Color Space、CIE uv 用二维图描述色彩

CIE Lab 高级色彩空间,较少使用

颜色空间的转换,依靠GPU进行运算:trans_from_rgb(),速度快

Scale_image() 可以对单通道(RGB、或HSV中的)进行重新渲染;

颜色的选取,通过对Hue通道进行threshold()

2D Histogram 可用来描述两通道(RGB、HSV等中的)相应值对应关系,可用来选取颜色相近区域:histo_2dim()

N维像素分类:learn_ndim_norm()、learn_ndim_box()

LUT:MLP、SVM、GMM

彩色过滤器:用于彩色图像的分割等:edges_color()、edges_color_sub_pix()、lines_color()

14、Halcon 窗体

Halcon窗体的坐标系统:(Row, Column) (Width, Height)

图形:可以显示灰度图、彩色图、3D;定义要显示的区域,插值

区域:绘图模式(Fill、Margin),边界、线宽,定义色彩模式,自动图形转换绘图:点、线、xld等

halcon知识点

1. 无论读入什么图像,读入图像显示效果明显和原始图像不一致,哪怕是从相机读入的图像,也是明显颜色差异。什么原因引起? 初步诊断是,显示的时候调用的颜色查找表存在异常不是 default ,而是其它选项。此时可以通过查阅相关参数,调用set_system解决,也可以在编辑-》参数选择-》颜色查找表进行更改。 2. 裁剪图像;从图像上截取某段图像进行保存。如何实现该操作? 首先应该知道,region不具有单独构成图像的要素,他没有灰度值。有用过opencv的应该知道 ROI(感兴趣区域),设置好它后,对图像的大部分操作就转为图像的一个矩形区域内进行。类似的,halcon有domain 概念。首先设置好一个矩形区,然后使用 reduce_domain(是一个矩形区域)后,再使用crop_domain 就裁剪出图像。 3. 读入bmp,或tiff 图像显示该图不是bmp文件或不能读。原因是什么? 这个常有新手询问,画图,图像管理器都能打开,又或者是相机采集完直接存到硬盘。Halcon 读取图像在windows下面到最后是调用windows库函数实现读图功能。咱不清楚到底是怎么调用的。对于图像格式,在读图函数F1说明很细。基本 bmp 如果文件头不是bw还是bm(百度百科bmp格式查找,编写此处时无网络,后续可能忘记),就读不进来。其他规格欢迎补充。解决办法,如果是相机采集,就在内存直接转换(参见 halcon到VC.pdf 里面的halcon和bitmap互转);如果是采完的图片,大部分通过画图工具转换为 24位bmp格式,即可解决。 4.读入avi文件报错。

Halcon 通过 directshow或另一个格式解析视频,正常来说应该可以读入市面大部分视频,实际测试发现只能读入最标准的avi文件格式。如果需要临时处理,需要下格式工厂等工具转化为最标准的avi文件格式(论坛叶诺有发帖说明)。 5. Region 或 xld 筛选。 Halcon提供了丰富的region 和xld筛选方法。Region可以使用select_shape_xld,选择出符合要求的区域,如果不能满足还可以通过类似 region feature 这样关键字组合成的算子获取区域特征,然后通过 tuple 排序或相加减,再通过 tuple_find 确定是对应哪个区域的特征。同样的halcon也提供了 select_contours_xld 进行轮廓筛选。 6. Halcon分几类对象,每个类的功用是? Halcon总分俩大类,tuple和图标对象obj 。Tuple涵盖了对所有基础数据类型的封装,可以理解为她是halcon定义的数组类。Obj 是alcon定义图标类基类。衍生出了许多类型,其中 Region ,Xld,Image 其中最主要的类型。 7. F1说明,参数部分 -array 是什么意思? 该符号说明,该参数接受一组输入,对tuple就是一组tuple,对obj 就是通过concat_obj 或其它操作产生的一组obj元组。 8. 俩个相对方形物体的距离计算。 如果这俩个物体和背景对比清晰,最近的距离在俩条边下则可以再预处理之后进行如下操作:

HALCON形状匹配总结

HALCON形状匹配总结 Halcon有三种模板匹配方法:即Component-Based、Gray-Value-Based、Shaped_based,分别是基于组件(或成分、元素)的匹配,基于灰度值的匹配和基于形状的匹配,此外还有变形匹配和三维模型匹配也是分属于前面的大类 本文只对形状匹配做简要说明和补充: Shape_Based匹配方法: 上图介绍的是形状匹配做法的一般流程及模板制作的两种 方法。 先要补充点知识:形状匹配常见的有四种情况一般形状匹配模板shape_model、线性变形匹配模板 planar_deformable_model、局部可变形模板 local_deformable_model、和比例缩放模板Scale_model 第一种是不支持投影变形的模板匹配,但是速度是最高的,第二种和第四种是支持投影变形的匹配,第三种则是支持局部变形的匹配。 一般形状匹配模板是最常用的,模板的形状和大小一经制作完毕便不再改变,在查找模板的过程中,只会改变模板的方向和位置等来匹配目标图像中的图像。这个方法查找速度很快,但是当目标图像中与模板对应的图像存在比例放大缩小

或是投影变形如倾斜等,均会影响查找结果。涉及到的算子通常为create_shape_model 和find_shape_model 线性变形匹配模板planar_deformable_model是指模板在行列方向上可以进行适当的缩放。行列方向上可以分别独立的进行一个适当的缩放变形来匹配。主要参数有行列方向查找缩放比例、图像金字塔、行列方向匹配分数(指可接受的匹配分数,大于这个值就接受,小于它就舍弃)、设置超找的角度、已经超找结果后得到的位置和匹配分数 线性变形匹配又分为两种:带标定的可变形模板匹配和不带标定的可变形模板匹配。涉及到的算子有: 不带标定的模板:创建和查找模板算子 create_planar_uncalib_deformable_model和 find_planar_uncalib_deformable_model 带标定模板的匹配:先读入摄像机内参和外参 read_cam_par 和read_pose 创建和查找模板算子create_planar_calib_deformable_model和 find_planar_calib_deformable_model 局部变形模板是指在一张图上查找模板的时候,可以改变模板的尺寸,来查找图像上具有局部变形的模板。例如包装纸袋上图案查找。参数和线性变形额差不多 算子如下:create_local_deformable_model和 find_local_deformable_model

Halcon学习之七:改变图像的现实方式和大小

change_format ( Image : ImagePart : Width, Height : ) 改变Image图像大小,而且ImagePart图像为灰度值图像。 crop_domain ( Image : ImagePart : : ) 从Image图像中裁剪一个矩形区域。这个矩形的周长最小。 crop_domain_rel ( Image : ImagePart : Top, Left, Bottom, Right : ) 删除相关区域,Top为顶端裁剪的行数,Left,Bottom,Right类似。 crop_part ( Image : ImagePart : Row, Column, Width, Height : ) 删除一个矩形图像区域。Row为右上角的列标索引。Width, Height为新图像ImagePart的宽度和高度。crop_rectangle1 ( Image : ImagePart : Row1, Column1, Row2, Column2 : ) 删除一个矩形图像区域。 tile_channels ( Image : TiledImage : NumColumns, TileOrder : ) 将多通道图像平铺为一幅大的单通道图像。NumColumns为平铺的列数。TileOrder为平铺的方式。tile_images ( Images : TiledImage : NumColumns, TileOrder : ) 将多通道平铺。 程序: [c-sharp] view plaincopyprint?read_image (Image, 'G:/Halcon/机器视觉 /images/brycecanyon1.png') get_image_pointer1 (Image, Pointer, Type, Width, Height) change_format (Image, ImagePart, Width/2, Height/2) crop_domain (Image, ImagePart1) crop_domain_rel (ImagePart1, ImagePart2, -20, -20, -1, -1) crop_part (ImagePart2, ImagePart3, 100, 100, Width, Height) crop_rectangle1 (ImagePart3, ImagePart4, 100, 100, 200, 200) tile_channels (Image, TiledImage, 2, 'horizontal') tile_images (Image, TiledImage1, 1, 'vertical') tile_images_offset (Image, TiledImage2, 0, 0, 50, 50, -1, -1, Width, Height)

Halcon学习之八:图像区域叠加与绘制

Halcon學習之八:圖像區域疊加與繪制 overpaint_gray ( ImageDestination, ImageSource : : : ) 將灰度值不相同區域用不同顏色繪制到ImageDestination中,ImageSource包含希望的灰度值圖像 overpaint_region ( Image, Region : : Grayval, Type : ) 將Region以一個恆定的灰度值繪制到Image圖像中 paint_gray ( ImageSource, ImageDestination : MixedImage : : ) 將ImageSource的圖像繪制到ImageDestination中,形成MixedImage。 paint_region ( Region, Image : ImageResult : Grayval, Type : ) 將Region以一個恆定的灰度值繪制到Image圖像中 paint_xld ( XLD, Image : ImageResult : Grayval : ) 將XLD以一個恆定的灰度值繪制到Image圖像中 set_grayval ( Image : : Row, Column, Grayval : ) 設置Image圖像中坐標為(Row,Column)的灰度值 程序: [c-sharp]view plaincopy 1read_image (Image, 'G:/Halcon/images/images/claudia.png') 2gen_circle (Circle, 200, 200, 100.5) 3reduce_domain (Image, Circle, ImageReduced) 4gen_image_proto (Image, ImageCleared, 32) 5overpaint_gray (ImageCleared, ImageReduced) 6gen_image_const (Image1, 'byte', 512, 512) 7overpaint_region (Image1, Circle, 255, 'fill') 8* /* Copy a circular part of the image into the image : */ 9read_image (Image2, 'G:/Halcon/images/images/brycecanyon1.png') 10paint_gray (ImageReduced, Image2, MixedImage) 11* /* Paint a rectangle into the image */ 12read_image (Image3, 'G:/Halcon/images/images/pads.png') 13gen_rectangle1 (Rectangle1, 30, 20, 100, 200) 14paint_region (Rectangle1, Image3, ImageResult, 255, 'fill') 15* /* Paint colored xld objects into a gray image */ 16* /* read and copy image to generate a three channel image */ 17copy_image (Image2, image0) 18copy_image (Image2, image1)

HALCON算子函数整理10 Matching-3D

HALCON算子函数——Chapter 10 : Matching-3D 1. affine_trans_object_model_3d 功能:把一个任意有限3D变换用于一个3D目标模型。 2. clear_all_object_model_3d 功能:释放所有3D目标模型的内存。 3. clear_all_shape_model_3d 功能:释放所有3D轮廓模型的内存。 4. clear_object_model_3d 功能:释放一个3D目标模型的内存。 5. clear_shape_model_3d_ 功能:释放一个3D轮廓模型的内存。 6. convert_point_3d_cart_to_spher 功能:把直角坐标系中的一个3D点转变为极坐标。 7. convert_point_3d_spher_to_cart 功能:把极坐标中的一个3D点转变为直角坐标。 8. create_cam_pose_look_at_point 功能:从摄像机中心和观察方向创建一个3D摄像机位置。 9. create_shape_model_3d 功能:为匹配准备一个3D目标模型。 10. find_shape_model_3d 功能:在一个图像中找出一个3D模型的最佳匹配。 11. get_object_model_3d_params

功能:返回一个3D目标模型的参数。 12. get_shape_model_3d_contours 功能:返回一个3D轮廓模型视图的轮廓表示。 13. get_shape_model_3d_params 功能:返回一个3D轮廓模型的参数。 14. project_object_model_3d 功能:把一个3D目标模型的边缘投影到图像坐标中。 15. project_shape_model_3d 功能:把一个3D轮廓模型的边缘投影到图像坐标中。 16. read_object_model_3d_dxf 功能:从一个DXF文件中读取一个3D目标模型。 17. read_shape_model_3d 功能:从一个文件中读取一个3D轮廓模型。 18. trans_pose_shape_model_3d 功能:把一个3D目标模型的坐标系中的位置转变为一个3D轮廓模型的参考坐标系中的位 置,反之亦然。 19. write_shape_model_3d 功能:向一个文件写入一个3D轮廓模型。

Halcon学习之四:有关图像生成的函数

Halcon学习之四:有关图像生成的函数 1、copy_image ( Image : DupImage : : ) 复制image图像 2、region_to_bin ( Region : BinImage : ForegroundGray, BackgroundGray,Width, Height : ) 将区域Region转换为一幅二进制图像BinImage。 ForegroundGray, BackgroundGray分别为前景色灰度值和背景色灰度值。Width, Height为Region的宽度和高度。 3、region_to_label ( Region : ImageLabel : Type, Width, Height : ) 将区域Region转换为一幅Lable图像ImageLabel。 Type为imagelabel的类型。 Width, Height为Region的宽度和高度。 4、region_to_mean ( Regions, Image : ImageMean : : ) 绘制ImageMean图像,将其灰度值设置为Regions和Image的平均灰度值。相关例子: [c-sharp]view plaincopyprint? 1.* 读取图像 2.read_image (Image, 'G:/Halcon/机器视觉 /images/bin_switch/bin_switch_2.png') 3.* 复制图像 4.copy_image (Image, DupImage) 5.* 区域生长算法

6.regiongrowing (Image, Regions, 3, 3, 1, 100) 7.* 生成ImageMean 8.region_to_mean (Regions, Image, ImageMean) 9.* 将Region转换为二进制图像 10.r egion_to_bin (Regions, BinImage, 255, 0, 512, 512) 11.*将Region转换为Label图像 12.r egion_to_label (Regions, ImageLabel, 'int4', 512, 512)

机器视觉之Halcon算子--区域特征

H a l c o n算子--区域特征 当我们想要提取Region时,图像处理后,往往存在几个类似的Region,此时,需要根据Region的一 些特殊特征,来选择指定的Region。 求Region指定特征值:region_features(Regions : : Features : Value) 根据特征值选择区域:select_shape(Regions : SelectedRegions : Features, Operation, Min, Max : ) Region特征一览: 特征英译备注area Area of the object 对象的面积 row Row index of the center 中心点的行坐标 column Column index of the center 中心点的列坐标 width Width of the region 区域的宽度 height Height of the region 区域的高度 row1 Row index of upper left corner 左上角行坐标 column1 Column index of upper left corner 左上角列坐标 row2 Row index of lower right corner 右下角行坐标 column2 Column index of lower right corner 右下角列坐标 circularity Circularity 圆度0~1 compactness Compactness 紧密度0~1 contlength Total length of contour 轮廓线总长 convexity Convexity 凸性 rectangularity Rectangularity 矩形度0~1 ra Main radius of the equivalent ellipse 等效椭圆长轴半径长度 rb Secondary radius of the equivalent ellipse 等效椭圆短轴半径长度 phi Orientation of the equivalent ellipse 等效椭圆方向 anisometry Anisometry 椭圆参数,Ra/Rb长轴与短轴的比值 bulkiness Bulkiness 椭圆参数,蓬松度π*Ra*Rb/A struct_factor Structur Factor? 椭圆参数, Anisometry*Bulkiness-1

Halcon学习笔记

Halcon学习笔记 1、Halcon的自我描述 Program Logic Each program consists of a sequence of HALCON operators The program can be structured into procedures The sequence can be extended by using control operators like if, for, repeat, or while The results of the operators are passed via variables No implicit data passing is applied Input parameters of operators can be variables or expressions Output parameters are always variables HDevelop has no features to design a graphical user interface An HDevelop program is considered as a prototypic solution of the vision part of an application HDevelop is typically not used for the final application 由此可以看出,Halcon的定位是一个类库,有着完整、快速实现函数,同时提供了HDevelop 作为快速开发的图形化(IDE)界面;但是,Halcon程序并不是一个完整的最终应用软件,它没有用户界面,也不提供显示的数据(公用的数据格式)。 Halcon的初学者也应当从参考Halcon的程序入手,熟悉Halcon类库,也即HDevelop-Based Programming;在此基础上,进入ORClass-Oriented Programming。这也是Halcon推荐的开发方式: The vision part is solved with HDevelop,and the application is developed with C++ or Visual Basic。 2、HDevelop界面的学习 通过阅读Halcon的PPT,学到了下面一些有用的信息: 文件——浏览示例,可以看到很多有用的例子; 程序窗体中,可以浏览与编辑Procedues(过程),这个其实就是自定义函数咯~还可以自己修改这些过程,并添加说明文档; F4——将函数语句注释掉;F3——激活; 本地过程(Local Procedue)与外部过程(Externel Procedue) 3、基本语法结构 Halcon的语法结构 类似于Pascal 与Visual Basic,大部分的语句是Halcon提供的算子,此外也包含了少部分的控制语句; 不允许单独声明变量; 提供自动的内存管理(初始化、析构及OverWrite),但句柄则需要显示释放; C++(算子模式) 通过代码导出,以C++为例,默认导出为算子型的语法结构,而非面向对象的;在此模式下,全部函数声明为全局类型,数据类型只需要用Hobject、HTuple两类类型进行声明; C++(面向对象) 可以以面向对象的方式重写代码,也即利用类及类的成员函数; 在这种模式下,控制变量的类型仍未HTuple,而图形数据可以由多种类型,如HImage等;其他语言(略)

halcon基础数据类型详解

halcon基础数据类型详解 #if defined(__CHAR_UNSIGNED__) || defined(__sgi) #define INT1 signed char /* integer, signed 1 Byte */ #define INT1_MIN SCHAR_MIN #define INT1_MAX SCHAR_MAX #else #define INT1 char /* integer, signed 1 Byte */ #define INT1_MIN CHAR_MIN #define INT1_MAX CHAR_MAX #endif #define UINT1 unsigned char /* integer, unsigned 1 Byte */ #define UINT1_MIN 0 #define UINT1_MAX UCHAR_MAX #define LONG_FORMAT _INT64_FORMAT typedef INT4_8 Hlong; typedef UINT4_8 Hulong; 看粗体部分,可以看到Hlong型在32位的机器上其实就是long型代表4个字节32位,在64位机器上有另一种定义 再来看看halcon中最重要的数据类型HTuple,在C++里面,halcon将HTuple类型封 装了类,其始祖类HRootObject,这个类相当于MFC里面的CObject,halcon从HRootObject 派生了HBaseArray,当然这两个类是虚基类,有一些方法需要我HTuple自己实现,当然也 有一些方法可以直接用的。这两个类在HCPPUtil里,可以看看。 HTuple类就是从HBaseArray派生,元组基类,相当于数组,具有如下的构造函数: HTuple(int l); HTuple(float f); HTuple(double d); HTuple(constchar *s);

HALCON算子函数Chapter 16:System

HALCON算子函數——Chapter 16 : System 16.1 Database 1. count_relation 功能:在HALCON數據庫中實體的數目。 2. get_modules 功能:查詢已使用模塊和模塊關鍵碼。 3. reset_obj_db 功能:HALCON系統的初始化。 16.2 Error-Handling 1. get_check 功能:HALCON控制模式的說明。 2. get_error_text 功能:查詢HALCON錯誤測試後錯誤數目。3. get_spy 功能:HALCON調試工具當前配置。 4. query_spy 功能:查詢HALCON調試工具可能的設置。5. set_check 功能:激活和鈍化HALCON控制模式。

6. set_spy 功能:HALCON調試工具的控制。 16.3 Information 1. get_chapter_info 功能:獲取程序有關章節的信息。 2. get_keywords 功能:獲取指定給程序的關鍵字。 3. get_operator_info 功能:獲取關於HALCON程序的信息。 4. get_operator_name 功能:獲取由給定字符串作為它們的名字的程序。 5. get_param_info 功能:獲取關於程序參數的信息。 6. get_param_names 功能:獲取一個HALCON程序參數的名字。 7. get_param_num 功能:獲取一個HALCON程序不同參數類的數目。 8. get_param_types 功能:獲取一個HALCON程序控制參數的缺省數據類型。

HALCON中filter函数

HALCON算子函数——Chapter 5 : Filter 5.1 Arithmetic 1. abs_image 功能:计算一个图像的绝对值(模数)。 2. add_image 功能:使两个图像相加。 3. div_image 功能:使两个图像相除。 4. invert_image 功能:使一个图像反像。 5. max_image 功能:按像素计算两个图像的最大值。 6. min_image 功能:按像素计算两个图像的最大小值。 7. mult_image 功能:使两个图像相乘。 8. scale_image 功能:为一个图像的灰度值分级。 9. sqrt_image 功能:计算一个图像的平方根。 10. sub_image 功能:使两个图像相减。 5.2 Bit 1. bit_and 功能:输入图像的所有像素的逐位与。 2. bit_lshift 功能:图像的所有像素的左移。3 . bit_mask 功能:使用位掩码的每个像素的逻辑与。 4. bit_not 功能:对像素的所有位求补。 5. bit_or 功能:输入图像的所有像素的逐位或。 6. bit_rshift 功能:图像的所有像素的右移。 7. bit_slice 功能:从像素中提取一位。 8. bit_xor 功能:输入图像的所有像素的逐位异或。5.3 Color

1. cfa_to_rgb 功能:把一个单通道颜色滤波阵列图像变成RGB图像。 2. gen_principal_comp_trans 功能:计算多通道图像的主要部分分析的转换矩阵。 3. linear_trans_color 功能:计算多通道图像的颜色值的一个仿射转换。 4. principal_comp 功能:计算多通道图像的主要部分。 5. rgb1_to_gray 功能:把一个RGB图像转变成一个灰度图像。 6. rgb3_to_gray 功能:把一个RGB图像转变成一个灰度图像。 7. trans_from_rgb 功能:把一个图像从RGB颜色空间转变成任意颜色空间。 8. trans_to_rgb 功能:把一个图像从任意颜色空间转变成RGB颜色空间。 5.4 Edges 1.close_edges 功能:使用边缘幅值图像消除边缘缺陷。 2. close_edges_length 功能:使用边缘幅值图像消除边缘缺陷。 3. derivate_gauss 功能:用高斯派生物对一个图像卷积。 4. diff_of_gauss 功能:近似高斯的拉普拉斯算子。 5. edges_color 功能:使用Canny、Deriche或者_Shen_滤波器提取颜色边缘。 6. edges_color_sub_pix 功能:使用Canny、Deriche或者_Shen_滤波器提取子像素精确颜色边缘。 7. edges_image 功能:使用Deriche、_Lanser、Shen或者_Canny滤

Halcon学习之边缘检测函数

Halcon学习之边缘检测函数 sobel_amp ( Image : EdgeAmplitude : FilterType, Size : )根据图像的一次导数计算图像的边缘 close_edges ( Edges, EdgeImage : RegionResult : MinAmplitude : ) close_edges_length( Edges, Gradient : ClosedEdges : MinAmplitude, MaxGapLength : ) 使用边缘高度图像关闭边缘间隙。输出的区域包含杯关闭的区域。(感觉是对边缘的扩充) derivate_gauss( Image : DerivGauss : Sigma, Component : ) watersheds( Image : Basins, Watersheds : : )从图像中提取风水岭。 zero_crossing( Image : RegionCrossing : : )零交点(二次导数) diff_of_gauss( Image : DiffOfGauss : Sigma, SigFactor : )近似日志算子(拉普拉斯高斯)。 laplace_of_gauss ( Image : ImageLaplace : Sigma : ) 拉普拉斯高斯edges_color_sub_pix ( Image : Edges : Filter, Alpha, Low, High : )精确的亚像素边缘提取(彩色图像) edges_sub_pix ( Image : Edges : Filter, Alpha, Low, High : ) 精确边缘提取的亚像素(灰度图像) edges_color ( Image : ImaAmp, ImaDir : Filter, Alpha, NMS, Low, High : )根据颜色进行边缘提取 edges_image ( Image : ImaAmp, ImaDir : Filter, Alpha, NMS, Low, High : )边缘提取 skeleton ( Region : Skeleton : : )计算区域的框架Skeleton == Region

跟我学机器视觉-HALCON学习例程中文详解-QQ摄像头读取条码

跟我学机器视觉-HALCON学习例程中文详解-QQ摄像头读取条码 第一步:插入QQ摄像头,安装好驱动(有的可能免驱动) 第二步:打开HDevelop,点击助手—打开新的Image Acquisition—选中图像获取接口(I),然后点击检测,找到摄像头。如下图: 第三步:点击连接,将颜色空间设置为gray,然后点击实时,此时图像窗口中将显示采集到的图像,将物体放置到摄像头前,位置调至条码清晰。如下图:

集,点击插入代码,此时程序编辑器中将自动生成代码,如下图:

这时单击下运行按钮,将会采集一副图像并显示到图形窗口中。接下来我们将开始条码读取的工作。 第五步:在Do Something后插入如下代码: create_bar_code_model ([ ], [ ], BarCodeHandle) *由于不知道条码是何类型,因此条码类型设置为auto。CodeTypes := ['auto'] find_bar_code (Image, SymbolRegions, BarCodeHandle, CodeTypes, DecodedDataStrings) get_bar_code_result (BarCodeHandle, 'all', 'decoded_types', DecodedDataTypes) 这时再重新运行程序,只要图像清晰,此时就可以读到条码了。条码区域会变成红色,而且在变量窗口中可以查到读取的条码类型和内容。如下图:

第六步:我们再添加代码,将读取结果直接显示在图像窗口中。 disp_message (WindowHandle, DecodedDataTypes[0]+': '+DecodedDataStrings[0], 'image', 100, 160, 'forest green', 'true') 此时会提示错误WindowHandle未被初始化。 *获取更多课程请Q智达工控学院:1613985351 因为图像采集助手会自动打开一个窗口,因此我们先将它关闭,然后自己创建一个窗口。在程序最开始加上这两句代码: dev_close_window () dev_open_window (0, 0, 512, 512, 'black', WindowHandle) 再重新运行程序,此时在读取到的条码在图像中写出来了。如下图:

halcon常用算法

1、read_image (Image, 'F:/image/001.bmp') 读入图像 2、threshold (Image, region, 100, 200) 阈值分割,获取区域 3、dev_close_window() 关闭当前图形窗口 4、dev_open_window (0, 0, 640, 480, 'black', WindowHandle) 打开一个新的图像窗口 5、decompose3 (Image, Red, Green, Blue) 三通道图像转换成三幅单通道图像 5.5、compose3(Red, Green, Blue, Image) 三幅单通道图像组合为三通道图像 6、connection (Region, ConnectedRegions) 将像素有相连的区域合并成一个元素element 7、count_obj(ConnectedRegions, Number) 计算元素element的个数 8、select_shape(Regions, SelectedRegions, Features, Operation, Min, Max) select_shape (ConnectedRegions,SelectedRegions,['area','anisometry'], 'and', [500,1.0], [50000,1 .7]) 连通域形状的选择 circularity:表示环状;充实度 roundness:圆度 9、dev_set_color('red') 设定输出的颜色 10、dev_set_draw ('margin') 或者 dev_set_draw ('fill') 确定区域填充模式 11、get_image_size (Image, Width, Height) 得到图像的宽度和高度 12、get_image_pointer1 (Image_slanted, Pointer, Type, Width, Height) 设定Pointer指向Image_slanted的起点位置。 13、dev_set_part (0, 0, Height-1, Width-1) 设定图像需要显示的范围 14、dev_display (Image_slanted) 显示图像 15、disp_continue_message(WindowHandle, 'blue', 'false') 等待用户操作是否继续stop () 16、projective_trans_image (Image_slanted, Image_rectified, HomMat2D, 'bilinear', 'false', 'false') 将投影变换应用于一幅图像中。 17、dev_set_line_width (5) 为区域轮廓线设定线宽 18、disp_message (WindowHandle, 'Decoded string: ', 'window', -1, -1, 'black', 'true') 程序写一个文本信息 19、union_collinear_contours_xld 合并在同一直线的XLD union_cocircular_contours_xld 合并在同圆的XLD union_adjacent_contours_xld 合并邻近的XLD 20、fit_line_contour_xld 拟合直线 21、trans_from_rgb(Rimage,Gimage,Bimage,Image1,Image2,Image3,'hsv') rgb颜色空间图像转换到hsv颜色空间图像 22、trans_to_rgb(Image1,Image2,Image3,ImageRed,ImageGreen,ImageBlue,'hsv') hsv颜色空间图像转换到rgb颜色空间图像 23、set_display_font (WindowID, 20, 'mono', 'true', 'false') 设置字体(bottle.hdev) 24、fill_up_shape (RawSegmentation, RemovedNoise, 'area', 1, 5) 根据给定的形状特征填补区域中的不足 25、opening_circle (RemovedNoise, ThickStructures, 2.5) 以半径为2.5像素先腐蚀再膨胀,开运算去除小区域。 26、fill_up (ThickStructures, Solid) 填补区域中的空洞 27、intersection (ConnectedPatterns, ThickStructures, NumberCandidates) 求两个区域的交集然后输出,求ConnectedPatterns区域和ThickStructures 区域的交集,输出 NumberCandidates 28、dev_set_shape ('rectangle1') 设置外接矩形 29、distance_lr (SelectedRegions, Row1, Col1, Row2, Col2, DistanceMin, DistanceMax) 计算直线和区域之间的距离,出现最小距离和最大距离 30、disp_line (WindowID, Row1, Col+100, Row2, Col) 绘制直线段( Col+100, Row1)为起点,(Col, Row2)为终点

Halcon学习(1)读取多张图片

Halcon学习(一)读取多张图片 从今天开始每天学习halcon软件。本博客中所用版本均为halcon11.0。 第一种方法 ImagePath:=[] ImagePath[0]:='E:/images1/a000.bmp' ImagePath[1]:='E:/images1/a001.bmp' ImagePath[2]:='E:/images1/a002.bmp' ImagePath[3]:='E:/images1/a003.bmp' ImagePath[4]:='E:/images1/a004.bmp' ImagePath[5]:='E:/images1/a005.bmp' ImagePath[6]:='E:/images1/a006.bmp' ImagePath[7]:='E:/images1/a007.bmp' for i:=0 to 7 by 1 read_image(Image,ImagePath[i]) endfor 第二种方法 for i:=0 to 7 by 1 read_image(Image,'E:/images1/'+i+'.bmp') endfor 第三种方法 NumImages :=8 for I :=1 to NumImages-1 by 1 read_image (Image, ' E:/images1/a ' + I$'03d') endfor 第四种方法(读取一个文件夹下的所有图片) 【助手】》【打开新的image acquisition 】》【图像助手】》【选择路径】》【代码生成】》【插入代码】 洒下的是汗水,收获的是虚空 dev_update_pc ( DisplayMode) 设置程序是否总在前面,对置顶有作用(不支持C++代码) dev_update_window (DisplayMode) 默认状态下所有的对象(图像,区域,或XLD)都在活动图形窗口显示。可以用OFF关闭此模式(不支持C++代码) dev_update_var (DisplayMode) 默认状态下系统变量窗口的所

HALCON 算子函数 整理 1-19章

halcon算子中文解释 comment ( : : Comment : ) 注释语句 exit ( : : : ) 退出函数 open_file ( : : FileName, FileType : FileHandle ) 创建('output' or 'append' )或者打开(output )文本文件 fwrite_string ( : : FileHandle, String : ) 写入string dev_close_window ( : : : ) 关闭活跃的图形窗口。 read_image ( : Image : FileName : ) ;加载图片 get_image_pointer1 ( Image : : : Pointer, Type, Width, Height ) 获得图像的数据。如:类型(= ' 字节',' ' ',uint2 int2 等等) 和图像的尺寸( 的宽度和高度) dev_open_window( : :Row,Column,WidthHeight,Background :WindowHandle ) 打开一个图形的窗口。 dev_set_part ( : : Row1, Column1, Row2, Column2 : ) 修改图像显示的位置 dev_set_draw (’fill’)填满选择的区域 dev_set_draw (’margin’)显示的对象只有边缘线, dev_set_line_width (3) 线宽用Line Width 指定 threshold ( Image : Region : MinGray, MaxGray : ) 选取从输入图像灰度值的g 满足下列条件:MinGray < = g < = MaxGray 的像素。 dev_set_colored (number) 显示region 是用到的颜色数目 dev_set_color ( : : ColorName : ) 指定颜色 connection ( Region : ConnectedRegions : : ) 合并所有选定像素触摸相互连通区 fill_up ( Region : RegionFillUp : : ) 填补选择区域中空洞的部分 fill_up_shape ( Region : RegionFillUp : Feature, Min, Max : ) select_shape ( Regions : SelectedRegions : Features, Operation, Min, Max : ) 选择带有某些特征的区域,Operation 是运算,如“与”“或” smallest_rectangle1 ( Regions : : : Row1, Column1, Row2, Column2 ) 以矩形像素坐标的角落,Column1,Row2(Row1,Column2) 计算矩形区域( 平行输入坐标轴) 。 dev_display ( Object : : : ) 显示图片 disp_rectangle1 ( : : WindowHandle, Row1, Column1, Row2, Column2 : ) 显示的矩形排列成的。disp_rectangle1 显示一个或多个矩形窗口的产量。描述一个矩形左上角(Row1,Column1) 和右下角(Row2,Column2) 。显示效果如图1. texture_laws ( Image : ImageT exture : FilterTypes, Shift, FilterSize : ) texture_laws 实行纹理变换图像FilterTypes: 预置的过滤器Shift :减少灰度变化FilterSize :过滤的尺寸 mean_image ( Image : ImageMean : MaskWidth, MaskHeight : ) 平滑图像, 原始灰度值的平均数MaskWidth: 过滤器的宽度面具 bin_threshold ( Image : Region : : ) 自动确定阈值 Region: 黑暗的区域的图像 dyn_threshold ( OrigImage, ThresholdImage : RegionDynThresh : Offset, LightDark : ) 比较两个像素的图像像素RegionDynThresh(Out) 分割区域Offset: 减少噪音引起的问题LightDark 提取光明、黑暗或类似的地方? dilation_circle ( Region : RegionDilation : Radius : ) 扩张有一个圆形结构元素的地区Radius 圆半径 complement ( Region : RegionComplement : : ) 返还补充的区域 reduce_domain ( Image, Region : ImageReduced : : ) 减少定义领域的图像

相关文档
相关文档 最新文档