Commit 56b429c4ca19555cfc589040f4ba69ce77d8c7bb
1 parent
8c1d7c70
remove resizefilter
Showing
1 changed file
with
0 additions
and
69 deletions
openbr/plugins/imgproc/resizefilter.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 <opencv2/imgproc/imgproc.hpp> | ||
| 18 | - | ||
| 19 | -#include <openbr/plugins/openbr_internal.h> | ||
| 20 | - | ||
| 21 | -using namespace cv; | ||
| 22 | - | ||
| 23 | -namespace br | ||
| 24 | -{ | ||
| 25 | - | ||
| 26 | -/*! | ||
| 27 | - * \ingroup transforms | ||
| 28 | - * \brief Resize the template depending on its metadata | ||
| 29 | - * \author Jordan Cheney \cite JordanCheney | ||
| 30 | - * \note Method: Area should be used for shrinking an image, Cubic for slow but accurate enlargment, Bilin for fast enlargement. | ||
| 31 | - */ | ||
| 32 | -class ResizeFilterTransform : public UntrainableTransform | ||
| 33 | -{ | ||
| 34 | - Q_OBJECT | ||
| 35 | - Q_ENUMS(Method) | ||
| 36 | - | ||
| 37 | -public: | ||
| 38 | - /*!< */ | ||
| 39 | - enum Method { Near = INTER_NEAREST, | ||
| 40 | - Area = INTER_AREA, | ||
| 41 | - Bilin = INTER_LINEAR, | ||
| 42 | - Cubic = INTER_CUBIC, | ||
| 43 | - Lanczo = INTER_LANCZOS4}; | ||
| 44 | - | ||
| 45 | -private: | ||
| 46 | - Q_PROPERTY(int rows READ get_rows WRITE set_rows RESET reset_rows STORED false) | ||
| 47 | - Q_PROPERTY(int columns READ get_columns WRITE set_columns RESET reset_columns STORED false) | ||
| 48 | - Q_PROPERTY(Method method READ get_method WRITE set_method RESET reset_method STORED false) | ||
| 49 | - Q_PROPERTY(QString filterKey READ get_filterKey WRITE set_filterKey RESET reset_filterKey STORED false) | ||
| 50 | - Q_PROPERTY(QString filterVal READ get_filterVal WRITE set_filterVal RESET reset_filterVal STORED false) | ||
| 51 | - BR_PROPERTY(int, rows, -1) | ||
| 52 | - BR_PROPERTY(int, columns, -1) | ||
| 53 | - BR_PROPERTY(Method, method, Bilin) | ||
| 54 | - BR_PROPERTY(QString, filterKey, "Label") | ||
| 55 | - BR_PROPERTY(QString, filterVal, "1.0") | ||
| 56 | - | ||
| 57 | - void project(const Template &src, Template &dst) const | ||
| 58 | - { | ||
| 59 | - dst = src; | ||
| 60 | - if (src.file.get<QString>(filterKey) == filterVal) | ||
| 61 | - resize(src, dst, Size((columns == -1) ? src.m().cols*rows/src.m().rows : columns, rows), 0, 0, method); | ||
| 62 | - } | ||
| 63 | -}; | ||
| 64 | - | ||
| 65 | -BR_REGISTER(Transform, ResizeFilterTransform) | ||
| 66 | - | ||
| 67 | -} // namespace br | ||
| 68 | - | ||
| 69 | -#include "imgproc/resizefilter.moc" |