digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::FaceUtils Class Reference
+ Inheritance diagram for Digikam::FaceUtils:

Public Types

enum  FaceRecognitionSteps { DetectFaceRegions , DetectAndRecognize }
 

Public Member Functions

 FaceUtils (QObject *const parent=nullptr)
 
bool hasBeenScanned (const ItemInfo &info) const
 Tells if the image has been scanned for faces or not.
 
bool hasBeenScanned (qlonglong imageid) const
 
Identity identityForTag (int tagId) const
 
void markAsScanned (const ItemInfo &info, bool hasBeenScanned=true) const
 
void markAsScanned (qlonglong imageid, bool hasBeenScanned=true) const
 Marks the image as scanned for faces.
 
bool normalTagChanged () const
 
void storeThumbnails (ThumbnailLoadThread *const thread, const QString &filePath, const QList< FaceTagsIface > &databaseFaces, const DImg &image)
 This uses a thumbnail load thread to load the image detail.
 
int tagForIdentity (const Identity &identity) const
 
QList< FaceTagsIfacetoFaceTagsIfaces (qlonglong imageid, const QList< QRectF > &detectedFaces, const QList< Identity > &recognitionResults, const QSize &fullSize) const
 Conversion.
 
QList< FaceTagsIfacewriteUnconfirmedResults (qlonglong imageid, const QList< QRectF > &detectedFaces, const QList< Identity > &recognitionResults, const QSize &fullSize)
 The given face list is a result of automatic detection and possibly recognition.
 
- Public Member Functions inherited from Digikam::FaceTagsEditor
void add (const FaceTagsIface &face, bool trainFace=true)
 Adds a new entry to the database.
 
FaceTagsIface add (qlonglong imageid, int tagId, const TagRegion &region, bool trainFace=true)
 
FaceTagsIface addManually (const FaceTagsIface &face)
 
FaceTagsIface changeRegion (const FaceTagsIface &face, const TagRegion &newRegion)
 Changes the region of the given entry.
 
FaceTagsIface changeSuggestedName (const FaceTagsIface &previousEntry, int unconfirmedNameTagId)
 Switches an unknownPersonEntry or unconfirmedEntry to an unconfirmedEntry (with a different suggested name).
 
FaceTagsIface changeTag (const FaceTagsIface &face, int newTagId)
 Changes the tag of the given entry.
 
QList< FaceTagsIfaceconfirmedFaceTagsIfaces (qlonglong imageid) const
 
FaceTagsIface confirmName (const FaceTagsIface &face, int tagId=-1, const TagRegion &confirmedRegion=TagRegion())
 Assign the name tag for given face entry.
 
QList< FaceTagsIfacedatabaseFaces (qlonglong imageid) const
 Reads the FaceTagsIfaces for the given image id from the database.
 
QList< FaceTagsIfacedatabaseFaces (qlonglong imageId, FaceTagsIface::TypeFlags flags) const
 
QList< FaceTagsIfacedatabaseFacesForTraining (qlonglong imageid) const
 
int faceCountForPersonInImage (qlonglong imageid, int tagId) const
 Returns the number of faces a particular person has in the specified image.
 
QList< ItemTagPairfaceItemTagPairs (qlonglong imageid, FaceTagsIface::TypeFlags flags) const
 
QMap< QString, QString > getSuggestedNames (qlonglong id) const
 Returns a Map of Tag Regions (in XML format) to Suggested Name (from Face Recognition) for the given image.
 
QList< QRect > getTagRects (qlonglong imageid) const
 Returns a list of all tag rectangles for the image.
 
QList< FaceTagsIfaceignoredFaceTagsIfaces (qlonglong imageid) const
 
int numberOfFaces (qlonglong imageid) const
 Returns the number of faces present in an image.
 
void removeAllFaces (qlonglong imageid)
 Unassigns all face tags from the image and sets it's scanned property to false.
 
void removeFace (const FaceTagsIface &face, bool touchTags=true)
 Remove the given face.
 
void removeFace (qlonglong imageid, const QRect &rect)
 Remove a face or the face for a certain rect from an image.
 
