digiKam
Digikam::FaceTagsEditor Class Reference
+ Inheritance diagram for Digikam::FaceTagsEditor:

Public Member Functions

void add (const FaceTagsIface &face, bool trainFace=true)
 
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)
 
FaceTagsIface changeSuggestedName (const FaceTagsIface &previousEntry, int unconfirmedNameTagId)
 
FaceTagsIface changeTag (const FaceTagsIface &face, int newTagId, ItemInfo &info)
 
QList< FaceTagsIfaceconfirmedFaceTagsIfaces (qlonglong imageid) const
 
FaceTagsIface confirmName (const FaceTagsIface &face, int tagId=-1, const TagRegion &confirmedRegion=TagRegion())
 
QList< FaceTagsIfacedatabaseFaces (qlonglong imageid) const
 
QList< FaceTagsIfacedatabaseFaces (qlonglong imageId, FaceTagsIface::TypeFlags flags) const
 
QList< FaceTagsIfacedatabaseFacesForTraining (qlonglong imageid) const
 
int faceCountForPersonInImage (qlonglong imageid, int tagId) const
 
QList< ItemTagPairfaceItemTagPairs (qlonglong imageid, FaceTagsIface::TypeFlags flags) const
 
 FaceTagsEditor ()
 
QMap< QString, QString > getSuggestedNames (qlonglong id) const
 
QList< QRect > getTagRects (qlonglong imageid) const
 
QList< FaceTagsIfaceignoredFaceTagsIfaces (qlonglong imageid) const
 
int numberOfFaces (qlonglong imageid) const
 
void removeAllFaces (qlonglong imageid)
 
void removeFace (const FaceTagsIface &face, bool touchTags=true)
 
void removeFace (qlonglong imageid, const QRect &rect)
 
void removeFaces (const QList< FaceTagsIface > &faces)
 
QList< FaceTagsIfaceunconfirmedFaceTagsIfaces (qlonglong imageid) const
 
QList< FaceTagsIfaceunconfirmedNameFaceTagsIfaces (qlonglong imageid) const
 
virtual ~FaceTagsEditor ()
 

Static Public Member Functions

static FaceTagsIface confirmedEntry (const FaceTagsIface &face, int tagId=-1, const TagRegion &confirmedRegion=TagRegion())
 
static FaceTagsIface unconfirmedEntry (qlonglong imageId, int tagId, const TagRegion &region)
 
static FaceTagsIface unknownPersonEntry (qlonglong imageId, const TagRegion &region)
 

Protected Member Functions

void addFaceAndTag (ItemTagPair &pair, const FaceTagsIface &face, const QStringList &properties, bool addTag)
 
virtual void addNormalTag (qlonglong imageid, int tagId)
 
void removeFaceAndTag (ItemTagPair &pair, const FaceTagsIface &face, bool touchTags)
 
virtual void removeNormalTag (qlonglong imageid, int tagId)
 
virtual void removeNormalTags (qlonglong imageid, const QList< int > &tagId)
 

Constructor & Destructor Documentation

◆ FaceTagsEditor()

Digikam::FaceTagsEditor::FaceTagsEditor ( )

◆ ~FaceTagsEditor()

Digikam::FaceTagsEditor::~FaceTagsEditor ( )
virtual

Member Function Documentation

◆ add() [1/2]

void Digikam::FaceTagsEditor::add ( const FaceTagsIface face,
bool  trainFace = true 
)

Adds a new entry to the database. The convenience wrapper will return the newly created entry. If trainFace is true, the face will also be listed in the db as needing training. The tag of the face will, if necessary, be converted to a person tag.

References addFaceAndTag(), Digikam::FaceTagsIface::attributesForFlags(), Digikam::FaceTagsIface::ConfirmedName, Digikam::FaceTagsIface::FaceForTraining, Digikam::FaceTagsIface::imageId(), and Digikam::FaceTagsIface::tagId().

Referenced by add(), Digikam::ItemScanner::commitFaces(), and Digikam::AlbumManager::mergeTAlbum().

◆ add() [2/2]

FaceTagsIface Digikam::FaceTagsEditor::add ( qlonglong  imageid,
int  tagId,
const TagRegion region,
bool  trainFace = true 
)

◆ addFaceAndTag()

◆ addManually()

