当前位置:网站首页>Measurement fitting based on Halcon learning [4] measure_ arc. Hdev routine
Measurement fitting based on Halcon learning [4] measure_ arc. Hdev routine
2022-07-04 02:10:00 【BoomBiuBiu】
This routine is measuring arcs
Read the picture :
* Read the picture
read_image (Zeiss1, 'zeiss1')
* Get the width and height of the picture
get_image_size (Zeiss1, Width, Height)
* close window
dev_close_window ()
* Open a new window
dev_open_window (0, 0, Width / 2, Height / 2, 'black', WindowHandle)
* Set the font displayed
set_display_font (WindowHandle, 14, 'mono', 'true', 'false')
* display picture
dev_display (Zeiss1)
* Display prompt message
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
Generate measuring arc :
* Define some parameters
* Center of arc
Row := 275
Column := 335
* Arc radius
Radius := 107
* Start angle and end angle of arc
AngleStart := -rad(55)
AngleExtent := rad(170)
dev_set_draw ('fill')
dev_set_color ('green')
dev_set_line_width (1)
* Calculate the ellipse point corresponding to a specific angle .
get_points_ellipse (AngleStart + AngleExtent, Row, Column, 0, Radius, Radius, RowPoint, ColPoint)
* Show arcs
disp_arc (WindowHandle, Row, Column, AngleExtent, RowPoint, ColPoint)
dev_set_line_width (3)
* Generate measuring arc
gen_measure_arc (Row, Column, Radius, AngleStart, AngleExtent, 10, Width, Height, 'nearest_neighbor', MeasureHandle)
* Display prompt message
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
Start measuring fit :
* Count
count_seconds (Seconds1)
n := 10
for i := 1 to n by 1
* Start measuring the distance between the edges
* Extract straight edges perpendicular to rectangular or circular arcs
* Image (input_object) The input image
* MeasureHandle (input_control) Measure object handle
* Sigma (input_control) Gaussian smoothing coefficient
* Threshold (input_control) Minimum margin amplitude
* Transition (input_control) Detect all positive and negative edges
* Select (input_control) Select all edges
* RowEdge (output_control) Edge center row coordinates
* ColumnEdge (output_control) Edge center column coordinates
* Amplitude (output_control) The edge amplitude of the edge ( Signed )
* Distance (output_control) The distance between adjacent edges
measure_pos (Zeiss1, MeasureHandle, 1, 10, 'all', 'all', RowEdge, ColumnEdge, Amplitude, Distance)
endfor
count_seconds (Seconds2)
Time := (Seconds2 - Seconds1) / n
* Display prompt message
disp_continue_message (WindowHandle, 'black', 'true')
* stop ()
* Calculate the distance of a straight line between two points
distance_pp (RowEdge[1], ColumnEdge[1], RowEdge[2], ColumnEdge[2], IntermedDist)
dev_set_color ('red')
* Draw a straight line
disp_line (WindowHandle, RowEdge[1], ColumnEdge[1], RowEdge[2], ColumnEdge[2])
dev_set_color ('yellow')
* Display prompt message
disp_message (WindowHandle, 'Distance: ' + IntermedDist, 'image', 250, 80, 'yellow', 'false')
* Clear handle
close_measure (MeasureHandle)
dev_set_line_width (1)
stop ()
dev_clear_window ()
边栏推荐
- JVM performance tuning and practical basic theory - medium
- Learn these super practical Google browser skills, girls casually flirt
- Why is the operation unsuccessful (unresolved) uncaught syntaxerror: invalid or unexpected token (resolved)
- What are the advantages and disadvantages of data center agents?
- Example 072 calculation of salary it is known that the base salary of an employee of a company is 500 yuan. The amount of software sold by the employee and the Commission method are as follows: Sales
- [typora installation package] old typera installation package, free version
- Example 073 square sum value judgment programming requires the input of a and B, if a ²+ b ² If the result of is greater than 100, a is output ²+ b ² Value, otherwise output the result of a + B.
- Key knowledge of C language
- Remember a lazy query error
- Comment la transformation numérique du crédit d'information de la Chine passe - t - elle du ciel au bout des doigts?
猜你喜欢
Use classname to modify style properties
LeetCode 168. Detailed explanation of Excel list name
中電資訊-信貸業務數字化轉型如何從星空到指尖?
When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview
Jerry's watch listens to the message notification of the target third-party software and pushes the message to the device [article]
LV1 previous life archives
[Yugong series] February 2022 attack and defense world advanced question misc-84 (MySQL)
JVM performance tuning and practical basic theory - medium
Yyds dry goods inventory hand-in-hand teach you the development of Tiktok series video batch Downloader
Feign implements dynamic URL
随机推荐
Special copy UML notes
2022 R2 mobile pressure vessel filling certificate examination and R2 mobile pressure vessel filling simulation examination questions
Applet graduation design is based on wechat course appointment registration. Applet graduation design opening report function reference
Key knowledge of C language
Keep an IT training diary 055- moral bitch
G3 boiler water treatment registration examination and G3 boiler water treatment theory examination in 2022
Advanced learning of MySQL -- Application -- index
How to view the computing power of GPU?
Small program graduation project based on wechat e-book small program graduation project opening report function reference
Introduction to graphics: graphic painting (I)
Final consistency of MESI cache in CPU -- why does CPU need cache
After listening to the system clear message notification, Jerry informed the device side to delete the message [article]
Mysql-15 aggregate function
Winter vacation daily question -- a single element in an ordered array
Sword finger offer 20 String representing numeric value
Summarize the past to motivate yourself to move on
Servlet simple verification code generation
In yolov5, denselayer is used to replace focus, and the FPN structure is changed to bi FPN
LV1 Roche limit
17. File i/o buffer