柒[7],形状模板匹配,函数CreateShapeModel/FindShapeModel/ReadShapeModel/WriteShapeModel/序列化

函数CreateShapeModel

函数功能

创建一个不可缩放的形状匹配模板

C++形式

LIntExport void CreateShapeModel(
const HObject& Template, 
const HTuple& NumLevels, 
const HTuple& AngleStart, 
const HTuple& AngleExtent, 
const HTuple& AngleStep, 
const HTuple& Optimization, 
const HTuple& Metric, 
const HTuple& Contrast, 
const HTuple& MinContrast, 
HTuple* ModelID);

//参数1:模板图像
//参数2:金字塔层数,默认"auto",参考值"auto",0-10,用于多尺度匹配,金字塔的层数越大,找到匹配使用的时间就越小
//参数3:匹配时起始角度
//参数4:匹配时角度范围
//参数5:匹配时旋转角度的步长,默认"auto",参考值>=0
//参数6:模板优化/模板创建方法,默认"auto"
//参数7:模板匹配的方法,默认"use_polarity"
//参数8:对比度增强系数
//参数9:最小对比度阈值,默认"auto",参考值 < 参数8的值
//参数10:输出的模板ID

//参数6的参考值
//"auto"
//"none"
//"point_reduction_low",减少点数
//"point_reduction_medium",减少点数
//"point_reduction_high",减少点数
//"pregenneration",预先存储到内存,会快
//"no_pregenneration",预先存储到内存,会慢
//参数7参考值
//"use_polarity",使用极性
//"ignore_global_polarity",忽略全局极性
//"ignore_local_polarity",忽略局部极性
//"ignore_color_polarity",忽略颜色极性

C#形式

public static void CreateShapeModel(
HObject template, 
HTuple numLevels, 
HTuple angleStart, 
HTuple angleExtent, 
HTuple angleStep, 
HTuple optimization, 
HTuple metric, 
HTuple contrast, 
HTuple minContrast, 
out HTuple modelID);

 函数FindShapeModel

函数功能

查找形状匹配模板

C++形式

LIntExport void FindShapeModel(
const HObject& Image, 
const HTuple& ModelID, 
const HTuple& AngleStart, 
const HTuple& AngleExtent, 
const HTuple& MinScore, 
const HTuple& NumMatches, 
const HTuple& MaxOverlap, 
const HTuple& SubPixel, 
const HTuple& NumLevels, 
const HTuple& Greediness, 
HTuple* Row, 
HTuple* Column, 
HTuple* Angle, 
HTuple* Score);

//参数1:输入图像
//参数2:模板ID
//参数3:匹配时的起始角度
//参数4:匹配时的角度范围
//参数5:匹配时最小得分,默认=0.5
//参数6:匹配时的最大数量,默认=1
//参数7:多个匹配结果的重叠系数,默认=0.5,值=0,不能重叠,值=1,所有匹配结果,参考值>=0 && <=1
//参数8:是否使用亚像素精度提取,默认值="least_squares"
//参数9:匹配时,搜索金字塔层数,默认值0,参考值0-10
//参数10:贪婪程度,默认0.9,参考值>=0 && <=1
//参数11:输出轮廓中心(Row)
//参数12:输出轮廓中心(Column)
//参数13:输出轮廓角度
//参数14:输出轮廓得分

//参数8参考值
//"least_squares"
//"none"
//"interpolation"
//"least_squares_high"
//"least_squares_very_high"
//"max_deformation 1"
//"max_deformation 2"
//"max_deformation 3"
//"max_deformation 4"
//"max_deformation 5"
//"max_deformation 6"

C#形式

public static void FindShapeModel(
HObject image, 
HTuple modelID, 
HTuple angleStart, 
HTuple angleExtent, 
HTuple minScore, 
HTuple numMatches, 
HTuple maxOverlap, 
HTuple subPixel, 
HTuple numLevels, 
HTuple greediness, 
out HTuple row, 
out HTuple column, 
out HTuple angle, 
out HTuple score);

函数ReadShapeModel

函数功能

读取形状匹配模板

C++形式

LIntExport void ReadShapeModel(
const HTuple& FileName, 
HTuple* ModelID);

//参数1:模板文件名称
//参数2:输出模板ID

C#形式

public static void ReadShapeModel(
HTuple fileName, 
out HTuple modelID)

 函数WriteShapeModel

函数功能

保存形状匹配模板

C++形式

LIntExport void WriteShapeModel(
const HTuple& ModelID, 
const HTuple& FileName);

//参数1:输模板ID
//参数2:模板文件名称

C#形式

public static void WriteShapeModel(
HTuple modelID, 
HTuple fileName);

函数DeserializeShapeModel

函数功能

反序列化形状匹配模板

C++形式

LIntExport void DeserializeShapeModel(
const HTuple& SerializedItemHandle, 
HTuple* ModelID);

//参数1:序列化的模板Handle
//参数2:输出模板ID

C#形式

public static void DeserializeShapeModel(
HTuple serializedItemHandle, 
out HTuple modelID)

 函数SerializeShapeModel

函数功能

序列化形状匹配模板

C++形式

LIntExport void SerializeShapeModel(
const HTuple& ModelID, 
HTuple* SerializedItemHandle);

//参数1:输模板ID
//参数2:模板文件名称

C#形式

public static void SerializeShapeModel(
HTuple modelID, 
out HTuple serializedItemHandle)

  • 10
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值