Revision 809391

Go back to digest for 25th May 2008

Features in Graphics

Marcel Wiesweg committed changes in /trunk/extragear/graphics/digikam/libs/database/haar/haariface.cpp:

Interface Haar calculation with database.

1) Indexing:
Methods accept filename, imageid, with preloaded QImage or DImg.
The obtained Haar::SignatureData is serialized into a QByteArray (class DatabaseBlob does that with the help of QDataStream) and written into the ImageHaarMatrix table.
Modification data and unique hash from the Images table (identifying the current file) are copied to the table.

2) Searching:
The original paper suggests a data structure where (for each color channel, for positive and negative) for each pixel a list contains those imageids that have a significant coefficient at that place. Such a structure requires pre-reading and approx. 5MB/10,000 images.

The current approach here does it the other way round.
It reads each sigle signature from the database, goes through its list of pixels with significant coefficient, and looks if the query signature has significant coefs as well at that pixel.

A simple benchmark searches 750*133 images (->100,000) in three seconds on my (relatively slow) machine.
Of course, I may have introduced bugs, which will show up once we have a GUI for creating searches. (searching for identical images works)

File Changes

Modified 1 files
  • /trunk/extragear/graphics/digikam/libs/database/haar/haariface.cpp
1 files changed in total