Commit 0c8fbf1b32edf39f4cd3661fa27108bbb8d62404

Authored by Josh Klontz
1 parent 794f8fc1

removed fddb gallery

Showing 1 changed file with 0 additions and 82 deletions
openbr/plugins/gallery/fddb.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/qtutils.h>  
19 -  
20 -namespace br  
21 -{  
22 -  
23 -/*!  
24 - * \ingroup galleries  
25 - * \brief Implements the FDDB detection format.  
26 - * \author Josh Klontz \cite jklontz  
27 - *  
28 - * \br_link http://vis-www.cs.umass.edu/fddb/README.txt  
29 - */  
30 -class FDDBGallery : public Gallery  
31 -{  
32 - Q_OBJECT  
33 -  
34 - TemplateList readBlock(bool *done)  
35 - {  
36 - *done = true;  
37 - QStringList lines = QtUtils::readLines(file);  
38 - TemplateList templates;  
39 - while (!lines.empty()) {  
40 - const QString fileName = lines.takeFirst();  
41 - int numDetects = lines.takeFirst().toInt();  
42 - for (int i=0; i<numDetects; i++) {  
43 - const QStringList detect = lines.takeFirst().split(' ');  
44 - Template t(fileName);  
45 - QList<QVariant> faceList; //to be consistent with slidingWindow  
46 - if (detect.size() == 5) { //rectangle  
47 - faceList.append(QRectF(detect[0].toFloat(), detect[1].toFloat(), detect[2].toFloat(), detect[3].toFloat()));  
48 - t.file.set("Confidence", detect[4].toFloat());  
49 - } else if (detect.size() == 6) { //ellipse  
50 - float x = detect[3].toFloat(),  
51 - y = detect[4].toFloat(),  
52 - radius = detect[1].toFloat();  
53 - faceList.append(QRectF(x - radius,y - radius,radius * 2.0, radius * 2.0));  
54 - t.file.set("Confidence", detect[5].toFloat());  
55 - } else {  
56 - qFatal("Unknown FDDB annotation format.");  
57 - }  
58 - t.file.set("Face", faceList);  
59 - t.file.set("Label",QString("face"));  
60 - templates.append(t);  
61 - }  
62 - }  
63 - return templates;  
64 - }  
65 -  
66 - void write(const Template &t)  
67 - {  
68 - (void) t;  
69 - qFatal("Not implemented.");  
70 - }  
71 -  
72 - void init()  
73 - {  
74 - //  
75 - }  
76 -};  
77 -  
78 -BR_REGISTER(Gallery, FDDBGallery)  
79 -  
80 -} // namespace br  
81 -  
82 -#include "gallery/fddb.moc"