Index: opencv/modules/features2d/src/detectors.cpp =================================================================== --- opencv/modules/features2d/src/detectors.cpp (revision 3295) +++ opencv/modules/features2d/src/detectors.cpp (working copy) @@ -50,15 +50,14 @@ */ struct MaskPredicate { - MaskPredicate( const Mat& _mask ) : mask(_mask) + MaskPredicate( const Mat& _mask ) : mask(&_mask) {} - 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; + const Mat* mask; }; void FeatureDetector::removeInvalidPoints( const Mat& mask, vector& keypoints )