代码拉取完成,页面将自动刷新
#include <iostream>
#include <string>
#include "WisFaceEngineWrap.h"
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main(int argc, char* argv[])
{
QsHANDLE engine = qs_Wis_Create();
if (!engine)
{
printf("create face engine failed.\n");
return 0;
}
printf("initial face engine success\r\n");
std::string imgFile1;
while (true)
{
std::cout << "input the picture\n";
std::cin >> imgFile1;
Mat img1 = imread(imgFile1);
if (img1.empty() == true)
{
printf("imread failed %s\n", imgFile1.c_str());
return 0;
}
QsFace face1;
int facenum1 = qs_Wis_DetectFaces(engine, img1.data, img1.cols, img1.rows, img1.step.p[0], &face1, 1);
if (facenum1 > 0)
{
printf("facenum=%d,{left=%d,top=%d,right=%d,bottom=%d}\n",
facenum1, face1.rect.left, face1.rect.top, face1.rect.right, face1.rect.bottom);
}
}
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。