当前位置:网站首页>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 ()
边栏推荐
- Conditional statements of shell programming
- LV1 tire pressure monitoring
- Openbionics exoskeleton project introduction | bciduino community finishing
- Containerization technology stack
- Small program graduation project based on wechat e-book small program graduation project opening report function reference
- 在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習
- FRP intranet penetration
- [leetcode daily question] a single element in an ordered array
- Bacteriostatic circle scanning correction template
- Small program graduation project based on wechat examination small program graduation project opening report function reference
猜你喜欢

Huawei cloud micro certification Huawei cloud computing service practice has been stable

Feign implements dynamic URL

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.

Huawei cloud micro certification Huawei cloud computing service practice has been stable

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

JVM performance tuning and practical basic theory - medium

LeetCode 168. Detailed explanation of Excel list name

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

High level application of SQL statements in MySQL database (I)
随机推荐
Format character%* s
Magical usage of edge browser (highly recommended by program ape and student party)
The boss said: whoever wants to use double to define the amount of goods, just pack up and go
LeetCode226. Flip binary tree
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.
Introduction to graphics: graphic painting (I)
Use classname to modify style properties
Small program graduation design is based on wechat order takeout small program graduation design opening report function reference
Applet graduation design is based on wechat course appointment registration. Applet graduation design 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 modification setting status [chapter]
A fan summed up so many interview questions for you. There is always one you need!
中電資訊-信貸業務數字化轉型如何從星空到指尖?
13. Time conversion function
17. File i/o buffer
MPLS③
Libcblas appears when installing opencv import CV2 so. 3:cannot open shared object file:NO such file or directory
The reasons why QT fails to connect to the database and common solutions
Yyds dry goods inventory hand-in-hand teach you the development of Tiktok series video batch Downloader
Gee import SHP data - crop image