dlib19.24 引用哪个版本的 libjpeg
时间: 2023-08-01 17:07:52 浏览: 40
dlib 19.24 默认使用 libjpeg-turbo 作为 JPEG 图像的编解码库,版本号为 1.5.1。不过,如果您使用的是基于 Debian 或 Ubuntu 的 Linux 发行版,则可能会自动安装 libjpeg8 或 libjpeg62-turbo 这两个软件包中的一个作为 libjpeg 库。
如果您想使用其他版本的 libjpeg 库,可以手动修改 dlib 的 CMakeFiles.txt 文件中关于 libjpeg 的配置参数,具体方法可以参考 dlib 的官方文档:https://github.com/davisking/dlib/blob/master/dlib/cmake/CMakeLists.txt
相关问题
dlib 19.24 c++ 人脸矫正的例子
以下是使用dlib 19.24 c++进行人脸矫正的示例代码:
```c++
#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/image_processing.h>
#include <dlib/gui_widgets.h>
#include <dlib/image_io.h>
using namespace dlib;
int main()
{
try
{
// Load the face detection model.
frontal_face_detector detector = get_frontal_face_detector();
shape_predictor sp;
deserialize("shape_predictor_68_face_landmarks.dat") >> sp;
// Load the image.
array2d<rgb_pixel> img;
load_image(img, "test.jpg");
// Detect faces.
std::vector<rectangle> dets = detector(img);
// Find the pose of each face.
std::vector<full_object_detection> shapes;
for (unsigned long i = 0; i < dets.size(); ++i)
shapes.push_back(sp(img, dets[i]));
// Draw the detected faces.
image_window win;
win.set_image(img);
win.add_overlay(dets, rgb_pixel(255, 0, 0));
// Draw the facial landmarks on each face.
for (unsigned long i = 0; i < shapes.size(); ++i)
win.add_overlay(render_face_detections(shapes[i]));
// Get the affine transform for each face and apply it to the image.
for (unsigned long i = 0; i < shapes.size(); ++i)
{
rectangle rect = shapes[i].get_rect();
full_object_detection shape = shapes[i];
matrix<double, 3, 3> trans = get_affine_transform(shape);
array2d<rgb_pixel> face_chip;
extract_image_chip(img, get_face_chip_details(shape,150,0.25), face_chip);
transform_image(face_chip, face_chip, interpolate_bilinear());
win.add_overlay(image_window::overlay_rect(rect, rgb_pixel(255, 0, 0), "face"));
win.add_overlay(image_window::overlay_rect(get_face_chip_details(shape,150,0.25), rgb_pixel(0, 255, 0), "chip"));
win.add_overlay(render_face_detections(shapes[i], rgb_pixel(0, 255, 0)));
save_png(face_chip, "face_chip_" + std::to_string(i+1) + ".png");
}
// Wait for the user to close the window.
win.wait_until_closed();
}
catch (std::exception& e)
{
std::cout << e.what() << std::endl;
}
}
```
此示例代码使用dlib的面部检测器和形状预测器来检测图像中的面部,并使用面部的关键点来获取每个面部的仿射变换矩阵。然后,它将这些仿射变换应用于原始图像中的面部,以便进行矫正。最后,它将矫正后的面部保存为图像文件。
注意:在使用此示例代码之前,您需要下载dlib的面部检测器和形状预测器,并将其保存在与示例代码相同的目录中。您还需要将示例代码中的“test.jpg”更改为您要矫正的实际图像文件名。
dlib-19.24.2
dlib-19.24.2是一个开源的C++库,用于机器学习、计算机视觉和图像处理。它提供了许多高效的工具和算法,可以用于人脸检测、人脸识别、面部标志点检测、对象检测和跟踪等领域。除了C++接口,dlib-19.24.2也提供了Python接口,方便Python用户使用其强大的功能。
这个版本dlib-19.24.2在前一个版本的基础上做了一些改进和优化。它添加了更多的机器学习算法和工具,例如支持向量机、最大间隔贝叶斯分类器、k均值聚类等。同时,它还改进了人脸识别和跟踪的性能,提高了检测和识别的准确度和稳定性。此外,对于图像处理和特征提取方面也进行了一些优化,使得整个库更加灵活和高效。
总的来说,dlib-19.24.2是一个功能丰富、高效稳定的C++库,适用于各种机器学习、计算机视觉和图像处理任务。它在处理复杂的图像和视频数据时表现出色,可以帮助开发者快速构建并部署相关应用程序。有了这个库的支持,用户可以更轻松地实现人脸识别、对象检测、图像分割等功能,为各种领域的应用提供强大的支持。