mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
made MaskPredicate safer (#419)
This commit is contained in:
parent
dfe4af9e1d
commit
354be115f2
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user