Commit 7aeb043ed11180d8f65709d80651ea36e59a02a0

Authored by Josh Klontz
1 parent 6e4b645c

dropped the half-byte stuff, it's not very effective

openbr/plugins/distance/halfbyteL1.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 -#include <openbr/core/distance_sse.h>  
19 -  
20 -using namespace cv;  
21 -  
22 -namespace br  
23 -{  
24 -  
25 -/*!  
26 - * \ingroup distances  
27 - * \brief Fast 4-bit L1 distance  
28 - * \author Josh Klontz \cite jklontz  
29 - */  
30 -class HalfByteL1Distance : public UntrainableDistance  
31 -{  
32 - Q_OBJECT  
33 -  
34 - float compare(const Mat &a, const Mat &b) const  
35 - {  
36 - return packed_l1(a.data, b.data, a.total());  
37 - }  
38 -};  
39 -  
40 -BR_REGISTER(Distance, HalfByteL1Distance)  
41 -  
42 -  
43 -} // namespace br  
44 -  
45 -#include "distance/halfbyteL1.moc"  
openbr/plugins/imgproc/pack.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 Compress two uchar into one uchar.  
27 - * \author Josh Klontz \cite jklontz  
28 - */  
29 -class PackTransform : public UntrainableTransform  
30 -{  
31 - Q_OBJECT  
32 -  
33 - void project(const Template &src, Template &dst) const  
34 - {  
35 - const Mat &m = src;  
36 - if ((m.cols % 2 != 0) || (m.type() != CV_8UC1))  
37 - qFatal("Invalid template format.");  
38 -  
39 - Mat n(m.rows, m.cols/2, CV_8UC1);  
40 - for (int i=0; i<m.rows; i++)  
41 - for (int j=0; j<m.cols/2; j++)  
42 - n.at<uchar>(i,j) = ((m.at<uchar>(i,2*j+0) >> 4) << 4) +  
43 - ((m.at<uchar>(i,2*j+1) >> 4) << 0);  
44 - dst = n;  
45 - }  
46 -};  
47 -  
48 -BR_REGISTER(Transform, PackTransform)  
49 -  
50 -} // namespace br  
51 -  
52 -#include "imgproc/pack.moc"