1
/* ============================================================
3
* This file is a part of kipi-plugins project
4
* http://www.kipi-plugins.org
7
* Description : locator that uses an OpenCV haar cascades classifier
9
* Copyright (C) 2009 by Andi Clemens <andi dot clemens at gmx dot net>
11
* This program is free software; you can redistribute it
12
* and/or modify it under the terms of the GNU General
13
* Public License as published by the Free Software Foundation;
14
* either version 2, or (at your option)
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
22
* ============================================================ */
24
#ifndef HAARCLASSIFIERLOCATOR_H
25
#define HAARCLASSIFIERLOCATOR_H
29
// To avoid broken compilation with OpenCV >= 2.0
36
#include <opencv/cv.h>
37
#include <opencv/highgui.h>
46
namespace KIPIRemoveRedEyesPlugin
49
class HaarClassifierLocator : public Locator
55
HaarClassifierLocator();
56
virtual ~HaarClassifierLocator();
58
int startCorrection(const QString& src, const QString& dest);
59
int startTestrun(const QString& src);
60
int startPreview(const QString& src);
62
QWidget* settingsWidget();
69
void updateSettings();
73
int findPossibleEyes(double csf, int ngf, const char* classifierFile);
75
void findBlobs(IplImage* i_mask, int minsize);
76
void generateMask(int i_v, CvSeq* i_eyes);
77
void allocateBuffers();
79
void saveImage(const QString& path, SaveResult type);
83
struct HaarClassifierLocatorPriv;
84
HaarClassifierLocatorPriv* const d;
87
} // namespace KIPIRemoveRedEyesPlugin
89
#endif /* HAARCLASSIFIERLOCATOR_H */