#include <imagerecognition/xqfacerecognizer.h>
Link against: faceplatform.lib
class XQFaceRecognizer : public QObject, public QObject |
XQFaceRecognizer facilitates in detecting and recognizing the faces in a given image.
Public Member Functions | |
---|---|
XQFaceRecognizer(XQFaceDatabase &, QObject *) | |
~XQFaceRecognizer() | |
void | cancelProcessing(const QString &) |
void | detectFaces(const QString &, const QImage &) |
bool | isProcessing() |
void | processFaces(const QString &, const QImage &, QList< QRect >) |
void | processFaces(const QString &) |
void | processFaces(const QString &, const QImage &, const QRect &, const QString &) |
Public Signals | |
---|---|
void | facesDetected(const QString &, const QImage, const QSize &, QList< QRect >) |
void | facesRecognized(const QString &, const QImage &, QList< XQFaceRegion >) |
Inherited Attributes | |
---|---|
QObject::d_ptr | |
QObject::objectName | |
QObject::staticQtMetaObject |
Inherited Functions | |
---|---|
QObject::QObject(QObjectPrivate &,QObject *) | |
QObject::blockSignals(bool) | |
QObject::childEvent(QChildEvent *) | |
QObject::children()const | |
QObject::connect(const QObject *,const QMetaMethod &,const QObject *,const QMetaMethod &,Qt::ConnectionType) | |
QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType) | |
QObject::connect(const QObject *,const char *,const char *,Qt::ConnectionType)const | |
QObject::connectNotify(const char *) | |
QObject::customEvent(QEvent *) | |
QObject::deleteLater | |
QObject::destroyed | |
QObject::disconnect(const QObject *,const QMetaMethod &,const QObject *,const QMetaMethod &) | |
QObject::disconnect(const QObject *,const char *) | |
QObject::disconnect(const QObject *,const char *,const QObject *,const char *) | |
QObject::disconnect(const char *,const QObject *,const char *) | |
QObject::disconnectNotify(const char *) | |
QObject::dumpObjectInfo() | |
QObject::dumpObjectTree() | |
QObject::dynamicPropertyNames()const | |
QObject::event(QEvent *) | |
QObject::eventFilter(QObject *,QEvent *) | |
QObject::findChild(const QString &)const | |
QObject::findChildren(const QRegExp &)const | |
QObject::findChildren(const QString &)const | |
QObject::inherits(const char *)const | |
QObject::installEventFilter(QObject *) | |
QObject::isWidgetType()const | |
QObject::killTimer(int) | |
QObject::moveToThread(QThread *) | |
QObject::objectName()const | |
QObject::parent()const | |
QObject::property(const char *)const | |
QObject::receivers(const char *)const | |
QObject::registerUserData() | |
QObject::removeEventFilter(QObject *) | |
QObject::sender()const | |
QObject::senderSignalIndex()const | |
QObject::setObjectName(const QString &) | |
QObject::setParent(QObject *) | |
QObject::setProperty(const char *,const QVariant &) | |
QObject::setUserData(uint,QObjectUserData *) | |
QObject::signalsBlocked()const | |
QObject::startTimer(int) | |
QObject::thread()const | |
QObject::timerEvent(QTimerEvent *) | |
QObject::userData(uint)const | |
QObject::~QObject() |
The faces in the image are compared against a set of already recognized faces managed by XQFaceDatabase interface.
XQFaceRecognizer | ( | XQFaceDatabase & | db, |
QObject * | parent = 0 | ||
) |
Constructor.
Parameters | |
---|---|
db | The XQFaceDatabase object to be used. This object would represent the database where the past learnings are stored. |
parent | The parent QObject. Default value is NULL meaning no parent. |
~XQFaceRecognizer | ( | ) |
Destructor.
void | cancelProcessing | ( | const QString & | sourceId | ) |
void | detectFaces | ( | const QString & | sourceId, |
const QImage & | image | |||
) |
void | facesDetected | ( | const QString & | sourceId, |
const QImage | image, | |||
const QSize & | imageSize, | |||
QList< QRect > | faceRects | |||
) | [signal] |
void | facesRecognized | ( | const QString & | sourceId, |
const QImage & | image, | |||
QList< XQFaceRegion > | faceRegions | |||
) | [signal] |
bool | isProcessing | ( | ) | const |
void | processFaces | ( | const QString & | sourceId, |
const QImage & | image, | |||
QList< QRect > | faceRects = QList< QRect >() | |||
) |
Enqueues an image for Face Recognition.
If the sourceId is a null string, then it is not possible to train the software. Recognition is still possible.
The XQFaceThumbnailer object is accessed internally via the XQFaceDatabase. Hence the instance if XQFaceThumbnailer supplied to XQFaceDatabase would be used.
Parameters | |
---|---|
sourceId | The file/fileid of the image on which Face Recognition is to be done. |
image | If this is a non-null QImage then the processing is done on the supplied image If it is a null QImage then the XQFaceThumbnailer interface createThumbnail() is called in order to create a QImage on which the Face Detection will be done. The QImage given as part of the thumbnailCreated() signal would be used. In either case (QImage is null or not) the XQFaceThumbnailer interface createFaceThumbnail() is called in order to extract the portion of the image with a face in it. The thumbnail returned as part of faceThumbnailCreated() is used for further processing. |
faceRects | The behaviour would be as followsIf this list is null then the face-detection is done on the entire image (or entire image represented by the sourceId if the image is null) and recognition is attempted on all the faces detected.If the list contains one or more elements, then the processing is done only on those rects. It is imperative that this parameter is valid only if the QImage supplied is not null since the reference image size for the rects is ambiguous otherwise. |
void | processFaces | ( | const QString & | sourceId | ) |
Enqueues an image for Face Recognition.
The XQFaceThumbnailer object is accessed internally via the XQFaceDatabase. Hence the instance if XQFaceThumbnailer supplied to XQFaceDatabase would be used.
Parameters | |
---|---|
sourceId | The file/fileid of the image on which Face Recognition is to be done. The XQFaceThumbnailer interface createThumbnail() is called in order to create a QImage on which the Face Detection will be done. The QImage given as part of the thumbnailCreated() signal would be used. In either case (QImage is null or not) the XQFaceThumbnailer interface createFaceThumbnail() is called in order to extract the portion of the image with a face in it. The thumbnail returned as part of faceThumbnailCreated() is used for further processing. |
void | processFaces | ( | const QString & | sourceId, |
const QImage & | image, | |||
const QRect & | faceRect, | |||
const QString & | faceId | |||
) |
Enqueues an image for Face Recognition.
A face region is formed out of the given rect and the supplied faceid is associated with it. This has the same effect as calling XQFaceRegion::setFaceId() on the face region that this rectangle represents. The facesRecognized() signal is still emitted even though the rect is supplied. Only the supplied rect is processed.
If the sourceId is a null string, then it is not possible to train the software. Recognition is still possible.
The XQFaceThumbnailer object is accessed internally via the XQFaceDatabase. Hence the instance if XQFaceThumbnailer supplied to XQFaceDatabase would be used.
Parameters | |
---|---|
sourceId | The file/fileid of the image on which Face Recognition is to be done. |
image | This parameter cannot be a null QImage.The processing is done on the supplied image. The XQFaceThumbnailer interface createFaceThumbnail() is called in order to extract the portion of the image with a face in it. The thumbnail returned as part of faceThumbnailCreated() is used for further processing. |
faceRect | The processing is done only on the supplied rect. It is imperative that this parameter is valid only if the QImage supplied is not null since the reference image size for the rect is ambiguous otherwise. |
faceId | After processing, this faceId is assigned to the face region (same effect as calling XQFaceRegion::setFaceId()) |