当前位置:网站首页>Halcon's practice based on shape template matching [1]
Halcon's practice based on shape template matching [1]
2022-07-05 07:55:00 【BoomBiuBiu】
According to the clip, carry out the actual combat based on the shape template matching
1、 Open the menu bar assistant Matching assistant
2、 Click acquisition assistant -- Enter the image acquisition interface -- Click the automatic detection interface
3、 Click to connect -- real time
4、 With Clip For example , You can see that there is a clip in the image window
5、 Click on the rotating rectangle of the template's region of interest , Create a template for the clip
6、 Click the application interface , Switch based on shape -- Click image acquisition assistant -- Click on the real-time image
It can be seen here that no matter how many clips are placed, they can be matched according to the shape
7、 Click execute on the detection interface , You can see some statistical data
8、 Click code generation , You can choose to generate display code / Correction code
9、 You can see the generated code in the program window
*
* Matching 01: ************************************************
* Matching 01: BEGIN of generated code for model initialization
* Matching 01: ************************************************
set_system ('border_shape_models', 'false')
*
* Matching 01: Initialize acquisition
open_framegrabber ('DirectShow', 1, 1, 0, 0, 0, 0, 'default', 8, 'rgb', -1, 'false', 'default', '[0] Web Camera', 0, -1, AcqHandle)
*
* Matching 01: Obtain the model image
grab_image (Image, AcqHandle)
*
* Matching 01: Build the ROI from basic regions
gen_rectangle2 (ModelRegion, 356.886, 1166.06, rad(-92.8126), 121.142, 84.885)
*
* Matching 01: Reduce the model template
reduce_domain (Image, ModelRegion, TemplateImage)
*
* Matching 01: Create the shape model
create_shape_model (TemplateImage, 6, rad(0), rad(360), rad(0.8586), ['none','no_pregeneration'], 'use_polarity', [7,31,12], 4, ModelID)
*
* Matching 01: Get the model contour for transforming it later into the image
get_shape_model_contours (ModelContours, ModelID, 1)
*
* Matching 01: Get the reference position
area_center (ModelRegion, ModelRegionArea, RefRow, RefColumn)
vector_angle_to_rigid (0, 0, 0, RefRow, RefColumn, 0, HomMat2D)
affine_trans_contour_xld (ModelContours, TransContours, HomMat2D)
*
* Matching 01: Display the model contours
dev_display (Image)
dev_set_color ('green')
dev_set_draw ('margin')
dev_display (ModelRegion)
dev_display (TransContours)
stop ()
*
* Matching 01: END of generated code for model initialization
* Matching 01: * * * * * * * * * * * * * * * * * * * * * * *
* Matching 01: BEGIN of generated code for model application
*
while (true)
*
* Matching 01: Obtain the image
grab_image (Image, AcqHandle)
*
* Matching 01: Find the model
find_shape_model (Image, ModelID, rad(0), rad(360), 0.5, 0, 0.5, 'least_squares', [6,1], 0.75, Row, Column, Angle, Score)
*
* Matching 01: Transform the model contours into the detected positions
dev_display (Image)
for I := 0 to |Score| - 1 by 1
hom_mat2d_identity (HomMat2D)
hom_mat2d_rotate (HomMat2D, Angle[I], 0, 0, HomMat2D)
hom_mat2d_translate (HomMat2D, Row[I], Column[I], HomMat2D)
affine_trans_contour_xld (ModelContours, TransContours, HomMat2D)
dev_set_color ('green')
dev_display (TransContours)
stop ()
endfor
endwhile
*
* Matching 01: Clear model when done
stop ()
clear_shape_model (ModelID)
* Matching 01: *******************************************
* Matching 01: END of generated code for model application
* Matching 01: *******************************************
*
边栏推荐
- Could NOT find XXX (missing: XXX_LIBRARY XXX_DIR)
- C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,LU分解(LU Decomposition)源程序
- Network communication model -- Network OSI tcp/ip layering
- Day07 type of mathematical operator automatic conversion relational operator bitwise operator blind date math
- Extern keyword function
- TCP and UDP
- [popular science] some interesting things that I don't know whether they are useful or not
- Global and Chinese market of resistivity meter 2022-2028: Research Report on technology, participants, trends, market size and share
- Consul安装
- Programming knowledge -- basis of C language
猜你喜欢
C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,LU分解(LU Decomposition)源程序
C WinForm [display real-time time in the status bar] - practical exercise 1
Network communication process
如何进行导电滑环选型
Acwing - the collection of pet elves - (multidimensional 01 Backpack + positive and reverse order + two forms of DP for the answer)
Programming knowledge -- assembly knowledge
找不到实时聊天软件?给你推荐电商企业都在用的!
Application of ultra pure water particle counter in electronic semiconductors
Screen record of the opening ceremony of the Beijing winter olympics 2
Altium designer 19.1.18 - Import frame
随机推荐
Beijing Winter Olympics opening ceremony display equipment record 3
How to realize audit trail in particle counter software
STM32 learning method
Embedded composition and route
研究發現,跨境電商客服系統都有這五點功能!
Train your dataset with yolov4
LED display equipment records of the opening ceremony of the Beijing Winter Olympics
The browser cannot access Baidu
. Net service governance flow limiting middleware -fireflysoft RateLimit
About yolov3, conduct map test directly
Temperature sensor DS18B20 principle, with STM32 routine code
Global and Chinese markets of large aperture scintillators 2022-2028: Research Report on technology, participants, trends, market size and share
软件设计师:03-数据库系统
RF ride side door processing of prompt box
Global and Chinese markets for recycled boilers 2022-2028: Research Report on technology, participants, trends, market size and share
Pointnet++ classification practice
Consul安装
Global and Chinese markets for anesthesia, breathing and sleep apnea devices 2022-2028: Research Report on technology, participants, trends, market size and share
Batch modify the txt file code to UTF-8 (notepad++)
Global and Chinese markets for flexible endoscopic lithotripsy devices 2022-2028: Research Report on technology, participants, trends, market size and share