@@ -222,9 +222,9 @@ enum ImwriteHDRCompressionFlags {
222
222
223
223
@anchor imread
224
224
225
- The function imread loads an image from the specified file and returns it . If the image cannot be
226
- read (because of missing file, improper permissions, unsupported or invalid format), the function
227
- returns an empty matrix ( Mat::data==NULL ) .
225
+ The ` imread` function loads an image from the specified file and returns OpenCV matrix . If the image cannot be
226
+ read (because of a missing file, improper permissions, or unsupported/ invalid format), the function
227
+ returns an empty matrix.
228
228
229
229
Currently, the following file formats are supported:
230
230
@@ -234,7 +234,7 @@ Currently, the following file formats are supported:
234
234
- Portable Network Graphics - \*.png (see the *Note* section)
235
235
- WebP - \*.webp (see the *Note* section)
236
236
- AVIF - \*.avif (see the *Note* section)
237
- - Portable image format - \*.pbm, \*.pgm, \*.ppm \*.pxm, \*.pnm (always supported)
237
+ - Portable image format - \*.pbm, \*.pgm, \*.ppm, \*.pxm, \*.pnm (always supported)
238
238
- PFM files - \*.pfm (see the *Note* section)
239
239
- Sun rasters - \*.sr, \*.ras (always supported)
240
240
- TIFF files - \*.tiff, \*.tif (see the *Note* section)
@@ -243,32 +243,31 @@ Currently, the following file formats are supported:
243
243
- Raster and Vector geospatial data supported by GDAL (see the *Note* section)
244
244
245
245
@note
246
- - The function determines the type of an image by the content, not by the file extension.
246
+ - The function determines the type of an image by its content, not by the file extension.
247
247
- In the case of color images, the decoded images will have the channels stored in **B G R** order.
248
248
- When using IMREAD_GRAYSCALE, the codec's internal grayscale conversion will be used, if available.
249
- Results may differ to the output of cvtColor()
250
- - On Microsoft Windows\* OS and MacOSX \*, the codecs shipped with an OpenCV image (libjpeg,
251
- libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs,
252
- and TIFFs. On MacOSX, there is also an option to use native MacOSX image readers. But beware
253
- that currently these native image loaders give images with different pixel values because of
254
- the color management embedded into MacOSX .
255
- - On Linux\*, BSD flavors and other Unix-like open-source operating systems, OpenCV looks for
256
- codecs supplied with an OS image. Install the relevant packages (do not forget the development
257
- files, for example, "libjpeg-dev", in Debian\* and Ubuntu\*) to get the codec support or turn
249
+ Results may differ from the output of cvtColor().
250
+ - On Microsoft Windows\* and Mac OS \*, the codecs shipped with OpenCV (libjpeg, libpng, libtiff ,
251
+ and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs, and TIFFs. On Mac OS ,
252
+ there is also an option to use native Mac OS image readers. However, beware that currently these
253
+ native image loaders give images with different pixel values because of the color management embedded
254
+ into Mac OS .
255
+ - On Linux\*, BSD flavors, and other Unix-like open-source operating systems, OpenCV looks for
256
+ codecs supplied with the OS. Ensure the relevant packages are installed (including development
257
+ files, such as "libjpeg-dev" in Debian\* and Ubuntu\*) to get codec support, or turn
258
258
on the OPENCV_BUILD_3RDPARTY_LIBS flag in CMake.
259
- - In the case you set *WITH_GDAL* flag to true in CMake and @ref IMREAD_LOAD_GDAL to load the image,
260
- then the [GDAL](http://www.gdal.org) driver will be used in order to decode the image, supporting
261
- the following formats: [Raster](http://www.gdal.org/formats_list.html),
262
- [Vector](http://www.gdal.org/ogr_formats.html).
263
- - If EXIF information is embedded in the image file, the EXIF orientation will be taken into account
264
- and thus the image will be rotated accordingly except if the flags @ref IMREAD_IGNORE_ORIENTATION
259
+ - If the *WITH_GDAL* flag is set to true in CMake and @ref IMREAD_LOAD_GDAL is used to load the image,
260
+ the [GDAL](http://www.gdal.org) driver will be used to decode the image, supporting
261
+ [Raster](http://www.gdal.org/formats_list.html) and [Vector](http://www.gdal.org/ogr_formats.html) formats.
262
+ - If EXIF information is embedded in the image file, the EXIF orientation will be taken into account,
263
+ and thus the image will be rotated accordingly unless the flags @ref IMREAD_IGNORE_ORIENTATION
265
264
or @ref IMREAD_UNCHANGED are passed.
266
- - Use the IMREAD_UNCHANGED flag to keep the floating point values from PFM image .
267
- - By default number of pixels must be less than 2^30. Limit can be set using system
268
- variable OPENCV_IO_MAX_IMAGE_PIXELS
265
+ - Use the IMREAD_UNCHANGED flag to preserve the floating- point values from PFM images .
266
+ - By default, the number of pixels must be less than 2^30. This limit can be changed by setting
267
+ the environment variable ` OPENCV_IO_MAX_IMAGE_PIXELS`. See @ref tutorial_env_reference.
269
268
270
- @param filename Name of file to be loaded.
271
- @param flags Flag that can take values of cv::ImreadModes
269
+ @param filename Name of the file to be loaded.
270
+ @param flags Flag that can take values of ` cv::ImreadModes`.
272
271
*/
273
272
CV_EXPORTS_W Mat imread ( const String& filename, int flags = IMREAD_COLOR_BGR );
274
273
0 commit comments