C++ 如何操作dlib地标点
我想知道如何操作/访问dlib地标点。我在相机预览上运行代码,目的是检测某些特定的情绪。我想检查一下,例如,眼睑之间的距离或嘴唇的位置如何随时间变化等等。对于python api,请尝试此链接() < C++ >样本有用于估计眼间距离的代码:C++ 如何操作dlib地标点,c++,opencv,image-processing,face-detection,dlib,C++,Opencv,Image Processing,Face Detection,Dlib,我想知道如何操作/访问dlib地标点。我在相机预览上运行代码,目的是检测某些特定的情绪。我想检查一下,例如,眼睑之间的距离或嘴唇的位置如何随时间变化等等。对于python api,请尝试此链接() < C++ >样本有用于估计眼间距离的代码: double interocular_distance ( const full_object_detection& det ) { dlib::vector<double,2> l, r; double cnt
double interocular_distance (
const full_object_detection& det
)
{
dlib::vector<double,2> l, r;
double cnt = 0;
// Find the center of the left eye by averaging the points around
// the eye.
for (unsigned long i = 36; i <= 41; ++i)
{
l += det.part(i);
++cnt;
}
l /= cnt;
// Find the center of the right eye by averaging the points around
// the eye.
cnt = 0;
for (unsigned long i = 42; i <= 47; ++i)
{
r += det.part(i);
++cnt;
}
r /= cnt;
// Now return the distance between the centers of the eyes
return length(l-r);
}
双目间距离(
恒满对象检测与检测
)
{
向量l,r;
双碳纳米管=0;
//通过平均周围的点来找到左眼的中心
//眼睛。
对于python api(无符号长i=36;i),请尝试以下链接()
< C++ >样本有用于估计眼间距离的代码:
double interocular_distance (
const full_object_detection& det
)
{
dlib::vector<double,2> l, r;
double cnt = 0;
// Find the center of the left eye by averaging the points around
// the eye.
for (unsigned long i = 36; i <= 41; ++i)
{
l += det.part(i);
++cnt;
}
l /= cnt;
// Find the center of the right eye by averaging the points around
// the eye.
cnt = 0;
for (unsigned long i = 42; i <= 47; ++i)
{
r += det.part(i);
++cnt;
}
r /= cnt;
// Now return the distance between the centers of the eyes
return length(l-r);
}
双目间距离(
恒满对象检测与检测
)
{
向量l,r;
双碳纳米管=0;
//通过平均周围的点来找到左眼的中心
//眼睛。
对于(未签名的long i=36;我感谢你,我将看C++选项。):谢谢,我将看C++选项。您可以使用嘴唇点的距离获取所有点并估计表情。为此,您需要从dlib研究面部表情,您只能获取标志点。您可以使用嘴唇点的距离获取所有点并估计表情。为此,您需要从dlib研究面部表情,您只能获取标志点。