首页 > 其他分享 >模板匹配——determine_shape_model_params

模板匹配——determine_shape_model_params

时间:2024-03-14 15:24:13浏览次数:20  
标签:parameters Parameters shape params determine 参数 model contrast

determine_shape_model_params — Determine the parameters of a shape model.  模版匹配参数确定

 determine_shape_model_params determines certain parameters of a shape model automatically from the model image Template. The parameters to be determined can be specified with Parameters. determine_shape_model_params can be used to determine the same parameters that are determined automatically when the respective parameter in create_shape_model, create_scaled_shape_model, or create_aniso_shape_model is set to 'auto': the number of pyramid levels (Parameters = 'num_levels'), the angle step length (Parameters = 'angle_step'), the scale step length (Parameters = 'scale_step' for isotropic scaling and 'scale_r_step' and/or 'scale_c_step' for anisotropic scaling), the kind of optimization (Parameters = 'optimization'), the threshold (Parameters = 'contrast') or the hysteresis thresholds (Parameters = 'contrast_hyst') for the contrast, the minimum size of the object parts (Parameters = 'min_size'), and the minimum contrast (Parameters = 'min_contrast'). By passing a tuple of the above values in Parameters, an arbitrary combination of these parameters can be determined. If all of the above parameters should be determined, the value 'all' can be passed. In this case both hysteresis thresholds are determined, i.e., the operator behaves like passing 'contrast_hyst' instead of 'contrast'.

determine_shape_model_params从模型图像模板自动确定形状模型的某些参数。要确定的参数可以使用参数指定。determine_shape_model_params可用于确定create_shape_model、create_scaled_shape_model或create_aniso_shape_model中的相应参数设置为“自动”时自动确定的相同参数:金字塔级别数(参数 = “num_levels”)、角度步长(参数 = “angle_step”)、刻度步长(参数 = “scale_step”用于各向同性缩放,“scale_r_step”和/或“scale_c_step”用于各向异性缩放), 对比度的优化类型 (Parameters = 'optimization')、阈值 (Parameters = 'contrast') 或滞后阈值 (Parameters = 'contrast_hyst')、对象部分的最小尺寸 (Parameters = 'min_size') 和最小对比度 (Parameters = 'min_contrast')。通过在参数中传递上述值的元组,可以确定这些参数的任意组合。如果应确定上述所有参数,则可以传递值“all”。在这种情况下,两个滞后阈值都是确定的,即算子的行为类似于传递“contrast_hyst”而不是“对比度”。

determine_shape_model_params is mainly useful to determine the above parameters before creating the model, e.g., in an interactive system, which makes suggestions for these parameters to the user, but enables the user to modify the suggested values.

determine_shape_model_params主要用于在创建模型之前确定上述参数,例如,在交互式系统中,它向用户提出这些参数的建议,但允许用户修改建议的值。

The automatically determined parameters are returned as a name-value pair in ParameterName and ParameterValue. The parameter names in ParameterName are identical to the names in Parameters, where, of course, the value 'all' is replaced by the actual parameter names. An exception is the parameter 'contrast_hyst', for which the two values 'contrast_low' and 'contrast_high' are returned.

自动确定的参数在 ParameterName 和 ParameterValue 中以名称-值对的形式返回。ParameterName 中的参数名称与 Parameters 中的名称相同,当然,其中值“all”将替换为实际的参数名称。参数“contrast_hyst”是一个例外,该参数返回两个值“contrast_low”和“contrast_high”。

The remaining parameters (NumLevels, AngleStart, AngleExtent, ScaleMin, ScaleMax, Optimization, Metric, Contrast, and MinContrast) have the same meaning as in create_shape_model, create_scaled_shape_model, and create_aniso_shape_model. The description of these parameters can be looked up with these operators. These parameters are used by determine_shape_model_params to calculate the parameters to be determined in the same manner as in create_shape_model, create_scaled_shape_model, and create_aniso_shape_model. It should be noted that if the parameters of a shape model with isotropic scaling should be determined, i.e., if Parameters contains 'scale_step' either explicitly or implicitly via 'all', the parameters ScaleMin and ScaleMax must contain one value each. If the parameters of a shape model with anisotropic scaling should be determined, i.e., if Parameters contains 'scale_r_step' or 'scale_c_step' either explicitly or implicitly, the parameters ScaleMin and ScaleMax must contain two values each. In this case, the first value of the respective parameter refers to the scaling in the row direction, while the second value refers to the scaling in the column direction.

