当前位置:网站首页>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 ()
边栏推荐
- Jerry's watch listens to the message notification of the target third-party software and pushes the message to the device [article]
- 2022 R2 mobile pressure vessel filling certificate examination and R2 mobile pressure vessel filling simulation examination questions
- String: LV1 eat hot pot
- When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview
- Why can't it run (unresolved)
- The reasons why QT fails to connect to the database and common solutions
- Rearrangement of tag number of cadence OrCAD components and sequence number of schematic page
- Maximum entropy model
- Winter vacation daily question -- a single element in an ordered array
- 2022 electrician (elementary) examination question bank and electrician (elementary) simulation examination question bank
猜你喜欢

FRP intranet penetration

中電資訊-信貸業務數字化轉型如何從星空到指尖?
![After listening to the system clear message notification, Jerry informed the device side to delete the message [article]](/img/0c/52816b75eb702c7c63966578ab4969.jpg)
After listening to the system clear message notification, Jerry informed the device side to delete the message [article]

LeetCode226. Flip binary tree

Bacteriostatic circle scanning correction template

Iclr2022 | ontoprotein: protein pre training integrated with gene ontology knowledge
![[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)

LeetCode 168. Detailed explanation of Excel list name

C learning notes: C foundation - Language & characteristics interpretation

Override and virtual of classes in C #
随机推荐
Will the memory of ParticleSystem be affected by maxparticles
Properties of binary trees (numerical aspects)
Why can't it run (unresolved)
What is the student party's Bluetooth headset recommendation? Student party easy to use Bluetooth headset recommended
Portable two-way radio equipment - current market situation and future development trend
Sequence sorting of basic exercises of test questions
Intel's new GPU patent shows that its graphics card products will use MCM Packaging Technology
FRP intranet penetration
1189. Maximum number of "balloons"
Méthode de calcul de la connexion MSSQL de la carte esp32c3
Applet graduation project is based on wechat classroom laboratory reservation applet graduation project opening report function reference
The requests module uses
G3 boiler water treatment registration examination and G3 boiler water treatment theory examination in 2022
16. System and process information
Human resource management online assignment
Create real-time video chat in unity3d
When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview
Pesticide synergist - current market situation and future development trend
Chapter 3.4: starrocks data import - Flink connector and CDC second level data synchronization
15. System limitations and options