diff --git a/openbr/plugins/imgproc/integral.cpp b/openbr/plugins/imgproc/integral.cpp deleted file mode 100644 index 7d0a551..0000000 --- a/openbr/plugins/imgproc/integral.cpp +++ /dev/null @@ -1,43 +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 transforms - * \brief Computes integral image. - * \author Josh Klontz \cite jklontz - */ -class IntegralTransform : public UntrainableTransform -{ - Q_OBJECT - - void project(const Template &src, Template &dst) const - { - cv::integral(src, dst); - } -}; - -BR_REGISTER(Transform, IntegralTransform) - -} // namespace br - -#include "imgproc/integral.moc" diff --git a/openbr/plugins/imgproc/integralhist.cpp b/openbr/plugins/imgproc/integralhist.cpp deleted file mode 100644 index c90b0b3..0000000 --- a/openbr/plugins/imgproc/integralhist.cpp +++ /dev/null @@ -1,62 +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 - -using namespace cv; - -namespace br -{ - -/*! - * \ingroup transforms - * \brief An integral histogram - * \author Josh Klontz \cite jklontz - */ -class IntegralHistTransform : public UntrainableTransform -{ - Q_OBJECT - Q_PROPERTY(int bins READ get_bins WRITE set_bins RESET reset_bins STORED false) - Q_PROPERTY(int radius READ get_radius WRITE set_radius RESET reset_radius STORED false) - BR_PROPERTY(int, bins, 256) - BR_PROPERTY(int, radius, 16) - - void project(const Template &src, Template &dst) const - { - const Mat &m = src.m(); - if (m.type() != CV_8UC1) qFatal("IntegralHist requires 8UC1 matrices."); - - Mat integral(m.rows/radius+1, (m.cols/radius+1)*bins, CV_32SC1); - integral.setTo(0); - for (int i=1; i(i, j+k) += integral.at(i-1, j +k); - for (int k=0; k(i, j+k) += integral.at(i , j-bins+k); - for (int k=0; k(i, j+k) -= integral.at(i-1, j-bins+k); - for (int k=0; k(i, j+m.at((i-1)*radius+k,(j/bins-1)*radius+l))++; - } - } - dst = integral; - } -}; - -BR_REGISTER(Transform, IntegralHistTransform) - -} // namespace br - -#include "imgproc/integralhist.moc" diff --git a/openbr/plugins/imgproc/integralsampler.cpp b/openbr/plugins/imgproc/integralsampler.cpp deleted file mode 100644 index 94fafa1..0000000 --- a/openbr/plugins/imgproc/integralsampler.cpp +++ /dev/null @@ -1,122 +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 - -using namespace cv; - -namespace br -{ - -/*! - * \ingroup transforms - * \brief Sliding window feature extraction from a multi-channel integral image. - * \author Josh Klontz \cite jklontz - */ -class IntegralSamplerTransform : public UntrainableTransform -{ - Q_OBJECT - Q_PROPERTY(int scales READ get_scales WRITE set_scales RESET reset_scales STORED false) - Q_PROPERTY(float scaleFactor READ get_scaleFactor WRITE set_scaleFactor RESET reset_scaleFactor STORED false) - Q_PROPERTY(float stepFactor READ get_stepFactor WRITE set_stepFactor RESET reset_stepFactor STORED false) - Q_PROPERTY(int minSize READ get_minSize WRITE set_minSize RESET reset_minSize STORED false) - Q_PROPERTY(bool secondOrder READ get_secondOrder WRITE set_secondOrder RESET reset_secondOrder STORED false) - BR_PROPERTY(int, scales, 6) - BR_PROPERTY(float, scaleFactor, 2) - BR_PROPERTY(float, stepFactor, 0.75) - BR_PROPERTY(int, minSize, 8) - BR_PROPERTY(bool, secondOrder, false) - - void project(const Template &src, Template &dst) const - { - typedef Eigen::Map< const Eigen::Matrix > InputDescriptor; - typedef Eigen::Map< const Eigen::Matrix > SecondOrderInputDescriptor; - typedef Eigen::Map< Eigen::Matrix > OutputDescriptor; - - const Mat &m = src.m(); - if (m.depth() != CV_32S) qFatal("Expected CV_32S matrix depth."); - const int channels = m.channels(); - const int rowStep = channels * m.cols; - - int descriptors = 0; - float idealSize = min(m.rows, m.cols)-1; - for (int scale=0; scale()/(currentSize*currentSize); - index++; - } - } - if (secondOrder) { - const int numDown = 1+(m.rows-currentSize-1)/currentStep; - const int numAcross = 1+(m.cols-currentSize-1)/currentStep; - const float *dataIn = n.ptr(index - numDown*numAcross); - for (int i=0; i