如何制作HALCON标定靶

来源:互联网 发布:淘宝客公众号系统搭建 编辑:程序博客网 时间:2024/06/10 12:53

如何利用HALCON算子生成HALCON标定靶


以上标靶使用算子

gen_caltab (7, 7, 0.01, 0.5, 'E:/临时存储/caltab.descr','E:/临时存储/caltab.ps')算子生成

假设设置如下参数

gen_caltab (xNum, yNum, MarkDist,DiameterRatio, 'E:/临时存储/caltab.descr', 'E:/临时存储/caltab.ps')

Parameter:

标靶以重心(质心)为原点,也就是中心圆的圆心为原点,x方向向右,y方向向下,单位为米;

xNum:x方向的圆点数目;

yNum:y方向的圆点数目;

MarkDist:圆与圆之间的距离;

DiameterRatio:圆直径占圆心距的比例,也就是Diameter=MarkDist* DiameterRatio,

半径Radius= MarkDist* DiameterRatio/2;

黑色边框的宽度= MarkDist/4;

三角形的两个角点(需要将斜边延长与外边框相交)坐标分别为

(-(xNum+1)* MarkDist/2,-(yNum-1)* MarkDist/2)和(-(xNum-1)* MarkDist/2,-(yNum+1)* MarkDist/2)

 

针对以上标靶,HALCON自带表述文件如下:

# Plate Description Version 2

# HALCON Version 11.0 --  Fri May 01 21:14:44 2015

# Description of the standard calibrationplate

# used for the camera calibration in HALCON

# (generated by gen_caltab)

#

#

 

# 7 rows x 7 columns

# Width, height of calibration plate[meter]: 0.08, 0.08

# Distance between mark centers [meter]:0.01

 

# Number of marks in y-dimension (rows)

r 7

 

# Number of marks in x-dimension (columns)

c 7

 

#   offsetof coordinate system in z-dimension [meter] (optional):

z 0

 

# Rectangular border (rim and black frame)of calibration plate

#  rim of the calibration plate (min x, max y, max x, min y) [meter]:

o -0.041 0.041 0.041 -0.041

#  outer border of the black frame (min x, max y, max x, min y) [meter]:

i -0.04 0.04 0.04 -0.04

#  triangular corner mark given by two corner points (x,y, x,y) [meter]

#  (optional):

t -0.04 -0.03 -0.03 -0.04

 

#  width of the black frame [meter]:

w 0.0025

 

# calibration marks:  x y radius [meter]

 

# calibration marks at y = -0.03 m

-0.03 -0.03 0.0025

-0.02 -0.03 0.0025

-0.01 -0.03 0.0025

0 -0.03 0.0025

0.01 -0.03 0.0025

0.02 -0.03 0.0025

0.03 -0.03 0.0025

 

# calibration marks at y = -0.02 m

-0.03 -0.02 0.0025

-0.02 -0.02 0.0025

-0.01 -0.02 0.0025

0 -0.02 0.0025

0.01 -0.02 0.0025

0.02 -0.02 0.0025

0.03 -0.02 0.0025

 

# calibration marks at y = -0.01 m

-0.03 -0.01 0.0025

-0.02 -0.01 0.0025

-0.01 -0.01 0.0025

0 -0.01 0.0025

0.01 -0.01 0.0025

0.02 -0.01 0.0025

0.03 -0.01 0.0025

 

# calibration marks at y = 0 m

-0.03 0 0.0025

-0.02 0 0.0025

-0.01 0 0.0025

0 0 0.0025

0.01 0 0.0025

0.02 0 0.0025

0.03 0 0.0025

 

# calibration marks at y = 0.01 m

-0.03 0.01 0.0025

-0.02 0.01 0.0025

-0.01 0.01 0.0025

0 0.01 0.0025

0.01 0.01 0.0025

0.02 0.01 0.0025

0.03 0.01 0.0025

 

# calibration marks at y = 0.02 m

-0.03 0.02 0.0025

-0.02 0.02 0.0025

-0.01 0.02 0.0025

0 0.02 0.0025

0.01 0.02 0.0025

0.02 0.02 0.0025

0.03 0.02 0.0025

 

# calibration marks at y = 0.03 m

-0.03 0.03 0.0025

-0.02 0.03 0.0025

-0.01 0.03 0.0025

0 0.03 0.0025

0.01 0.03 0.0025

0.02 0.03 0.0025

0.03 0.03 0.0025

 

知道每个参数的意义以及标靶每个位置尺寸后,就可以利用画图软件来画自己想要的标靶了,然后去专门生产标靶的公司加工成玻璃或者陶瓷的标靶就可以了。标靶也可以直接用打印机打印出来的,生成的.ps文件可以用GSview软件来打开,打开后可以另存为pdf文件。

 

 打开软件下载地址:http://download.csdn.net/detail/grevision/8853537



GreVision——绿叶视觉

grevision@foxmail.com

1 0
原创粉丝点击