Commit 8c1d7c70a9619ec047d7ef537918675d3779a4fa
1 parent
6ad751d2
remove redlinearregression
Showing
1 changed file
with
0 additions
and
62 deletions
openbr/plugins/imgproc/redlinearregression.cpp deleted
| 1 | -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
| 2 | - * Copyright 2012 The MITRE Corporation * | ||
| 3 | - * * | ||
| 4 | - * Licensed under the Apache License, Version 2.0 (the "License"); * | ||
| 5 | - * you may not use this file except in compliance with the License. * | ||
| 6 | - * You may obtain a copy of the License at * | ||
| 7 | - * * | ||
| 8 | - * http://www.apache.org/licenses/LICENSE-2.0 * | ||
| 9 | - * * | ||
| 10 | - * Unless required by applicable law or agreed to in writing, software * | ||
| 11 | - * distributed under the License is distributed on an "AS IS" BASIS, * | ||
| 12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * | ||
| 13 | - * See the License for the specific language governing permissions and * | ||
| 14 | - * limitations under the License. * | ||
| 15 | - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | ||
| 16 | - | ||
| 17 | -#include <openbr/plugins/openbr_internal.h> | ||
| 18 | - | ||
| 19 | -using namespace cv; | ||
| 20 | - | ||
| 21 | -namespace br | ||
| 22 | -{ | ||
| 23 | - | ||
| 24 | -/*! | ||
| 25 | - * \ingroup transforms | ||
| 26 | - * \brief Prediction using only the red wavelength; magic numbers from jmp | ||
| 27 | - * \author E. Taborsky \cite mmtaborsky | ||
| 28 | - */ | ||
| 29 | -class RedLinearRegressionTransform : public UntrainableTransform | ||
| 30 | -{ | ||
| 31 | - Q_OBJECT | ||
| 32 | - | ||
| 33 | - void project(const Template &src, Template &dst) const | ||
| 34 | - { | ||
| 35 | - Mat m; src[0].convertTo(m, CV_32F); assert(m.isContinuous() && (m.channels() == 1)); | ||
| 36 | - | ||
| 37 | - const float rmult = .6533673; | ||
| 38 | - const float add = 41.268; | ||
| 39 | - | ||
| 40 | - Mat dst1(m.size(), CV_32F); | ||
| 41 | - int rows = m.rows; | ||
| 42 | - int cols = m.cols; | ||
| 43 | - | ||
| 44 | - const float *rsrc = (const float*) m.ptr(); | ||
| 45 | - float *p = (float*)dst1.ptr(); | ||
| 46 | - | ||
| 47 | - for (int r = 0; r < rows; r++){ | ||
| 48 | - for (int c = 0; c < cols; c++){ | ||
| 49 | - int index = r*cols+c; | ||
| 50 | - const float rval = rsrc[index]; | ||
| 51 | - p[index] = rval*rmult+add; | ||
| 52 | - } | ||
| 53 | - } | ||
| 54 | - dst = dst1; | ||
| 55 | - } | ||
| 56 | -}; | ||
| 57 | - | ||
| 58 | -BR_REGISTER(Transform, RedLinearRegressionTransform) | ||
| 59 | - | ||
| 60 | -} // namespace br | ||
| 61 | - | ||
| 62 | -#include "imgproc/redlinearregression.moc" |