fast_match_mgT_fast_match_mgFastMatchMgFastMatchMgfast_match_mg (算子名称)
名称
fast_match_mgT_fast_match_mgFastMatchMgFastMatchMgfast_match_mg — Searching all good gray value matches in a pyramid.
警告
fast_match_mgfast_match_mgFastMatchMgFastMatchMgFastMatchMgfast_match_mg is obsolete and is only provided for
reasons of backward compatibility. New applications should use the
shape-based or NCC-based operators instead.
参数签名
void FastMatchMg(const HObject& Image, HObject* Matches, const HTuple& TemplateID, const HTuple& MaxError, const HTuple& NumLevel)
HRegion HTemplate::FastMatchMg(const HImage& Image, double MaxError, const HTuple& NumLevel) const
HRegion HTemplate::FastMatchMg(const HImage& Image, double MaxError, Hlong NumLevel) const
HRegion HImage::FastMatchMg(const HTemplate& TemplateID, double MaxError, const HTuple& NumLevel) const
HRegion HImage::FastMatchMg(const HTemplate& TemplateID, double MaxError, Hlong NumLevel) const
static void HOperatorSet.FastMatchMg(HObject image, out HObject matches, HTuple templateID, HTuple maxError, HTuple numLevel)
HRegion HTemplate.FastMatchMg(HImage image, double maxError, HTuple numLevel)
HRegion HTemplate.FastMatchMg(HImage image, double maxError, int numLevel)
HRegion HImage.FastMatchMg(HTemplate templateID, double maxError, HTuple numLevel)
HRegion HImage.FastMatchMg(HTemplate templateID, double maxError, int numLevel)
描述
该算子 fast_match_mgfast_match_mgFastMatchMgFastMatchMgFastMatchMgfast_match_mg like 该算子
fast_matchfast_matchFastMatchFastMatchFastMatchfast_match performs a matching of the template of
TemplateIDTemplateIDTemplateIDTemplateIDtemplateIDtemplate_id and ImageImageImageImageimageimage.
In contrast to fast_matchfast_matchFastMatchFastMatchFastMatchfast_match, however, the search for
good matches starts in scaled down images (pyramid).
The number of levels of the pyramid will be determined by
NumLevelNumLevelNumLevelNumLevelnumLevelnum_level.
Hereby the value 1 indicates that no pyramid will be used.
In this case 该算子 fast_match_mgfast_match_mgFastMatchMgFastMatchMgFastMatchMgfast_match_mg is
equivalent to 该算子 fast_matchfast_matchFastMatchFastMatchFastMatchfast_match. The value
2 triggers the search in the image with half the framesize.
The search for all those points showing an error small enough
in the scaled down image (error smaller than MaxErrorMaxErrorMaxErrorMaxErrormaxErrormax_error)
will be refined at the corresponding positions
in the original image (ImageImageImageImageimageimage).
The runtime of matching depends on the parameter MaxErrorMaxErrorMaxErrorMaxErrormaxErrormax_error:
the larger the value the longer is the processing time,
because more points of the pattern have to be tested.
If MaxErrorMaxErrorMaxErrorMaxErrormaxErrormax_error is to low the pattern will not be found.
The value has therefore to be optimized for every
application.
NumLevelNumLevelNumLevelNumLevelnumLevelnum_level indicates the number of levels of the pyramid,
including the original image.
Optionally a second value can be given. This value specifies
the number (0..n) of the lowest level which is used the matching.
The region found up to this level will then be zoomed to the size
of the original level.
This can used to increase the runtime in the case that the accuracy
does not have to be so high.
运行信息
- 多线程类型:可重入(与非独占操作符并行运行)。
- 多线程作用域:全局(可以从任何线程调用)。
- 在元组级别自动并行化。
参数表
ImageImageImageImageimageimage (input_object) singlechannelimage(-array) → objectHImageHObjectHImageHobject (byte)
Input image inside of which the pattern has to
be found.
MatchesMatchesMatchesMatchesmatchesmatches (output_object) region(-array) → objectHRegionHObjectHRegionHobject *
All points which have an error below a certain
threshold.
TemplateIDTemplateIDTemplateIDTemplateIDtemplateIDtemplate_id (input_control) template → HTemplate, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Template number.
MaxErrorMaxErrorMaxErrorMaxErrormaxErrormax_error (input_control) real → HTuplefloatHTupleHtuple (real) (double) (double) (double)
Maximal average difference of the gray values.
Default:
30.0
Suggested values:
0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 11.0, 15.0, 17.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0
Value range:
0
≤
MaxError
MaxError
MaxError
MaxError
maxError
max_error
≤
255
Minimum increment:
1
Recommended increment:
3
NumLevelNumLevelNumLevelNumLevelnumLevelnum_level (input_control) integer(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of levels in the pyramid.
Default:
3
Suggested values:
1, 2, 3, 4, 5, 6, 7, 8
结果
If the parameter values are correct, 该算子 fast_match_mgfast_match_mgFastMatchMgFastMatchMgFastMatchMgfast_match_mg
返回值 2 (
H_MSG_TRUE)
.
If the input is empty (no input images are available) the behavior can
be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>).
如有必要,将引发异常。
可能的前置算子
create_templatecreate_templateCreateTemplateCreateTemplateCreateTemplatecreate_template,
read_templateread_templateReadTemplateReadTemplateReadTemplateread_template,
adapt_templateadapt_templateAdaptTemplateAdaptTemplateAdaptTemplateadapt_template,
draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region,
draw_rectangle1draw_rectangle1DrawRectangle1DrawRectangle1DrawRectangle1draw_rectangle1,
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain
可替代算子
best_matchbest_matchBestMatchBestMatchBestMatchbest_match,
best_match_mgbest_match_mgBestMatchMgBestMatchMgBestMatchMgbest_match_mg,
fast_matchfast_matchFastMatchFastMatchFastMatchfast_match,
exhaustive_matchexhaustive_matchExhaustiveMatchExhaustiveMatchExhaustiveMatchexhaustive_match,
exhaustive_match_mgexhaustive_match_mgExhaustiveMatchMgExhaustiveMatchMgExhaustiveMatchMgexhaustive_match_mg
模块
Matching