avoid Ptr<> == NULL checks

This commit is contained in:
Alexander Alekhin
2018-09-08 16:49:11 +00:00
parent 64b3c1e691
commit df8b057b44
7 changed files with 14 additions and 21 deletions
+1 -1
View File
@@ -178,7 +178,7 @@ int main(int argc, char *argv[])
vector<Rect> zone;
vector<vector <Point> > region;
Mat desc, result(img.rows, img.cols, CV_8UC3);
if (b.dynamicCast<SimpleBlobDetector>() != NULL)
if (b.dynamicCast<SimpleBlobDetector>().get())
{
Ptr<SimpleBlobDetector> sbd = b.dynamicCast<SimpleBlobDetector>();
sbd->detect(img, keyImg, Mat());
+1 -1
View File
@@ -500,7 +500,7 @@ int main(int argc, char *argv[])
vector<vector <Point> > region;
Mat desc;
if (b.dynamicCast<MSER>() != NULL)
if (b.dynamicCast<MSER>().get())
{
Ptr<MSER> sbd = b.dynamicCast<MSER>();
sbd->detectRegions(img, region, zone);