当前位置:网站首页>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 ()
边栏推荐
- mysql使用視圖報錯,EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
- The difference between lambda expressions and anonymous inner classes
- Yyds dry goods inventory it's not easy to say I love you | use the minimum web API to upload files
- Maximum likelihood method, likelihood function and log likelihood function
- Applet graduation design is based on wechat course appointment registration. Applet graduation design opening report function reference
- Chinese Mitten Crab - current market situation and future development trend
- Basic editing specifications and variables of shell script
- Use classname to modify style properties
- Chapter 3.4: starrocks data import - Flink connector and CDC second level data synchronization
- Data collection and summary
猜你喜欢

Introduction to graphics: graphic painting (I)

Remember a lazy query error

What is the intelligent monitoring system of sewage lifting pump station and does it play a big role

The boss said: whoever wants to use double to define the amount of goods, just pack up and go

What are the advantages and disadvantages of data center agents?

On Valentine's day, I code a programmer's exclusive Bing Dwen Dwen (including the source code for free)
![Setting function of Jerry's watch management device [chapter]](/img/0b/8fab078e1046dbc22aa3327c49faa7.jpg)
Setting function of Jerry's watch management device [chapter]

Small program graduation project based on wechat video broadcast 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?

Small program graduation project based on wechat examination small program graduation project opening report function reference
随机推荐
High level application of SQL statements in MySQL database (I)
Will the memory of ParticleSystem be affected by maxparticles
LeetCode226. Flip binary tree
Question d: Haffman coding
Sword finger offer 14- I. cut rope
在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習
Difference between value and placeholder
G3 boiler water treatment registration examination and G3 boiler water treatment theory examination in 2022
Is Shengang securities company as safe as other securities companies
LV1 tire pressure monitoring
Ceramic metal crowns - current market situation and future development trend
Format character%* s
Global and Chinese market for travel wheelchairs 2022-2028: Research Report on technology, participants, trends, market size and share
Maximum likelihood method, likelihood function and log likelihood function
Setting function of Jerry's watch management device [chapter]
Introduction to graphics: graphic painting (I)
Meta metauniverse female safety problems occur frequently. How to solve the related problems in the metauniverse?
Méthode de calcul de la connexion MSSQL de la carte esp32c3
Jerry's watch listens to the message notification of the target third-party software and pushes the message to the device [article]
Small program graduation project based on wechat examination small program graduation project opening report function reference