Example program for distance_pl
程序员文章站
2022-07-04 16:00:26
...
dev_close_window ()
read_image (Image, 'mreut')
dev_open_window (0, 0, 512, 512, 'white', WindowID)
dev_display (Image)
dev_set_color ('black')
threshold (Image, Region, 180, 255)
dev_clear_window ()
dev_display (Region)
connection (Region, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 10000, 100000000)
* 访问对象的轮廓(点坐标)
get_region_contour (SelectedRegions, Rows, Columns)
RowLine1 := 5
ColLine1 := 300
RowLine2 := 300
ColLine2 := 400
NumberTuple := |Rows|
dev_set_color ('red')
disp_line (WindowID, RowLine1, ColLine1, RowLine2, ColLine2)
dev_set_color ('green')
for i := 1 to NumberTuple by 20
* 在这个点上画了一个十字
disp_line (WindowID, Rows[i], Columns[i] - 2, Rows[i], Columns[i] + 2)
disp_line (WindowID, Rows[i] - 2, Columns[i], Rows[i] + 2, Columns[i])
* 计算点线距离
distance_pl (Rows[i], Columns[i], RowLine1, ColLine1, RowLine2, ColLine2, Distance)
stop()
endfor
上一篇: Example program for distance_pc
下一篇: Halcon文件操作
推荐阅读
-
example1.php
-
ftp类(example.php)
-
注册微软账户失败无法查看验证example.com邮箱该怎么办?
-
springboot 报错 org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type 'com.example.service.HrService' avai
-
asp.net core 3.1 入口:Program.cs中的Main函数
-
[PHP] small example to show dynamic type change
-
Can't debug c++ project because unable to static library start program *.lib
-
There are no operators in the program to be executed 可能的原因
-
C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1
-
Cannot run program "/usr/local/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or