Halcon区域region的合并,旋转与排序

内容源自:

*对目标进行排序
*http://www.ihalcon.com/read-15537.html

重点关注:

union1 (SelectedRegions, RegionUnion) ///区域合并

sort_region (RegionAffineTrans, SortedRegions, 'character', 'true', 'row') ///排序

完整的源码:

1*对目标进行排序 2*http://www.ihalcon.com/read-15537.html 3dev_close_window() 4dev_update_off() 5read_image (Image, '对目标进行排序.bmp') 6get_image_size (Image, Width, Height) 7dev_open_window (0, 0, Width/1.5, Height/1.5, 'black', WindowHandle) 8dev_display (Image) 9 10threshold (Image, Region, 0, 30) 11connection (Region, ConnectedRegions) 12select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 200, 600) 13union1 (SelectedRegions, RegionUnion) ///区域合并 14 15smallest_rectangle2 (RegionUnion, Row, Column, Phi, Length1, Length2) 16gen_rectangle2_contour_xld (Rectangle, Row, Column, Phi, Length1, Length2) 17vector_angle_to_rigid (Row, Column, 0, Row, Column, -Phi, HomMat2D) 18vector_angle_to_rigid (Row, Column, 0, Row, Column, Phi, HomMat2D1) 19affine_trans_image (Image, ImageAffineTrans, HomMat2D, 'constant', 'false') 20affine_trans_region (SelectedRegions, RegionAffineTrans, HomMat2D, 'nearest_neighbor') 21sort_region (RegionAffineTrans, SortedRegions, 'character', 'true', 'row') ///排序 22affine_trans_region (SortedRegions, RegionAffineTrans1, HomMat2D1, 'nearest_neighbor') 23 24dev_display (Image) 25count_obj (RegionAffineTrans1, Number) 26for i:=1 to Number by 1 27 select_obj (RegionAffineTrans1, ObjectSelected, i) 28 area_center (ObjectSelected, Area, Row1, Column1) 29 dev_disp_text (i, 'image', Row1, Column1, 'red', 'box', 'false') 30endfor
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

一篇文章带你了解JavaScript日期

日期对象允许您使用日期(年、月、日、小时、分钟、秒和毫秒)。一、JavaScript的日期格式一个JavaScript日期可以写为一个字符串:ThuFeb02201909:59:51GMT0800(中国标准时间)或者是一个数字:1486000791164写数字的日期,指定的毫秒数自1970年1月1日00:00:00到现在。1\.显示日期使用

Halcon区域region的合并,旋转与排序 - HelloWorld