~ubuntu-branches/ubuntu/maverick/digikam/maverick

« back to all changes in this revision

Viewing changes to libs/database/haar/haariface.h

  • Committer: Bazaar Package Importer
  • Author(s): Luka Renko
  • Date: 2009-03-17 23:07:56 UTC
  • mfrom: (1.2.20 upstream) (3.1.4 experimental)
  • Revision ID: james.westby@ubuntu.com-20090317230756-db5b8rqjwb2j35e5
Tags: 2:0.10.0-1ubuntu1
* Remaining changes to Debian (committed to Debian SVN):
  - Depends: kde-icons-oxygen dropped (included through kdelibs)
  - Recommends: kipi-plugins added (provides major functionality)
  - debian/digikamthemedesigner.manpage: add missing manpage
* Remaning change to Debian:
  - Section: devel for -dbg package (no debug in Jaunty)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * Description : Haar Database interface
8
8
 *
9
9
 * Copyright (C) 2003 by Ricardo Niederberger Cabral <nieder at mail dot ru>
10
 
 * Copyright (C) 2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
11
 
 * Copyright (C) 2008 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
 
10
 * Copyright (C) 2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
11
 * Copyright (C) 2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
 
12
 * Copyright (C) 2009 by Andi Clemens <andi dot clemens at gmx dot net>
12
13
 *
13
14
 * This program is free software; you can redistribute it
14
15
 * and/or modify it under the terms of the GNU General
31
32
#include <QString>
32
33
#include <QMap>
33
34
#include <QList>
 
35
#include <haar.h>
34
36
 
35
37
// Local includes.
36
38
 
43
45
 
44
46
class DImg;
45
47
 
46
 
namespace Haar
47
 
{
48
 
    class SignatureData; 
49
 
}
 
48
//namespace Haar
 
49
//{
 
50
//    class SignatureData;
 
51
//}
50
52
 
51
53
class HaarProgressObserver
52
54
{
96
98
     *  All matches with a similarity above a given threshold are returned.
97
99
     *  The threshold is in the range 0..1, with 1 meaning identical signature.
98
100
     */
99
 
    QList<qlonglong> bestMatchesForImageWithThreshold(qlonglong imageid, double requiredPercentage, SketchType type=ScannedSketch);
 
101
    QList<qlonglong> bestMatchesForImageWithThreshold(qlonglong imageid,
 
102
                                                      double requiredPercentage, SketchType type=ScannedSketch);
100
103
 
101
104
    /** Calculates the Haar signature, bring it in a form as stored in the DB,
102
105
     *  and encode it to Ascii data. Can be used for bestMatchesForSignature.
117
120
    QMap< qlonglong, QList<qlonglong> > findDuplicates(const QList<qlonglong>& images2Scan, double requiredPercentage,
118
121
                                                       HaarProgressObserver *observer = 0);
119
122
 
 
123
    /** Fill a map of duplicates images found over a list of image to scan, in a fast way.
 
124
     *  @see findDuplicates()
 
125
     */
 
126
    QMap< qlonglong, QList<qlonglong> > findDuplicatesFast(HaarProgressObserver *observer = 0);
 
127
 
120
128
    /** Calls findDuplicates with all images in the given album ids */
121
129
    QMap< qlonglong, QList<qlonglong> > findDuplicatesInAlbums(const QList<int> &albums2Scan, double requiredPercentage,
122
130
                                                               HaarProgressObserver *observer = 0);
145
153
    bool   indexImage(qlonglong imageid);
146
154
 
147
155
    QList<qlonglong> bestMatches(Haar::SignatureData *data, int numberOfResults, SketchType type);
148
 
    QList<qlonglong> bestMatchesWithThreshold(Haar::SignatureData *querySig, double requiredPercentage, SketchType type);
 
156
    QList<qlonglong> bestMatchesWithThreshold(Haar::SignatureData *querySig,
 
157
                                              double requiredPercentage, SketchType type);
149
158
 
150
159
    QMap<qlonglong, double> searchDatabase(Haar::SignatureData *data, SketchType type);
 
160
    void calculateScore(double &score, Haar::SignatureData &querySig, Haar::SignatureData &targetSig,
 
161
                        Haar::Weights &weights, Haar::SignatureMap** queryMaps);
151
162
 
152
163
private:
153
164