◆ addNormalTag()

void Digikam::FaceTagsEditor::addNormalTag ( qlonglong  imageid,
int  tagId 
)
protectedvirtual

Reimplemented in Digikam::FaceUtils.

References Digikam::ItemInfo::setTag().

Referenced by addFaceAndTag(), and removeFaceAndTag().

◆ changeRegion()

◆ changeSuggestedName()

◆ changeTag()

FaceTagsIface Digikam::FaceTagsEditor::changeTag ( const FaceTagsIface face,
int  newTagId,
ItemInfo info 
)

Changes the tag of the given entry. Returns the face with the new Tag.

Since a new Tag is going to be assigned to the Face, it's important to remove the association between the face and the old tagId.

If the face is being ignored and it was an unconfirmed face, don't remove a possible tag. See bug 449142

NOTE: Ignored Tag is being associated with the Images. This is to allow storing Ignored information in the metadata of the image. We store metadata of FaceTags, if it's a confirmed or ignored person.

References addFaceAndTag(), Digikam::FaceTagsIface::attributesForFlags(), Digikam::FaceTagsIface::imageId(), Digikam::FaceTagsIface::isNull(), Digikam::FaceTags::isPerson(), Digikam::FaceTags::isTheIgnoredPerson(), Digikam::FaceTags::isTheUnconfirmedPerson(), Digikam::FaceTags::isTheUnknownPerson(), removeFace(), Digikam::FaceTagsIface::setTagId(), Digikam::FaceTagsIface::setType(), Digikam::FaceTagsIface::tagId(), Digikam::FaceTagsIface::type(), Digikam::FaceTagsIface::typeForId(), and Digikam::FaceTagsIface::UnconfirmedName.

Referenced by Digikam::DatabaseWriter::process().

◆ confirmedEntry()

FaceTagsIface Digikam::FaceTagsEditor::confirmedEntry ( const FaceTagsIface face,
int  tagId = -1,
const TagRegion confirmedRegion = TagRegion() 
)
static

◆ confirmedFaceTagsIfaces()

QList< FaceTagsIface > Digikam::FaceTagsEditor::confirmedFaceTagsIfaces ( qlonglong  imageid) const

◆ confirmName()

FaceTagsIface Digikam::FaceTagsEditor::confirmName ( const FaceTagsIface face,
int  tagId = -1,
const TagRegion confirmedRegion = TagRegion() 
)

Assign the name tag for given face entry. Pass the tagId if it changed or was newly assigned (UnknownName). Pass the new, corrected region if it changed. If the default values are passed, tag id or region are taken from the given face. The given face should be an unchanged entry read from the database. The confirmed tag will, if necessary, be converted to a person tag. Returns the newly inserted entry.

References addFaceAndTag(), Digikam::FaceTagsIface::attributesForFlags(), confirmedEntry(), Digikam::FaceTagsIface::ConfirmedName, Digikam::FaceTagsIface::FaceForTraining, Digikam::FaceTagsIface::imageId(), Digikam::FaceTags::isTheIgnoredPerson(), Digikam::FaceTags::isTheUnconfirmedPerson(), Digikam::FaceTags::isTheUnknownPerson(), removeFaceAndTag(), and Digikam::FaceTagsIface::tagId().

Referenced by Digikam::DatabaseWriter::process().

◆ databaseFaces() [1/2]

◆ databaseFaces() [2/2]

QList< FaceTagsIface > Digikam::FaceTagsEditor::databaseFaces ( qlonglong  imageId,
FaceTagsIface::TypeFlags  flags 
) const

◆ databaseFacesForTraining()

QList< FaceTagsIface > Digikam::FaceTagsEditor::databaseFacesForTraining ( qlonglong  imageid) const

◆ faceCountForPersonInImage()

int Digikam::FaceTagsEditor::faceCountForPersonInImage ( qlonglong  imageid,
int  tagId 
) const

Returns the number of faces a particular person has in the specified image

References Digikam::ImageTagPropertyName::tagRegion(), and Digikam::ItemTagPair::values().

◆ faceItemTagPairs()

◆ getSuggestedNames()

QMap< QString, QString > Digikam::FaceTagsEditor::getSuggestedNames ( qlonglong  id) const

