Commit 354be115 authored by Maria Dimashova's avatar Maria Dimashova

made MaskPredicate safer (#419)

parent dfe4af9e
...@@ -48,17 +48,16 @@ namespace cv ...@@ -48,17 +48,16 @@ namespace cv
/* /*
* FeatureDetector * FeatureDetector
*/ */
struct MaskPredicate class MaskPredicate
{ {
MaskPredicate( const Mat& _mask ) : mask(_mask) public:
{} MaskPredicate( const Mat& _mask ) : mask(_mask) {}
MaskPredicate& operator=(const MaskPredicate&) { return *this; }
bool operator() (const KeyPoint& key_pt) const 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; return mask.at<uchar>( (int)(key_pt.pt.y + 0.5f), (int)(key_pt.pt.x + 0.5f) ) == 0;
} }
private:
const Mat& mask; const Mat mask;
}; };
FeatureDetector::~FeatureDetector() FeatureDetector::~FeatureDetector()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment