当前位置:网站首页>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 ()
边栏推荐
- From the 18th line to the first line, the new story of the network security industry
- Use classname to modify style properties
- MySQL advanced (Advanced) SQL statement (I)
- Libcblas appears when installing opencv import CV2 so. 3:cannot open shared object file:NO such file or directory
- Comment la transformation numérique du crédit d'information de la Chine passe - t - elle du ciel au bout des doigts?
- The requests module uses
- 1189. Maximum number of "balloons"
- Final consistency of MESI cache in CPU -- why does CPU need cache
- Pesticide synergist - current market situation and future development trend
- Summarize the past to motivate yourself to move on
猜你喜欢
Force buckle day32
JVM performance tuning and practical basic theory - medium
Do you know the eight signs of a team becoming agile?
Small program graduation project based on wechat examination small program graduation project opening report function reference
Comment la transformation numérique du crédit d'information de la Chine passe - t - elle du ciel au bout des doigts?
Jerry's synchronous weather information to equipment [chapter]
SQL statement
MySQL advanced (Advanced) SQL statement (I)
MPLS③
Libcblas appears when installing opencv import CV2 so. 3:cannot open shared object file:NO such file or directory
随机推荐
Description of setting items of Jerry [chapter]
Sword finger offer 14- I. cut rope
Global and Chinese market for travel wheelchairs 2022-2028: Research Report on technology, participants, trends, market size and share
I don't know why it can't run in the project and how to change it
Human resource management online assignment
Reading notes - learn to write: what is writing?
JVM performance tuning and practical basic theory - medium
LV1 Roche limit
JVM performance tuning and practical basic theory - medium
After listening to the system clear message notification, Jerry informed the device side to delete the message [article]
Feign implements dynamic URL
Mobile phone battery - current market situation and future development trend
Key knowledge of C language
PMP daily three questions (February 14, 2022)
Prose article appreciation - the rain in the warm country has never changed into cold, hard and brilliant flowers. Knowledgeable people think he is monotonous, and he thinks he is unlucky, doesn't he?
Méthode de calcul de la connexion MSSQL de la carte esp32c3
Customize redistemplate tool class
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.
Yyds dry goods inventory hand-in-hand teach you the development of Tiktok series video batch Downloader
Is Shengang securities company as safe as other securities companies