DLib:draw_rectangle()中要使用的输入参数

DLib: what input arguments to be used in draw_rectangle()

本文关键字:参数 输入 draw rectangle DLib      更新时间:2023-10-16

Dlib:中draw_rectangle函数中使用的这些输入参数是什么

  1. image_type& img
  2. const rectangle& rect
  3. const pixel_type& val
  4. unsigned int thickness

有人能告诉我这些参数是什么吗?我应该用什么值来在输入图像上绘制找到的地标的覆盖图以保存它。

template <
    typename image_type,
    typename pixel_type
    >
void draw_rectangle (
    image_type& img,
    const rectangle& rect,
    const pixel_type& val,
    unsigned int thickness = 1
);
/*!
    requires
        - image_type == an image object that implements the interface defined in
          dlib/image_processing/generic_image.h 
        - pixel_traits<pixel_type> is defined
    ensures
        - Draws the given rectangle onto the image img.  It does this by calling
          draw_line() four times to draw the four sides of the rectangle.  
        - The rectangle is drawn with the color given by val.
        - The drawn rectangle will have edges that are thickness pixels wide.
!*/

这是他们的网页上说的。这似乎很不言自明。您需要绘制一个图像,需要绘制矩形。pixel_type表示颜色厚度是线条的厚度,默认为一个像素。

您可以在此处找到有关此库的图像的更多信息,也可以在此处的首页上阅读有关不同的pixel_type

根据你的问题,我想说你可能想先学习更多的C++,尤其是模板,因为这个库大量使用它们。这里有很多函数,你不可能在这里问每一个函数的问题。