adding python smoke test for MSDDetector

pull/3357/head
Your Name 3 years ago
parent 0da725559e
commit f9d92f2bb5
  1. 2
      modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
  2. 24
      modules/xfeatures2d/misc/python/test/test_descriptors.py

@ -282,7 +282,7 @@ class CV_EXPORTS_W MSDDetector : public Feature2D {
public:
static Ptr<MSDDetector> create(int m_patch_radius = 3, int m_search_area_radius = 5,
CV_WRAP static Ptr<MSDDetector> create(int m_patch_radius = 3, int m_search_area_radius = 5,
int m_nms_radius = 5, int m_nms_scale_radius = 0, float m_th_saliency = 250.0f, int m_kNN = 4,
float m_scale_factor = 1.25f, int m_n_scales = -1, bool m_compute_orientation = false);
};

@ -0,0 +1,24 @@
#!/usr/bin/env python
# Python 2/3 compatibility
from __future__ import print_function
import os
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests
class MSDDetector_test(NewOpenCVTests):
def test_create(self):
msd = cv.xfeatures2d.MSDDetector_create()
self.assertFalse(msd is None)
img1 = np.zeros((100, 100, 3), dtype=np.uint8)
kp1_, des1_ = msd.detectAndCompute(img1, None)
if __name__ == '__main__':
NewOpenCVTests.bootstrap()
Loading…
Cancel
Save