分类器实现图像分割
- 创建svm分类器: create_class_svm()
- 增加样本:add_samples_image_class_svm()
- 分类器训练: train_class_svm()
- 分类识别算子:classify_image_class_svm()
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image (Image, 'train.png')
*创建训练区域
gen_empty_obj (Union_Obj)
for Index := 1 to 5 by 1
draw_region (Region, WindowHandle)
concat_obj (Union_Obj, Region, Union_Obj)
endfor
*创建分类器
create_class_svm (3, 'rbf', 0.02, 0.001, 5, 'one-versus-all', 'normalization', 10, SVMHandle)
add_samples_image_class_svm (Image, Union_Obj, SVMHandle)
*训练
train_class_svm (SVMHandle, 0.001, 'default')
classify_image_class_svm (Image, ClassRegions, SVMHandle)