void removeFaces (const QList< FaceTagsIface > &faces)
 
bool rotateFaces (qlonglong imageId, const QSize &size, int oldOrientation, int newOrientation)
 Rotate face tags.
 
QList< FaceTagsIfaceunconfirmedFaceTagsIfaces (qlonglong imageid) const
 Returns list of Unconfirmed and Unknown faces in the Image.
 
QList< FaceTagsIfaceunconfirmedNameFaceTagsIfaces (qlonglong imageid) const
 Returns a list of UnconfirmedFaces in the Image.
 

Static Public Member Functions

static QRect faceRectToDisplayRect (const QRect &rect)
 For display, it may be desirable to display a slightly larger region than the strict face rectangle.
 
- Static Public Member Functions inherited from Digikam::FaceTagsEditor
static FaceTagsIface confirmedEntry (const FaceTagsIface &face, int tagId=-1, const TagRegion &confirmedRegion=TagRegion())
 Returns the entry that would be added if the given face is confirmed.
 
static FaceTagsIface unconfirmedEntry (qlonglong imageId, int tagId, const TagRegion &region)
 Returns the entry that would be added if the given face is autodetected.
 
static FaceTagsIface unknownPersonEntry (qlonglong imageId, const TagRegion &region)
 

Protected Member Functions

void addNormalTag (qlonglong imageId, int tagId) override
 Reimplemented from parent class.
 
void removeNormalTag (qlonglong imageId, int tagId) override
 
void removeNormalTags (qlonglong imageId, const QList< int > &tagIds) override
 
- Protected Member Functions inherited from Digikam::FaceTagsEditor
void addFaceAndTag (ItemTagPair &pair, const FaceTagsIface &face, const QStringList &properties, bool addTag)
 
void removeFaceAndTag (ItemTagPair &pair, const FaceTagsIface &face, bool touchTags)
 

Member Function Documentation

◆ addNormalTag()

void Digikam::FaceUtils::addNormalTag ( qlonglong  imageId,
int  tagId 
)
overrideprotectedvirtual

Reimplemented from Digikam::FaceTagsEditor.

◆ faceRectToDisplayRect()

QRect Digikam::FaceUtils::faceRectToDisplayRect ( const QRect &  rect)
static

This returns a pixel margin commonly used to increase the rectangle size in all four directions.

◆ removeNormalTag()

void Digikam::FaceUtils::removeNormalTag ( qlonglong  imageId,
int  tagId 
)
overrideprotectedvirtual

If the face just removed was the final face associated with that Tag, reset Tag Icon.

Reimplemented from Digikam::FaceTagsEditor.

◆ removeNormalTags()

void Digikam::FaceUtils::removeNormalTags ( qlonglong  imageId,
const QList< int > &  tagIds 
)
overrideprotectedvirtual

Reimplemented from Digikam::FaceTagsEditor.

◆ storeThumbnails()

void Digikam::FaceUtils::storeThumbnails ( ThumbnailLoadThread *const  thread,
const QString &  filePath,
const QList< FaceTagsIface > &  databaseFaces,
const DImg image 
)

Images in faces and thumbnails.

If requested, the faces will be scaled to the given (fixed) size. Store the needed thumbnails for the given faces. This can be a huge optimization when the has already been loaded anyway.

◆ toFaceTagsIfaces()

QList< FaceTagsIface > Digikam::FaceUtils::toFaceTagsIfaces ( qlonglong  imageid,
const QList< QRectF > &  detectedFaces,
const QList< Identity > &  recognitionResults,
const QSize &  fullSize 
) const

Convert between FacesEngine results and FaceTagsIface.

◆ writeUnconfirmedResults()

QList< FaceTagsIface > Digikam::FaceUtils::writeUnconfirmedResults ( qlonglong  imageid,
const QList< QRectF > &  detectedFaces,
const QList< Identity > &  recognitionResults,
const QSize &  fullSize 
)

The results are written to the database and merged with existing entries. The returned list contains the faces written to the database and has the same size as the given list. If a face was skipped (because of an existing entry), a null FaceTagsIface will be at this place.