operator _Tp* ();
operator const _Tp*() const;
+ bool operator==(const Ptr<_Tp>& ptr) const;
+
_Tp* obj; //< the object pointer.
int* refcount; //< the associated reference counter
};
return p;
}
+template<typename _Tp> inline bool Ptr<_Tp>::operator==(const Ptr<_Tp>& _ptr) const
+{
+ return refcount == _ptr.refcount;
+}
+
//// specializied implementations of Ptr::delete_obj() for classic OpenCV types
template<> CV_EXPORTS void Ptr<CvMat>::delete_obj();
declare.in(frame);
Ptr<FeatureDetector> fd = Algorithm::create<FeatureDetector>("Feature2D.FAST");
- ASSERT_FALSE( fd == 0 );
+ ASSERT_FALSE( fd.empty() );
fd->set("threshold", 20);
fd->set("nonmaxSuppression", true);
fd->set("type", type);
void FlannBasedMatcher::read( const FileNode& fn)
{
- if (indexParams == 0)
+ if (indexParams.empty())
indexParams = new flann::IndexParams();
FileNode ip = fn["indexParams"];
};
}
- if (searchParams == 0)
+ if (searchParams.empty())
searchParams = new flann::SearchParams();
FileNode sp = fn["searchParams"];
Mat gray_image;
CV_Assert(image.type() == CV_8UC3);
cvtColor(image, gray_image, CV_BGR2GRAY);
- if (surf == 0)
+ if (surf.empty())
{
detector_->detect(gray_image, features.keypoints);
extractor_->compute(gray_image, features.keypoints, features.descriptors);
Algorithm::create<BackgroundSubtractorGMG>("BackgroundSubtractor.GMG");
Mat fgmask;
- if (fgbg == NULL)
+ if (fgbg.empty())
CV_Error(CV_StsError,"Failed to create Algorithm\n");
/**