videoio.hpp 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129
  1. /*M///////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
  4. //
  5. // By downloading, copying, installing or using the software you agree to this license.
  6. // If you do not agree to this license, do not download, install,
  7. // copy or use the software.
  8. //
  9. //
  10. // License Agreement
  11. // For Open Source Computer Vision Library
  12. //
  13. // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
  14. // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
  15. // Third party copyrights are property of their respective owners.
  16. //
  17. // Redistribution and use in source and binary forms, with or without modification,
  18. // are permitted provided that the following conditions are met:
  19. //
  20. // * Redistribution's of source code must retain the above copyright notice,
  21. // this list of conditions and the following disclaimer.
  22. //
  23. // * Redistribution's in binary form must reproduce the above copyright notice,
  24. // this list of conditions and the following disclaimer in the documentation
  25. // and/or other materials provided with the distribution.
  26. //
  27. // * The name of the copyright holders may not be used to endorse or promote products
  28. // derived from this software without specific prior written permission.
  29. //
  30. // This software is provided by the copyright holders and contributors "as is" and
  31. // any express or implied warranties, including, but not limited to, the implied
  32. // warranties of merchantability and fitness for a particular purpose are disclaimed.
  33. // In no event shall the Intel Corporation or contributors be liable for any direct,
  34. // indirect, incidental, special, exemplary, or consequential damages
  35. // (including, but not limited to, procurement of substitute goods or services;
  36. // loss of use, data, or profits; or business interruption) however caused
  37. // and on any theory of liability, whether in contract, strict liability,
  38. // or tort (including negligence or otherwise) arising in any way out of
  39. // the use of this software, even if advised of the possibility of such damage.
  40. //
  41. //M*/
  42. #ifndef OPENCV_VIDEOIO_HPP
  43. #define OPENCV_VIDEOIO_HPP
  44. #include "opencv2/core.hpp"
  45. /**
  46. @defgroup videoio Video I/O
  47. @brief Read and write video or images sequence with OpenCV
  48. ### See also:
  49. - @ref videoio_overview
  50. - Tutorials: @ref tutorial_table_of_content_app
  51. @{
  52. @defgroup videoio_flags_base Flags for video I/O
  53. @defgroup videoio_flags_others Additional flags for video I/O API backends
  54. @defgroup videoio_hwaccel Hardware-accelerated video decoding and encoding
  55. @defgroup videoio_c C API for video I/O
  56. @defgroup videoio_ios iOS glue for video I/O
  57. @defgroup videoio_winrt WinRT glue for video I/O
  58. @defgroup videoio_registry Query I/O API backends registry
  59. @}
  60. */
  61. ////////////////////////////////// video io /////////////////////////////////
  62. typedef struct CvCapture CvCapture;
  63. typedef struct CvVideoWriter CvVideoWriter;
  64. namespace cv
  65. {
  66. //! @addtogroup videoio
  67. //! @{
  68. //! @addtogroup videoio_flags_base
  69. //! @{
  70. /** @brief cv::VideoCapture API backends identifier.
  71. Select preferred API for a capture object.
  72. To be used in the VideoCapture::VideoCapture() constructor or VideoCapture::open()
  73. @note Backends are available only if they have been built with your OpenCV binaries.
  74. See @ref videoio_overview for more information.
  75. */
  76. enum VideoCaptureAPIs {
  77. CAP_ANY = 0, //!< Auto detect == 0
  78. CAP_VFW = 200, //!< Video For Windows (obsolete, removed)
  79. CAP_V4L = 200, //!< V4L/V4L2 capturing support
  80. CAP_V4L2 = CAP_V4L, //!< Same as CAP_V4L
  81. CAP_FIREWIRE = 300, //!< IEEE 1394 drivers
  82. CAP_FIREWARE = CAP_FIREWIRE, //!< Same value as CAP_FIREWIRE
  83. CAP_IEEE1394 = CAP_FIREWIRE, //!< Same value as CAP_FIREWIRE
  84. CAP_DC1394 = CAP_FIREWIRE, //!< Same value as CAP_FIREWIRE
  85. CAP_CMU1394 = CAP_FIREWIRE, //!< Same value as CAP_FIREWIRE
  86. CAP_QT = 500, //!< QuickTime (obsolete, removed)
  87. CAP_UNICAP = 600, //!< Unicap drivers (obsolete, removed)
  88. CAP_DSHOW = 700, //!< DirectShow (via videoInput)
  89. CAP_PVAPI = 800, //!< PvAPI, Prosilica GigE SDK
  90. CAP_OPENNI = 900, //!< OpenNI (for Kinect)
  91. CAP_OPENNI_ASUS = 910, //!< OpenNI (for Asus Xtion)
  92. CAP_ANDROID = 1000, //!< Android - not used
  93. CAP_XIAPI = 1100, //!< XIMEA Camera API
  94. CAP_AVFOUNDATION = 1200, //!< AVFoundation framework for iOS (OS X Lion will have the same API)
  95. CAP_GIGANETIX = 1300, //!< Smartek Giganetix GigEVisionSDK
  96. CAP_MSMF = 1400, //!< Microsoft Media Foundation (via videoInput)
  97. CAP_WINRT = 1410, //!< Microsoft Windows Runtime using Media Foundation
  98. CAP_INTELPERC = 1500, //!< RealSense (former Intel Perceptual Computing SDK)
  99. CAP_REALSENSE = 1500, //!< Synonym for CAP_INTELPERC
  100. CAP_OPENNI2 = 1600, //!< OpenNI2 (for Kinect)
  101. CAP_OPENNI2_ASUS = 1610, //!< OpenNI2 (for Asus Xtion and Occipital Structure sensors)
  102. CAP_OPENNI2_ASTRA= 1620, //!< OpenNI2 (for Orbbec Astra)
  103. CAP_GPHOTO2 = 1700, //!< gPhoto2 connection
  104. CAP_GSTREAMER = 1800, //!< GStreamer
  105. CAP_FFMPEG = 1900, //!< Open and record video file or stream using the FFMPEG library
  106. CAP_IMAGES = 2000, //!< OpenCV Image Sequence (e.g. img_%02d.jpg)
  107. CAP_ARAVIS = 2100, //!< Aravis SDK
  108. CAP_OPENCV_MJPEG = 2200, //!< Built-in OpenCV MotionJPEG codec
  109. CAP_INTEL_MFX = 2300, //!< Intel MediaSDK
  110. CAP_XINE = 2400, //!< XINE engine (Linux)
  111. CAP_UEYE = 2500, //!< uEye Camera API
  112. };
  113. /** @brief cv::VideoCapture generic properties identifier.
  114. Reading / writing properties involves many layers. Some unexpected result might happens along this chain.
  115. Effective behaviour depends from device hardware, driver and API Backend.
  116. @sa videoio_flags_others, VideoCapture::get(), VideoCapture::set()
  117. */
  118. enum VideoCaptureProperties {
  119. CAP_PROP_POS_MSEC =0, //!< Current position of the video file in milliseconds.
  120. CAP_PROP_POS_FRAMES =1, //!< 0-based index of the frame to be decoded/captured next.
  121. CAP_PROP_POS_AVI_RATIO =2, //!< Relative position of the video file: 0=start of the film, 1=end of the film.
  122. CAP_PROP_FRAME_WIDTH =3, //!< Width of the frames in the video stream.
  123. CAP_PROP_FRAME_HEIGHT =4, //!< Height of the frames in the video stream.
  124. CAP_PROP_FPS =5, //!< Frame rate.
  125. CAP_PROP_FOURCC =6, //!< 4-character code of codec. see VideoWriter::fourcc .
  126. CAP_PROP_FRAME_COUNT =7, //!< Number of frames in the video file.
  127. CAP_PROP_FORMAT =8, //!< Format of the %Mat objects (see Mat::type()) returned by VideoCapture::retrieve().
  128. //!< Set value -1 to fetch undecoded RAW video streams (as Mat 8UC1).
  129. CAP_PROP_MODE =9, //!< Backend-specific value indicating the current capture mode.
  130. CAP_PROP_BRIGHTNESS =10, //!< Brightness of the image (only for those cameras that support).
  131. CAP_PROP_CONTRAST =11, //!< Contrast of the image (only for cameras).
  132. CAP_PROP_SATURATION =12, //!< Saturation of the image (only for cameras).
  133. CAP_PROP_HUE =13, //!< Hue of the image (only for cameras).
  134. CAP_PROP_GAIN =14, //!< Gain of the image (only for those cameras that support).
  135. CAP_PROP_EXPOSURE =15, //!< Exposure (only for those cameras that support).
  136. CAP_PROP_CONVERT_RGB =16, //!< Boolean flags indicating whether images should be converted to RGB. <br/>
  137. //!< *GStreamer note*: The flag is ignored in case if custom pipeline is used. It's user responsibility to interpret pipeline output.
  138. CAP_PROP_WHITE_BALANCE_BLUE_U =17, //!< Currently unsupported.
  139. CAP_PROP_RECTIFICATION =18, //!< Rectification flag for stereo cameras (note: only supported by DC1394 v 2.x backend currently).
  140. CAP_PROP_MONOCHROME =19,
  141. CAP_PROP_SHARPNESS =20,
  142. CAP_PROP_AUTO_EXPOSURE =21, //!< DC1394: exposure control done by camera, user can adjust reference level using this feature.
  143. CAP_PROP_GAMMA =22,
  144. CAP_PROP_TEMPERATURE =23,
  145. CAP_PROP_TRIGGER =24,
  146. CAP_PROP_TRIGGER_DELAY =25,
  147. CAP_PROP_WHITE_BALANCE_RED_V =26,
  148. CAP_PROP_ZOOM =27,
  149. CAP_PROP_FOCUS =28,
  150. CAP_PROP_GUID =29,
  151. CAP_PROP_ISO_SPEED =30,
  152. CAP_PROP_BACKLIGHT =32,
  153. CAP_PROP_PAN =33,
  154. CAP_PROP_TILT =34,
  155. CAP_PROP_ROLL =35,
  156. CAP_PROP_IRIS =36,
  157. CAP_PROP_SETTINGS =37, //!< Pop up video/camera filter dialog (note: only supported by DSHOW backend currently. The property value is ignored)
  158. CAP_PROP_BUFFERSIZE =38,
  159. CAP_PROP_AUTOFOCUS =39,
  160. CAP_PROP_SAR_NUM =40, //!< Sample aspect ratio: num/den (num)
  161. CAP_PROP_SAR_DEN =41, //!< Sample aspect ratio: num/den (den)
  162. CAP_PROP_BACKEND =42, //!< Current backend (enum VideoCaptureAPIs). Read-only property
  163. CAP_PROP_CHANNEL =43, //!< Video input or Channel Number (only for those cameras that support)
  164. CAP_PROP_AUTO_WB =44, //!< enable/ disable auto white-balance
  165. CAP_PROP_WB_TEMPERATURE=45, //!< white-balance color temperature
  166. CAP_PROP_CODEC_PIXEL_FORMAT =46, //!< (read-only) codec's pixel format. 4-character code - see VideoWriter::fourcc . Subset of [AV_PIX_FMT_*](https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/raw.c) or -1 if unknown
  167. CAP_PROP_BITRATE =47, //!< (read-only) Video bitrate in kbits/s
  168. CAP_PROP_ORIENTATION_META=48, //!< (read-only) Frame rotation defined by stream meta (applicable for FFmpeg back-end only)
  169. CAP_PROP_ORIENTATION_AUTO=49, //!< if true - rotates output frames of CvCapture considering video file's metadata (applicable for FFmpeg back-end only) (https://github.com/opencv/opencv/issues/15499)
  170. CAP_PROP_HW_ACCELERATION=50, //!< (**open-only**) Hardware acceleration type (see #VideoAccelerationType). Setting supported only via `params` parameter in cv::VideoCapture constructor / .open() method. Default value is backend-specific.
  171. CAP_PROP_HW_DEVICE =51, //!< (**open-only**) Hardware device index (select GPU if multiple available). Device enumeration is acceleration type specific.
  172. CAP_PROP_HW_ACCELERATION_USE_OPENCL=52, //!< (**open-only**) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between HW accelerated decoder and cv::UMat.
  173. CAP_PROP_OPEN_TIMEOUT_MSEC=53, //!< (**open-only**) timeout in milliseconds for opening a video capture (applicable for FFmpeg back-end only)
  174. CAP_PROP_READ_TIMEOUT_MSEC=54, //!< (**open-only**) timeout in milliseconds for reading from a video capture (applicable for FFmpeg back-end only)
  175. CAP_PROP_STREAM_OPEN_TIME_USEC =55, //<! (read-only) time in microseconds since Jan 1 1970 when stream was opened. Applicable for FFmpeg backend only. Useful for RTSP and other live streams
  176. CAP_PROP_VIDEO_TOTAL_CHANNELS = 56, //!< (read-only) Number of video channels
  177. CAP_PROP_VIDEO_STREAM = 57, //!< (**open-only**) Specify video stream, 0-based index. Use -1 to disable video stream from file or IP cameras. Default value is 0.
  178. CAP_PROP_AUDIO_STREAM = 58, //!< (**open-only**) Specify stream in multi-language media files, -1 - disable audio processing or microphone. Default value is -1.
  179. CAP_PROP_AUDIO_POS = 59, //!< (read-only) Audio position is measured in samples. Accurate audio sample timestamp of previous grabbed fragment. See CAP_PROP_AUDIO_SAMPLES_PER_SECOND and CAP_PROP_AUDIO_SHIFT_NSEC.
  180. CAP_PROP_AUDIO_SHIFT_NSEC = 60, //!< (read only) Contains the time difference between the start of the audio stream and the video stream in nanoseconds. Positive value means that audio is started after the first video frame. Negative value means that audio is started before the first video frame.
  181. CAP_PROP_AUDIO_DATA_DEPTH = 61, //!< (open, read) Alternative definition to bits-per-sample, but with clear handling of 32F / 32S
  182. CAP_PROP_AUDIO_SAMPLES_PER_SECOND = 62, //!< (open, read) determined from file/codec input. If not specified, then selected audio sample rate is 44100
  183. CAP_PROP_AUDIO_BASE_INDEX = 63, //!< (read-only) Index of the first audio channel for .retrieve() calls. That audio channel number continues enumeration after video channels.
  184. CAP_PROP_AUDIO_TOTAL_CHANNELS = 64, //!< (read-only) Number of audio channels in the selected audio stream (mono, stereo, etc)
  185. CAP_PROP_AUDIO_TOTAL_STREAMS = 65, //!< (read-only) Number of audio streams.
  186. CAP_PROP_AUDIO_SYNCHRONIZE = 66, //!< (open, read) Enables audio synchronization.
  187. CAP_PROP_LRF_HAS_KEY_FRAME = 67, //!< FFmpeg back-end only - Indicates whether the Last Raw Frame (LRF), output from VideoCapture::read() when VideoCapture is initialized with VideoCapture::open(CAP_FFMPEG, {CAP_PROP_FORMAT, -1}) or VideoCapture::set(CAP_PROP_FORMAT,-1) is called before the first call to VideoCapture::read(), contains encoded data for a key frame.
  188. CAP_PROP_CODEC_EXTRADATA_INDEX = 68, //!< Positive index indicates that returning extra data is supported by the video back end. This can be retrieved as cap.retrieve(data, <returned index>). E.g. When reading from a h264 encoded RTSP stream, the FFmpeg backend could return the SPS and/or PPS if available (if sent in reply to a DESCRIBE request), from calls to cap.retrieve(data, <returned index>).
  189. #ifndef CV_DOXYGEN
  190. CV__CAP_PROP_LATEST
  191. #endif
  192. };
  193. /** @brief cv::VideoWriter generic properties identifier.
  194. @sa VideoWriter::get(), VideoWriter::set()
  195. */
  196. enum VideoWriterProperties {
  197. VIDEOWRITER_PROP_QUALITY = 1, //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs.
  198. VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order.
  199. VIDEOWRITER_PROP_NSTRIPES = 3, //!< Number of stripes for parallel encoding. -1 for auto detection.
  200. VIDEOWRITER_PROP_IS_COLOR = 4, //!< If it is not zero, the encoder will expect and encode color frames, otherwise it
  201. //!< will work with grayscale frames.
  202. VIDEOWRITER_PROP_DEPTH = 5, //!< Defaults to CV_8U.
  203. VIDEOWRITER_PROP_HW_ACCELERATION = 6, //!< (**open-only**) Hardware acceleration type (see #VideoAccelerationType). Setting supported only via `params` parameter in VideoWriter constructor / .open() method. Default value is backend-specific.
  204. VIDEOWRITER_PROP_HW_DEVICE = 7, //!< (**open-only**) Hardware device index (select GPU if multiple available). Device enumeration is acceleration type specific.
  205. VIDEOWRITER_PROP_HW_ACCELERATION_USE_OPENCL= 8, //!< (**open-only**) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between cv::UMat and HW accelerated encoder.
  206. #ifndef CV_DOXYGEN
  207. CV__VIDEOWRITER_PROP_LATEST
  208. #endif
  209. };
  210. //! @} videoio_flags_base
  211. //! @addtogroup videoio_flags_others
  212. //! @{
  213. /** @name Hardware acceleration support
  214. @{
  215. */
  216. /** @brief Video Acceleration type
  217. *
  218. * Used as value in #CAP_PROP_HW_ACCELERATION and #VIDEOWRITER_PROP_HW_ACCELERATION
  219. *
  220. * @note In case of FFmpeg backend, it translated to enum AVHWDeviceType (https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/hwcontext.h)
  221. */
  222. enum VideoAccelerationType
  223. {
  224. VIDEO_ACCELERATION_NONE = 0, //!< Do not require any specific H/W acceleration, prefer software processing.
  225. //!< Reading of this value means that special H/W accelerated handling is not added or not detected by OpenCV.
  226. VIDEO_ACCELERATION_ANY = 1, //!< Prefer to use H/W acceleration. If no one supported, then fallback to software processing.
  227. //!< @note H/W acceleration may require special configuration of used environment.
  228. //!< @note Results in encoding scenario may differ between software and hardware accelerated encoders.
  229. VIDEO_ACCELERATION_D3D11 = 2, //!< DirectX 11
  230. VIDEO_ACCELERATION_VAAPI = 3, //!< VAAPI
  231. VIDEO_ACCELERATION_MFX = 4, //!< libmfx (Intel MediaSDK/oneVPL)
  232. };
  233. //! @} Hardware acceleration support
  234. /** @name IEEE 1394 drivers
  235. @{
  236. */
  237. /** @brief Modes of the IEEE 1394 controlling registers
  238. (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)
  239. every feature can have only one mode turned on at a time
  240. */
  241. enum { CAP_PROP_DC1394_OFF = -4, //!< turn the feature off (not controlled manually nor automatically).
  242. CAP_PROP_DC1394_MODE_MANUAL = -3, //!< set automatically when a value of the feature is set by the user.
  243. CAP_PROP_DC1394_MODE_AUTO = -2,
  244. CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,
  245. CAP_PROP_DC1394_MAX = 31
  246. };
  247. //! @} IEEE 1394 drivers
  248. /** @name OpenNI (for Kinect)
  249. @{
  250. */
  251. //! OpenNI map generators
  252. enum { CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,
  253. CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,
  254. CAP_OPENNI_IR_GENERATOR = 1 << 29,
  255. CAP_OPENNI_GENERATORS_MASK = CAP_OPENNI_DEPTH_GENERATOR + CAP_OPENNI_IMAGE_GENERATOR + CAP_OPENNI_IR_GENERATOR
  256. };
  257. //! Properties of cameras available through OpenNI backend
  258. enum { CAP_PROP_OPENNI_OUTPUT_MODE = 100,
  259. CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, //!< In mm
  260. CAP_PROP_OPENNI_BASELINE = 102, //!< In mm
  261. CAP_PROP_OPENNI_FOCAL_LENGTH = 103, //!< In pixels
  262. CAP_PROP_OPENNI_REGISTRATION = 104, //!< Flag that synchronizes the remapping depth map to image map
  263. //!< by changing depth generator's view point (if the flag is "on") or
  264. //!< sets this view point to its normal one (if the flag is "off").
  265. CAP_PROP_OPENNI_REGISTRATION_ON = CAP_PROP_OPENNI_REGISTRATION,
  266. CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105,
  267. CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106,
  268. CAP_PROP_OPENNI_CIRCLE_BUFFER = 107,
  269. CAP_PROP_OPENNI_MAX_TIME_DURATION = 108,
  270. CAP_PROP_OPENNI_GENERATOR_PRESENT = 109,
  271. CAP_PROP_OPENNI2_SYNC = 110,
  272. CAP_PROP_OPENNI2_MIRROR = 111
  273. };
  274. //! OpenNI shortcuts
  275. enum { CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
  276. CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE,
  277. CAP_OPENNI_DEPTH_GENERATOR_PRESENT = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
  278. CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE,
  279. CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH,
  280. CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION,
  281. CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION,
  282. CAP_OPENNI_IR_GENERATOR_PRESENT = CAP_OPENNI_IR_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
  283. };
  284. //! OpenNI data given from depth generator
  285. enum { CAP_OPENNI_DEPTH_MAP = 0, //!< Depth values in mm (CV_16UC1)
  286. CAP_OPENNI_POINT_CLOUD_MAP = 1, //!< XYZ in meters (CV_32FC3)
  287. CAP_OPENNI_DISPARITY_MAP = 2, //!< Disparity in pixels (CV_8UC1)
  288. CAP_OPENNI_DISPARITY_MAP_32F = 3, //!< Disparity in pixels (CV_32FC1)
  289. CAP_OPENNI_VALID_DEPTH_MASK = 4, //!< CV_8UC1
  290. CAP_OPENNI_BGR_IMAGE = 5, //!< Data given from RGB image generator
  291. CAP_OPENNI_GRAY_IMAGE = 6, //!< Data given from RGB image generator
  292. CAP_OPENNI_IR_IMAGE = 7 //!< Data given from IR image generator
  293. };
  294. //! Supported output modes of OpenNI image generator
  295. enum { CAP_OPENNI_VGA_30HZ = 0,
  296. CAP_OPENNI_SXGA_15HZ = 1,
  297. CAP_OPENNI_SXGA_30HZ = 2,
  298. CAP_OPENNI_QVGA_30HZ = 3,
  299. CAP_OPENNI_QVGA_60HZ = 4
  300. };
  301. //! @} OpenNI
  302. /** @name GStreamer
  303. @{
  304. */
  305. enum { CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200 //!< Default is 1
  306. };
  307. //! @} GStreamer
  308. /** @name PvAPI, Prosilica GigE SDK
  309. @{
  310. */
  311. //! PVAPI
  312. enum { CAP_PROP_PVAPI_MULTICASTIP = 300, //!< IP for enable multicast master mode. 0 for disable multicast.
  313. CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, //!< FrameStartTriggerMode: Determines how a frame is initiated.
  314. CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302, //!< Horizontal sub-sampling of the image.
  315. CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303, //!< Vertical sub-sampling of the image.
  316. CAP_PROP_PVAPI_BINNINGX = 304, //!< Horizontal binning factor.
  317. CAP_PROP_PVAPI_BINNINGY = 305, //!< Vertical binning factor.
  318. CAP_PROP_PVAPI_PIXELFORMAT = 306 //!< Pixel format.
  319. };
  320. //! PVAPI: FrameStartTriggerMode
  321. enum { CAP_PVAPI_FSTRIGMODE_FREERUN = 0, //!< Freerun
  322. CAP_PVAPI_FSTRIGMODE_SYNCIN1 = 1, //!< SyncIn1
  323. CAP_PVAPI_FSTRIGMODE_SYNCIN2 = 2, //!< SyncIn2
  324. CAP_PVAPI_FSTRIGMODE_FIXEDRATE = 3, //!< FixedRate
  325. CAP_PVAPI_FSTRIGMODE_SOFTWARE = 4 //!< Software
  326. };
  327. //! PVAPI: DecimationHorizontal, DecimationVertical
  328. enum { CAP_PVAPI_DECIMATION_OFF = 1, //!< Off
  329. CAP_PVAPI_DECIMATION_2OUTOF4 = 2, //!< 2 out of 4 decimation
  330. CAP_PVAPI_DECIMATION_2OUTOF8 = 4, //!< 2 out of 8 decimation
  331. CAP_PVAPI_DECIMATION_2OUTOF16 = 8 //!< 2 out of 16 decimation
  332. };
  333. //! PVAPI: PixelFormat
  334. enum { CAP_PVAPI_PIXELFORMAT_MONO8 = 1, //!< Mono8
  335. CAP_PVAPI_PIXELFORMAT_MONO16 = 2, //!< Mono16
  336. CAP_PVAPI_PIXELFORMAT_BAYER8 = 3, //!< Bayer8
  337. CAP_PVAPI_PIXELFORMAT_BAYER16 = 4, //!< Bayer16
  338. CAP_PVAPI_PIXELFORMAT_RGB24 = 5, //!< Rgb24
  339. CAP_PVAPI_PIXELFORMAT_BGR24 = 6, //!< Bgr24
  340. CAP_PVAPI_PIXELFORMAT_RGBA32 = 7, //!< Rgba32
  341. CAP_PVAPI_PIXELFORMAT_BGRA32 = 8, //!< Bgra32
  342. };
  343. //! @} PvAPI
  344. /** @name XIMEA Camera API
  345. @{
  346. */
  347. //! Properties of cameras available through XIMEA SDK backend
  348. enum { CAP_PROP_XI_DOWNSAMPLING = 400, //!< Change image resolution by binning or skipping.
  349. CAP_PROP_XI_DATA_FORMAT = 401, //!< Output data format.
  350. CAP_PROP_XI_OFFSET_X = 402, //!< Horizontal offset from the origin to the area of interest (in pixels).
  351. CAP_PROP_XI_OFFSET_Y = 403, //!< Vertical offset from the origin to the area of interest (in pixels).
  352. CAP_PROP_XI_TRG_SOURCE = 404, //!< Defines source of trigger.
  353. CAP_PROP_XI_TRG_SOFTWARE = 405, //!< Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.
  354. CAP_PROP_XI_GPI_SELECTOR = 406, //!< Selects general purpose input.
  355. CAP_PROP_XI_GPI_MODE = 407, //!< Set general purpose input mode.
  356. CAP_PROP_XI_GPI_LEVEL = 408, //!< Get general purpose level.
  357. CAP_PROP_XI_GPO_SELECTOR = 409, //!< Selects general purpose output.
  358. CAP_PROP_XI_GPO_MODE = 410, //!< Set general purpose output mode.
  359. CAP_PROP_XI_LED_SELECTOR = 411, //!< Selects camera signalling LED.
  360. CAP_PROP_XI_LED_MODE = 412, //!< Define camera signalling LED functionality.
  361. CAP_PROP_XI_MANUAL_WB = 413, //!< Calculates White Balance(must be called during acquisition).
  362. CAP_PROP_XI_AUTO_WB = 414, //!< Automatic white balance.
  363. CAP_PROP_XI_AEAG = 415, //!< Automatic exposure/gain.
  364. CAP_PROP_XI_EXP_PRIORITY = 416, //!< Exposure priority (0.5 - exposure 50%, gain 50%).
  365. CAP_PROP_XI_AE_MAX_LIMIT = 417, //!< Maximum limit of exposure in AEAG procedure.
  366. CAP_PROP_XI_AG_MAX_LIMIT = 418, //!< Maximum limit of gain in AEAG procedure.
  367. CAP_PROP_XI_AEAG_LEVEL = 419, //!< Average intensity of output signal AEAG should achieve(in %).
  368. CAP_PROP_XI_TIMEOUT = 420, //!< Image capture timeout in milliseconds.
  369. CAP_PROP_XI_EXPOSURE = 421, //!< Exposure time in microseconds.
  370. CAP_PROP_XI_EXPOSURE_BURST_COUNT = 422, //!< Sets the number of times of exposure in one frame.
  371. CAP_PROP_XI_GAIN_SELECTOR = 423, //!< Gain selector for parameter Gain allows to select different type of gains.
  372. CAP_PROP_XI_GAIN = 424, //!< Gain in dB.
  373. CAP_PROP_XI_DOWNSAMPLING_TYPE = 426, //!< Change image downsampling type.
  374. CAP_PROP_XI_BINNING_SELECTOR = 427, //!< Binning engine selector.
  375. CAP_PROP_XI_BINNING_VERTICAL = 428, //!< Vertical Binning - number of vertical photo-sensitive cells to combine together.
  376. CAP_PROP_XI_BINNING_HORIZONTAL = 429, //!< Horizontal Binning - number of horizontal photo-sensitive cells to combine together.
  377. CAP_PROP_XI_BINNING_PATTERN = 430, //!< Binning pattern type.
  378. CAP_PROP_XI_DECIMATION_SELECTOR = 431, //!< Decimation engine selector.
  379. CAP_PROP_XI_DECIMATION_VERTICAL = 432, //!< Vertical Decimation - vertical sub-sampling of the image - reduces the vertical resolution of the image by the specified vertical decimation factor.
  380. CAP_PROP_XI_DECIMATION_HORIZONTAL = 433, //!< Horizontal Decimation - horizontal sub-sampling of the image - reduces the horizontal resolution of the image by the specified vertical decimation factor.
  381. CAP_PROP_XI_DECIMATION_PATTERN = 434, //!< Decimation pattern type.
  382. CAP_PROP_XI_TEST_PATTERN_GENERATOR_SELECTOR = 587, //!< Selects which test pattern generator is controlled by the TestPattern feature.
  383. CAP_PROP_XI_TEST_PATTERN = 588, //!< Selects which test pattern type is generated by the selected generator.
  384. CAP_PROP_XI_IMAGE_DATA_FORMAT = 435, //!< Output data format.
  385. CAP_PROP_XI_SHUTTER_TYPE = 436, //!< Change sensor shutter type(CMOS sensor).
  386. CAP_PROP_XI_SENSOR_TAPS = 437, //!< Number of taps.
  387. CAP_PROP_XI_AEAG_ROI_OFFSET_X = 439, //!< Automatic exposure/gain ROI offset X.
  388. CAP_PROP_XI_AEAG_ROI_OFFSET_Y = 440, //!< Automatic exposure/gain ROI offset Y.
  389. CAP_PROP_XI_AEAG_ROI_WIDTH = 441, //!< Automatic exposure/gain ROI Width.
  390. CAP_PROP_XI_AEAG_ROI_HEIGHT = 442, //!< Automatic exposure/gain ROI Height.
  391. CAP_PROP_XI_BPC = 445, //!< Correction of bad pixels.
  392. CAP_PROP_XI_WB_KR = 448, //!< White balance red coefficient.
  393. CAP_PROP_XI_WB_KG = 449, //!< White balance green coefficient.
  394. CAP_PROP_XI_WB_KB = 450, //!< White balance blue coefficient.
  395. CAP_PROP_XI_WIDTH = 451, //!< Width of the Image provided by the device (in pixels).
  396. CAP_PROP_XI_HEIGHT = 452, //!< Height of the Image provided by the device (in pixels).
  397. CAP_PROP_XI_REGION_SELECTOR = 589, //!< Selects Region in Multiple ROI which parameters are set by width, height, ... ,region mode.
  398. CAP_PROP_XI_REGION_MODE = 595, //!< Activates/deactivates Region selected by Region Selector.
  399. CAP_PROP_XI_LIMIT_BANDWIDTH = 459, //!< Set/get bandwidth(datarate)(in Megabits).
  400. CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH = 460, //!< Sensor output data bit depth.
  401. CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH = 461, //!< Device output data bit depth.
  402. CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH = 462, //!< bitdepth of data returned by function xiGetImage.
  403. CAP_PROP_XI_OUTPUT_DATA_PACKING = 463, //!< Device output data packing (or grouping) enabled. Packing could be enabled if output_data_bit_depth > 8 and packing capability is available.
  404. CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE = 464, //!< Data packing type. Some cameras supports only specific packing type.
  405. CAP_PROP_XI_IS_COOLED = 465, //!< Returns 1 for cameras that support cooling.
  406. CAP_PROP_XI_COOLING = 466, //!< Start camera cooling.
  407. CAP_PROP_XI_TARGET_TEMP = 467, //!< Set sensor target temperature for cooling.
  408. CAP_PROP_XI_CHIP_TEMP = 468, //!< Camera sensor temperature.
  409. CAP_PROP_XI_HOUS_TEMP = 469, //!< Camera housing temperature.
  410. CAP_PROP_XI_HOUS_BACK_SIDE_TEMP = 590, //!< Camera housing back side temperature.
  411. CAP_PROP_XI_SENSOR_BOARD_TEMP = 596, //!< Camera sensor board temperature.
  412. CAP_PROP_XI_CMS = 470, //!< Mode of color management system.
  413. CAP_PROP_XI_APPLY_CMS = 471, //!< Enable applying of CMS profiles to xiGetImage (see XI_PRM_INPUT_CMS_PROFILE, XI_PRM_OUTPUT_CMS_PROFILE).
  414. CAP_PROP_XI_IMAGE_IS_COLOR = 474, //!< Returns 1 for color cameras.
  415. CAP_PROP_XI_COLOR_FILTER_ARRAY = 475, //!< Returns color filter array type of RAW data.
  416. CAP_PROP_XI_GAMMAY = 476, //!< Luminosity gamma.
  417. CAP_PROP_XI_GAMMAC = 477, //!< Chromaticity gamma.
  418. CAP_PROP_XI_SHARPNESS = 478, //!< Sharpness Strength.
  419. CAP_PROP_XI_CC_MATRIX_00 = 479, //!< Color Correction Matrix element [0][0].
  420. CAP_PROP_XI_CC_MATRIX_01 = 480, //!< Color Correction Matrix element [0][1].
  421. CAP_PROP_XI_CC_MATRIX_02 = 481, //!< Color Correction Matrix element [0][2].
  422. CAP_PROP_XI_CC_MATRIX_03 = 482, //!< Color Correction Matrix element [0][3].
  423. CAP_PROP_XI_CC_MATRIX_10 = 483, //!< Color Correction Matrix element [1][0].
  424. CAP_PROP_XI_CC_MATRIX_11 = 484, //!< Color Correction Matrix element [1][1].
  425. CAP_PROP_XI_CC_MATRIX_12 = 485, //!< Color Correction Matrix element [1][2].
  426. CAP_PROP_XI_CC_MATRIX_13 = 486, //!< Color Correction Matrix element [1][3].
  427. CAP_PROP_XI_CC_MATRIX_20 = 487, //!< Color Correction Matrix element [2][0].
  428. CAP_PROP_XI_CC_MATRIX_21 = 488, //!< Color Correction Matrix element [2][1].
  429. CAP_PROP_XI_CC_MATRIX_22 = 489, //!< Color Correction Matrix element [2][2].
  430. CAP_PROP_XI_CC_MATRIX_23 = 490, //!< Color Correction Matrix element [2][3].
  431. CAP_PROP_XI_CC_MATRIX_30 = 491, //!< Color Correction Matrix element [3][0].
  432. CAP_PROP_XI_CC_MATRIX_31 = 492, //!< Color Correction Matrix element [3][1].
  433. CAP_PROP_XI_CC_MATRIX_32 = 493, //!< Color Correction Matrix element [3][2].
  434. CAP_PROP_XI_CC_MATRIX_33 = 494, //!< Color Correction Matrix element [3][3].
  435. CAP_PROP_XI_DEFAULT_CC_MATRIX = 495, //!< Set default Color Correction Matrix.
  436. CAP_PROP_XI_TRG_SELECTOR = 498, //!< Selects the type of trigger.
  437. CAP_PROP_XI_ACQ_FRAME_BURST_COUNT = 499, //!< Sets number of frames acquired by burst. This burst is used only if trigger is set to FrameBurstStart.
  438. CAP_PROP_XI_DEBOUNCE_EN = 507, //!< Enable/Disable debounce to selected GPI.
  439. CAP_PROP_XI_DEBOUNCE_T0 = 508, //!< Debounce time (x * 10us).
  440. CAP_PROP_XI_DEBOUNCE_T1 = 509, //!< Debounce time (x * 10us).
  441. CAP_PROP_XI_DEBOUNCE_POL = 510, //!< Debounce polarity (pol = 1 t0 - falling edge, t1 - rising edge).
  442. CAP_PROP_XI_LENS_MODE = 511, //!< Status of lens control interface. This shall be set to XI_ON before any Lens operations.
  443. CAP_PROP_XI_LENS_APERTURE_VALUE = 512, //!< Current lens aperture value in stops. Examples: 2.8, 4, 5.6, 8, 11.
  444. CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE = 513, //!< Lens current focus movement value to be used by XI_PRM_LENS_FOCUS_MOVE in motor steps.
  445. CAP_PROP_XI_LENS_FOCUS_MOVE = 514, //!< Moves lens focus motor by steps set in XI_PRM_LENS_FOCUS_MOVEMENT_VALUE.
  446. CAP_PROP_XI_LENS_FOCUS_DISTANCE = 515, //!< Lens focus distance in cm.
  447. CAP_PROP_XI_LENS_FOCAL_LENGTH = 516, //!< Lens focal distance in mm.
  448. CAP_PROP_XI_LENS_FEATURE_SELECTOR = 517, //!< Selects the current feature which is accessible by XI_PRM_LENS_FEATURE.
  449. CAP_PROP_XI_LENS_FEATURE = 518, //!< Allows access to lens feature value currently selected by XI_PRM_LENS_FEATURE_SELECTOR.
  450. CAP_PROP_XI_DEVICE_MODEL_ID = 521, //!< Returns device model id.
  451. CAP_PROP_XI_DEVICE_SN = 522, //!< Returns device serial number.
  452. CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA = 529, //!< The alpha channel of RGB32 output image format.
  453. CAP_PROP_XI_IMAGE_PAYLOAD_SIZE = 530, //!< Buffer size in bytes sufficient for output image returned by xiGetImage.
  454. CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT = 531, //!< Current format of pixels on transport layer.
  455. CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ = 532, //!< Sensor clock frequency in Hz.
  456. CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX = 533, //!< Sensor clock frequency index. Sensor with selected frequencies have possibility to set the frequency only by this index.
  457. CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT = 534, //!< Number of output channels from sensor used for data transfer.
  458. CAP_PROP_XI_FRAMERATE = 535, //!< Define framerate in Hz.
  459. CAP_PROP_XI_COUNTER_SELECTOR = 536, //!< Select counter.
  460. CAP_PROP_XI_COUNTER_VALUE = 537, //!< Counter status.
  461. CAP_PROP_XI_ACQ_TIMING_MODE = 538, //!< Type of sensor frames timing.
  462. CAP_PROP_XI_AVAILABLE_BANDWIDTH = 539, //!< Calculate and returns available interface bandwidth(int Megabits).
  463. CAP_PROP_XI_BUFFER_POLICY = 540, //!< Data move policy.
  464. CAP_PROP_XI_LUT_EN = 541, //!< Activates LUT.
  465. CAP_PROP_XI_LUT_INDEX = 542, //!< Control the index (offset) of the coefficient to access in the LUT.
  466. CAP_PROP_XI_LUT_VALUE = 543, //!< Value at entry LUTIndex of the LUT.
  467. CAP_PROP_XI_TRG_DELAY = 544, //!< Specifies the delay in microseconds (us) to apply after the trigger reception before activating it.
  468. CAP_PROP_XI_TS_RST_MODE = 545, //!< Defines how time stamp reset engine will be armed.
  469. CAP_PROP_XI_TS_RST_SOURCE = 546, //!< Defines which source will be used for timestamp reset. Writing this parameter will trigger settings of engine (arming).
  470. CAP_PROP_XI_IS_DEVICE_EXIST = 547, //!< Returns 1 if camera connected and works properly.
  471. CAP_PROP_XI_ACQ_BUFFER_SIZE = 548, //!< Acquisition buffer size in buffer_size_unit. Default bytes.
  472. CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT = 549, //!< Acquisition buffer size unit in bytes. Default 1. E.g. Value 1024 means that buffer_size is in KiBytes.
  473. CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE = 550, //!< Acquisition transport buffer size in bytes.
  474. CAP_PROP_XI_BUFFERS_QUEUE_SIZE = 551, //!< Queue of field/frame buffers.
  475. CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT = 552, //!< Number of buffers to commit to low level.
  476. CAP_PROP_XI_RECENT_FRAME = 553, //!< GetImage returns most recent frame.
  477. CAP_PROP_XI_DEVICE_RESET = 554, //!< Resets the camera to default state.
  478. CAP_PROP_XI_COLUMN_FPN_CORRECTION = 555, //!< Correction of column FPN.
  479. CAP_PROP_XI_ROW_FPN_CORRECTION = 591, //!< Correction of row FPN.
  480. CAP_PROP_XI_SENSOR_MODE = 558, //!< Current sensor mode. Allows to select sensor mode by one integer. Setting of this parameter affects: image dimensions and downsampling.
  481. CAP_PROP_XI_HDR = 559, //!< Enable High Dynamic Range feature.
  482. CAP_PROP_XI_HDR_KNEEPOINT_COUNT = 560, //!< The number of kneepoints in the PWLR.
  483. CAP_PROP_XI_HDR_T1 = 561, //!< Position of first kneepoint(in % of XI_PRM_EXPOSURE).
  484. CAP_PROP_XI_HDR_T2 = 562, //!< Position of second kneepoint (in % of XI_PRM_EXPOSURE).
  485. CAP_PROP_XI_KNEEPOINT1 = 563, //!< Value of first kneepoint (% of sensor saturation).
  486. CAP_PROP_XI_KNEEPOINT2 = 564, //!< Value of second kneepoint (% of sensor saturation).
  487. CAP_PROP_XI_IMAGE_BLACK_LEVEL = 565, //!< Last image black level counts. Can be used for Offline processing to recall it.
  488. CAP_PROP_XI_HW_REVISION = 571, //!< Returns hardware revision number.
  489. CAP_PROP_XI_DEBUG_LEVEL = 572, //!< Set debug level.
  490. CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION = 573, //!< Automatic bandwidth calculation.
  491. CAP_PROP_XI_FFS_FILE_ID = 594, //!< File number.
  492. CAP_PROP_XI_FFS_FILE_SIZE = 580, //!< Size of file.
  493. CAP_PROP_XI_FREE_FFS_SIZE = 581, //!< Size of free camera FFS.
  494. CAP_PROP_XI_USED_FFS_SIZE = 582, //!< Size of used camera FFS.
  495. CAP_PROP_XI_FFS_ACCESS_KEY = 583, //!< Setting of key enables file operations on some cameras.
  496. CAP_PROP_XI_SENSOR_FEATURE_SELECTOR = 585, //!< Selects the current feature which is accessible by XI_PRM_SENSOR_FEATURE_VALUE.
  497. CAP_PROP_XI_SENSOR_FEATURE_VALUE = 586, //!< Allows access to sensor feature value currently selected by XI_PRM_SENSOR_FEATURE_SELECTOR.
  498. };
  499. //! @} XIMEA
  500. /** @name ARAVIS Camera API
  501. @{
  502. */
  503. //! Properties of cameras available through ARAVIS backend
  504. enum { CAP_PROP_ARAVIS_AUTOTRIGGER = 600 //!< Automatically trigger frame capture if camera is configured with software trigger
  505. };
  506. //! @} ARAVIS
  507. /** @name AVFoundation framework for iOS
  508. @{
  509. */
  510. //! Properties of cameras available through AVFOUNDATION backend
  511. enum { CAP_PROP_IOS_DEVICE_FOCUS = 9001,
  512. CAP_PROP_IOS_DEVICE_EXPOSURE = 9002,
  513. CAP_PROP_IOS_DEVICE_FLASH = 9003,
  514. CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004,
  515. CAP_PROP_IOS_DEVICE_TORCH = 9005
  516. };
  517. //! @} AVFoundation framework for iOS
  518. /** @name Smartek Giganetix GigEVisionSDK
  519. @{
  520. */
  521. //! Properties of cameras available through Smartek Giganetix Ethernet Vision backend
  522. /* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */
  523. enum { CAP_PROP_GIGA_FRAME_OFFSET_X = 10001,
  524. CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002,
  525. CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003,
  526. CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004,
  527. CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005,
  528. CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006
  529. };
  530. //! @} Smartek
  531. /** @name Intel Perceptual Computing SDK
  532. @{
  533. */
  534. enum { CAP_PROP_INTELPERC_PROFILE_COUNT = 11001,
  535. CAP_PROP_INTELPERC_PROFILE_IDX = 11002,
  536. CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003,
  537. CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004,
  538. CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005,
  539. CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006,
  540. CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007
  541. };
  542. //! Intel Perceptual Streams
  543. enum { CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29,
  544. CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28,
  545. CAP_INTELPERC_IR_GENERATOR = 1 << 27,
  546. CAP_INTELPERC_GENERATORS_MASK = CAP_INTELPERC_DEPTH_GENERATOR + CAP_INTELPERC_IMAGE_GENERATOR + CAP_INTELPERC_IR_GENERATOR
  547. };
  548. enum { CAP_INTELPERC_DEPTH_MAP = 0, //!< Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth.
  549. CAP_INTELPERC_UVDEPTH_MAP = 1, //!< Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates.
  550. CAP_INTELPERC_IR_MAP = 2, //!< Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam.
  551. CAP_INTELPERC_IMAGE = 3
  552. };
  553. //! @} Intel Perceptual
  554. /** @name gPhoto2 connection
  555. @{
  556. */
  557. /** @brief gPhoto2 properties
  558. If `propertyId` is less than 0 then work on widget with that __additive inversed__ camera setting ID
  559. Get IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE.
  560. @see CvCaptureCAM_GPHOTO2 for more info
  561. */
  562. enum { CAP_PROP_GPHOTO2_PREVIEW = 17001, //!< Capture only preview from liveview mode.
  563. CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002, //!< Readonly, returns (const char *).
  564. CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003, //!< Trigger, only by set. Reload camera settings.
  565. CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004, //!< Reload all settings on set.
  566. CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005, //!< Collect messages with details.
  567. CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006, //!< Readonly, returns (const char *).
  568. CAP_PROP_SPEED = 17007, //!< Exposure speed. Can be readonly, depends on camera program.
  569. CAP_PROP_APERTURE = 17008, //!< Aperture. Can be readonly, depends on camera program.
  570. CAP_PROP_EXPOSUREPROGRAM = 17009, //!< Camera exposure program.
  571. CAP_PROP_VIEWFINDER = 17010 //!< Enter liveview mode.
  572. };
  573. //! @} gPhoto2
  574. /** @name Images backend
  575. @{
  576. */
  577. /** @brief Images backend properties
  578. */
  579. enum { CAP_PROP_IMAGES_BASE = 18000,
  580. CAP_PROP_IMAGES_LAST = 19000 // excluding
  581. };
  582. //! @} Images
  583. //! @} videoio_flags_others
  584. class IVideoCapture;
  585. //! @cond IGNORED
  586. namespace internal { class VideoCapturePrivateAccessor; }
  587. //! @endcond IGNORED
  588. /** @brief Class for video capturing from video files, image sequences or cameras.
  589. The class provides C++ API for capturing video from cameras or for reading video files and image sequences.
  590. Here is how the class can be used:
  591. @include samples/cpp/videocapture_basic.cpp
  592. @note In @ref videoio_c "C API" the black-box structure `CvCapture` is used instead of %VideoCapture.
  593. @note
  594. - (C++) A basic sample on using the %VideoCapture interface can be found at
  595. `OPENCV_SOURCE_CODE/samples/cpp/videocapture_starter.cpp`
  596. - (Python) A basic sample on using the %VideoCapture interface can be found at
  597. `OPENCV_SOURCE_CODE/samples/python/video.py`
  598. - (Python) A multi threaded video processing sample can be found at
  599. `OPENCV_SOURCE_CODE/samples/python/video_threaded.py`
  600. - (Python) %VideoCapture sample showcasing some features of the Video4Linux2 backend
  601. `OPENCV_SOURCE_CODE/samples/python/video_v4l2.py`
  602. */
  603. class CV_EXPORTS_W VideoCapture
  604. {
  605. public:
  606. /** @brief Default constructor
  607. @note In @ref videoio_c "C API", when you finished working with video, release CvCapture structure with
  608. cvReleaseCapture(), or use Ptr\<CvCapture\> that calls cvReleaseCapture() automatically in the
  609. destructor.
  610. */
  611. CV_WRAP VideoCapture();
  612. /** @overload
  613. @brief Opens a video file or a capturing device or an IP video stream for video capturing with API Preference
  614. @param filename it can be:
  615. - name of video file (eg. `video.avi`)
  616. - or image sequence (eg. `img_%02d.jpg`, which will read samples like `img_00.jpg, img_01.jpg, img_02.jpg, ...`)
  617. - or URL of video stream (eg. `protocol://host:port/script_name?script_params|auth`)
  618. - or GStreamer pipeline string in gst-launch tool format in case if GStreamer is used as backend
  619. Note that each video stream or IP camera feed has its own URL scheme. Please refer to the
  620. documentation of source stream to know the right URL.
  621. @param apiPreference preferred Capture API backends to use. Can be used to enforce a specific reader
  622. implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW.
  623. @sa cv::VideoCaptureAPIs
  624. */
  625. CV_WRAP explicit VideoCapture(const String& filename, int apiPreference = CAP_ANY);
  626. /** @overload
  627. @brief Opens a video file or a capturing device or an IP video stream for video capturing with API Preference and parameters
  628. The `params` parameter allows to specify extra parameters encoded as pairs `(paramId_1, paramValue_1, paramId_2, paramValue_2, ...)`.
  629. See cv::VideoCaptureProperties
  630. */
  631. CV_WRAP explicit VideoCapture(const String& filename, int apiPreference, const std::vector<int>& params);
  632. /** @overload
  633. @brief Opens a camera for video capturing
  634. @param index id of the video capturing device to open. To open default camera using default backend just pass 0.
  635. (to backward compatibility usage of camera_id + domain_offset (CAP_*) is valid when apiPreference is CAP_ANY)
  636. @param apiPreference preferred Capture API backends to use. Can be used to enforce a specific reader
  637. implementation if multiple are available: e.g. cv::CAP_DSHOW or cv::CAP_MSMF or cv::CAP_V4L.
  638. @sa cv::VideoCaptureAPIs
  639. */
  640. CV_WRAP explicit VideoCapture(int index, int apiPreference = CAP_ANY);
  641. /** @overload
  642. @brief Opens a camera for video capturing with API Preference and parameters
  643. The `params` parameter allows to specify extra parameters encoded as pairs `(paramId_1, paramValue_1, paramId_2, paramValue_2, ...)`.
  644. See cv::VideoCaptureProperties
  645. */
  646. CV_WRAP explicit VideoCapture(int index, int apiPreference, const std::vector<int>& params);
  647. /** @brief Default destructor
  648. The method first calls VideoCapture::release to close the already opened file or camera.
  649. */
  650. virtual ~VideoCapture();
  651. /** @brief Opens a video file or a capturing device or an IP video stream for video capturing.
  652. @overload
  653. Parameters are same as the constructor VideoCapture(const String& filename, int apiPreference = CAP_ANY)
  654. @return `true` if the file has been successfully opened
  655. The method first calls VideoCapture::release to close the already opened file or camera.
  656. */
  657. CV_WRAP virtual bool open(const String& filename, int apiPreference = CAP_ANY);
  658. /** @brief Opens a video file or a capturing device or an IP video stream for video capturing with API Preference and parameters
  659. @overload
  660. The `params` parameter allows to specify extra parameters encoded as pairs `(paramId_1, paramValue_1, paramId_2, paramValue_2, ...)`.
  661. See cv::VideoCaptureProperties
  662. @return `true` if the file has been successfully opened
  663. The method first calls VideoCapture::release to close the already opened file or camera.
  664. */
  665. CV_WRAP virtual bool open(const String& filename, int apiPreference, const std::vector<int>& params);
  666. /** @brief Opens a camera for video capturing
  667. @overload
  668. Parameters are same as the constructor VideoCapture(int index, int apiPreference = CAP_ANY)
  669. @return `true` if the camera has been successfully opened.
  670. The method first calls VideoCapture::release to close the already opened file or camera.
  671. */
  672. CV_WRAP virtual bool open(int index, int apiPreference = CAP_ANY);
  673. /** @brief Opens a camera for video capturing with API Preference and parameters
  674. @overload
  675. The `params` parameter allows to specify extra parameters encoded as pairs `(paramId_1, paramValue_1, paramId_2, paramValue_2, ...)`.
  676. See cv::VideoCaptureProperties
  677. @return `true` if the camera has been successfully opened.
  678. The method first calls VideoCapture::release to close the already opened file or camera.
  679. */
  680. CV_WRAP virtual bool open(int index, int apiPreference, const std::vector<int>& params);
  681. /** @brief Returns true if video capturing has been initialized already.
  682. If the previous call to VideoCapture constructor or VideoCapture::open() succeeded, the method returns
  683. true.
  684. */
  685. CV_WRAP virtual bool isOpened() const;
  686. /** @brief Closes video file or capturing device.
  687. The method is automatically called by subsequent VideoCapture::open and by VideoCapture
  688. destructor.
  689. The C function also deallocates memory and clears \*capture pointer.
  690. */
  691. CV_WRAP virtual void release();
  692. /** @brief Grabs the next frame from video file or capturing device.
  693. @return `true` (non-zero) in the case of success.
  694. The method/function grabs the next frame from video file or camera and returns true (non-zero) in
  695. the case of success.
  696. The primary use of the function is in multi-camera environments, especially when the cameras do not
  697. have hardware synchronization. That is, you call VideoCapture::grab() for each camera and after that
  698. call the slower method VideoCapture::retrieve() to decode and get frame from each camera. This way
  699. the overhead on demosaicing or motion jpeg decompression etc. is eliminated and the retrieved frames
  700. from different cameras will be closer in time.
  701. Also, when a connected camera is multi-head (for example, a stereo camera or a Kinect device), the
  702. correct way of retrieving data from it is to call VideoCapture::grab() first and then call
  703. VideoCapture::retrieve() one or more times with different values of the channel parameter.
  704. @ref tutorial_kinect_openni
  705. */
  706. CV_WRAP virtual bool grab();
  707. /** @brief Decodes and returns the grabbed video frame.
  708. @param [out] image the video frame is returned here. If no frames has been grabbed the image will be empty.
  709. @param flag it could be a frame index or a driver specific flag
  710. @return `false` if no frames has been grabbed
  711. The method decodes and returns the just grabbed frame. If no frames has been grabbed
  712. (camera has been disconnected, or there are no more frames in video file), the method returns false
  713. and the function returns an empty image (with %cv::Mat, test it with Mat::empty()).
  714. @sa read()
  715. @note In @ref videoio_c "C API", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video
  716. capturing structure. It is not allowed to modify or release the image! You can copy the frame using
  717. cvCloneImage and then do whatever you want with the copy.
  718. */
  719. CV_WRAP virtual bool retrieve(OutputArray image, int flag = 0);
  720. /** @brief Stream operator to read the next video frame.
  721. @sa read()
  722. */
  723. virtual VideoCapture& operator >> (CV_OUT Mat& image);
  724. /** @overload
  725. @sa read()
  726. */
  727. virtual VideoCapture& operator >> (CV_OUT UMat& image);
  728. /** @brief Grabs, decodes and returns the next video frame.
  729. @param [out] image the video frame is returned here. If no frames has been grabbed the image will be empty.
  730. @return `false` if no frames has been grabbed
  731. The method/function combines VideoCapture::grab() and VideoCapture::retrieve() in one call. This is the
  732. most convenient method for reading video files or capturing data from decode and returns the just
  733. grabbed frame. If no frames has been grabbed (camera has been disconnected, or there are no more
  734. frames in video file), the method returns false and the function returns empty image (with %cv::Mat, test it with Mat::empty()).
  735. @note In @ref videoio_c "C API", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video
  736. capturing structure. It is not allowed to modify or release the image! You can copy the frame using
  737. cvCloneImage and then do whatever you want with the copy.
  738. */
  739. CV_WRAP virtual bool read(OutputArray image);
  740. /** @brief Sets a property in the VideoCapture.
  741. @param propId Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...)
  742. or one from @ref videoio_flags_others
  743. @param value Value of the property.
  744. @return `true` if the property is supported by backend used by the VideoCapture instance.
  745. @note Even if it returns `true` this doesn't ensure that the property
  746. value has been accepted by the capture device. See note in VideoCapture::get()
  747. */
  748. CV_WRAP virtual bool set(int propId, double value);
  749. /** @brief Returns the specified VideoCapture property
  750. @param propId Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...)
  751. or one from @ref videoio_flags_others
  752. @return Value for the specified property. Value 0 is returned when querying a property that is
  753. not supported by the backend used by the VideoCapture instance.
  754. @note Reading / writing properties involves many layers. Some unexpected result might happens
  755. along this chain.
  756. @code{.txt}
  757. VideoCapture -> API Backend -> Operating System -> Device Driver -> Device Hardware
  758. @endcode
  759. The returned value might be different from what really used by the device or it could be encoded
  760. using device dependent rules (eg. steps or percentage). Effective behaviour depends from device
  761. driver and API Backend
  762. */
  763. CV_WRAP virtual double get(int propId) const;
  764. /** @brief Returns used backend API name
  765. @note Stream should be opened.
  766. */
  767. CV_WRAP String getBackendName() const;
  768. /** Switches exceptions mode
  769. *
  770. * methods raise exceptions if not successful instead of returning an error code
  771. */
  772. CV_WRAP void setExceptionMode(bool enable) { throwOnFail = enable; }
  773. /// query if exception mode is active
  774. CV_WRAP bool getExceptionMode() { return throwOnFail; }
  775. /** @brief Wait for ready frames from VideoCapture.
  776. @param streams input video streams
  777. @param readyIndex stream indexes with grabbed frames (ready to use .retrieve() to fetch actual frame)
  778. @param timeoutNs number of nanoseconds (0 - infinite)
  779. @return `true` if streamReady is not empty
  780. @throws Exception %Exception on stream errors (check .isOpened() to filter out malformed streams) or VideoCapture type is not supported
  781. The primary use of the function is in multi-camera environments.
  782. The method fills the ready state vector, grabs video frame, if camera is ready.
  783. After this call use VideoCapture::retrieve() to decode and fetch frame data.
  784. */
  785. static /*CV_WRAP*/
  786. bool waitAny(
  787. const std::vector<VideoCapture>& streams,
  788. CV_OUT std::vector<int>& readyIndex,
  789. int64 timeoutNs = 0);
  790. protected:
  791. Ptr<CvCapture> cap;
  792. Ptr<IVideoCapture> icap;
  793. bool throwOnFail;
  794. friend class internal::VideoCapturePrivateAccessor;
  795. };
  796. class IVideoWriter;
  797. /** @example samples/cpp/tutorial_code/videoio/video-write/video-write.cpp
  798. Check @ref tutorial_video_write "the corresponding tutorial" for more details
  799. */
  800. /** @example samples/cpp/videowriter_basic.cpp
  801. An example using VideoCapture and VideoWriter class
  802. */
  803. /** @brief Video writer class.
  804. The class provides C++ API for writing video files or image sequences.
  805. */
  806. class CV_EXPORTS_W VideoWriter
  807. {
  808. public:
  809. /** @brief Default constructors
  810. The constructors/functions initialize video writers.
  811. - On Linux FFMPEG is used to write videos;
  812. - On Windows FFMPEG or MSWF or DSHOW is used;
  813. - On MacOSX AVFoundation is used.
  814. */
  815. CV_WRAP VideoWriter();
  816. /** @overload
  817. @param filename Name of the output video file.
  818. @param fourcc 4-character code of codec used to compress the frames. For example,
  819. VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G') is a
  820. motion-jpeg codec etc. List of codes can be obtained at [Video Codecs by
  821. FOURCC](http://www.fourcc.org/codecs.php) page. FFMPEG backend with MP4 container natively uses
  822. other values as fourcc code: see [ObjectType](http://mp4ra.org/#/codecs),
  823. so you may receive a warning message from OpenCV about fourcc code conversion.
  824. @param fps Framerate of the created video stream.
  825. @param frameSize Size of the video frames.
  826. @param isColor If it is not zero, the encoder will expect and encode color frames, otherwise it
  827. will work with grayscale frames.
  828. @b Tips:
  829. - With some backends `fourcc=-1` pops up the codec selection dialog from the system.
  830. - To save image sequence use a proper filename (eg. `img_%02d.jpg`) and `fourcc=0`
  831. OR `fps=0`. Use uncompressed image format (eg. `img_%02d.BMP`) to save raw frames.
  832. - Most codecs are lossy. If you want lossless video file you need to use a lossless codecs
  833. (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...)
  834. - If FFMPEG is enabled, using `codec=0; fps=0;` you can create an uncompressed (raw) video file.
  835. */
  836. CV_WRAP VideoWriter(const String& filename, int fourcc, double fps,
  837. Size frameSize, bool isColor = true);
  838. /** @overload
  839. The `apiPreference` parameter allows to specify API backends to use. Can be used to enforce a specific reader implementation
  840. if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_GSTREAMER.
  841. */
  842. CV_WRAP VideoWriter(const String& filename, int apiPreference, int fourcc, double fps,
  843. Size frameSize, bool isColor = true);
  844. /** @overload
  845. * The `params` parameter allows to specify extra encoder parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .)
  846. * see cv::VideoWriterProperties
  847. */
  848. CV_WRAP VideoWriter(const String& filename, int fourcc, double fps, const Size& frameSize,
  849. const std::vector<int>& params);
  850. /** @overload
  851. */
  852. CV_WRAP VideoWriter(const String& filename, int apiPreference, int fourcc, double fps,
  853. const Size& frameSize, const std::vector<int>& params);
  854. /** @brief Default destructor
  855. The method first calls VideoWriter::release to close the already opened file.
  856. */
  857. virtual ~VideoWriter();
  858. /** @brief Initializes or reinitializes video writer.
  859. The method opens video writer. Parameters are the same as in the constructor
  860. VideoWriter::VideoWriter.
  861. @return `true` if video writer has been successfully initialized
  862. The method first calls VideoWriter::release to close the already opened file.
  863. */
  864. CV_WRAP virtual bool open(const String& filename, int fourcc, double fps,
  865. Size frameSize, bool isColor = true);
  866. /** @overload
  867. */
  868. CV_WRAP bool open(const String& filename, int apiPreference, int fourcc, double fps,
  869. Size frameSize, bool isColor = true);
  870. /** @overload
  871. */
  872. CV_WRAP bool open(const String& filename, int fourcc, double fps, const Size& frameSize,
  873. const std::vector<int>& params);
  874. /** @overload
  875. */
  876. CV_WRAP bool open(const String& filename, int apiPreference, int fourcc, double fps,
  877. const Size& frameSize, const std::vector<int>& params);
  878. /** @brief Returns true if video writer has been successfully initialized.
  879. */
  880. CV_WRAP virtual bool isOpened() const;
  881. /** @brief Closes the video writer.
  882. The method is automatically called by subsequent VideoWriter::open and by the VideoWriter
  883. destructor.
  884. */
  885. CV_WRAP virtual void release();
  886. /** @brief Stream operator to write the next video frame.
  887. @sa write
  888. */
  889. virtual VideoWriter& operator << (const Mat& image);
  890. /** @overload
  891. @sa write
  892. */
  893. virtual VideoWriter& operator << (const UMat& image);
  894. /** @brief Writes the next video frame
  895. @param image The written frame. In general, color images are expected in BGR format.
  896. The function/method writes the specified image to video file. It must have the same size as has
  897. been specified when opening the video writer.
  898. */
  899. CV_WRAP virtual void write(InputArray image);
  900. /** @brief Sets a property in the VideoWriter.
  901. @param propId Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY)
  902. or one of @ref videoio_flags_others
  903. @param value Value of the property.
  904. @return `true` if the property is supported by the backend used by the VideoWriter instance.
  905. */
  906. CV_WRAP virtual bool set(int propId, double value);
  907. /** @brief Returns the specified VideoWriter property
  908. @param propId Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY)
  909. or one of @ref videoio_flags_others
  910. @return Value for the specified property. Value 0 is returned when querying a property that is
  911. not supported by the backend used by the VideoWriter instance.
  912. */
  913. CV_WRAP virtual double get(int propId) const;
  914. /** @brief Concatenates 4 chars to a fourcc code
  915. @return a fourcc code
  916. This static method constructs the fourcc code of the codec to be used in the constructor
  917. VideoWriter::VideoWriter or VideoWriter::open.
  918. */
  919. CV_WRAP static int fourcc(char c1, char c2, char c3, char c4);
  920. /** @brief Returns used backend API name
  921. @note Stream should be opened.
  922. */
  923. CV_WRAP String getBackendName() const;
  924. protected:
  925. Ptr<CvVideoWriter> writer;
  926. Ptr<IVideoWriter> iwriter;
  927. static Ptr<IVideoWriter> create(const String& filename, int fourcc, double fps,
  928. Size frameSize, bool isColor = true);
  929. };
  930. //! @cond IGNORED
  931. template<> struct DefaultDeleter<CvCapture>{ CV_EXPORTS void operator ()(CvCapture* obj) const; };
  932. template<> struct DefaultDeleter<CvVideoWriter>{ CV_EXPORTS void operator ()(CvVideoWriter* obj) const; };
  933. //! @endcond IGNORED
  934. //! @} videoio
  935. } // cv
  936. #endif //OPENCV_VIDEOIO_HPP