From e7ec3673a3ece0833f48a99a9c52e0e2b3c17dd5 Mon Sep 17 00:00:00 2001 From: Jordan Cheney Date: Wed, 18 Feb 2015 16:28:28 -0500 Subject: [PATCH] Fixed l1 name mistake --- openbr/plugins/distance/L1.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ openbr/plugins/distance/l1.cpp | 46 ---------------------------------------------- 2 files changed, 46 insertions(+), 46 deletions(-) create mode 100644 openbr/plugins/distance/L1.cpp delete mode 100644 openbr/plugins/distance/l1.cpp diff --git a/openbr/plugins/distance/L1.cpp b/openbr/plugins/distance/L1.cpp new file mode 100644 index 0000000..cd11cec --- /dev/null +++ b/openbr/plugins/distance/L1.cpp @@ -0,0 +1,46 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright 2012 The MITRE Corporation * + * * + * Licensed under the Apache License, Version 2.0 (the "License"); * + * you may not use this file except in compliance with the License. * + * You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, software * + * distributed under the License is distributed on an "AS IS" BASIS, * + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * + * See the License for the specific language governing permissions and * + * limitations under the License. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include + +#include + +namespace br +{ + +/*! + * \ingroup distances + * \brief L1 distance computed using eigen. + * \author Josh Klontz \cite jklontz + */ +class L1Distance : public UntrainableDistance +{ + Q_OBJECT + + float compare(const cv::Mat &a, const cv::Mat &b) const + { + const int size = a.rows * a.cols; + Eigen::Map aMap((float*)a.data, size); + Eigen::Map bMap((float*)b.data, size); + return (aMap-bMap).cwiseAbs().sum(); + } +}; + +BR_REGISTER(Distance, L1Distance) + +} // namespace br + +#include "distance/L1.moc" diff --git a/openbr/plugins/distance/l1.cpp b/openbr/plugins/distance/l1.cpp deleted file mode 100644 index cd11cec..0000000 --- a/openbr/plugins/distance/l1.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright 2012 The MITRE Corporation * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include - -#include - -namespace br -{ - -/*! - * \ingroup distances - * \brief L1 distance computed using eigen. - * \author Josh Klontz \cite jklontz - */ -class L1Distance : public UntrainableDistance -{ - Q_OBJECT - - float compare(const cv::Mat &a, const cv::Mat &b) const - { - const int size = a.rows * a.cols; - Eigen::Map aMap((float*)a.data, size); - Eigen::Map bMap((float*)b.data, size); - return (aMap-bMap).cwiseAbs().sum(); - } -}; - -BR_REGISTER(Distance, L1Distance) - -} // namespace br - -#include "distance/L1.moc" -- libgit2 0.21.4