scan#

scan(matching_data, matching_setup, matching_score, n_jobs=4, callback_class=None, callback_class_args={}, pad_fourier=True, pad_template_filter=True, interpolation_order=3, jobs_per_callback_class=8, shared_memory_handler=None)[source]#

Run template matching.

Warning

matching_data might be altered or destroyed during computation.

Parameters:
matching_datatme.matching_data.MatchingData

Template matching data.

matching_setupCallable

Function pointer to setup function.

matching_scoreCallable

Function pointer to scoring function.

n_jobsint, optional

Number of parallel jobs. Default is 4.

callback_classtype, optional

Analyzer class pointer to operate on computed scores.

callback_class_argsdict, optional

Arguments passed to the callback_class. Default is an empty dictionary.

pad_fourier: bool, optional

Whether to pad target and template to the full convolution shape.

pad_template_filter: bool, optional

Whether to pad potential template filters to the full convolution shape.

interpolation_orderint, optional

Order of spline interpolation for rotations.

jobs_per_callback_classint, optional

How many jobs should be processed by a single callback_class instance, if one is provided.

shared_memory_handlertype, optional

Manager for shared memory objects, None by default.

Returns:
Optional[Tuple]

The merged results from callback_class if provided otherwise None.

Examples

Schematically, scan() is identical to scan_subsets(), with the distinction that the objects contained in matching_data are not split and the search is only parallelized over angles. Assuming you have followed the example in scan_subsets(), scan() can be invoked like so

>>> from tme.matching_exhaustive import scan
>>> results = scan(
>>>    matching_data = matching_data,
>>>    matching_score = matching_score,
>>>    matching_setup = matching_setup,
>>>    callback_class = callback_class,
>>>    callback_class_args = callback_class_args,
>>> )