Commit 724533253940e967a0d0af0866a088e588212704

Authored by Josh Klontz
1 parent 5888c182

remove discardalpha

openbr/plugins/imgproc/discardalpha.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 Drop the alpha channel (if exists).
29   - * \author Austin Blanton \cite imaus10
30   - */
31   -class DiscardAlphaTransform : public UntrainableTransform
32   -{
33   - Q_OBJECT
34   -
35   - void project(const Template &src, Template &dst) const
36   - {
37   - if (src.m().channels() > 4 || src.m().channels() == 2) {
38   - dst.file.fte = true;
39   - return;
40   - }
41   -
42   - dst = src;
43   - if (src.m().channels() == 4) {
44   - std::vector<Mat> mv;
45   - split(src, mv);
46   - mv.pop_back();
47   - merge(mv, dst);
48   - }
49   - }
50   -};
51   -
52   -BR_REGISTER(Transform, DiscardAlphaTransform)
53   -
54   -} // namespace br
55   -
56   -#include "imgproc/discardalpha.moc"