当前位置:网站首页>Region of Halcon: generation of multiple regions (4)
Region of Halcon: generation of multiple regions (4)
2022-06-26 01:24:00 【Mr anhydrous】
One 、 summary
There are many concepts of some region generation , Beginners are often at a loss , If you don't learn systematically , A few years down , The thought is still vague , Doing the project feels “ Book to time side hate less ”, This article is a follow-up to the previous ones , The aim is to penetrate comprehensively and systematically , It has the effect of water dropping through the stone .
Two 、 Region based operators
2.1 Point acquisition of contour line
operator :get_region_contour(region, Rows, Columns)
Get known area region Scattered points of , Save in Rows, Columns Inside .
read_image (Image, 'f:/images/DOTS/block.jpg')
rgb1_to_gray(Image,gray)
get_image_size(gray,width,height)
* gen_rectangle1(rect,0,0,height,width)
fast_threshold (gray,rect,0, 50 , 7)
* get_region_chain(rect, Row, Column, Chain)
get_region_contour(rect, Rows, Columns)
gen_image_const(BlkImage,'byte',width,height)
for I:=0 to |Rows|-1 by 1
tmpRow:=Rows[I]
tmpClm:=Columns[I]
set_grayval(BlkImage, tmpRow, tmpClm, 228)
endfor
dev_display(BlkImage)2.2. Get the segment area
gen_region_line(regline,row1,col1,row2,col2)
Get the region of a line segment , Be careful ,regline It's an area , Not a pixel list ; To get the hash point, you need the following steps :
gen_region_line(RegionLines, 100, 50, 150, 250)
get_region_points(RegionLines, Rows, Columns)2.3 Get the pixel tuple of the region ( See the section )
gen_region_points(regin,rows,cos)
function : Store individual pixels as image areas .
2.4 Generate polygons
gen_region_polygon
function : Store a polygon as an area .
gen_image_const(BlkImage,'byte',width,height)
gen_region_polygon(reg,[100,50,50,100,300,300,300,100],[50,100,200,400,400,200,50,50])

2.5 Generate polygon solid
gen_region_polygon_filled(region,rows,cols)
function : Store a polygon as a filled area .
gen_image_const(BlkImage,'byte',width,height)
gen_region_polygon_filled(reg,[100,50,50,100,300,300,300,100],[50,100,200,400,400,200,50,50])

2.6 Get... From area xld
gen_contour_region_xld (reg, Contours, 'border')
reg Yes input area ,Contours It's got xld object .
gen_image_const(BlkImage,'byte',width,height)
gen_region_polygon_filled(reg,[100,50,50,100,300,300,300,100],[50,100,200,400,400,200,50,50])
gen_image_const(xldImage,'byte',width,height)
gen_contour_region_xld (reg, Contours, 'border')2.6. Generate polygon areas
gen_region_polygon_xld
function : Create a XLD The area in the polygon .
The following code generates the outer contour region edge .
gen_image_const(BlkImage,'byte',width,height)
gen_region_polygon_filled(reg,[100,50,50,100,300,300,300,100],[50,100,200,400,400,200,50,50])
gen_image_const(xldImage,'byte',width,height)
gen_contour_region_xld (reg, Contours, 'border')
gen_polygons_xld(Contours,Polygons , 'ramer', 1 )
gen_region_polygon_xld( Polygons,Region, 'margin')2.7. Generate area scanlines
gen_region_runs
function : Create an image area in scan width encoding .
2.8. Mark areas with the same gray scale
label_to_region
function : Extract the area with the same gray value in an image .
边栏推荐
猜你喜欢

Xinku online | cnopendata text data of IPO declaration and issuance of A-share listed companies

MOS管防倒灌电路设计及其过程分析

《网络是怎么样连接的》读书笔记 - 集线器、路由器和路由器(三)

Redis之Strings命令

FPGA notes -- implementation of FPGA floating point operation

使用Gin框架运行Demo时报错“ listen tcp :8080: bind: An attempt was made to access a socket in a way forbidden”

【花雕体验】11 上手ESP32C3

Nacos registry

Implementation notes of least square fitting conic in stm32

DGUS新升级:全面支持数字视频播放功能
随机推荐
The cache page stores the initial parameters after the route jump under the react + router framework
RT-Thread 项目工程搭建和配置--(Env Kconfig)
Etcd database source code analysis -- inter cluster network layer server interface
idea配置
ASP. Net cache cache usage
Containerd client comparison
C#使用MySql进行操作
Flex & Bison 开始
Recognize map
Duck feeding data instant collection solution resources
. Net using access 2010 database
MOS管防倒灌电路设计及其过程分析
ADC acquisition noise and comparison between RMS filter and Kalman filter
FreeRTOS+STM32L+ESP8266+MQTT协议传输温湿度数据到腾讯云物联网平台
shell正则表达式
CityJSON
Optimized three-dimensional space positioning method and its fast implementation in C language
Shengxin weekly issue 33
Technical foreword - metauniverse
2022防爆电气操作证考试题库及模拟考试