其余参数(NumLevels、AngleStart、AngleExtent、ScaleMin、ScaleMax、Optimization、Metric、Contrast 和 MinContrast)的含义与 create_shape_model、create_scaled_shape_model 和 create_aniso_shape_model 中的含义相同。可以使用这些运算符查找这些参数的描述。determine_shape_model_params使用这些参数来计算要确定的参数,其方式与create_shape_model、create_scaled_shape_model和create_aniso_shape_model中的方式相同。应该注意的是,如果应确定具有各向同性缩放的形状模型的参数,即,如果参数通过“all”显式或隐式地包含“scale_step”,则参数 ScaleMin 和 ScaleMax 必须各包含一个值。如果应确定具有各向异性缩放的形状模型的参数,即,如果 Parameters 显式或隐式包含“scale_r_step”或“scale_c_step”,则参数 ScaleMin 和 ScaleMax 必须分别包含两个值。在这种情况下,相应参数的第一个值是指行方向上的缩放,而第二个值是指列方向上的缩放。

Note that in determine_shape_model_params some parameters appear that can also be determined automatically (NumLevels, Optimization, Contrast, MinContrast). If these parameters should not be determined automatically, i.e., their name is not passed in Parameters, the corresponding parameters must contain valid values and must not be set to 'auto'. In contrast, if these parameters are to be determined automatically, their values are treated in the following way: If the optimization or the (hysteresis) contrast is to be determined automatically, i.e., Parameters contains the value 'optimization' or 'contrast' ('contrast_hyst'), the values passed in Optimization and Contrast are ignored. In contrast, if the maximum number of pyramid levels or the minimum contrast is to be determined automatically, i.e., Parameters contains the value 'num_levels' or 'min_contrast', you can let HALCON determine suitable values and at the same time specify an upper or lower boundary, respectively:

请注意,在determine_shape_model_params中会出现一些也可以自动确定的参数(NumLevels、Optimization、Contrast、MinContrast)。如果这些参数不应自动确定,即未在参数中传递其名称,则相应的参数必须包含有效值,并且不得设置为“auto”。相反,如果要自动确定这些参数,则按以下方式处理其值:如果要自动确定优化或(滞后)对比度,即参数包含值“优化”或“对比度”(“contrast_hyst”),则忽略在优化和对比度中传递的值。相反,如果要自动确定金字塔级别的最大数量或最小对比度,即参数包含值“num_levels”或“min_contrast”,则可以让 HALCON 确定合适的值,同时分别指定上限或下限:

If the maximum number of pyramid levels should be specified in advance, NumLevels can be set to the particular value. If in this case Parameters contains the value 'num_levels', the computed number of pyramid levels is at most NumLevels. If NumLevels is set to 'auto' (or 0 for backwards compatibility), the number of pyramid levels is determined without restrictions as large as possible.

如果应提前指定金字塔级别的最大数量,则可以将 NumLevels 设置为特定值。如果在本例中 Parameters 包含值“num_levels”,则计算出的金字塔级别数最多为 NumLevels。如果 NumLevels 设置为“auto”(或 0 表示向后兼容),则确定金字塔级别的数量,而不受尽可能大的限制。

If the minimum contrast should be specified in advance, MinContrast can be set to the particular value. If in this case Parameters contains the value 'min_contrast', the computed minimum contrast is at least MinContrast. If MinContrast is set to 'auto', the minimum contrast is determined without restrictions.

如果应提前指定最小对比度,则可以将 MinContrast 设置为特定值。如果在本例中 Parameters 包含值“min_contrast”,则计算出的最小对比度至少为 MinContrast。如果 MinContrast 设置为“auto”,则无限制地确定最小对比度。

 

