made MaskPredicate safer (#419)

This commit is contained in:
Maria Dimashova 2010-11-26 10:57:01 +00:00
parent dfe4af9e1d
commit 354be115f2

View File

@ -48,17 +48,16 @@ namespace cv
/*
* FeatureDetector
*/
struct MaskPredicate
class MaskPredicate
{
MaskPredicate( const Mat& _mask ) : mask(_mask)
{}
MaskPredicate& operator=(const MaskPredicate&) { return *this; }
public:
MaskPredicate( const Mat& _mask ) : mask(_mask) {}
bool operator() (const KeyPoint& key_pt) const
{
return mask.at<uchar>( (int)(key_pt.pt.y + 0.5f), (int)(key_pt.pt.x + 0.5f) ) == 0;
}
const Mat& mask;
private:
const Mat mask;
};
FeatureDetector::~FeatureDetector()