Commit c28d4b15c3a77d23f631151ed47c8bdd35fe6830

Authored by Josh Klontz
1 parent 2e58b635

remove kernel hash

openbr/plugins/imgproc/kernelhash.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   -namespace br
20   -{
21   -
22   -/*!
23   - * \ingroup transforms
24   - * \brief Kernel hash
25   - * \author Josh Klontz \cite jklontz
26   - */
27   -class KernelHashTransform : public UntrainableTransform
28   -{
29   - Q_OBJECT
30   - Q_PROPERTY(uchar dimsIn READ get_dimsIn WRITE set_dimsIn RESET reset_dimsIn STORED false)
31   - Q_PROPERTY(uchar dimsOut READ get_dimsOut WRITE set_dimsOut RESET reset_dimsOut STORED false)
32   - BR_PROPERTY(uchar, dimsIn, 8)
33   - BR_PROPERTY(uchar, dimsOut, 7)
34   -
35   - void project(const Template &src, Template &dst) const
36   - {
37   - if (src.m().type() != CV_8UC1)
38   - qFatal("Expected 8UC1 input.");
39   -
40   - dst = cv::Mat::zeros(src.m().rows, src.m().cols, CV_8UC1);
41   - const uchar *srcData = src.m().data;
42   - uchar *dstData = dst.m().data;
43   - const int step = src.m().cols;
44   - for (int i=0; i<src.m().rows-1; i++)
45   - for (int j=0; j<src.m().cols-1; j++) {
46   - dstData[i*step+j] = (uint(pow(float(dimsIn),1.f))*srcData[i *step+j]
47   - + uint(pow(float(dimsIn),2.f))*srcData[(i+1)*step+j]
48   - + uint(pow(float(dimsIn),0.f))*srcData[i *step+(j+1)]
49   - /*+ uint(pow(float(dimsIn),0.f))*srcData[(i+1)*step+(j+1)]*/) % dimsOut;
50   - }
51   - }
52   -};
53   -
54   -BR_REGISTER(Transform, KernelHashTransform)
55   -
56   -} // namespace br
57   -
58   -#include "imgproc/kernelhash.moc"