halcon学习笔记
鹏鹏娃
学习笔记
展开
-
Halcon--阈值分割总结
dev_clear_window ()dev_close_window ()read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-18.11-Steady/examples/images/color/citrus_fruits_15.png')dev_open_window (0, 0, 512, 512, 'black',...原创 2019-05-30 10:42:14 · 1285 阅读 · 0 评论 -
Halcon中数据的四舍五入、取整、有效数字以及和字符串之间的转换
a:= 3.456*取整、取最近的整数int_a := int(a) //取整数部分,结果是3round_a := round(a) //将输入元组转换为最接近的整数元组,结果是3*四舍五入,结果是字符串g0 := a$'.0f' //保留0位,结果是'3'g1 := a$'.1f' //保留1位,结果是'3.5'g2 := a$'.2f' //保留2位,结果...转载 2019-04-17 21:18:23 · 10452 阅读 · 0 评论 -
halcon------图像读取
1、本地图片读取① 单张读取read_image (Image, 'C:/Users/Administrator/Desktop/1.png')② 编号连续的图片读取(000、001、002……)for i := 3 to 6 by 1 read_image (Image, 'C:/Users/Administrator/Desktop/pic/' + i$'.3' + '.jp...原创 2019-04-17 21:55:28 · 699 阅读 · 0 评论 -
halcon——如何保存halcon窗口图片及文字
dev_clear_window ()dev_close_window ()read_image (Image, 'printer_chip/printer_chip_01')get_image_size (Image, Width, Height)dev_open_window (0, 0, 500, 300, 'green', WindowHandle)dev_displa...原创 2019-05-23 14:59:18 · 16125 阅读 · 2 评论 -
halcon——设置字体大小
dev_clear_window ()dev_close_window ()read_image (Image, 'printer_chip/printer_chip_01')get_image_size (Image, Width, Height)dev_open_window (0, 0, 500, 300, 'green', WindowHandle)dev_display (...原创 2019-05-23 15:10:55 · 16570 阅读 · 0 评论 -
halcon(窗口画线)
dev_clear_window ()dev_close_window ()read_image (Image, 'printer_chip/printer_chip_01')get_image_size (Image, Width, Height)dev_open_window (0, 0, Width, Height, 'black', WindowHandle)*在窗口画线,...原创 2019-05-23 16:18:17 · 9883 阅读 · 0 评论 -
halcon--图像裁剪算子
read_image (Image, 'printer_chip/printer_chip_01')get_image_size (Image, Width, Height)dev_close_window ()crop_part (Image, ImagePart, 500, 100, Width, Height)dev_display (ImagePart)原创 2019-05-24 14:55:12 · 11420 阅读 · 0 评论 -
halcon ---Tuple数组
***************数组下标从0开始*********************dev_clear_window ()dev_close_window () *1.定义空数组Tuple:=[]*2.指定数据定义数组TUple1:=[1,2,3,4,5,6]Tuple2:=[1,8,9,'depengjun']*Tuple2和Tpule3相等Tuple3:=[0x...原创 2019-05-28 11:14:49 · 1625 阅读 · 0 评论 -
halcon(Tuple数组)
***************数组下标从0开始*********************dev_clear_window ()dev_close_window () *1.定义空数组Tuple:=[]*2.指定数据定义数组TUple1:=[1,2,3,4,5,6]Tuple2:=[1,8,9,'depengjun']*Tuple2和Tpule3相等Tuple3:=[0...原创 2019-05-28 11:15:54 · 2726 阅读 · 0 评论 -
数组的基本运算(halcon)
****数组的基本运算******V1:=[4.5,4,10]V2:=[4,2,20]*最小值与最大值val_min:=min(V1)val_max:=max(V1)*两数组中的最小与最大值val_min2:=min2(V1,V2)val_max2:=max2(V1,V2)*元素求和val_sum:=sum(V1)*求均值和绝对值val_mean:=mean(V1)...原创 2019-05-28 11:35:31 · 2613 阅读 · 0 评论 -
halcon矩阵和图像的运算
****************************************************************************************halcon矩阵和图像的运算*****************************************************************************************dev_c...原创 2019-05-28 16:06:05 · 2696 阅读 · 0 评论 -
halcon--批量保存图像到文件夹
***保存图片,其中 ---'C:/Users/admin/Desktop/halcon/'+Index$'.'------------- *其中上面为地址+图像名(Index$'.',,是图像名,'.',保留一位数,'.3',保留三位数) write_image (ImageNoise, 'tiff', 0, 'C:/Users/admin/Desktop/halcon...原创 2019-05-28 16:08:00 · 6799 阅读 · 1 评论 -
halcon图像仿射变换原则
affine_trans_image (Image, ImageAffineTrans, HomMat2D , 'constant', 'false') Image----输入图像 ImageAffineTrans-----仿射变换后图像 HomMat2D------变换矩阵 'constant'----插值方式 'false'---...原创 2019-05-28 21:19:29 · 2100 阅读 · 0 评论 -
对图像进行线性灰度变换halcon
****对图像进行线性灰度变换*******dev_clear_window ()dev_close_window ()read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-18.11-Steady/examples/images/lcd/tft_cells_01.png')get_image_size (Image, ...原创 2019-05-29 20:35:47 · 3570 阅读 · 0 评论 -
直方图及直方图均衡化--halcon
****对图像进行线性灰度变换*******dev_clear_window ()dev_close_window ()read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-18.11-Steady/examples/images/lcd/tft_cells_01.png')get_image_size (Image, ...原创 2019-05-29 21:05:14 · 6526 阅读 · 0 评论 -
halcon----图像矫正
在这里插入代码片dev_update_off ()dev_close_window ()read_image (Image_slanted, ‘datacode/ecc200/ecc200_to_preprocess_001’)dev_open_window_fit_image (Image_slanted, 0, 0, -1, -1, WindowHandle)set_displa...原创 2019-04-16 22:00:02 · 4456 阅读 · 1 评论 -
vector_to_proj_hom_mat2d算子-------halcon
在这里插入代码片vector_to_proj_hom_mat2d ([RowUL,RowUR,RowLR,RowLL] + 0.5, [ColUL,ColUR,ColLR,ColLL] + 0.5, [160,160,340,340] + 0.5, [250,550,550,250] + 0.5, 'normalized_dlt', [], [], [], [], [], [], HomMat...原创 2019-04-16 16:41:32 · 4602 阅读 · 0 评论 -
Halcon--阈值分割之(最大类间方差法(OSTU))
*最大类间方差法(OSTU)dev_close_window ()dev_clear_window ()read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-18.11-Steady/examples/images/color/citrus_fruits_15.png')dev_open_window (0, 0, 51...原创 2019-05-30 10:43:34 · 3869 阅读 · 1 评论 -
halcon---边缘检测算子(总结)
***************边缘检测*****************dev_clear_window ()dev_close_window ()read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-18.11-Steady/examples/images/food/vegetables/raspberry_4.png')...原创 2019-05-30 11:10:39 · 2860 阅读 · 0 评论 -
halcon--字符识别
****************字符识别实例*************dev_close_window ()dev_clear_window ()dev_update_window ('off')read_image (Image, 'bottle2')get_image_size (Image, Width, Height)dev_close_window ()dev...原创 2019-05-30 15:10:38 · 1134 阅读 · 0 评论 -
利用halcon解方程,和曲线拟合
Size:=500X := [25:50:Size]Y := 15 + 0.4 * X + 0.001 * X * XY := Y + 40 * rand(|Y|)% 随机生成点集gen_cross_contour_xld (Cross, Size - Y, X, 15, 0.785398)% 将坐标点变成十字架图标。///////////////////////////...原创 2019-04-20 11:32:18 · 5160 阅读 · 0 评论 -
halcon--XLD的回归参数
dev_clear_window ()dev_close_window ()dev_open_window (0, 0, 512, 512, 'black', WindowHandle)gen_circle_contour_xld (ContCircle, 200, 200, 100, 0, 6.28318, 'positive', 1)query_contour_global_attr...原创 2019-05-28 10:35:36 · 548 阅读 · 0 评论 -
halcon选取特定形状特征要求的XLD轮廓或多边形
dev_clear_window ()dev_close_window ()read_image (Image, 'tooth_rim')get_image_size (Image, Width, Height)*新建立一个桌布并显示图像dev_open_window (0, 0, Width, Height, 'black', WindowHandle)dev_display (...原创 2019-05-27 20:49:48 · 3960 阅读 · 0 评论 -
halcon求圆的中心和直径,统计圆的个数和选择圆
*利用形状特征选择区域。select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 10, 9999)*计算圆形数量count_obj (SelectedRegions, Number)*选择第几个圆形select_obj (SelectedRegions, ObjectSelected, 25)*区域的面积和中心...原创 2019-05-27 19:24:40 · 3117 阅读 · 0 评论 -
halcon-画十字架
*用十字画出圆心位置 disp_cross (WindowHandle1, R[0], R[1], 10, 0)gen_cross_contour_xld (Cross, Size - Y, X, 15, 0.785398)% 将坐标点变成十字架图标。原创 2019-05-27 18:54:43 · 10656 阅读 · 0 评论 -
halcon--通过形状选择,得到圆心坐标,并画出位置标记
dev_clear_window ()dev_close_window ()read_image (Image, 'tooth_rim')get_image_size (Image, Width, Height)*新建立一个桌布并显示图像dev_open_window (0, 0, Width, Height, 'black', WindowHandle)dev_display ...原创 2019-05-27 17:00:16 · 8235 阅读 · 0 评论 -
Halcon—(利用形状特征选择区域)
dev_clear_window ()dev_close_window ()read_image (Image, 'tooth_rim')get_image_size (Image, Width, Height)dev_open_window (0, 0, Width, Height, 'black', WindowHandle)dev_display (Image)*阈值分割...原创 2019-05-27 14:38:07 · 2246 阅读 · 0 评论 -
halcon---按特征选取区域
dev_close_window ()dev_clear_window ()read_image (Image, 'printer_chip/printer_chip_01')get_image_size (Image, Width, Height)dev_close_window ()dev_open_window (0, 0, Width, Height, 'black', W...原创 2019-05-24 16:02:56 · 3716 阅读 · 0 评论 -
区域生长法分割图像
dev_close_window ()dev_clear_window ()read_image (Image, 'printer_chip/printer_chip_01')get_image_size (Image, Width, Height)dev_close_window ()dev_open_window (0, 0, Width, Height, 'black', W...原创 2019-05-24 15:35:30 · 2019 阅读 · 0 评论 -
halcon,裁剪和阈值分割
dev_close_window ()dev_clear_window ()read_image (Image, 'printer_chip/printer_chip_01')get_image_size (Image, Width, Height)dev_close_window ()dev_open_window (0, 0, Width, Height, 'black', W...原创 2019-05-24 15:01:17 · 831 阅读 · 0 评论 -
halcon---滤波操作
dev_clear_window ()dev_close_window ()read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-18.11-Steady/examples/images/lcd/tft_cells_01.png')get_image_size (Image, Width, Height)dev_open...原创 2019-05-29 21:21:02 · 2377 阅读 · 0 评论