@@ -28,11 +28,12 @@ class WaterfillTemplateMatcher{
2828
2929
3030public:
31- // Load a template image from disk, min_color and max_color denote the color range of the object
32- // displayed in the image file while min_area is the minimum number of pixels required for the
33- // object in the template to be loaded .
31+ // Load a template image from disk, use waterfill to find the biggest object in the template image that
32+ // matches the color range of min_color and max_color.
33+ // min_area is the minimum number of pixels required for the found object in the template .
3434 //
35- // The portion of the image holding the found object will get cropped and saved as the actual template image.
35+ // The portion of the image holding the biggest object will get cropped and saved as the actual template
36+ // image.
3637 // So if someone changes the template image by padding it to make it larger, as long as the padded color
3738 // does not fall into [min_color and max_color] range, it will not affect the template matching outcome
3839 // in any way.
@@ -49,6 +50,7 @@ class WaterfillTemplateMatcher{
4950 // Compute RMSD of the current image against the template as-is, using `ExactImageMatcher`.
5051 // `ExactImageMatcher` will resize the image to match template size and scale template brightness to match the image
5152 // before computing RMSD.
53+ // The part of the image template where alpha is 0 is not used to compare with the corresponding part in the input image.
5254 // In case the image is invalid, return a large value.
5355 // It also calls the virtual function `check_image()` on the image.
5456 // If the function returns false, then return a large value.
@@ -59,7 +61,8 @@ class WaterfillTemplateMatcher{
5961 // This cropped image is compared against the template as-is.
6062 // The waterfill object's aspect ratio and area ratio are checked against template's. Return a large value
6163 // if the check fails.
62- // See `double rmsd(const ImageViewRGB32& image) const` on the details of comparing the image against the template.
64+ // See `double rmsd(Resolution input_resolution, const ImageViewRGB32& image) const` on the details of comparing the
65+ // image against the template.
6366 virtual double rmsd_precropped (
6467 Resolution input_resolution,
6568 const ImageViewRGB32& cropped_image,
@@ -71,7 +74,8 @@ class WaterfillTemplateMatcher{
7174 // image against the template as-is.
7275 // The waterfill object's aspect ratio and area ratio are checked against template's. Return a large value
7376 // if the check fails.
74- // See `double rmsd(const ImageViewRGB32& image) const` on the details of comparing the image against the template.
77+ // See `double rmsd(Resolution input_resolution, const ImageViewRGB32& image) const` on the details of comparing the
78+ // image against the template.
7579 virtual double rmsd_original (
7680 Resolution input_resolution,
7781 const ImageViewRGB32& original_image,
0 commit comments