当前位置:网站首页>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 ()
边栏推荐
- Why can't it run (unresolved)
- Jerry's synchronous weather information to equipment [chapter]
- Applet graduation project is based on wechat classroom laboratory reservation applet graduation project opening report function reference
- Magical usage of edge browser (highly recommended by program ape and student party)
- Advanced learning of MySQL -- Application -- index
- Neo4j learning notes
- The reasons why QT fails to connect to the database and common solutions
- 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
- Comment la transformation numérique du crédit d'information de la Chine passe - t - elle du ciel au bout des doigts?
- Hunan University | robust Multi-Agent Reinforcement Learning in noisy environment
猜你喜欢

Mysql-15 aggregate function

Remember a lazy query error

中電資訊-信貸業務數字化轉型如何從星空到指尖?

FRP intranet penetration

Yyds dry goods inventory it's not easy to say I love you | use the minimum web API to upload files
![[software implementation series] software implementation interview questions with SQL joint query diagram](/img/8b/8718fea82f83a6169ea5d8c2e5b645.jpg)
[software implementation series] software implementation interview questions with SQL joint query diagram
![[leetcode daily question] a single element in an ordered array](/img/3a/2b465589b70cd6aeec08e79fcf40d4.jpg)
[leetcode daily question] a single element in an ordered array

Force buckle day32

Write the first CUDA program

Yyds dry goods inventory override and virtual of classes in C
随机推荐
Applet graduation design is based on wechat course appointment registration. Applet graduation design opening report function reference
Cancer biopsy instruments and kits - market status and future development trends
Advanced learning of MySQL -- Application -- index
Global and Chinese markets for electroencephalogram (EEG) devices 2022-2028: Research Report on technology, participants, trends, market size and share
Design and implementation of redis 7.0 multi part AOF
The difference between lambda expressions and anonymous inner classes
Three layer switching ①
LeetCode226. Flip binary tree
Small program graduation project based on wechat examination small program graduation project opening report function reference
Small program graduation project based on wechat e-book small program graduation project opening report function reference
Chapter 3.4: starrocks data import - Flink connector and CDC second level data synchronization
Hunan University | robust Multi-Agent Reinforcement Learning in noisy environment
Intel's new GPU patent shows that its graphics card products will use MCM Packaging Technology
Why can't it run (unresolved)
Applet graduation project is based on wechat classroom laboratory reservation applet graduation project opening report function reference
Summarize the past to motivate yourself to move on
Remember a lazy query error
[software implementation series] software implementation interview questions with SQL joint query diagram
Valentine's Day - 9 jigsaw puzzles with deep love in wechat circle of friends
All ceramic crowns - current market situation and future development trend