mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merge pull request #26152 from sturkmen72:m_buf_supported
Documentation update for imagecodecs #26152 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
@@ -222,9 +222,9 @@ enum ImwriteHDRCompressionFlags {
|
||||
|
||||
@anchor imread
|
||||
|
||||
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 ).
|
||||
The `imread` function loads an image from the specified file and returns OpenCV matrix. If the image cannot be
|
||||
read (because of a missing file, improper permissions, or unsupported/invalid format), the function
|
||||
returns an empty matrix.
|
||||
|
||||
Currently, the following file formats are supported:
|
||||
|
||||
@@ -234,7 +234,7 @@ Currently, the following file formats are supported:
|
||||
- Portable Network Graphics - \*.png (see the *Note* section)
|
||||
- WebP - \*.webp (see the *Note* section)
|
||||
- AVIF - \*.avif (see the *Note* section)
|
||||
- Portable image format - \*.pbm, \*.pgm, \*.ppm \*.pxm, \*.pnm (always supported)
|
||||
- Portable image format - \*.pbm, \*.pgm, \*.ppm, \*.pxm, \*.pnm (always supported)
|
||||
- PFM files - \*.pfm (see the *Note* section)
|
||||
- Sun rasters - \*.sr, \*.ras (always supported)
|
||||
- TIFF files - \*.tiff, \*.tif (see the *Note* section)
|
||||
@@ -243,32 +243,31 @@ Currently, the following file formats are supported:
|
||||
- Raster and Vector geospatial data supported by GDAL (see the *Note* section)
|
||||
|
||||
@note
|
||||
- The function determines the type of an image by the content, not by the file extension.
|
||||
- The function determines the type of an image by its 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.
|
||||
- When using IMREAD_GRAYSCALE, the codec's internal grayscale conversion will be used, if available.
|
||||
Results may differ to the output of cvtColor()
|
||||
- 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
|
||||
that currently these native image loaders give images with different pixel values because of
|
||||
the color management embedded into MacOSX.
|
||||
- On Linux\*, BSD flavors and other Unix-like open-source operating systems, OpenCV looks for
|
||||
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
|
||||
Results may differ from the output of cvtColor().
|
||||
- On Microsoft Windows\* and Mac OS\*, the codecs shipped with OpenCV (libjpeg, libpng, libtiff,
|
||||
and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs, and TIFFs. On Mac OS,
|
||||
there is also an option to use native Mac OS image readers. However, beware that currently these
|
||||
native image loaders give images with different pixel values because of the color management embedded
|
||||
into Mac OS.
|
||||
- On Linux\*, BSD flavors, and other Unix-like open-source operating systems, OpenCV looks for
|
||||
codecs supplied with the OS. Ensure the relevant packages are installed (including development
|
||||
files, such as "libjpeg-dev" in Debian\* and Ubuntu\*) to get codec support, or turn
|
||||
on the OPENCV_BUILD_3RDPARTY_LIBS flag in CMake.
|
||||
- In the case you set *WITH_GDAL* flag to true in CMake and @ref IMREAD_LOAD_GDAL to load the image,
|
||||
then the [GDAL](http://www.gdal.org) driver will be used in order to decode the image, supporting
|
||||
the following formats: [Raster](http://www.gdal.org/formats_list.html),
|
||||
[Vector](http://www.gdal.org/ogr_formats.html).
|
||||
- If EXIF information is embedded in the image file, the EXIF orientation will be taken into account
|
||||
and thus the image will be rotated accordingly except if the flags @ref IMREAD_IGNORE_ORIENTATION
|
||||
- If the *WITH_GDAL* flag is set to true in CMake and @ref IMREAD_LOAD_GDAL is used to load the image,
|
||||
the [GDAL](http://www.gdal.org) driver will be used to decode the image, supporting
|
||||
[Raster](http://www.gdal.org/formats_list.html) and [Vector](http://www.gdal.org/ogr_formats.html) formats.
|
||||
- If EXIF information is embedded in the image file, the EXIF orientation will be taken into account,
|
||||
and thus the image will be rotated accordingly unless the flags @ref IMREAD_IGNORE_ORIENTATION
|
||||
or @ref IMREAD_UNCHANGED are passed.
|
||||
- Use the IMREAD_UNCHANGED flag to keep the floating point values from PFM image.
|
||||
- By default number of pixels must be less than 2^30. Limit can be set using system
|
||||
variable OPENCV_IO_MAX_IMAGE_PIXELS
|
||||
- Use the IMREAD_UNCHANGED flag to preserve the floating-point values from PFM images.
|
||||
- By default, the number of pixels must be less than 2^30. This limit can be changed by setting
|
||||
the environment variable `OPENCV_IO_MAX_IMAGE_PIXELS`. See @ref tutorial_env_reference.
|
||||
|
||||
@param filename Name of file to be loaded.
|
||||
@param flags Flag that can take values of cv::ImreadModes
|
||||
@param filename Name of the file to be loaded.
|
||||
@param flags Flag that can take values of `cv::ImreadModes`.
|
||||
*/
|
||||
CV_EXPORTS_W Mat imread( const String& filename, int flags = IMREAD_COLOR_BGR );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user