当前位置:网站首页>Halcon clolor_ pieces. Hedv: classifier_ Color recognition
Halcon clolor_ pieces. Hedv: classifier_ Color recognition
2022-07-05 08:40:00 【Aii parson】
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image (Image, 'E:/03 CV( ancient )/Halcon/ Code / Sugar bean /train.jpg')
Regions:=[' yellow ',' red ',' green ',' orange ',' background ']
gen_empty_obj (Classes)# Create an empty object , To save training samples
for i := 1 to |Regions| by 1
dev_display (Image)
dev_display (Classes)
disp_message (WindowHandle, ' Please select the specified area :', 'window', 12, 12, 'black', 'true')
draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2) # Rectangular frame , You can also draw a frame of any shape
gen_rectangle1 (Rectangle, Row1, Column1, Row2, Column2)
concat_obj (Rectangle, Classes, Classes)
endfor
# Create classifier , Add data , Training data
*union1 (Classes, RegionUnion)* Not used here union1
create_class_mlp (3,7, 5, 'softmax', 'normalization', 3, 42, MLPHandle)# If it is a three channel color image , The first parameter can be set 3, The third parameter is the number of output parameters, that is Class Number of colors included , Remove the background color . The second parameter is the third parameter 2 About times .
add_samples_image_class_mlp (Image, Classes, MLPHandle)# Put the training sample Class Add to network
disp_message (WindowHandle, 'Training...', 'window', 100, 12, 'black', 'false')
train_class_mlp (MLPHandle, 400, 0.5, 0.01, Error, ErrorLog)
*test distinguish
for i := 1 to 3 by 1
read_image (Image1, 'E:/03 CV( ancient )/Halcon/ Code / Sugar bean /test0'+i)
classify_image_class_mlp (Image1, ClassRegions, MLPHandle, 0.5) # Classify and recognize objects
# Show
for Index := 1 to 5 by 1
dev_clear_window ()
copy_obj (ClassRegions, ObjectsSelected, Index, 1)# Choose one
dev_display (Image1)
dev_display (ObjectsSelected)
disp_message (WindowHandle, Regions[5-Index], 'window', 10, 10, 'black', 'true')
endfor
endfor




边栏推荐
- Stm32--- systick timer
- UE pixel stream, come to a "diet pill"!
- Esphone Feixun DC1 soft change access homeassstant
- C# LINQ源码分析之Count
- Basic number theory - fast power
- Reasons for the insecurity of C language standard function scanf
- Daily question - input a date and output the day of the year
- Guess riddles (10)
- Wheel 1:qcustomplot initialization template
- 实例005:三数排序 输入三个整数x,y,z,请把这三个数由小到大输出。
猜你喜欢

Guess riddles (5)

Guess riddles (6)

剑指 Offer 06. 从尾到头打印链表

【三层架构】
![[牛客网刷题 Day4] JZ35 复杂链表的复制](/img/bc/ce90bb3cb6f52605255f1d6d6894b0.png)
[牛客网刷题 Day4] JZ35 复杂链表的复制

【NOI模拟赛】汁树(树形DP)

Numpy pit: after the addition of dimension (n, 1) and dimension (n,) array, the dimension becomes (n, n)

实例003:完全平方数 一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?

Example 004: for the day of the day, enter a day of a month of a year to judge the day of the year?

Guess riddles (8)
随机推荐
MATLAB skills (28) Fuzzy Comprehensive Evaluation
Sword finger offer 06 Print linked list from end to end
实例005:三数排序 输入三个整数x,y,z,请把这三个数由小到大输出。
Infix expression evaluation
剑指 Offer 06. 从尾到头打印链表
2022.7.4-----leetcode. one thousand and two hundred
Guess riddles (2)
Arrangement of some library files
猜谜语啦(142)
Is the security account given by Yixue school safe? Where can I open an account
Arduino+a4988 control stepper motor
Guess riddles (4)
Esp8266 interrupt configuration
[matlab] matlab reads and writes Excel
Guess riddles (11)
STM32---IIC
Yolov4 target detection backbone
Explore the authentication mechanism of StarUML
猜谜语啦(5)
Guess riddles (6)