public class FourierTemplateMatcher extends Object implements ImageAnalyser<FImage>
FImages. Template matching is
performed in the frequency domain using an FFT.
The implementation is heavily inspired by the OpenCV code.
| Modifier and Type | Class and Description |
|---|---|
static class |
FourierTemplateMatcher.Mode
Different algorithms for comparing templates to images.
|
| Constructor and Description |
|---|
FourierTemplateMatcher(FImage template,
FourierTemplateMatcher.Mode mode)
Default constructor with the template to match.
|
FourierTemplateMatcher(FImage template,
Rectangle bounds,
FourierTemplateMatcher.Mode mode)
Construct with the template to match and the bounds rectangle in which
to search.
|
| Modifier and Type | Method and Description |
|---|---|
void |
analyseImage(FImage image)
Perform template matching.
|
FValuePixel[] |
getBestResponses(int numResponses)
Get the top-N "best" responses found by the template matcher.
|
FImage |
getResponseMap() |
Rectangle |
getSearchBounds() |
int |
getXOffset() |
int |
getYOffset() |
void |
setSearchBounds(Rectangle searchBounds)
Set the search bounds rectangle.
|
public FourierTemplateMatcher(FImage template, FourierTemplateMatcher.Mode mode)
analyseImage(FImage), the whole image
will be searched.template - The template.mode - The matching mode.public FourierTemplateMatcher(FImage template, Rectangle bounds, FourierTemplateMatcher.Mode mode)
template - The templatebounds - The bounding box for search.mode - The matching mode.public Rectangle getSearchBounds()
public void setSearchBounds(Rectangle searchBounds)
null results in the entire image
being searched.searchBounds - the search bounds to setpublic void analyseImage(FImage image)
analyseImage in interface ImageAnalyser<FImage>image - The image to process in place.ImageAnalyser.analyseImage(org.openimaj.image.Image)public FValuePixel[] getBestResponses(int numResponses)
numResponses - The number of responsespublic int getXOffset()
getResponseMap() to the original image
analysed by analyseImage(FImage).public int getYOffset()
getResponseMap() to the original image
analysed by analyseImage(FImage).public FImage getResponseMap()
analyseImage(FImage)