当前位置:网站首页>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 .
边栏推荐
- C another new class is ICO? And app Use of config
- 生信周刊第34期
- Installation and startup of redis
- 毕业季你考虑好去留了吗
- From query database performance optimization to redis cache - talk about cache penetration, avalanche and breakdown
- Implementation notes of least square fitting conic in stm32
- STM32 key development foundation
- DGUS新升级:全面支持数字视频播放功能
- JSON实例(一)
- [understanding of opportunity -30]: Guiguzi - internal "chapter - empathy, stand on the other side's position and narrow the psychological distance with the other side
猜你喜欢

Freertos+stm32l+esp8266+mqtt protocol transmits temperature and humidity data to Tencent cloud IOT platform

Data analysis slicer, PivotTable and PivotChart (necessary in the workplace)

Duck feeding data instant collection solution resources

QT cmake pure C code calls the system console to input scanf and Chinese output garbled code

RT-Thread 项目工程搭建和配置--(Env Kconfig)

Mpu6050 reads the ID incorrectly and 0xd1 occurs (the correct ID should be 0x68 or 0x69). Solution.

Implementation notes of least square fitting conic in stm32

物联网?快来看 Arduino 上云啦

Return value is object type method call equals()

MOS管防倒灌电路设计及其过程分析
随机推荐
Containerd client comparison
How to effectively promote products
Online gadget sharing (updated from time to time, current quantity: 2)
[learn FPGA programming from scratch -44]: vision chapter - integrated circuit helps high-quality development in the digital era -1- main forms of integrated circuit chips
Remote incremental synchronization artifact Rsync
数组中的第K个最大元素
Discrete Mathematics - 01 mathematical logic
原生DOM与虚拟DOM
Music spectrum display toy -- implementation and application of FFT in stm32
Sqlserver is case sensitive
[excel knowledge and skills] Excel data type
WIN10系统C盘清理策略
开窍之问答
JS reverse case: cracking login password
Modelsim simulation FFT core cannot be simulated solution (qsys)
Handling of @charset UTF-8 warning problems during vite packaging and construction;
vite打包构建时 @charset utf-8警告问题处理;
同花顺软件买股票进行交易安全吗?怎么开户买股票
Computer network knowledge summary (interview)
生信周刊第33期