Package boofcv.alg.template
Class TemplateMatching<T extends ImageBase<T>>
java.lang.Object
boofcv.alg.template.TemplateMatching<T>
Runs a template matching algorithm across the image. Local peaks are found in the resulting
intensity image and the best solutions returned.
-
Constructor Summary
ConstructorDescriptionSpecifies internal algorithm -
Method Summary
Modifier and TypeMethodDescriptionReturns all the found matches.void
process()
Performs template matching.void
Specifies the input image which the template is to be found inside.void
setMinimumSeparation
(int radius) Adjust how close to objects can be found to each othervoid
setTemplate
(T template, T mask, int maxMatches) Specifies the template to search for and the maximum number of matches to return.
-
Constructor Details
-
TemplateMatching
Specifies internal algorithm- Parameters:
match
- Provide template matching intensity algorithm
-
-
Method Details
-
setMinimumSeparation
public void setMinimumSeparation(int radius) Adjust how close to objects can be found to each other- Parameters:
radius
- Distance in pixels. Try using the template's radius or 2
-
setTemplate
Specifies the template to search for and the maximum number of matches to return.- Parameters:
template
- Template being searched formask
- Optional mask. Same size as template. 0 = pixel is transparent, values larger than zero determine how influential the pixel is. Can be null.maxMatches
- The maximum number of matches it will return
-
setImage
Specifies the input image which the template is to be found inside.- Parameters:
image
- Image being processed
-
process
public void process()Performs template matching. -
getResults
Returns all the found matches. The location is the location of the top left corner of the template. Score is the first score with higher number being better- Returns:
- List of found templates
-