Interface TemplateMatchingIntensity<T extends ImageBase>
-
- All Known Implementing Classes:
- BaseTemplateIntensity, TemplateDiffSquared, TemplateDiffSquared.F32, TemplateDiffSquared.U8, TemplateNCC, TemplateNCC.F32, TemplateNCC.U8
public interface TemplateMatchingIntensity<T extends ImageBase>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
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description intgetBorderX0()Thickness of border along the image left side (lower extent)intgetBorderX1()Thickness of border along the image right side (upper extent)intgetBorderY0()Thickness of border along the image top (lower extent)intgetBorderY1()Thickness of border along the image bottom (upper extent)GrayF32getIntensity()Contains results of template matching.booleanisBorderProcessed()Does this algorithm process the image's border.voidprocess(T image, T template)Matches the template to the image and computes an intensity image.voidprocess(T image, T template, T mask)Matches the template with a mask to the image and computes an intensity image.
-
-
-
Method Detail
-
process
void process(T image, T template)
Matches the template to the image and computes an intensity image.- Parameters:
image- Input image. Not modified.template- Template image. Must be equal to or smaller than the input image. Not modified.
-
process
void process(T image, T template, T mask)
Matches the template with a mask to the image and computes an intensity image.- Parameters:
image- Input image. Not modified.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
-
-
DataMelt 3.0 © DataMelt by jWork.ORG