如何操作dlib地标点
How to manipulate dlib landmark points
我想知道如何操作/访问dlib地标点。我在相机预览中运行代码,目的是检测一些特定的情绪。例如,我想检查眼睑之间的距离或嘴唇的位置如何随时间变化等等。
python api -试试这个链接(https://matthewearl.github.io/2015/07/28/switching-eds-with-python/)
对于c++ - http://dlib.net/train_shape_predictor_ex.cpp.html样本有估算眼间距离的代码:
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);
}
就像你可以访问任何面部特征一样关于特性号的更多信息可以在dlib/image_processing/render_face_detection .h
相关文章:
- 为什么在popback()操作之后,它仍然打印完整的矢量
- 在编译C++代码(具有dlib和opencv)到WASM时面临问题
- 重载操作程序时出错>>用于类中的字符串 memebr
- 对字符串进行位操作
- 我可以在 C++ 中的函数体之外进行操作吗?
- MPI突然停止了对多个核心的操作
- 如何在信号处理程序和普通函数中对全局变量进行互斥读写操作
- 对字符数组中的元素执行逐位操作
- 如何在directx/c++中进行平移/缩放操作
- 逐位操作的隐式类型转换
- 为什么一个向量上的多线程操作很慢
- 自定义对象的dlib序列化在gcc中失败
- 排序时无法执行交换操作.我做的时候它会崩溃.为什么
- 位移操作和位掩码未检测到重复字符
- 如何进行特定的位操作?
- 当我们进行一些操作时,应该使用什么'std::string'或'std::stringstream'?
- 字符串操作 - 字符计数
- 此代码中的操作流程是什么?C/C++.
- Dlib元素特定操作
- 如何操作dlib地标点