当前位置:网站首页>Halcon's region: features of multiple regions (6)
Halcon's region: features of multiple regions (6)
2022-06-27 23:31:00 【Mr anhydrous】
One 、 summary
The operator of the region , It's best for beginners to try every one , This is not just a matter of enhancing the image , And understand Halcon The process of ability , And improve the efficiency of engineering practice . This paper introduces several applications in numerical image analysis , More useful domain operators . Please share !
Two 、 Operators and experiments
2.1 Regional expansion
- expand_region(Regions, ForbiddenArea : RegionExpanded : Iterations, Mode : )
Fill gaps between areas or split overlapping areas .ForbiddenArea Is not involved in the operation ( Retain ) Region .

- Test code :
read_image(Image, 'F:/images/maps/manyRegs')
rgb1_to_gray(Image,gray)
get_image_size(Image, Width, Height)
threshold(gray, Region, 0, 215)
connection(Region, ConRegions)
gen_empty_region(EmptyRegion)
expand_region(ConRegions, EmptyRegion, RegionExpanded, 'maximal', 'image')Results show :
First, divide the area into multiple groups .

Expand the region of multivariate group , Spread the whole map area .

2.2 Select... From the area tuple index Regions
select_obj Will have Index Index given ( from 1 Start ) Icon object from icon input object tuple Objects Copy to output object ObjectSelected. No new storage space is allocated for areas and images . contrary , Creates a new object that contains a reference to an existing object . The number of objects in an object tuple can be manipulated count_obj To query .
Such as : Take out No 12 Individuals of regions , Deposit in ObjectSelected Tuples
select_obj (RegionExpanded, ObjectSelected,12)2.3 The nearest neighbors of the region are listed
find_neighbors function : Search for immediate neighborhood .
- find_neighbors (ObjectSelected, RegionExpanded, 1, RegionIndex1, RegionIndex2)
Output RegionIndex1, RegionIndex2 Deposit ,ObjectSelected Sequence number pairs of all nearest neighbors of the region .
Reference code :
read_image(Image, 'F:/images/maps/manyRegs')
rgb1_to_gray(Image,gray)
get_image_size(Image, Width, Height)
threshold(gray, Region, 0, 215)
connection(Region, ConRegions)
gen_empty_region(EmptyRegion)
expand_region(ConRegions, EmptyRegion, RegionExpanded, 'maximal', 'image')
select_obj (RegionExpanded, ObjectSelected,1)
find_neighbors (RegionExpanded, RegionExpanded, 3, RegionIndex1, RegionIndex2)3、 ... and 、 An example of an official tutorial
The following is an example from the Official Handbook , The result is to extract the nearest neighbors of all regions .
read_image (Image, 'fabrik')
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowID)
dev_set_colored (6)
regiongrowing (Image, Regions, 1, 1, 3, 200)
gen_empty_region (Empty)
expand_region (Regions, Empty, RegionExpanded, 'maximal', 'image')
dev_clear_window ()
select_obj (RegionExpanded, ObjectSelected, 19)
find_neighbors (ObjectSelected, RegionExpanded, 1, RegionIndex1, RegionIndex2)
select_obj (RegionExpanded, ObjectSelected, RegionIndex2)
gen_empty_obj (NoObj)
find_neighbors (NoObj, RegionExpanded, 1, RegionIndex1, RegionIndex2)
shape_trans (RegionExpanded, RegionTrans, 'inner_center')
area_center (RegionTrans, Area, Row, Column)
stop ()
dev_clear_window ()
dev_set_colored (6)
dev_display (RegionExpanded)
dev_set_draw ('margin')
dev_set_color ('black')
dev_set_line_width (1)
dev_display (RegionExpanded)
dev_set_color ('white')
dev_set_line_width (3)
for i := 0 to |RegionIndex1| - 1 by 1
disp_line (WindowID, Row[RegionIndex1[i] - 1], Column[RegionIndex1[i] - 1], Row[RegionIndex2[i] - 1], Column[RegionIndex2[i] - 1])
endforReference results :

边栏推荐
- Detect objects and transfer images through mqtt
- Small chip chiplet Technology
- 【tinyriscv verilator】分支移植到正点原子达芬奇开发板
- 【微服务|Sentinel】sentinel数据持久化
- Spark BUG实践(包含的BUG:ClassCastException;ConnectException;NoClassDefFoundError;RuntimeExceptio等。。。。)
- 圖的存儲結構
- 凌云出海记 | 沐融科技&华为云:打造非洲金融SaaS解决方案样板
- Spark bug Practice (including bug: classcastexception; connectexception; noclassdeffounderror; runtimeexceptio, etc.)
- [learn FPGA programming from scratch -48]: Vision - development and application of intelligent sensors
- Fsnotify interface of go language to monitor file modification
猜你喜欢

C WinForm reads the resources picture

Discuz小鱼游戏风影传说商业GBK+UTF8版模板/DZ游戏网站模板

Is the dog virtue training with a monthly salary of 30000 a good business?

Practice torch FX: pytorch based model optimization quantization artifact

ClickOnce error deploying ClickOnce application - the reference in the manifest does not match the identity of the downloaded assembly

【剑指Offer】47. 礼物的最大价值

Feign通过自定义注解实现路径的转义

捷码赋能案例:湖南天辰产研实力迅速提升!实战玩转智慧楼宇/工地等项目

vmware虚拟机桥接连通

UESTC (shenhengtao team) & JD AI (Mei Tao team) proposed a structured dual stream attention network for video Q & A, with performance SOTA! Better than the method based on dual video representation!
随机推荐
6G显卡显存不足出现CUDA Error:out of memory解决办法
打造南沙“强芯”,南沙首届IC Nansha大会召开
vivado 如何添加时序约束
[从零开始学习FPGA编程-48]:视野篇 - 智能传感器的发展与应用
C WinForm reads the resources picture
Spark bug practice (including bug:classcastexception; connectexception; NoClassDefFoundError; runtimeException, etc.)
[Blue Bridge Cup training 100 questions] scratch digital calculation Blue Bridge Cup competition special prediction programming question collective training simulation exercise question No. 16
[can you really use es] Introduction to es Basics (II)
[sword finger offer] 47 Maximum value of gifts
Download versions such as typora 1.2.5
Feign通过自定义注解实现路径的转义
Netease cloud lost its "feelings" card
Feign implements path escape through custom annotations
First principles (optimal solution theory)
[essay]me53n add button to call URL
MapReduce初级编程实践
良/恶性乳腺肿瘤预测(逻辑回归分类器)
seata
Livox lidar+ Haikang camera generates color point cloud in real time
ICML 2022: UFRGS |作为最优策略转移基础的乐观线性支持和后继特征