Returns a Map of Tag Regions (in XML format) to Suggested Name (from Face Recognition) for the given image. This function makes read operations to the database, and hence can be inefficient when called repeatedly. A cached version is provided in ItemInfo, and should be preferred for intensive operations such as sorting, categorizing etc.

For Unconfirmed Results, the value is stored as a tuple of (SuggestedId, Property, Region). Look at the digikam.db file for more details.

References Digikam::ImageTagPropertyName::autodetectedPerson(), Digikam::ItemTagPair::availablePairs(), Digikam::FaceTags::faceNameForTag(), and Digikam::ItemTagPair::values().

Referenced by Digikam::ItemInfo::getSuggestedNames().

◆ getTagRects()

QList< QRect > Digikam::FaceTagsEditor::getTagRects ( qlonglong  imageid) const

Returns a list of all tag rectangles for the image. Unlike findAndTagFaces, this does not take a DImg, because it returns only a QRect, not a Face, so no need of cropping a face rectangle.

References Digikam::ItemTagPair::availablePairs(), Digikam::ImageTagPropertyName::tagRegion(), Digikam::TagRegion::toRect(), and Digikam::ItemTagPair::values().

◆ ignoredFaceTagsIfaces()

QList< FaceTagsIface > Digikam::FaceTagsEditor::ignoredFaceTagsIfaces ( qlonglong  imageid) const

◆ numberOfFaces()

int Digikam::FaceTagsEditor::numberOfFaces ( qlonglong  imageid) const

◆ removeAllFaces()

void Digikam::FaceTagsEditor::removeAllFaces ( qlonglong  imageid)

◆ removeFace() [1/2]

void Digikam::FaceTagsEditor::removeFace ( const FaceTagsIface face,
bool  touchTags = true 
)

◆ removeFace() [2/2]

void Digikam::FaceTagsEditor::removeFace ( qlonglong  imageid,
const QRect &  rect 
)

◆ removeFaceAndTag()

◆ removeFaces()

◆ removeNormalTag()

void Digikam::FaceTagsEditor::removeNormalTag ( qlonglong  imageid,
int  tagId 
)
protectedvirtual

Reimplemented in Digikam::FaceUtils.

References Digikam::ItemInfo::removeTag().

Referenced by removeFaceAndTag().

◆ removeNormalTags()

void Digikam::FaceTagsEditor::removeNormalTags ( qlonglong  imageid,
const QList< int > &  tagId 
)
protectedvirtual

◆ unconfirmedEntry()

FaceTagsIface Digikam::FaceTagsEditor::unconfirmedEntry ( qlonglong  imageId,
int  tagId,
const TagRegion region 
)
static

Returns the entry that would be added if the given face is autodetected. If tagId is -1, the unknown person will be taken.

References Digikam::FaceTagsIface::UnconfirmedName, and Digikam::FaceTags::unknownPersonTagId().

Referenced by Digikam::FacePipeline::addManually(), changeSuggestedName(), Digikam::DatabaseWriter::process(), and unknownPersonEntry().

◆ unconfirmedFaceTagsIfaces()

QList< FaceTagsIface > Digikam::FaceTagsEditor::unconfirmedFaceTagsIfaces ( qlonglong  imageid) const

Returns list of Unconfirmed and Unknown faces in the Image. If you want just Unconfirmed Faces,

See also
unconfirmedNameFaceTagsIfaces

References databaseFaces(), and Digikam::FaceTagsIface::UnconfirmedTypes.

Referenced by Digikam::ScanStateFilter::filter(), and Digikam::DatabaseWriter::process().

◆ unconfirmedNameFaceTagsIfaces()

QList< FaceTagsIface > Digikam::FaceTagsEditor::unconfirmedNameFaceTagsIfaces ( qlonglong  imageid) const

Returns a list of UnconfirmedFaces in the Image. Different from

See also
unconfirmedFaceTagsIfaces

References databaseFaces(), and Digikam::FaceTagsIface::UnconfirmedName.

Referenced by Digikam::ItemInfo::unconfirmedFaceCount().

◆ unknownPersonEntry()

FaceTagsIface Digikam::FaceTagsEditor::unknownPersonEntry ( qlonglong  imageId,
const TagRegion region 
)
static

References unconfirmedEntry().


The documentation for this class was generated from the following files: