opencv on mbed
Object Detection
[Image processing]
Enumerations | |
enum | TemplateMatchModes { TM_SQDIFF = 0, TM_SQDIFF_NORMED = 1, TM_CCORR = 2, TM_CCORR_NORMED = 3, TM_CCOEFF = 4, TM_CCOEFF_NORMED = 5 } |
type of the template matching operation More... | |
Functions | |
CV_EXPORTS_W void | matchTemplate (InputArray image, InputArray templ, OutputArray result, int method, InputArray mask=noArray()) |
Compares a template against overlapped image regions. |
Enumeration Type Documentation
enum TemplateMatchModes |
type of the template matching operation
Definition at line 3367 of file imgproc.hpp.
Function Documentation
CV_EXPORTS_W void cv::matchTemplate | ( | InputArray | image, |
InputArray | templ, | ||
OutputArray | result, | ||
int | method, | ||
InputArray | mask = noArray() |
||
) |
Compares a template against overlapped image regions.
The function slides through image , compares the overlapped patches of size against templ using the specified method and stores the comparison results in result . Here are the formulae for the available comparison methods ( denotes image, template, result ). The summation is done over template and/or the image patch:
After the function finishes the comparison, the best matches can be found as global minimums (when TM_SQDIFF was used) or maximums (when TM_CCORR or TM_CCOEFF was used) using the minMaxLoc function. In case of a color image, template summation in the numerator and each sum in the denominator is done over all of the channels and separate mean values are used for each channel. That is, the function can take a color template and a color image. The result will still be a single-channel image, which is easier to analyze.
- Parameters:
-
image Image where the search is running. It must be 8-bit or 32-bit floating-point. templ Searched template. It must be not greater than the source image and have the same data type. result Map of comparison results. It must be single-channel 32-bit floating-point. If image is and templ is , then result is . method Parameter specifying the comparison method, see cv::TemplateMatchModes mask Mask of searched template. It must have the same datatype and size with templ. It is not set by default.
Generated on Tue Jul 12 2022 16:42:42 by 1.7.2