Merge pull request #888 from catree:lucid

pull/891/merge
Alexander Alekhin 9 years ago
commit fa8839bbd5
  1. 4
      modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
  2. 6
      modules/xfeatures2d/src/lucid.cpp

@ -132,6 +132,8 @@ public:
An image descriptor that can be computed very fast, while being An image descriptor that can be computed very fast, while being
about as robust as, for example, SURF or BRIEF. about as robust as, for example, SURF or BRIEF.
@note It requires a color image as input.
*/ */
class CV_EXPORTS_W LUCID : public Feature2D class CV_EXPORTS_W LUCID : public Feature2D
{ {
@ -140,7 +142,7 @@ public:
* @param lucid_kernel kernel for descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth * @param lucid_kernel kernel for descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth
* @param blur_kernel kernel for blurring image prior to descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth * @param blur_kernel kernel for blurring image prior to descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth
*/ */
CV_WRAP static Ptr<LUCID> create(const int lucid_kernel, const int blur_kernel); CV_WRAP static Ptr<LUCID> create(const int lucid_kernel = 1, const int blur_kernel = 2);
}; };

@ -100,12 +100,14 @@ namespace cv {
// gliese581h suggested filling a cv::Mat with descriptors to enable BFmatcher compatibility // gliese581h suggested filling a cv::Mat with descriptors to enable BFmatcher compatibility
// speed-ups and enhancements by gliese581h // speed-ups and enhancements by gliese581h
void LUCIDImpl::compute(InputArray _src, std::vector<KeyPoint> &keypoints, OutputArray _desc) { void LUCIDImpl::compute(InputArray _src, std::vector<KeyPoint> &keypoints, OutputArray _desc) {
if (_src.getMat().empty()) cv::Mat src_input = _src.getMat();
if (src_input.empty())
return; return;
CV_Assert(src_input.depth() == CV_8U && src_input.channels() == 3);
Mat_<Vec3b> src; Mat_<Vec3b> src;
blur(_src.getMat(), src, cv::Size(b_kernel, b_kernel)); blur(src_input, src, cv::Size(b_kernel, b_kernel));
int x, y, j, d, p, m = (l_kernel*2+1)*(l_kernel*2+1)*3, width = src.cols, height = src.rows, r, c; int x, y, j, d, p, m = (l_kernel*2+1)*(l_kernel*2+1)*3, width = src.cols, height = src.rows, r, c;

Loading…
Cancel
Save