drothlis/stb-tester — pull request #34 by abaharna (2013-06-24 14:35:12+00:00)
Title: stbt.py: store `MatchParameters.match_method` as a string

Currently the `MatchParameters` constructor maps the `match_method`
argument (str) to the corresponding OpenCV match method enum (int).
While the value is passed in as a string, it is stored as an integer.

This makes it difficult to reconstruct the string representation of the
`match_method`. In addition, if it is necessary to override the value in
an existing MatchParameters instance, the mapping would have to be
performed by the user manually:

params = stbt.MatchParameters()
...
params['match_method'] = cv2.TM_SQDIFF_NORMED

This change keeps the `MatchParameters.match_method` as a string, but
converts it to the OpenCV enum at the point at which it is used (the
`_match_template()` function. A new variable `match_method_cv` is
introduced in `_match_template()` to perform the mapping.