如何通过Android上的OPENCV提高面部检测性能
How to improve face detection performance with OpenCV on Android?
我正在从事一个Android项目,我正在使用OpenCV通过相机检测面。应用程序可以正确检测到面部,但性能非常慢。我已经多次检查了这个问题,但是找不到任何解决方案。有什么方法可以改善性能?
我的代码是:
QVideoFrame FilterRunnable::run( QVideoFrame *input,
const QVideoSurfaceFormat &surfaceFormat,
QVideoFilterRunnable::RunFlags flags )
{
input->map(QAbstractVideoBuffer::ReadOnly);
QImage image = imageWrapper(*input);
image = image.scaled(640,480);
cv::Mat mat(image.width(),image.height(),CV_8UC3,image.bits(), image.bytesPerLine());
vector< Rect > detectedFaces;
detectedFaces.clear();
frontalFaceClassifier.detectMultiScale( mat, detectedFaces,
1.6, 3, 2 | CV_HAAR_SCALE_IMAGE , Size(60,60) );
qDebug()<<"Cantidad de caras en el vector : " << detectedFaces.size();
if( detectedFaces.size() > 0 ){
actualFace = detectedFaces.at( 0 );
countDetectedFaces++;
qDebug()<<"**********qwerty**********"<<detectedFaces.size();
}
for(int i=0;i<detectedFaces.size();i++)
{
Rect dibujarCuadrado = detectedFaces.at(i);
cv::rectangle (mat, dibujarCuadrado, 20, 1, LINE_8, 0);
}
}
我看到您仅实现了一个HAAR分类器。我以为您使用前面一个。您可以将配置文件面部分类器(在OpenCV HAAR软件包中可用)中添加到其他语句中,以提高准确性。通常,您可以培训所需的任何分类器并将其合并。对于培训分类器,这是一个很棒的视频
相关文章:
- 使用CMake检测支持的C++标准
- 当套接字连接断开时检测C/C++Unix
- C/C++预处理器是否可以检测一些编译器选项
- WMI检测进程创建事件-c++
- 计算每个节点的树高,帮助我解释这个代码解决方案
- 基于树莓pi的tensorflow lite量化ssd目标检测
- 下面是我为检测链接列表中的循环而制作的代码
- 落砂模拟碰撞检测C++和SFML
- 我可以检测和更改 gcc/g++ 中结构的当前数据对齐设置吗?
- 当使用比格式支持的精度更高的精度来显示数字时,会写出什么数据
- 为什么C++编译器没有检测到正确声明的类?
- 检测win32服务创建和删除的最佳方法
- 在不使用经过训练的模型的情况下检测/分割面部和面部特征:openCV C++
- ***检测到堆栈粉碎***:在高斯消除中
- 如何通过Android上的OPENCV提高面部检测性能
- 面部特征检测-眼角、眉毛
- 面部和眼睛检测工作不正常
- 用于面部和眼睛检测的最佳opencv版本
- OpenCV 如何检测网络摄像头并比较本地文件以匹配面部
- SDL 检测高 DPI/视网膜显示器