Purpose: updated the highgui chapter
This commit is contained in:
@@ -13,15 +13,15 @@ imdecode
|
||||
|
||||
Reads an image from a buffer in memory.
|
||||
|
||||
:param buf: The input array of vector of bytes
|
||||
:param buf: Input array of vector of bytes.
|
||||
|
||||
:param flags: The same flags as in :ref:`imread`
|
||||
:param flags: The same flags as in :ref:`imread` .
|
||||
|
||||
The function reads image from the specified buffer in memory.
|
||||
If the buffer is too short or contains invalid data, the empty matrix will be returned.
|
||||
The function reads an image from the specified buffer in memory.
|
||||
If the buffer is too short or contains invalid data, the empty matrix is returned.
|
||||
|
||||
See
|
||||
:ref:`imread` for the list of supported formats and the flags description.
|
||||
:ref:`imread` for the list of supported formats and flags description.
|
||||
|
||||
.. index:: imencode
|
||||
|
||||
@@ -33,17 +33,17 @@ imencode
|
||||
|
||||
Encode an image into a memory buffer.
|
||||
|
||||
:param ext: The file extension that defines the output format
|
||||
:param ext: File extension that defines the output format.
|
||||
|
||||
:param img: The image to be written
|
||||
:param img: Image to be written.
|
||||
|
||||
:param buf: The output buffer; resized to fit the compressed image
|
||||
:param buf: Output buffer resized to fit the compressed image.
|
||||
|
||||
:param params: The format-specific parameters; see :ref:`imwrite`
|
||||
:param params: Format-specific parameters. See :ref:`imwrite` .
|
||||
|
||||
The function compresses the image and stores it in the memory buffer, which is resized to fit the result.
|
||||
The function compresses the image and stores it in the memory buffer that is resized to fit the result.
|
||||
See
|
||||
:ref:`imwrite` for the list of supported formats and the flags description.
|
||||
:ref:`imwrite` for the list of supported formats and flags description.
|
||||
|
||||
.. index:: imread
|
||||
|
||||
@@ -57,37 +57,37 @@ imread
|
||||
|
||||
:param filename: Name of file to be loaded.
|
||||
|
||||
:param flags: Specifies color type of the loaded image:
|
||||
:param flags: Flags specifying the color type of a loaded image:
|
||||
|
||||
* **>0** the loaded image is forced to be a 3-channel color image
|
||||
* **>0** a 3-channel color image
|
||||
|
||||
* **=0** the loaded image is forced to be grayscale
|
||||
* **=0** a grayscale image
|
||||
|
||||
* **<0** the loaded image will be loaded as-is (note that in the current implementation the alpha channel, if any, is stripped from the output image, e.g. 4-channel RGBA image will be loaded as RGB if :math:`flags\ge0` ).
|
||||
* **<0** The image is loaded as is. Note that in the current implementation the alpha channel, if any, is stripped from the output image. For example, a 4-channel RGBA image is loaded as RGB if :math:`flags\ge0` .
|
||||
|
||||
The function ``imread`` loads an image from the specified file and returns it. If the image can not be read (because of missing file, improper permissions, unsupported or invalid format), the function returns empty matrix ( ``Mat::data==NULL`` ).Currently, the following file formats are supported:
|
||||
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:
|
||||
|
||||
* Windows bitmaps - ``*.bmp, *.dib`` (always supported)
|
||||
|
||||
* JPEG files - ``*.jpeg, *.jpg, *.jpe`` (see **Note2**)
|
||||
* JPEG files - ``*.jpeg, *.jpg, *.jpe`` (see the *Notes* section)
|
||||
|
||||
* JPEG 2000 files - ``*.jp2`` (see **Note2**)
|
||||
* JPEG 2000 files - ``*.jp2`` (see the *Notes* section)
|
||||
|
||||
* Portable Network Graphics - ``*.png`` (see **Note2**)
|
||||
* Portable Network Graphics - ``*.png`` (see the *Notes* section)
|
||||
|
||||
* Portable image format - ``*.pbm, *.pgm, *.ppm`` (always supported)
|
||||
|
||||
* Sun rasters - ``*.sr, *.ras`` (always supported)
|
||||
|
||||
* TIFF files - ``*.tiff, *.tif`` (see **Note2**)
|
||||
* TIFF files - ``*.tiff, *.tif`` (see the *Notes* section)
|
||||
|
||||
**Note1**
|
||||
: The function determines type of the image by the content, not by the file extension.
|
||||
**Notes**:
|
||||
|
||||
**Note2**
|
||||
: On Windows and MacOSX the shipped with OpenCV image codecs (libjpeg, libpng, libtiff and libjasper) are used by default; so OpenCV can always read JPEGs, PNGs and TIFFs. On MacOSX there is also the option to use native MacOSX image readers. But beware that currently these native image loaders give images with somewhat different pixel values, because of the embedded into MacOSX color management.
|
||||
* The function determines the type of an image by the content, not by the file extension.
|
||||
|
||||
On Linux, BSD flavors and other Unix-like open-source operating systems OpenCV looks for the supplied with OS image codecs. Please, install the relevant packages (do not forget the development files, e.g. "libjpeg-dev" etc. in Debian and Ubuntu) in order to get the codec support, or turn on ``OPENCV_BUILD_3RDPARTY_LIBS`` flag in CMake.
|
||||
* 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 on the ``OPENCV_BUILD_3RDPARTY_LIBS`` flag in CMake.
|
||||
|
||||
.. index:: imwrite
|
||||
|
||||
@@ -101,20 +101,20 @@ imwrite
|
||||
|
||||
:param filename: Name of the file.
|
||||
|
||||
:param img: The image to be saved.
|
||||
:param img: Image to be saved.
|
||||
|
||||
:param params: The format-specific save parameters, encoded as pairs ``paramId_1, paramValue_1, paramId_2, paramValue_2, ...`` . The following parameters are currently supported:
|
||||
:param params: Format-specific save parameters encoded as pairs ``paramId_1, paramValue_1, paramId_2, paramValue_2, ...`` . The following parameters are currently supported:
|
||||
|
||||
* In the case of JPEG it can be a quality ( ``CV_IMWRITE_JPEG_QUALITY`` ), from 0 to 100 (the higher is the better), 95 by default.
|
||||
* For JPEG, it can be a quality ( ``CV_IMWRITE_JPEG_QUALITY`` ) from 0 to 100 (the higher is the better). Default value is 95.
|
||||
|
||||
* In the case of PNG it can be the compression level ( ``CV_IMWRITE_PNG_COMPRESSION`` ), from 0 to 9 (the higher value means smaller size and longer compression time), 3 by default.
|
||||
* For PNG, it can be the compression level ( ``CV_IMWRITE_PNG_COMPRESSION`` ) from 0 to 9. A higher value means a smaller size and longer compression time. Default value is 3.
|
||||
|
||||
* In the case of PPM, PGM or PBM it can a binary format flag ( ``CV_IMWRITE_PXM_BINARY`` ), 0 or 1, 1 by default.
|
||||
* For PPM, PGM, or PBM, it can be a binary format flag ( ``CV_IMWRITE_PXM_BINARY`` ), 0 or 1. Default value is 1.
|
||||
|
||||
The function ``imwrite`` saves the image to the specified file. The image format is chosen based on the ``filename`` extension, see
|
||||
:ref:`imread` for the list of extensions. Only 8-bit (or 16-bit in the case of PNG, JPEG 2000 and TIFF) single-channel or 3-channel (with 'BGR' channel order) images can be saved using this function. If the format, depth or channel order is different, use
|
||||
The function ``imwrite`` saves the image to the specified file. The image format is chosen based on the ``filename`` extension (see
|
||||
:ref:`imread` for the list of extensions). Only 8-bit (or 16-bit in case of PNG, JPEG 2000, and TIFF) single-channel or 3-channel (with 'BGR' channel order) images can be saved using this function. If the format, depth or channel order is different, use
|
||||
:ref:`Mat::convertTo` , and
|
||||
:ref:`cvtColor` to convert it before saving, or use the universal XML I/O functions to save the image to XML or YAML format.
|
||||
:ref:`cvtColor` to convert it before saving. Or, use the universal XML I/O functions to save the image to XML or YAML format.
|
||||
|
||||
.. index:: VideoCapture
|
||||
|
||||
@@ -214,11 +214,13 @@ VideoCapture::VideoCapture
|
||||
|
||||
.. c:function:: VideoCapture::VideoCapture(int device)
|
||||
|
||||
VideoCapture constructors.?? No desc here and further??
|
||||
|
||||
:param filename: TOWRITE
|
||||
|
||||
:param device: TOWRITE
|
||||
|
||||
VideoCapture constructors.
|
||||
|
||||
|
||||
.. index:: VideoCapture::get
|
||||
|
||||
@@ -228,47 +230,48 @@ VideoCapture::get
|
||||
---------------------
|
||||
.. c:function:: double VideoCapture::get(int property_id)
|
||||
|
||||
:param property_id: Property identifier. Can be one of the following:
|
||||
:param property_id: Property identifier. It can be one of the following:
|
||||
|
||||
* **CV_CAP_PROP_POS_MSEC** Film current position in milliseconds or video capture timestamp
|
||||
* **CV_CAP_PROP_POS_MSEC** Film current position in milliseconds or video capture timestamp.
|
||||
|
||||
* **CV_CAP_PROP_POS_FRAMES** 0-based index of the frame to be decoded/captured next
|
||||
* **CV_CAP_PROP_POS_FRAMES** 0-based index of the frame to be decoded/captured next.
|
||||
|
||||
* **CV_CAP_PROP_POS_AVI_RATIO** Relative position of the video file (0 - start of the film, 1 - end of the film)
|
||||
* **CV_CAP_PROP_POS_AVI_RATIO** Relative position of the video file: 0 - start of the film, 1 - end of the film.
|
||||
|
||||
* **CV_CAP_PROP_FRAME_WIDTH** Width of the frames in the video stream
|
||||
* **CV_CAP_PROP_FRAME_WIDTH** Width of the frames in the video stream.
|
||||
|
||||
* **CV_CAP_PROP_FRAME_HEIGHT** Height of the frames in the video stream
|
||||
* **CV_CAP_PROP_FRAME_HEIGHT** Height of the frames in the video stream.
|
||||
|
||||
* **CV_CAP_PROP_FPS** Frame rate
|
||||
* **CV_CAP_PROP_FPS** Frame rate.
|
||||
|
||||
* **CV_CAP_PROP_FOURCC** 4-character code of codec
|
||||
* **CV_CAP_PROP_FOURCC** 4-character code of codec.
|
||||
|
||||
* **CV_CAP_PROP_FRAME_COUNT** Number of frames in the video file
|
||||
* **CV_CAP_PROP_FRAME_COUNT** Number of frames in the video file.
|
||||
|
||||
* **CV_CAP_PROP_FORMAT** The format of the Mat objects returned by retrieve()
|
||||
* **CV_CAP_PROP_FORMAT** Format of the Mat objects returned by ``retrieve()`` .
|
||||
|
||||
* **CV_CAP_PROP_MODE** A backend-specific value indicating the current capture mode
|
||||
* **CV_CAP_PROP_MODE** Backend-specific value indicating the current capture mode.
|
||||
|
||||
* **CV_CAP_PROP_BRIGHTNESS** Brightness of the image (only for cameras)
|
||||
* **CV_CAP_PROP_BRIGHTNESS** Brightness of the image (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_CONTRAST** Contrast of the image (only for cameras)
|
||||
* **CV_CAP_PROP_CONTRAST** Contrast of the image (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_SATURATION** Saturation of the image (only for cameras)
|
||||
* **CV_CAP_PROP_SATURATION** Saturation of the image (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_HUE** Hue of the image (only for cameras)
|
||||
* **CV_CAP_PROP_HUE** Hue of the image (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_GAIN** Gain of the image (only for cameras)
|
||||
* **CV_CAP_PROP_GAIN** Gain of the image (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_EXPOSURE** Exposure (only for cameras)
|
||||
* **CV_CAP_PROP_EXPOSURE** Exposure (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_CONVERT_RGB** Boolean flags indicating whether images should be converted to RGB
|
||||
* **CV_CAP_PROP_CONVERT_RGB** Boolean flags indicating whether images should be converted to RGB.
|
||||
|
||||
* **CV_CAP_PROP_WHITE_BALANCE** Currently unsupported
|
||||
|
||||
* **CV_CAP_PROP_RECTIFICATION** TOWRITE (note: only supported by DC1394 v 2.x backend currently)
|
||||
|
||||
Note that when querying a property which is unsupported by the backend used by the VideoCapture class, the value 0 is returned.
|
||||
|
||||
**Note**: When querying a property that is not supported by the backend used by the ``VideoCapture`` class, value 0 is returned.
|
||||
|
||||
.. index:: VideoCapture::set
|
||||
|
||||
@@ -278,49 +281,51 @@ VideoCapture::set
|
||||
---------------------
|
||||
.. c:function:: bool VideoCapture::set(int property_id, double value)
|
||||
|
||||
:param property_id: Property identifier. Can be one of the following:
|
||||
Sets a property in the VideoCapture backend.
|
||||
|
||||
* **CV_CAP_PROP_POS_MSEC** Film current position in milliseconds or video capture timestamp
|
||||
:param property_id: Property identifier. It can be one of the following:
|
||||
|
||||
* **CV_CAP_PROP_POS_FRAMES** 0-based index of the frame to be decoded/captured next
|
||||
* **CV_CAP_PROP_POS_MSEC** Film current position in milliseconds or video capture timestamp.
|
||||
|
||||
* **CV_CAP_PROP_POS_AVI_RATIO** Relative position of the video file (0 - start of the film, 1 - end of the film)
|
||||
* **CV_CAP_PROP_POS_FRAMES** 0-based index of the frame to be decoded/captured next.
|
||||
|
||||
* **CV_CAP_PROP_FRAME_WIDTH** Width of the frames in the video stream
|
||||
* **CV_CAP_PROP_POS_AVI_RATIO** Relative position of the video file: 0 - start of the film, 1 - end of the film.
|
||||
|
||||
* **CV_CAP_PROP_FRAME_HEIGHT** Height of the frames in the video stream
|
||||
* **CV_CAP_PROP_FRAME_WIDTH** Width of the frames in the video stream.
|
||||
|
||||
* **CV_CAP_PROP_FPS** Frame rate
|
||||
* **CV_CAP_PROP_FRAME_HEIGHT** Height of the frames in the video stream.
|
||||
|
||||
* **CV_CAP_PROP_FOURCC** 4-character code of codec
|
||||
* **CV_CAP_PROP_FPS** Frame rate.
|
||||
|
||||
* **CV_CAP_PROP_FRAME_COUNT** Number of frames in the video file
|
||||
* **CV_CAP_PROP_FOURCC** 4-character code of codec.
|
||||
|
||||
* **CV_CAP_PROP_FORMAT** The format of the Mat objects returned by retrieve()
|
||||
* **CV_CAP_PROP_FRAME_COUNT** Number of frames in the video file.
|
||||
|
||||
* **CV_CAP_PROP_MODE** A backend-specific value indicating the current capture mode
|
||||
* **CV_CAP_PROP_FORMAT** Format of the Mat objects returned by ``retrieve()`` .
|
||||
|
||||
* **CV_CAP_PROP_BRIGHTNESS** Brightness of the image (only for cameras)
|
||||
* **CV_CAP_PROP_MODE** Backend-specific value indicating the current capture mode.
|
||||
|
||||
* **CV_CAP_PROP_CONTRAST** Contrast of the image (only for cameras)
|
||||
* **CV_CAP_PROP_BRIGHTNESS** Brightness of the image (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_SATURATION** Saturation of the image (only for cameras)
|
||||
* **CV_CAP_PROP_CONTRAST** Contrast of the image (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_HUE** Hue of the image (only for cameras)
|
||||
* **CV_CAP_PROP_SATURATION** Saturation of the image (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_GAIN** Gain of the image (only for cameras)
|
||||
* **CV_CAP_PROP_HUE** Hue of the image (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_EXPOSURE** Exposure (only for cameras)
|
||||
* **CV_CAP_PROP_GAIN** Gain of the image (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_CONVERT_RGB** Boolean flags indicating whether images should be converted to RGB
|
||||
* **CV_CAP_PROP_EXPOSURE** Exposure (only for cameras).
|
||||
|
||||
* **CV_CAP_PROP_CONVERT_RGB** Boolean flags indicating whether images should be converted to RGB.
|
||||
|
||||
* **CV_CAP_PROP_WHITE_BALANCE** Currently unsupported
|
||||
|
||||
* **CV_CAP_PROP_RECTIFICATION** TOWRITE (note: only supported by DC1394 v 2.x backend currently)
|
||||
|
||||
:param value: value of the property.
|
||||
:param value: Value of the property.
|
||||
|
||||
|
||||
Sets a property in the VideoCapture backend.
|
||||
|
||||
.. index:: VideoWriter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user