当前位置:网站首页>Halcon knowledge: check the measurement objects [1]
Halcon knowledge: check the measurement objects [1]
2022-06-30 20:18:00 【Mr anhydrous】
One 、 summary
The measurement object is the object to solve the measurement problem , Through the microscopic measurement of the object , Accurate sub-pixel measurement can be obtained by fitting . This includes the distance between parallel lines 、 The radius of the circle 、 The long and short radii of ellipses, etc .
Two 、 Model generation and setup
2.1 Model generation
create_metrology_model
Create the data structure needed to measure the geometry .
- create_metrology_model( : : : MetrologyHandle)
Generate a measurement object , There is no set content .
Usually , For two-dimensional metrology , The position of the object to be measured must be provided 、 Approximate values of orientation and geometry . In the image of the display object , The boundaries of these approximate objects are used to locate the real edges of the objects , To fit the parameters of the geometry , Make them best match the image data . The result of the measurement is the optimized parameter . The metering model is used to store all necessary information , For example, the initial parameters of the position and geometry of the measurement object 、 Control the measured parameters and results . Geometric shapes that can be measured by two-dimensional metrology include circles 、 ellipse 、 Rectangles and lines .
The edge of the object in the image is located in the so-called measurement area . These are rectangular areas arranged perpendicular to the boundary of the approximate object , So their center lies on the boundary . The parameters for adjusting the size and distribution of the measurement area are specified together with the approximate shape parameters of each measurement object .
When applying measurements , Use RANSAC The algorithm determines the edge positions in all measurement areas and fits them to the geometry .
( About RANSAC The principle of the algorithm is described in the paper : Machine vision :ransac Algorithm details It's detailed in )
The measurement model contains 7 Measurement objects , Displayed as a blue outline . Use the measurement area located on each measurement object ( Gray rectangle ) Inner edge ( Cyan cross ), Fit Geometry ( Green outline ) And measure its parameters . As shown in the measurement object of circular type , You can find instances of multiple measurement objects .

First , Use create_metrology_model Create a measurement model data structure , Container used as one or more metering objects . after , You should use set_metrology_model_image_size Specify the image size of the image that will perform the measurement , For effective measurement .
2.2 Size setting
set_metrology_model_image_size
- set_metrology_model_image_size( : : MetrologyHandle, Width, Height : )
set_metrology_model_image_size Used to set or change the size of the image that will perform edge detection related to the metrology model ( of 2D The basic principle of measurement , Please see the create_metrology_model). The metering model consists of a handle MetrologyHandle Definition .
The image width must be determined by the parameter Width Appoint . The image height must be determined by the parameter Height Appoint . Pictured , Is the length of the small rectangle used for measurement 、 Width .

2.3 align_metrology_model Define the angle of the measurement
- align_metrology_model( : : MetrologyHandle, Row, Column, Angle : )
align_metrology_model Move and rotate the entire metrology model relative to the image coordinate system at the upper left corner of the origin MetrologyHandle. Alignment ensures that the position and orientation of the metrology model fit the object to be measured in the current image . then apply_metrology_model Use alignment to perform measurements . First, the measurement model is rotated according to the angle , Then the measurement model is translated by row and column . The aligned value is called next time align_metrology_model Cover .
2.4 apply_metrology_model
- apply_metrology_model(Image : : MetrologyHandle : )
apply_metrology_model stay Image Internal positioning measurement model MetrologyHandle The edge of the measuring area of the measuring object , The corresponding geometric shape is fitted to the generated edge position ( See create_metrology_model understand 2D The basic principle of measurement ). Measurement target as follows :
1) Determine the position of the edge
In the measuring area of the measuring object , Locate edges . The edge position is to use the operator inside measure_pos or blur_measure_pos Calculated . If you use set_metrology_object_fuzzy_param At least one fuzzy function is set for the measurement object , Use the latter .
2) Fit the geometry to the edge position
The geometry of the metering object is adjusted to best fit the resulting edge position . especially ,RANSAC The algorithm is used to select a set of initial edge positions , This is necessary to create instances of specific geometries , for example , Select three edge positions for round type metering objects . then , Determine those edge positions near the corresponding instance of the geometry , If the number of suitable edge positions is sufficient ( See set_metrology_object_param General parameters of “min_score”), Then the final fitting of the geometry . If the number of suitable edge positions is not enough , Then test another set of initial edge positions , Until you find the right edge position to choose . In the edge position selected for the final fit , Fit the geometry and store its parameters in the metrological model . Please note that , If the general parameters “num_instances” Set to greater than 1 Value , Multiple instances are returned for each measurement object . This parameter and other parameters can be set when adding a metering object to the metering model , You can also use the operator set_metrology_object_param Set separately . Please note that , For each instance of the metering object , Use different initial edge positions , namely , The second instance calculates the edge position of the first instance based on the edge position that has not been used as the initial edge position . When it finds “num_instances” When an instance , Or if the remaining number of suitable initial edge positions is too small to further fit the geometry , The algorithm will stop .
3) Access to the results
have access to get_metrology_object_result Access the measurement results from the measurement model . Please note that , If you return multiple instances of an object , The order of returning instances is arbitrary , Therefore, the quality of fitting cannot be measured . Pay further attention to , If you use set_metrology_model_param Set parameters for the metering model “camera_param” and “plane_pose”, The world coordinates are used for fitting . otherwise , Use image coordinates . have access to get_metrology_object_result_contour Obtain the... Of the measured object XLD outline .
( Follow up )
add_metrology_object_generic
get_metrology_object_model_contour,
set_metrology_model_param,
add_metrology_object_circle_measure,
add_metrology_object_ellipse_measure,
add_metrology_object_line_measure
边栏推荐
- exness:美GDP终值意外加速萎缩1.6%
- CADD课程学习(1)-- 药物设计基础知识
- Web host iptables firewall security script
- [iccv 2019] characteristics precise supervision of feature super resolution for small object detection
- Qt:qaxobject operation Excel
- [ICLR 2021] semi supervised object detection: unbiased teacher for semi supervised object detection
- 4.3-inch touch screen 12 channel control port programmable network central control supports mutual backup of 5 central control hosts
- 25: Chapter 3: developing pass service: 8: [registration / login] interface: receiving and verifying "mobile number and verification code" parameters; (it is important to know the application scenario
- 操作系统面试题汇总(不定期更新)
- To eliminate bugs, developers must know several bug exploration and testing artifacts.
猜你喜欢

Jenkins can't pull the latest jar package

Introduction to neural network (Part 1)

exness:流动性系列-流动性清洗和反转、决策区间

Audio and video architecture construction in the super video era | science and Intel jointly launched the second season of "architect growth plan"

maya房子建模

微信小程序开发实战 云音乐

Great God detailed open source Buff gain Introduction 丨 Live

To eliminate bugs, developers must know several bug exploration and testing artifacts.

Transport layer uses sliding window to realize flow control

NLP 论文领读|文本生成模型退化怎么办?SimCTG 告诉你答案
随机推荐
【Try to Hack】Windows系统账户安全
暑期实训21组第一周个人工作总结
十分之坑,tar命令解压文件的时候竟然不能解析英文括号“()”
Enterprise middle office planning and it architecture microservice transformation
Big God explains open source buff gain strategy live broadcast
neo4j load csv 配置和使用
Redis ziplist 压缩列表的源码解析
Web主机iptables防火墙安全脚本
Qt:qaxobject operation Excel
【ICLR 2021】半监督目标检测:Unbiased Teacher For Semi-Supervised Object Detection
Conditional compilation
To eliminate bugs, developers must know several bug exploration and testing artifacts.
Introduction to neural network (Part 1)
MySQL master-slave synchronization
CADD课程学习(1)-- 药物设计基础知识
凌云出海记 | 一零跃动&华为云:共助非洲普惠金融服务
Graduates
Build your own website (20)
杰理之触摸按键识别流程【篇】
Application of JDBC in performance test