::determine_shape_model_params (ImageReduced, 'auto', -0.39, 0.79, 0.9, 1.1, 'auto', 'use_polarity', 'auto', 'auto', 'all', ParameterName, ParameterValue)

 

标签:parameters,Parameters,shape,params,determine,参数,model,contrast
From: https://www.cnblogs.com/echo-efun/p/18072680

相关文章

  • 模板匹配——create_shape_model
    Theoperatorcreate_shape_modelpreparesatemplate,whichispassedintheimageTemplate,asashapemodelusedformatching.TheROIofthemodelispassedasthedomainofTemplate.运算符create_shape_model准备一个模板,该模板在图像模板中传递,作为用于匹配的......
  • 模板匹配——set_shape_model_clutter
    通过设置杂波,来准确定位要检测对象;如下图中未设置杂波情况下,匹配结果如(3);如图(4)设置杂波后,匹配结果如图(5)**Createashapemodel.*创建一个模型read_image(ImageModel,'/bga_gap/bga_gap_01.png')gen_circle(ROI,753.869,551.624,28.4027)reduce_domain(Image......
  • 模版匹配——set_shape_model_param
    1.'min_contrast'最小对比度SetstheminimumcontrastoftheobjectinthesearchimagesfortheshapemodelModelID.Thereby,thevalueof'min_contrast'thatwasoriginallyset,e.g.withcreate_shape_model,isoverwrittenfortheshape......
  • Axios的params参数传递
    问题描述:如果传递的params如下所示:{a:[1,2]}那么,url是这样的:xxxx/xxx?a[]=1&a[]=2注意,这里的a数组被分开了,并在a后面加了一个"[]"然而我后端使用的框架是FastAPI,默认接收a(也就是不加"[]"),这就导致了参数无法正常接收 解决方案:给axios加一个paramsSerializer函数,自定......
  • 基于WonderShaper对Docker容器进行带宽限速
    #安装WonderShaperaptupdateaptinstallwondershaper#创建Docker网桥dockernetworkcreate--driverbridge<网桥名>#然后终端会输出网桥ID:d0970005351xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd30d0e757f0#记住前面几位然后查看所有网卡ifconfig#如果执行不了就自己去......
  • 关于SpringMVC中@RequestMapping的params参数
    @RequestMapping注解的params参数同一个url,只要params不同,springmvc也是会区分匹配的。@PostMapping("/reduceProductStock")publicStringreduceProductStock(@RequestParamLongproductId,@RequestParamIntegerquantity){productService.reduceProductStock(pr......
  • 实战1-params随机生成(难度初级)
    目标网站>aHR0cDovL3R6eG0uanh6d2Z3dy5nb3YuY24vaWNpdHkvaXByby9vcGVuL3B1YmxpY2l0eQ==1.先找到需要逆向的参数通过翻页找到这个数据包![这是图片](https://img2024.cnblogs.com/blog/2861542/202402/2861542-20240228165958593-1353453011.png)复制数据包的Curl,运用爬虫工......
  • C#的函数使用 和参数修饰符 out ref params
    //函数和方法//函数好比对象的动作行为在定义函数的时候,职责(作用/功能)越单一越好满足高内聚低耦合的开发思路//变量的命名规则小驼峰//函数的命名规则大驼峰动词开头//函数的参数参数可以认为是外部需要函数帮忙处理的数据......
  • 【libGDX】使用ShapeRenderer绘制几何图形
    1ShapeRenderer简介​ShapeRenderer是libGDX中用于绘制基本形状的工具之一。它可以绘制点、线、矩形、多边形、圆形、椭圆形、扇形、立方体、圆锥体等几何图形。这对于在游戏或图形应用程序中绘制简单的形状是很有用的。​ShapeRenderer的主要方法如下:​1)开......
  • R语言k-Shape时间序列聚类方法对股票价格时间序列聚类|附代码数据
    原文链接:http://tecdat.cn/?p=3726最近我们被客户要求撰写关于时间序列聚类的研究报告,包括一些图形和统计输出。本文我们将使用k-Shape时间序列聚类方法检查与我们有业务关系的公司的股票收益率的时间序列企业对企业交易和股票价格在本研究中,我们将研究具有交易关系的公司的......