当前位置:网站首页>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
边栏推荐
- 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
- 小学期,第三场-下午:WEB_sessionlfi
- 最新海康摄像机、NVR、流媒体服务器、回放取流RTSP地址规则说明[通俗易懂]
- 基于slate构建文档编辑器
- Web host iptables firewall security script
- 数据智能——DTCC2022!中国数据库技术大会即将开幕
- Static classes use @resource annotation injection
- Jerry's long press reset [chapter]
- Application of JDBC in performance test
- NLP技能树学习路线-(一)路线总览
猜你喜欢

NLP paper lead reading | what about the degradation of text generation model? Simctg tells you the answer

S7-1500 PLC之间进行TCP通信的具体方法和步骤详解(图文)

The prospectus of pelt medical was "invalid" for the second time in the Hong Kong stock exchange, and the listing plan was substantially delayed

CADD course learning (1) -- basic knowledge of drug design

消灭Bug,开发者不可不知的几款Bug探索测试神器。

文件包含&条件竞争

GeoServer安装

Smarter! Airiot accelerates the upgrading of energy conservation and emission reduction in the coal industry
![Jerry's touch key recognition process [chapter]](/img/3e/bb73c735d0a7c7a26989c65a432dad.png)
Jerry's touch key recognition process [chapter]

传输层 使用滑动窗口实现流量控制
随机推荐
Web主机iptables防火墙安全脚本
【450. 删除二叉搜索树中的节点】
暑期实训21组第一周个人工作总结
昨晚 Spark Summit 重要功能发布全在这里(附超清视频)
MySQL master-slave synchronization
CADD course learning (1) -- basic knowledge of drug design
小学期,第三场-下午:WEB_xxe
S7-1500 PLC之间进行TCP通信的具体方法和步骤详解(图文)
Big God explains open source buff gain strategy live broadcast
QT qstringlist usage
Client request external interface standard processing method
Go 语言标识符、包名规范
消灭Bug,开发者不可不知的几款Bug探索测试神器。
【ICLR 2021】半监督目标检测:Unbiased Teacher For Semi-Supervised Object Detection
pytorch实现FLOPs和Params的计算
Openfire在使用MySQL数据库后的中文乱码问题解决
杰理之关于长按复位【篇】
Primary school, session 3 - afternoon: Web_ sessionlfi
Pytorch implements the calculation of flops and params
[iccv 2019] characteristics precise supervision of feature super resolution for small object detection