The structure DarknetImage is used to store a normalized RGB Darknet image. More...
#include "darknet.h"
Public Attributes | |
int | c |
channel | |
float * | data |
normalized floats, the number of which is determined by "w * h * c" | |
int | h |
height | |
int | w |
width | |
The structure DarknetImage is used to store a normalized RGB Darknet image.
The format is intended to be used for internal use by Darknet, but there are some situations where it may also be used or referenced externally via the Darknet API.
Moving forward starting with Darknet V3 (August 2024), where possible the emphasis will be to use OpenCV cv::Mat
objects in the external-facing API instead of DarknetImage. Internally, Darknet will continue to use Image
.
C
API, which is why it exists this way and not as a C++ class with methods.Within data
, the image is stored as 3 non-interlaced channels in RGB order. Each channel is stored as rows, from top to bottom. So a 5x3 RGB image would look like this:
A 5x3 pure red image, with a blueish/green square in the bottom-right corner would look like this:
For additional information or to help debug the internals of DarknetImage
, see Darknet::image_as_debug_string().
int DarknetImage::c |
channel
float* DarknetImage::data |
normalized floats, the number of which is determined by "w * h * c"
int DarknetImage::h |
height
int DarknetImage::w |
width