当前位置:网站首页>Halcon's region: features of multiple regions (5)
Halcon's region: features of multiple regions (5)
2022-06-26 17:17:00 【Mr anhydrous】
One 、 summary
Some areas generate , Beginners need everyone to try , This is not just a matter of enhancing the image , And understand Halcon The process of ability . This paper introduces several applications in numerical image analysis , More useful domain operators . Please share !
This article is dedicated to the experimental verification of the attribute of the region . It is a series with the previous articles , Include :
halcon Area of : Area (Region) Contour operator on
halcon Area of : Multiple areas (Region) Generate (3)
halcon Area of : Multiple areas (Region) Generate (4)_
halcon Area of :get_region_chain and get_region_contour_
Two 、 Characteristics of the area
2.1 area_center Regional Center
- area_center: function : The area of an area ( size ) And the center .
area_center(regin, ares,Row1, Column1)
set_color(3600,'red')
read_image (Image, 'f:/images/DOTS/block.jpg')
rgb1_to_gray(Image,gray)
get_image_size(gray,width,height)
fast_threshold (gray,regin,0, 50 , 7)
area_center(regin,ares,Row1, Column1)2.2 circularity Calculate roundness
- circularity: function : Shape coefficient that affects the similarity between a region and a circle .
circularity(regin, Circularity)
Roundness range :0-1
set_color(3600,'red')
read_image (Image, 'f:/images/DOTS/many_block.jpg')
rgb1_to_gray(Image,gray)
get_image_size(gray,width,height)
fast_threshold (gray,regin,0, 50 , 7)
connection(regin, ConnectedRegions)
circularity(ConnectedRegions, Circularity)
Roundness is :0.395611、0.64085、0.949253、0.529871; It seems to be consistent from a visual point of view .
2.3. compactness Tightness
- compactness: function : The shape factor that affects the density of an area .

Tightness :3.43204、1.25161、1.10005、2.074
Tightness and roundness are similar , and , The circle has the highest compactness .
2.4. connect and_holes Number of connections and holes
function : Number of connections and interrupts .
connect_and_holes(regin, NumConnected, NumHoles)
set_color(3600,'red')
read_image (Image, 'f:/images/DOTS/block.jpg')
rgb1_to_gray(Image,gray)
get_image_size(gray,width,height)
fast_threshold (gray,regin,0, 50 , 7)
connect_and_holes(regin, NumConnected, NumHoles)Connect as 2, Holes are 2 Here is the picture .

2.5. contlength Get the contour length outside the region
function : Describe an area outline (contour) The length of .
contlength(regin,ContLength)

Note here , Let's verify ,gen_contour_region_xld and contlength(regin, ContLength) The length of the two outer contours is inconsistent :
gen_contour_region_xld (regin, Contours, 'border')
contlength(regin, ContLength)2.6. Convexity of region
convexity function : The shape coefficient that affects the convexity of a region .

result :0.539397、0.991524、0.994038、0.72976, You can see , A circle is almost as convex as a square .
2.7. diameter region
function : The maximum distance between two boundary points in an area .
diameter_region(ConnectedRegions,row1,col1,row2,col2,dim)
set_color(3600,'red')
read_image (Image, 'f:/images/DOTS/many_block.jpg')
rgb1_to_gray(Image,gray)
get_image_size(gray,width,height)
fast_threshold (gray,regin,0, 50 , 7)
connection(regin, ConnectedRegions)
diameter_region(ConnectedRegions,row1,col1,row2,col2,dim)
Maximum diameter :161.608、155.013、151.743、132.91
2.8. eccentricity Ellipse parameters
function : The shape factor from the ellipse parameter .
eccentricity(Regions : : : Anisometry, Bulkiness, StructureFactor)

obviously Anisometry Is the ratio of major and minor axes ; above A Is the actually measured pixel area in the ellipse .Bulkiness Ratio of actual area to theoretical area .StructureFactor Structural factor ,
2.9. elliptic axis Similar ellipse
function : Parameters of similar ellipses .
2.10.euler_number Euler number
function : Calculation Euler number . operator euler_number Calculate Euler number , That is, the difference between the number of connecting components and the number of holes .
such as : The hole in the figure below ( The background is empty ), It's a green number ; The connector of the foreground is four black areas ; So the Euler number is :
Number( Black connection 4 individual )- empty ( white 5 individual )=-1

边栏推荐
- Find out the maximum value of each column element of NxN matrix and store it in the one-dimensional array indicated by formal parameter B in order
- Secrets of gear contract
- Platform management background and merchant menu resource management: access control design of platform management background
- Web3去中心化存储生态图景
- Calculate the sum of the main diagonals of the array
- Microservice architecture practice: user login and account switching design, order query design of the mall
- Today, I met a "migrant worker" who took out 38K from Tencent, which let me see the ceiling of the foundation
- 【推荐系统学习】推荐系统的技术栈
- Leetcode 1169. Query invalid transactions (if the amount of data is small, this problem still needs to be solved by violent enumeration)
- Count the number of words in a line of string and take it as the return value of the function
猜你喜欢

Treasure and niche CTA animation material website sharing

探讨:下一代稳定币

Synchronized description of concurrency

玩轉Linux,輕松安裝配置MySQL

Sandboxed container: container or virtual machine

Fire evacuation and self rescue... This safety production and fire training is full!

Redis and database data consistency

Platform management background and merchant menu resource management: Design of platform management background data service

Teach you to learn dapr - 1 The era of net developers

【代码随想录-动态规划】T583、两个字符串的删除操作
随机推荐
Leetcode topic [array] -283- move zero
Cloud native 02: Alibaba cloud cloud efficient flow pipeline
Teach you to learn dapr - 2 Must know concept
Leetcode daily [2022 - 02 - 16]
Redis overview
Concurrent thread safety
What does the equals method compare? Who told you
【推荐系统学习】推荐系统架构
Teach you to learn dapr - 4 Service invocation
Comp281 explanation
Leetcode 1169. Query invalid transactions (if the amount of data is small, this problem still needs to be solved by violent enumeration)
Jouer avec Linux et installer et configurer MySQL facilement
玩轉Linux,輕松安裝配置MySQL
Calculate the average of N numbers in the index group of X, and return the number that is less than the average and closest to the average through formal parameters
Prometeus 2.34.0 新特性
宝藏又小众的CTA动画素材素材网站分享
Wechat app mall, review products, upload commodity pictures, and score Commodity Services
Programmer interview guide - self introduction
并发之Synchronized说明
The function keeps the value of variable H to two decimal places and rounds the third digit