[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/graphics/digikam/utilities/fuzzysearch
From: Gilles Caulier <caulier.gilles () gmail ! com>
Date: 2008-05-31 20:04:47
Message-ID: 1212264287.926312.14345.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 814966 by cgilles:
digiKam from trunk : Find duplicates tool based on Haar wavelets: first try to check \
algorithm to parse whole collection
Marcel,
Code is in FuzzySearchView::slotFindDuplicates() method. Of course, we need to use \
kioslave because it can take a while. The map key/value need to be stored in new \
SAlbums dedicated. For each SAblum, there are :
- The reference image id
- The list of duplicate candidates.
When Search KIOSlave will return the map, we will scan all Duplicates Search albums \
using AlbumManager and list all in the listview from left sidebar tab. When user \
select an album, icon view will display all duplicate candidates.
What do you think about ?
CCMAIL: marcel.wiesweg@gmx.de
M +23 -1 fuzzysearchview.cpp
--- trunk/extragear/graphics/digikam/utilities/fuzzysearch/fuzzysearchview.cpp \
#814965:814966 @@ -53,6 +53,8 @@
#include "album.h"
#include "albummanager.h"
+#include "albumdb.h"
+#include "databaseaccess.h"
#include "ddebug.h"
#include "ddragobjects.h"
#include "imageinfo.h"
@@ -819,7 +821,27 @@
void FuzzySearchView::slotFindDuplicates()
{
- // TODO
+ AlbumDB *db = DatabaseAccess().db();
+ QList<AlbumShortInfo> aList = db->getAlbumShortInfos();
+ QList<qlonglong> idList;
+
+ // Get all items DB id from all albums and all collections
+ for (QList<AlbumShortInfo>::const_iterator it = aList.begin(); it != \
aList.end(); ++it) + {
+ idList += db->getItemIDsInAlbum((*it).id);
+ }
+
+ HaarIface haarIface;
+ QMap< qlonglong, QList<qlonglong> > results = haarIface.findDuplicates(idList);
+
+ DDebug() << "Find duplicates (" << idList.count() << " items):" << endl;
+
+ for (QMap< qlonglong, QList<qlonglong> >::const_iterator it = results.begin();
+ it != results.end(); ++it)
+ {
+ DDebug() << "id: " << it.key() << " => " << it.value() << endl;
+ }
+
}
} // NameSpace Digikam
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic