IMREAD_ANYDEPTH=2,//!< If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit.
IMREAD_ANYCOLOR=4,//!< If set, the image is read in any possible color format.
IMREAD_LOAD_GDAL=8,//!< If set, use the gdal driver for loading the image.
IMREAD_GRAYSCALE_REDUCED_2=16,//!< If set, always convert image to the single channel grayscale image and the image size reduced 1/2.
IMREAD_COLOR_REDUCED_2=17,//!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/2.
IMREAD_GRAYSCALE_REDUCED_4=32,//!< If set, always convert image to the single channel grayscale image and the image size reduced 1/4.
IMREAD_COLOR_REDUCED_4=33,//!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/4.
IMREAD_GRAYSCALE_REDUCED_8=64,//!< If set, always convert image to the single channel grayscale image and the image size reduced 1/8.
IMREAD_COLOR_REDUCED_8=65//!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/8.
IMREAD_REDUCED_GRAYSCALE_2=16,//!< If set, always convert image to the single channel grayscale image and the image size reduced 1/2.
IMREAD_REDUCED_COLOR_2=17,//!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/2.
IMREAD_REDUCED_GRAYSCALE_4=32,//!< If set, always convert image to the single channel grayscale image and the image size reduced 1/4.
IMREAD_REDUCED_COLOR_4=33,//!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/4.
IMREAD_REDUCED_GRAYSCALE_8=64,//!< If set, always convert image to the single channel grayscale image and the image size reduced 1/8.
IMREAD_REDUCED_COLOR_8=65//!< If set, always convert image to the 3 channel BGR color image and the image size reduced 1/8.
};
//! Imwrite flags
...
...
@@ -91,25 +91,31 @@ enum ImwriteFlags {
IMWRITE_WEBP_QUALITY=64//!< For WEBP, it can be a quality from 1 to 100 (the higher is the better). By default (without any parameter) and for quality above 100 the lossless compression is used.
};
//! Imwrite PNG specific flags
//! Imwrite PNG specific flags used to tune the compression algorithm.
/** These flags will be modify the way of PNG image compression and will be passed to the underlying zlib processing stage.
- The effect of IMWRITE_PNG_STRATEGY_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between IMWRITE_PNG_STRATEGY_DEFAULT and IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY.
- IMWRITE_PNG_STRATEGY_RLE is designed to be almost as fast as IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY, but give better compression for PNG image data.
- The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately.
- IMWRITE_PNG_STRATEGY_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications.
*/
enumImwritePNGFlags{
IMWRITE_PNG_STRATEGY_DEFAULT=0,
IMWRITE_PNG_STRATEGY_FILTERED=1,
IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY=2,
IMWRITE_PNG_STRATEGY_RLE=3,
IMWRITE_PNG_STRATEGY_FIXED=4
IMWRITE_PNG_STRATEGY_DEFAULT=0,//!< Use this value for normal data.
IMWRITE_PNG_STRATEGY_FILTERED=1,//!< Use this value for data produced by a filter (or predictor).Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better.
IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY=2,//!< Use this value to force Huffman encoding only (no string match).
IMWRITE_PNG_STRATEGY_RLE=3,//!< Use this value to limit match distances to one (run-length encoding).
IMWRITE_PNG_STRATEGY_FIXED=4//!< Using this value prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications.
};
/** @brief Loads an image from a file.
@anchor imread
@param filename Name of file to be loaded.
@param flags Flag that can take values of @ref cv::ImreadModes
The function imread loads an image from the specified file and returns it. If the image cannot be
read (because of missing file, improper permissions, unsupported or invalid format), the function
returns an empty matrix ( Mat::data==NULL ). Currently, the following file formats are supported:
returns an empty matrix ( Mat::data==NULL ).
Currently, the following file formats are supported:
- Windows bitmaps - \*.bmp, \*.dib (always supported)
- JPEG files - \*.jpeg, \*.jpg, \*.jpe (see the *Notes* section)
...
...
@@ -125,6 +131,7 @@ returns an empty matrix ( Mat::data==NULL ). Currently, the following file forma
@note
- The function determines the type of an image by the content, not by the file extension.
- In the case of color images, the decoded images will have the channels stored in **B G R** order.
- On Microsoft Windows\* OS and MacOSX\*, the codecs shipped with an OpenCV image (libjpeg,
libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs,
and TIFFs. On MacOSX, there is also an option to use native MacOSX image readers. But beware
...
...
@@ -134,38 +141,35 @@ returns an empty matrix ( Mat::data==NULL ). Currently, the following file forma
codecs supplied with an OS image. Install the relevant packages (do not forget the development
files, for example, "libjpeg-dev", in Debian\* and Ubuntu\*) to get the codec support or turn
on the OPENCV_BUILD_3RDPARTY_LIBS flag in CMake.
@note In the case of color images, the decoded images will have the channels stored in B G R order.
*/
@param filename Name of file to be loaded.
@param flags Flag that can take values of cv::ImreadModes