Commit fa8839bb authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #888 from catree:lucid

parents 46f3b4d6 4820eff5
...@@ -132,6 +132,8 @@ public: ...@@ -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: ...@@ -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 { ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment