1 /*M///////////////////////////////////////////////////////////////////////////////////////
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
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.
11 // For Open Source Computer Vision Library
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.
17 // Redistribution and use in source and binary forms, with or without modification,
18 // are permitted provided that the following conditions are met:
20 // * Redistribution's of source code must retain the above copyright notice,
21 // this list of conditions and the following disclaimer.
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.
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.
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.
43 #ifndef __OPENCV_HIGHGUI_HPP__
44 #define __OPENCV_HIGHGUI_HPP__
46 #include "opencv2/core.hpp"
49 ///////////////////////// graphical user interface //////////////////////////
53 // Flags for namedWindow
54 enum { WINDOW_NORMAL = 0x00000000, // the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size
55 WINDOW_AUTOSIZE = 0x00000001, // the user cannot resize the window, the size is constrainted by the image displayed
56 WINDOW_OPENGL = 0x00001000, // window with opengl support
58 WINDOW_FULLSCREEN = 1, // change the window to fullscreen
59 WINDOW_FREERATIO = 0x00000100, // the image expends as much as it can (no ratio constraint)
60 WINDOW_KEEPRATIO = 0x00000000 // the ratio of the image is respected
63 // Flags for set / getWindowProperty
64 enum { WND_PROP_FULLSCREEN = 0, // fullscreen property (can be WINDOW_NORMAL or WINDOW_FULLSCREEN)
65 WND_PROP_AUTOSIZE = 1, // autosize property (can be WINDOW_NORMAL or WINDOW_AUTOSIZE)
66 WND_PROP_ASPECT_RATIO = 2, // window's aspect ration (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO);
67 WND_PROP_OPENGL = 3 // opengl support
70 enum { EVENT_MOUSEMOVE = 0,
71 EVENT_LBUTTONDOWN = 1,
72 EVENT_RBUTTONDOWN = 2,
73 EVENT_MBUTTONDOWN = 3,
77 EVENT_LBUTTONDBLCLK = 7,
78 EVENT_RBUTTONDBLCLK = 8,
79 EVENT_MBUTTONDBLCLK = 9,
80 EVENT_MOUSEWHEEL = 10,
81 EVENT_MOUSEHWHEEL = 11
84 enum { EVENT_FLAG_LBUTTON = 1,
85 EVENT_FLAG_RBUTTON = 2,
86 EVENT_FLAG_MBUTTON = 4,
87 EVENT_FLAG_CTRLKEY = 8,
88 EVENT_FLAG_SHIFTKEY = 16,
89 EVENT_FLAG_ALTKEY = 32
93 enum { QT_FONT_LIGHT = 25, //QFont::Light,
94 QT_FONT_NORMAL = 50, //QFont::Normal,
95 QT_FONT_DEMIBOLD = 63, //QFont::DemiBold,
96 QT_FONT_BOLD = 75, //QFont::Bold,
97 QT_FONT_BLACK = 87 //QFont::Black
101 enum { QT_STYLE_NORMAL = 0, //QFont::StyleNormal,
102 QT_STYLE_ITALIC = 1, //QFont::StyleItalic,
103 QT_STYLE_OBLIQUE = 2 //QFont::StyleOblique
107 enum { QT_PUSH_BUTTON = 0,
113 typedef void (*MouseCallback)(int event, int x, int y, int flags, void* userdata);
114 typedef void (*TrackbarCallback)(int pos, void* userdata);
115 typedef void (*OpenGlDrawCallback)(void* userdata);
116 typedef void (*ButtonCallback)(int state, void* userdata);
119 CV_EXPORTS_W void namedWindow(const String& winname, int flags = WINDOW_AUTOSIZE);
121 CV_EXPORTS_W void destroyWindow(const String& winname);
123 CV_EXPORTS_W void destroyAllWindows();
125 CV_EXPORTS_W int startWindowThread();
127 CV_EXPORTS_W int waitKey(int delay = 0);
129 CV_EXPORTS_W void imshow(const String& winname, InputArray mat);
131 CV_EXPORTS_W void resizeWindow(const String& winname, int width, int height);
133 CV_EXPORTS_W void moveWindow(const String& winname, int x, int y);
135 CV_EXPORTS_W void setWindowProperty(const String& winname, int prop_id, double prop_value);
137 CV_EXPORTS_W double getWindowProperty(const String& winname, int prop_id);
139 //! assigns callback for mouse events
140 CV_EXPORTS void setMouseCallback(const String& winname, MouseCallback onMouse, void* userdata = 0);
142 CV_EXPORTS int getMouseWheelDelta(int flags);
144 CV_EXPORTS int createTrackbar(const String& trackbarname, const String& winname,
145 int* value, int count,
146 TrackbarCallback onChange = 0,
149 CV_EXPORTS_W int getTrackbarPos(const String& trackbarname, const String& winname);
151 CV_EXPORTS_W void setTrackbarPos(const String& trackbarname, const String& winname, int pos);
155 CV_EXPORTS void imshow(const String& winname, const ogl::Texture2D& tex);
157 CV_EXPORTS void setOpenGlDrawCallback(const String& winname, OpenGlDrawCallback onOpenGlDraw, void* userdata = 0);
159 CV_EXPORTS void setOpenGlContext(const String& winname);
161 CV_EXPORTS void updateWindow(const String& winname);
168 const char* nameFont; // Qt: nameFont
169 Scalar color; // Qt: ColorFont -> cvScalar(blue_component, green_component, red\_component[, alpha_component])
170 int font_face; // Qt: bool italic
171 const int* ascii; // font data and metrics
174 float hscale, vscale;
175 float shear; // slope coefficient: 0 - normal, >0 - italic
176 int thickness; // Qt: weight
177 float dx; // horizontal interval between letters
178 int line_type; // Qt: PointSize
181 CV_EXPORTS QtFont fontQt(const String& nameFont, int pointSize = -1,
182 Scalar color = Scalar::all(0), int weight = QT_FONT_NORMAL,
183 int style = QT_STYLE_NORMAL, int spacing = 0);
185 CV_EXPORTS void addText( const Mat& img, const String& text, Point org, const QtFont& font);
187 CV_EXPORTS void displayOverlay(const String& winname, const String& text, int delayms = 0);
189 CV_EXPORTS void displayStatusBar(const String& winname, const String& text, int delayms = 0);
191 CV_EXPORTS void saveWindowParameters(const String& windowName);
193 CV_EXPORTS void loadWindowParameters(const String& windowName);
195 CV_EXPORTS int startLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]);
197 CV_EXPORTS void stopLoop();
199 CV_EXPORTS int createButton( const String& bar_name, ButtonCallback on_change,
200 void* userdata = 0, int type = QT_PUSH_BUTTON,
201 bool initial_button_state = false);
205 ////////////////////////////////// video io /////////////////////////////////
207 typedef struct CvCapture CvCapture;
208 typedef struct CvVideoWriter CvVideoWriter;
214 enum { CAP_ANY = 0, // autodetect
215 CAP_VFW = 200, // platform native
218 CAP_FIREWARE = 300, // IEEE 1394 drivers
219 CAP_FIREWIRE = CAP_FIREWARE,
220 CAP_IEEE1394 = CAP_FIREWARE,
221 CAP_DC1394 = CAP_FIREWARE,
222 CAP_CMU1394 = CAP_FIREWARE,
223 CAP_QT = 500, // QuickTime
224 CAP_UNICAP = 600, // Unicap drivers
225 CAP_DSHOW = 700, // DirectShow (via videoInput)
226 CAP_PVAPI = 800, // PvAPI, Prosilica GigE SDK
227 CAP_OPENNI = 900, // OpenNI (for Kinect)
228 CAP_OPENNI_ASUS = 910, // OpenNI (for Asus Xtion)
229 CAP_ANDROID = 1000, // Android
230 CAP_XIAPI = 1100, // XIMEA Camera API
231 CAP_AVFOUNDATION = 1200, // AVFoundation framework for iOS (OS X Lion will have the same API)
232 CAP_GIGANETIX = 1300, // Smartek Giganetix GigEVisionSDK
233 CAP_MSMF = 1400, // Microsoft Media Foundation (via videoInput)
234 CAP_INTELPERC = 1500 // Intel Perceptual Computing SDK
237 // generic properties (based on DC1394 properties)
238 enum { CAP_PROP_POS_MSEC =0,
239 CAP_PROP_POS_FRAMES =1,
240 CAP_PROP_POS_AVI_RATIO =2,
241 CAP_PROP_FRAME_WIDTH =3,
242 CAP_PROP_FRAME_HEIGHT =4,
245 CAP_PROP_FRAME_COUNT =7,
248 CAP_PROP_BRIGHTNESS =10,
249 CAP_PROP_CONTRAST =11,
250 CAP_PROP_SATURATION =12,
253 CAP_PROP_EXPOSURE =15,
254 CAP_PROP_CONVERT_RGB =16,
255 CAP_PROP_WHITE_BALANCE_BLUE_U =17,
256 CAP_PROP_RECTIFICATION =18,
257 CAP_PROP_MONOCROME =19,
258 CAP_PROP_SHARPNESS =20,
259 CAP_PROP_AUTO_EXPOSURE =21, // DC1394: exposure control done by camera, user can adjust refernce level using this feature
261 CAP_PROP_TEMPERATURE =23,
262 CAP_PROP_TRIGGER =24,
263 CAP_PROP_TRIGGER_DELAY =25,
264 CAP_PROP_WHITE_BALANCE_RED_V =26,
268 CAP_PROP_ISO_SPEED =30,
269 CAP_PROP_BACKLIGHT =32,
274 CAP_PROP_SETTINGS =37
279 // modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)
280 // every feature can have only one mode turned on at a time
281 enum { CAP_PROP_DC1394_OFF = -4, //turn the feature off (not controlled manually nor automatically)
282 CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user
283 CAP_PROP_DC1394_MODE_AUTO = -2,
284 CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,
285 CAP_PROP_DC1394_MAX = 31
289 // OpenNI map generators
290 enum { CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,
291 CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,
292 CAP_OPENNI_GENERATORS_MASK = CAP_OPENNI_DEPTH_GENERATOR + CAP_OPENNI_IMAGE_GENERATOR
295 // Properties of cameras available through OpenNI interfaces
296 enum { CAP_PROP_OPENNI_OUTPUT_MODE = 100,
297 CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm
298 CAP_PROP_OPENNI_BASELINE = 102, // in mm
299 CAP_PROP_OPENNI_FOCAL_LENGTH = 103, // in pixels
300 CAP_PROP_OPENNI_REGISTRATION = 104, // flag that synchronizes the remapping depth map to image map
301 // by changing depth generator's view point (if the flag is "on") or
302 // sets this view point to its normal one (if the flag is "off").
303 CAP_PROP_OPENNI_REGISTRATION_ON = CAP_PROP_OPENNI_REGISTRATION,
304 CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105,
305 CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106,
306 CAP_PROP_OPENNI_CIRCLE_BUFFER = 107,
307 CAP_PROP_OPENNI_MAX_TIME_DURATION = 108,
308 CAP_PROP_OPENNI_GENERATOR_PRESENT = 109
312 enum { CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
313 CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE,
314 CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE,
315 CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH,
316 CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION,
317 CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION
320 // OpenNI data given from depth generator
321 enum { CAP_OPENNI_DEPTH_MAP = 0, // Depth values in mm (CV_16UC1)
322 CAP_OPENNI_POINT_CLOUD_MAP = 1, // XYZ in meters (CV_32FC3)
323 CAP_OPENNI_DISPARITY_MAP = 2, // Disparity in pixels (CV_8UC1)
324 CAP_OPENNI_DISPARITY_MAP_32F = 3, // Disparity in pixels (CV_32FC1)
325 CAP_OPENNI_VALID_DEPTH_MASK = 4, // CV_8UC1
327 // Data given from RGB image generator
328 CAP_OPENNI_BGR_IMAGE = 5,
329 CAP_OPENNI_GRAY_IMAGE = 6
332 // Supported output modes of OpenNI image generator
333 enum { CAP_OPENNI_VGA_30HZ = 0,
334 CAP_OPENNI_SXGA_15HZ = 1,
335 CAP_OPENNI_SXGA_30HZ = 2,
336 CAP_OPENNI_QVGA_30HZ = 3,
337 CAP_OPENNI_QVGA_60HZ = 4
342 enum { CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200 // default is 1
347 enum { CAP_PROP_PVAPI_MULTICASTIP = 300, // ip for anable multicast master mode. 0 for disable multicast
348 CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301 // FrameStartTriggerMode: Determines how a frame is initiated
351 // PVAPI: FrameStartTriggerMode
352 enum { CAP_PVAPI_FSTRIGMODE_FREERUN = 0, // Freerun
353 CAP_PVAPI_FSTRIGMODE_SYNCIN1 = 1, // SyncIn1
354 CAP_PVAPI_FSTRIGMODE_SYNCIN2 = 2, // SyncIn2
355 CAP_PVAPI_FSTRIGMODE_FIXEDRATE = 3, // FixedRate
356 CAP_PVAPI_FSTRIGMODE_SOFTWARE = 4 // Software
359 // Properties of cameras available through XIMEA SDK interface
360 enum { CAP_PROP_XI_DOWNSAMPLING = 400, // Change image resolution by binning or skipping.
361 CAP_PROP_XI_DATA_FORMAT = 401, // Output data format.
362 CAP_PROP_XI_OFFSET_X = 402, // Horizontal offset from the origin to the area of interest (in pixels).
363 CAP_PROP_XI_OFFSET_Y = 403, // Vertical offset from the origin to the area of interest (in pixels).
364 CAP_PROP_XI_TRG_SOURCE = 404, // Defines source of trigger.
365 CAP_PROP_XI_TRG_SOFTWARE = 405, // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.
366 CAP_PROP_XI_GPI_SELECTOR = 406, // Selects general purpose input
367 CAP_PROP_XI_GPI_MODE = 407, // Set general purpose input mode
368 CAP_PROP_XI_GPI_LEVEL = 408, // Get general purpose level
369 CAP_PROP_XI_GPO_SELECTOR = 409, // Selects general purpose output
370 CAP_PROP_XI_GPO_MODE = 410, // Set general purpose output mode
371 CAP_PROP_XI_LED_SELECTOR = 411, // Selects camera signalling LED
372 CAP_PROP_XI_LED_MODE = 412, // Define camera signalling LED functionality
373 CAP_PROP_XI_MANUAL_WB = 413, // Calculates White Balance(must be called during acquisition)
374 CAP_PROP_XI_AUTO_WB = 414, // Automatic white balance
375 CAP_PROP_XI_AEAG = 415, // Automatic exposure/gain
376 CAP_PROP_XI_EXP_PRIORITY = 416, // Exposure priority (0.5 - exposure 50%, gain 50%).
377 CAP_PROP_XI_AE_MAX_LIMIT = 417, // Maximum limit of exposure in AEAG procedure
378 CAP_PROP_XI_AG_MAX_LIMIT = 418, // Maximum limit of gain in AEAG procedure
379 CAP_PROP_XI_AEAG_LEVEL = 419, // Average intensity of output signal AEAG should achieve(in %)
380 CAP_PROP_XI_TIMEOUT = 420 // Image capture timeout in milliseconds
384 // Properties for Android cameras
385 enum { CAP_PROP_ANDROID_AUTOGRAB = 1024,
386 CAP_PROP_ANDROID_PREVIEW_SIZES_STRING = 1025, // readonly, tricky property, returns const char* indeed
387 CAP_PROP_ANDROID_PREVIEW_FORMAT = 1026, // readonly, tricky property, returns const char* indeed
388 CAP_PROP_ANDROID_FLASH_MODE = 8001,
389 CAP_PROP_ANDROID_FOCUS_MODE = 8002,
390 CAP_PROP_ANDROID_WHITE_BALANCE = 8003,
391 CAP_PROP_ANDROID_ANTIBANDING = 8004,
392 CAP_PROP_ANDROID_FOCAL_LENGTH = 8005,
393 CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006,
394 CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007,
395 CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008
399 // Android camera output formats
400 enum { CAP_ANDROID_COLOR_FRAME_BGR = 0, //BGR
401 CAP_ANDROID_COLOR_FRAME = CAP_ANDROID_COLOR_FRAME_BGR,
402 CAP_ANDROID_GREY_FRAME = 1, //Y
403 CAP_ANDROID_COLOR_FRAME_RGB = 2,
404 CAP_ANDROID_COLOR_FRAME_BGRA = 3,
405 CAP_ANDROID_COLOR_FRAME_RGBA = 4
409 // Android camera flash modes
410 enum { CAP_ANDROID_FLASH_MODE_AUTO = 0,
411 CAP_ANDROID_FLASH_MODE_OFF = 1,
412 CAP_ANDROID_FLASH_MODE_ON = 2,
413 CAP_ANDROID_FLASH_MODE_RED_EYE = 3,
414 CAP_ANDROID_FLASH_MODE_TORCH = 4
418 // Android camera focus modes
419 enum { CAP_ANDROID_FOCUS_MODE_AUTO = 0,
420 CAP_ANDROID_FOCUS_MODE_CONTINUOUS_VIDEO = 1,
421 CAP_ANDROID_FOCUS_MODE_EDOF = 2,
422 CAP_ANDROID_FOCUS_MODE_FIXED = 3,
423 CAP_ANDROID_FOCUS_MODE_INFINITY = 4,
424 CAP_ANDROID_FOCUS_MODE_MACRO = 5
428 // Android camera white balance modes
429 enum { CAP_ANDROID_WHITE_BALANCE_AUTO = 0,
430 CAP_ANDROID_WHITE_BALANCE_CLOUDY_DAYLIGHT = 1,
431 CAP_ANDROID_WHITE_BALANCE_DAYLIGHT = 2,
432 CAP_ANDROID_WHITE_BALANCE_FLUORESCENT = 3,
433 CAP_ANDROID_WHITE_BALANCE_INCANDESCENT = 4,
434 CAP_ANDROID_WHITE_BALANCE_SHADE = 5,
435 CAP_ANDROID_WHITE_BALANCE_TWILIGHT = 6,
436 CAP_ANDROID_WHITE_BALANCE_WARM_FLUORESCENT = 7
440 // Android camera antibanding modes
441 enum { CAP_ANDROID_ANTIBANDING_50HZ = 0,
442 CAP_ANDROID_ANTIBANDING_60HZ = 1,
443 CAP_ANDROID_ANTIBANDING_AUTO = 2,
444 CAP_ANDROID_ANTIBANDING_OFF = 3
448 // Properties of cameras available through AVFOUNDATION interface
449 enum { CAP_PROP_IOS_DEVICE_FOCUS = 9001,
450 CAP_PROP_IOS_DEVICE_EXPOSURE = 9002,
451 CAP_PROP_IOS_DEVICE_FLASH = 9003,
452 CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004,
453 CAP_PROP_IOS_DEVICE_TORCH = 9005
457 // Properties of cameras available through Smartek Giganetix Ethernet Vision interface
458 /* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */
459 enum { CAP_PROP_GIGA_FRAME_OFFSET_X = 10001,
460 CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002,
461 CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003,
462 CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004,
463 CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005,
464 CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006
467 enum { CAP_PROP_INTELPERC_PROFILE_COUNT = 11001,
468 CAP_PROP_INTELPERC_PROFILE_IDX = 11002,
469 CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003,
470 CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004,
471 CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005,
472 CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006,
473 CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007
476 // Intel PerC streams
477 enum { CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29,
478 CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28,
479 CAP_INTELPERC_GENERATORS_MASK = CAP_INTELPERC_DEPTH_GENERATOR + CAP_INTELPERC_IMAGE_GENERATOR
482 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.
483 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.
484 CAP_INTELPERC_IR_MAP = 2, // Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam.
485 CAP_INTELPERC_IMAGE = 3
490 class CV_EXPORTS_W VideoCapture
493 CV_WRAP VideoCapture();
494 CV_WRAP VideoCapture(const String& filename);
495 CV_WRAP VideoCapture(int device);
497 virtual ~VideoCapture();
498 CV_WRAP virtual bool open(const String& filename);
499 CV_WRAP virtual bool open(int device);
500 CV_WRAP virtual bool isOpened() const;
501 CV_WRAP virtual void release();
503 CV_WRAP virtual bool grab();
504 CV_WRAP virtual bool retrieve(OutputArray image, int flag = 0);
505 virtual VideoCapture& operator >> (CV_OUT Mat& image);
506 virtual VideoCapture& operator >> (CV_OUT UMat& image);
507 CV_WRAP virtual bool read(OutputArray image);
509 CV_WRAP virtual bool set(int propId, double value);
510 CV_WRAP virtual double get(int propId);
514 Ptr<IVideoCapture> icap;
516 static Ptr<IVideoCapture> createCameraCapture(int index);
519 class CV_EXPORTS_W VideoWriter
522 CV_WRAP VideoWriter();
523 CV_WRAP VideoWriter(const String& filename, int fourcc, double fps,
524 Size frameSize, bool isColor = true);
526 virtual ~VideoWriter();
527 CV_WRAP virtual bool open(const String& filename, int fourcc, double fps,
528 Size frameSize, bool isColor = true);
529 CV_WRAP virtual bool isOpened() const;
530 CV_WRAP virtual void release();
531 virtual VideoWriter& operator << (const Mat& image);
532 CV_WRAP virtual void write(const Mat& image);
534 CV_WRAP static int fourcc(char c1, char c2, char c3, char c4);
537 Ptr<CvVideoWriter> writer;
540 template<> CV_EXPORTS void DefaultDeleter<CvCapture>::operator ()(CvCapture* obj) const;
541 template<> CV_EXPORTS void DefaultDeleter<CvVideoWriter>::operator ()(CvVideoWriter* obj) const;