digiKam
Digikam::FaceDetector Class Reference

Public Member Functions

QString backendIdentifier () const
 
QList< QRectF > detectFaces (const DImg &image, const QSize &originalSize=QSize())
 
QList< QRectF > detectFaces (const QImage &image, const QSize &originalSize=QSize())
 
QList< QRectF > detectFaces (const QString &imagePath)
 
 FaceDetector ()
 
 FaceDetector (const FaceDetector &other)
 
FaceDetectoroperator= (const FaceDetector &other)
 
QVariantMap parameters () const
 
int recommendedImageSize (const QSize &availableSize=QSize()) const
 
void setParameter (const QString &parameter, const QVariant &value)
 
void setParameters (const QVariantMap &parameters)
 
 ~FaceDetector ()
 

Static Public Member Functions

static QRect toAbsoluteRect (const QRectF &relativeRect, const QSize &size)
 
static QList< QRect > toAbsoluteRects (const QList< QRectF > &relativeRects, const QSize &size)
 
static QRectF toRelativeRect (const QRect &absoluteRect, const QSize &size)
 
static QList< QRectF > toRelativeRects (const QList< QRect > &absoluteRects, const QSize &size)
 

Constructor & Destructor Documentation

◆ FaceDetector() [1/2]

Digikam::FaceDetector::FaceDetector ( )

Provides face detection, that means the process of selecting those regions of a full image which contain face.

This class provides shallow copying The class is fully reentrant (a single object and its copies are not thread-safe). Deferred creation is guaranteed, that means creation of a FaceDetector object is cheap, the expensive creation of the detection backend is performed when detectFaces is called for the first time.

◆ FaceDetector() [2/2]

Digikam::FaceDetector::FaceDetector ( const FaceDetector other)

◆ ~FaceDetector()

Digikam::FaceDetector::~FaceDetector ( )

Member Function Documentation

◆ backendIdentifier()

QString Digikam::FaceDetector::backendIdentifier ( ) const

◆ detectFaces() [1/3]

QList< QRectF > Digikam::FaceDetector::detectFaces ( const DImg image,
const QSize &  originalSize = QSize() 
)

Scan an image for faces. Return a list with regions possibly containing faces. If the image has been downscaled anywhere in the process, provide the original size of the image as this may be of importance in the detection process.

Found faces are returned in relative coordinates.

References Digikam::DImg::isNull(), Digikam::DImg::size(), and toRelativeRects().

◆ detectFaces() [2/3]

QList< QRectF > Digikam::FaceDetector::detectFaces ( const QImage &  image,
const QSize &  originalSize = QSize() 
)

Scan an image for faces. Return a list with regions possibly containing faces. If the image has been downscaled anywhere in the process, provide the original size of the image as this may be of importance in the detection process.

Found faces are returned in relative coordinates.

References toRelativeRects().

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

◆ detectFaces() [3/3]

QList< QRectF > Digikam::FaceDetector::detectFaces ( const QString &  imagePath)

References toRelativeRects().

◆ operator=()

FaceDetector & Digikam::FaceDetector::operator= ( const FaceDetector other)

◆ parameters()

QVariantMap Digikam::FaceDetector::parameters ( ) const

Referenced by setParameters().

◆ recommendedImageSize()

int Digikam::FaceDetector::recommendedImageSize ( const QSize &  availableSize = QSize()) const

Returns the recommended size if you want to scale images for detection. Larger images can be passed, but may be downscaled.

References Digikam::OpenCVDNNFaceDetector::recommendedImageSizeForDetection().

Referenced by Digikam::DetectionWorker::scaleForDetection().

◆ setParameter()

void Digikam::FaceDetector::setParameter ( const QString &  parameter,
const QVariant &  value 
)

Tunes backend parameters. Available parameters:

"speed" vs. "accuracy", 0..1, float "sensitivity" vs. "specificity", 0..1, float.

For both pairs: a = 1-b, you can set either. The first pair changes the ROC curve in a trade for computing time. The second pair moves on a given ROC curve towards more false positives, or more missed faces.

References value.

◆ setParameters()

void Digikam::FaceDetector::setParameters ( const QVariantMap &  parameters)

◆ toAbsoluteRect()

QRect Digikam::FaceDetector::toAbsoluteRect ( const QRectF &  relativeRect,
const QSize &  size 
)
static

Referenced by toAbsoluteRects().

◆ toAbsoluteRects()

QList< QRect > Digikam::FaceDetector::toAbsoluteRects ( const QList< QRectF > &  relativeRects,
const QSize &  size 
)
static

References toAbsoluteRect().

◆ toRelativeRect()

QRectF Digikam::FaceDetector::toRelativeRect ( const QRect &  absoluteRect,
const QSize &  size 
)
static

Referenced by toRelativeRects().

◆ toRelativeRects()

QList< QRectF > Digikam::FaceDetector::toRelativeRects ( const QList< QRect > &  absoluteRects,
const QSize &  size 
)
static

References toRelativeRect().

Referenced by detectFaces().


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