Dlib在Z轴上旋转图像

时间:2017-10-12 09:29:00

标签: c++ c++11 image-processing dlib

我正在尝试使用dlib在Z轴上旋转来生成一些图像。 我找到了point_transform_affine3d rotate_around_z(double angle),但我不明白如何使用它。

我的起点是从JPG文件加载的array2d<unsigned char> image,我需要将此图像从-10转到+10度。

例如,要使用图像数组在X轴和Y轴上旋转我使用此cose(正常工作):

        dlib::array<array2d<unsigned char> > images;
        std::vector<std::vector<rectangle> > object_locations, ignore;
        // Parser[0] is an input XML
        ignore = load_image_dataset(images, object_locations, parser[0]);

        // Add rotations for every training image in steps of 1 degrees from -7 to +7.
        matrix<double,15,1> angles;
        double step = 1.0 * M_PI / 180.0;
        for (int r = -7; r <= 7; ++r) angles(r) = (double) r * step;
        add_image_rotations(angles, images, object_locations, ignore);

如何获得新的矩形标签呢?

0 个答案:

没有答案