当前位置:网站首页>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 ()
边栏推荐
- Introduction to graphics: graphic painting (I)
- Portable two-way radio equipment - current market situation and future development trend
- What is the student party's Bluetooth headset recommendation? Student party easy to use Bluetooth headset recommended
- Gee import SHP data - crop image
- A. Div. 7
- Sword finger offer 14- I. cut rope
- From the 18th line to the first line, the new story of the network security industry
- Jerry's modification setting status [chapter]
- Take you to master the formatter of visual studio code
- Chinese Mitten Crab - current market situation and future development trend
猜你喜欢

Small program graduation project based on wechat examination small program graduation project opening report function reference

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.
![[Yugong series] February 2022 attack and defense world advanced question misc-83 (QR easy)](/img/36/e5b716f2f976eb474b673f85363dae.jpg)
[Yugong series] February 2022 attack and defense world advanced question misc-83 (QR easy)

Take you to master the formatter of visual studio code

Comment la transformation numérique du crédit d'information de la Chine passe - t - elle du ciel au bout des doigts?

The automatic control system of pump station has powerful functions and diverse application scenarios

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

Feign implements dynamic URL

Yyds dry goods inventory it's not easy to say I love you | use the minimum web API to upload files

Applet graduation project based on wechat selection voting applet graduation project opening report function reference
随机推荐
Writeup (real questions and analysis of ciscn over the years) of the preliminary competition of national college students' information security competition
Winter vacation daily question -- a single element in an ordered array
Intel's new GPU patent shows that its graphics card products will use MCM Packaging Technology
Maximum entropy model
Chain ide -- the infrastructure of the metauniverse
60 year old people buy medical insurance and recommend a better product
Maximum likelihood method, likelihood function and log likelihood function
Méthode de calcul de la connexion MSSQL de la carte esp32c3
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
Dans la recherche de l'intelligence humaine ai, Meta a misé sur l'apprentissage auto - supervisé
Software product download collection
Conditional statements of shell programming
Should enterprises start building progressive web applications?
Data collection and summary
[typora installation package] old typera installation package, free version
Experimental animal models - current market situation and future development trend
[software implementation series] software implementation interview questions with SQL joint query diagram
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.
FRP intranet penetration