From bce9f54152e9c13e0f648c3d4065ce3f78443e4c Mon Sep 17 00:00:00 2001 From: Stefano Fabri Date: Fri, 2 Jul 2010 17:36:28 +0000 Subject: [PATCH] Corrected Mask operator (from documentation mask must be a char matrix with non-zero values in the region of interest) --- modules/features2d/src/detectors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/features2d/src/detectors.cpp b/modules/features2d/src/detectors.cpp index 69c328acc8..8857c80d11 100644 --- a/modules/features2d/src/detectors.cpp +++ b/modules/features2d/src/detectors.cpp @@ -55,7 +55,7 @@ struct MaskPredicate MaskPredicate& operator=(const MaskPredicate&) {} bool operator() (const KeyPoint& key_pt) const { - return mask.at( (int)(key_pt.pt.y + 0.5f), (int)(key_pt.pt.x + 0.5f) ) != 0; + return mask.at( (int)(key_pt.pt.y + 0.5f), (int)(key_pt.pt.x + 0.5f) ) == 0; } const Mat& mask;