The function xf::cv::imread loads an image from the specified file path, copies into xf::cv::Mat and returns it. If the image cannot be read (because of missing file, improper permissions, unsupported or invalid format), the function exits with a non-zero return code and an error statement.
Note
In an HLS standalone mode like Cosim, use cv::imread
followed by copyTo
function, instead of xf::cv::imread
.
API Syntax
template<int PTYPE, int ROWS, int COLS, int NPC>
xf::cv::Mat<PTYPE, ROWS, COLS, NPC> imread (char *filename, int type)
Parameter Descriptions
The table below describes the template and the function parameters.
Parameter | Description |
---|---|
PTYPE | Input pixel type. Value should be in accordance with the ‘type’ argument’s value. |
ROWS | Maximum height of the image to be read |
COLS | Maximum width of the image to be read |
NPC | Number of pixels to be processed per cycle; possible options are XF_NPPC1 and XF_NPPC8 for 1 pixel and 8 pixel operations respectively. |
filename | Name of the file to be loaded |
type | Flag that depicts the type of image. The values are:
|