Commit Graph

1407 Commits

Author SHA1 Message Date
Tony S Yu 06bd3ebd6f Add doctest example to match_template. 2012-05-08 21:32:09 -04:00
Tony S Yu a2f91585ef Add test for pad_input = True. 2012-05-08 21:32:08 -04:00
Tony S Yu 193d5abd3c Rename pad_output parameter to pad_input. 2012-05-08 21:32:08 -04:00
Tony S Yu 383ca6220a Set match_template to default to no padding and fix test. 2012-05-08 21:32:08 -04:00
Tony S Yu ad99285bc0 Prevent match_template from returning NaNs. 2012-05-08 21:32:08 -04:00
Tony S Yu 0c1e3541b3 Check that image is larger than template. 2012-05-08 21:32:08 -04:00
Tony S Yu 5e49eb4fb6 Add alternate example for match_template. 2012-05-08 21:32:08 -04:00
Tony S Yu b2006da346 Change flipud/fliplr to array indexing. 2012-05-08 21:32:08 -04:00
Tony S Yu 43ed4b9fb7 Pad input image instead of output. 2012-05-08 21:32:08 -04:00
Tony S Yu 5d79537566 Fix convolution input to get correlation results. 2012-05-08 21:32:07 -04:00
Tony S Yu 7caf85a5c1 Renaming for clarity. 2012-05-08 21:32:07 -04:00
Tony S Yu f21f032bfe Add normalization test and remove unnecessary clipping. 2012-05-08 21:32:07 -04:00
Tony S Yu 94262bc8d6 Tweak example to reduce confusion.
Set background 1 so that the template has values equally-above and -below the mean image value. This change makes the template results left-right symmetric, which may reduce confusion.
2012-05-08 21:32:07 -04:00
Tony S Yu 5682d27eb0 Rewrite normalization algorithm.
This is a major revision that removes the `method` parameter of `match_template` and uses a new normalization method.

Note that the example result is different with this new normalization.
2012-05-08 21:32:07 -04:00
Tony S Yu 753e999a7a Minor cleanup
* Rename some variables.
* Delete some old comments.
* Move some variable initializations to the top of the function.
2012-05-08 21:32:07 -04:00
Tony S Yu 883dd24cdb Fix bug when indexing into summed-area table. 2012-05-08 21:32:07 -04:00
Tony S Yu 2e8fcef89b Simply equation in docstring of match_docstring. 2012-05-08 21:32:06 -04:00
Tony S Yu a87bcb2d73 DOC: demonstrate where the template is matched in an image. 2012-05-08 21:32:06 -04:00
Tony S Yu cbdea0d36e Add pad_output argmument to match_template. 2012-05-08 21:32:06 -04:00
Tony S Yu 3c7ae849b9 Remove unnecessary truncation at boundary. 2012-05-08 21:32:06 -04:00
Tony S Yu 545bdab985 Refactor template matching.
* Change Cython function to take names of correlation method instead of numbers representing the methods.

* Use alternate formula for `template_norm` of 'norm-corr' method, but note that both formulas need to be checked for correctness.

* Add note that `match_template` output has a different shape than the input image. This needs to be fixed before merging.

* Change 'Sigma' to 'Sum' in docstring to avoid confusion with standard deviation.

* Other minor changes for readability.
2012-05-08 21:32:06 -04:00
Tony S Yu 8c816109c9 Remove OpenCV version of match_template 2012-05-08 21:32:06 -04:00
Tony S Yu 425a4ea707 Use feature.peak_local_max instead of custom peak detection. 2012-05-08 21:32:06 -04:00
Tony S Yu 9d3072d3f8 Fix type errors in match_template by casting inputs to float32. 2012-05-08 21:32:06 -04:00
Tony S Yu 2a00e24b12 Change _template.match_template variables to float.
Template and image in test are converted to float32 before passing to `match_template`. This change is temporary: `match_template` should convert these variables internally.
2012-05-08 21:32:06 -04:00
Tony S Yu e8461e22dd Move template matching to feature subpackage 2012-05-08 21:32:05 -04:00
Tony S Yu 01d66fc501 Reorganize example so that all plotting code is at the end 2012-05-08 21:28:50 -04:00
Tony S Yu e6098e140b Replace assert statement with plot to show matches 2012-05-08 21:28:50 -04:00
Tony S Yu 12b39dae5c Fix assert failure in example 2012-05-08 21:28:50 -04:00
Tony S Yu acc35c843b Add comment about code duplication. 2012-05-08 21:28:50 -04:00
Tony S Yu 6272c312c4 Simplify _template.pyx using integral_image from transform subpackage.
Remove `integral_images` and `integral_image_sqr` from _template.pyx in favor of calls to `skimage.transform.integral_image`.

This change required `match_template` arguments ("image" and "template") to be changed from float to double.

After this change, the template test runs about 25% slower.
2012-05-08 21:28:50 -04:00
Tony S Yu 2b368aecb1 Remove unused integral_image function in _template.pyx 2012-05-08 21:28:50 -04:00
Tony S Yu 56611198e4 PEP8: add spacing around operators 2012-05-08 21:28:50 -04:00
Tony S Yu 4ab4213749 Change OpenCV import to make it an optional dependency 2012-05-08 21:28:50 -04:00
Tony S Yu d43049da71 Wrap long lines 2012-05-08 21:28:49 -04:00
Tony S Yu 49349a07c6 Fix copy-paste bug 2012-05-08 21:28:49 -04:00
Tony S Yu 19f1021f60 Clean up docstrings 2012-05-08 21:28:49 -04:00
Tony S Yu ae85fa8b15 Wrap long lines 2012-05-08 21:28:49 -04:00
Tony S Yu f8e0478542 Remove dependency on math module 2012-05-08 21:28:49 -04:00
Tony S Yu b79a8dd437 Update setup file to new repo and fix typos 2012-05-08 21:28:49 -04:00
Tony S Yu f6b279bff7 Fix whitespace 2012-05-08 21:28:49 -04:00
Tony S Yu 424a2b8e52 Remove unused imports 2012-05-08 21:28:49 -04:00
Tony S Yu 23311a0993 Convert template matching Pull Request to skimage
This commit takes the template matching implementation from holtzhau/template (Pull Request #13) and converts the code to use the new package name (scikits.image --> skimage).
2012-05-08 21:28:49 -04:00
tonysyu 085af1d9e5 Merge pull request #184 from stefanv/fast_coordinate_map
Implement fast image warping.
2012-05-08 18:03:07 -07:00
Stefan van der Walt 4524f994e8 ENH: Better formulation of _stackcopy. 2012-05-08 16:21:53 -07:00
Stefan van der Walt 4296597cdf BUG: Temporary workaround for shape offset parameter in radon transform. 2012-05-08 15:43:09 -07:00
Stefan van der Walt 59b65fdada Merge pull request #164 from cournape/bento_build
PKG: Add Bento support.
2012-05-08 12:32:54 -07:00
Stefan van der Walt 54dc1bb59c STY: Minor cleanups. 2012-05-08 12:26:26 -07:00
Stefan van der Walt feb3e920b1 TST: Increase radon transform threshold to make test more robust. 2012-05-07 14:14:31 -07:00
Stefan van der Walt 52f35313a7 BUG: Fix plugin import on systems without PIL or FreeImage. 2012-05-07 14:06:25 -07:00