Interface TemplateMatchingIntensity<T extends ImageBase<T>>
- All Known Implementing Classes:
TemplateCorrelationFFT
,TemplateIntensityImage
,TemplateIntensityImage_MT
Moves an image template over the image and for each pixel computes a metric for how similar that region is to template. An intensity image is thus computed for the entire image. Better matches always have a more positive value. If a metric inheritally has a small value for better matches then its sign will be adjusted so that poor matches have a negative value.
A pixel in the intensity image is the result of evaluating the template with its center over that pixel. Given pixel (x,y) in the intensity image the template's top left corner (x',y') can be found at: x' = x - getOffsetX() and y' = y - getOffsetY().
IMAGE BORDER: If the image border is processed or not depends on the implementation. If the border is processed then partial templates are considered. If the border is not processed then the value of the intensity along the border is not defined and should not be processed.
-
Method Summary
Modifier and TypeMethodDescriptionint
Thickness of border along the image left side (lower extent)int
Thickness of border along the image right side (upper extent)int
Thickness of border along the image top (lower extent)int
Thickness of border along the image bottom (upper extent)Contains results of template matching.boolean
Does this algorithm process the image's border.boolean
If true then a better fit is a larger number, otherwise a smaller number is a better fitvoid
Matches the template to the image and computes an intensity image.void
Matches the template with a mask to the image and computes an intensity image.void
setInputImage
(T image) Specifies the input image which the template is going ot be matched against
-
Method Details
-
setInputImage
Specifies the input image which the template is going ot be matched against- Parameters:
image
- Input image. Not modified.
-
process
Matches the template to the image and computes an intensity image. Must callsetInputImage(ImageBase)
first- Parameters:
template
- Template image. Must be equal to or smaller than the input image. Not modified.
-
process
Matches the template with a mask to the image and computes an intensity image. Must callsetInputImage(ImageBase)
first- Parameters:
mask
- Mask that identifies how translucent pixels. 0 = 100% transparent and all values above increase its importance. Typical values are 0 to 255 for integer images and 0.0 to 1.0 for floating point.template
- Template image. Must be equal to or smaller than the input image. Not modified.
-
getIntensity
GrayF32 getIntensity()Contains results of template matching. Higher intensity values correspond to a better match. Local matches can be found usingNonMaxSuppression
. See comment about processing the image border.- Returns:
- Feature intensity
-
isBorderProcessed
boolean isBorderProcessed()Does this algorithm process the image's border. If it does not process the border- Returns:
- true if the border is processed and false otherwise.
-
getBorderX0
int getBorderX0()Thickness of border along the image left side (lower extent)- Returns:
- Border in pixels
-
getBorderX1
int getBorderX1()Thickness of border along the image right side (upper extent)- Returns:
- Border in pixels
-
getBorderY0
int getBorderY0()Thickness of border along the image top (lower extent)- Returns:
- Border in pixels
-
getBorderY1
int getBorderY1()Thickness of border along the image bottom (upper extent)- Returns:
- Border in pixels
-
isMaximize
boolean isMaximize()If true then a better fit is a larger number, otherwise a smaller number is a better fit
-