◆ OpenCVDNNFaceDetector()
Digikam::OpenCVDNNFaceDetector::OpenCVDNNFaceDetector |
( |
DetectorNNModel |
model = DetectorNNModel::SSDMOBILENET | ) |
|
|
explicit |
◆ ~OpenCVDNNFaceDetector()
Digikam::OpenCVDNNFaceDetector::~OpenCVDNNFaceDetector |
( |
| ) |
|
◆ cvDetectFaces()
std::vector< cv::Rect > Digikam::OpenCVDNNFaceDetector::cvDetectFaces |
( |
const cv::Mat & |
inputImage, |
|
|
const cv::Size & |
paddedSize |
|
) |
| |
◆ detectFaces()
QList< QRect > Digikam::OpenCVDNNFaceDetector::detectFaces |
( |
const cv::Mat & |
inputImage, |
|
|
const cv::Size & |
paddedSize |
|
) |
| |
There is no proof that doing this will help, since face can be detected at various positions (even half, masked faces can be detected), not only frontal. Effort on doing this should be questioned. TODO: Restructure and improve Face Detection module.
void OpenCVDNNFaceDetector::resizeBboxToStandardHumanFace(int& width, int& height) { Human head sizes data https://en.wikipedia.org/wiki/Human_head#Average_head_sizes
float maxRatioFrontalFace = 15.4 / 15.5;
float minRatioNonFrontalFace = 8.6 / 21.6;
float r = width*1.0/height, rReference;
if ((r >= minRatioNonFrontalFace*0.9) && r <= (maxRatioFrontalFace * 1.1))
{
rReference = r;
}
else if (r <= 0.25)
{
rReference = r * 1.5;
}
else if (r >= 4)
{
rReference = r / 1.5;
}
else if (r < minRatioNonFrontalFace * 0.9)
{
rReference = minRatioNonFrontalFace;
}
else if (r > maxRatioFrontalFace * 1.1)
{
rReference = maxRatioFrontalFace;
}
if (width > height)
{
height = width / rReference;
}
else
{
width = height * rReference;
}
}
References cvDetectFaces().
◆ prepareForDetection() [1/3]
cv::Mat Digikam::OpenCVDNNFaceDetector::prepareForDetection |
( |
const DImg & |
inputImage, |
|
|
cv::Size & |
paddedSize |
|
) |
| const |
◆ prepareForDetection() [2/3]
cv::Mat Digikam::OpenCVDNNFaceDetector::prepareForDetection |
( |
const QImage & |
inputImage, |
|
|
cv::Size & |
paddedSize |
|
) |
| const |
◆ prepareForDetection() [3/3]
cv::Mat Digikam::OpenCVDNNFaceDetector::prepareForDetection |
( |
const QString & |
inputImagePath, |
|
|
cv::Size & |
paddedSize |
|
) |
| const |
◆ recommendedImageSizeForDetection()
int Digikam::OpenCVDNNFaceDetector::recommendedImageSizeForDetection |
( |
| ) |
|
|
static |
The documentation for this class was generated from the following files: