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.
10 // Intel License Agreement
11 // For Open Source Computer Vision Library
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
19 // * Redistribution's of source code must retain the above copyright notice,
20 // this list of conditions and the following disclaimer.
22 // * Redistribution's in binary form must reproduce the above copyright notice,
23 // this list of conditions and the following disclaimer in the documentation
24 // and/or other materials provided with the distribution.
26 // * The name of Intel Corporation may not be used to endorse or promote products
27 // derived from this software without specific prior written permission.
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
42 #ifndef __OPENCV_HIGHGUI_H__
43 #define __OPENCV_HIGHGUI_H__
45 #include "opencv2/core/core_c.h"
49 #endif /* __cplusplus */
51 /****************************************************************************************\
52 * Basic GUI functions *
53 \****************************************************************************************/
55 //-----------New for Qt
57 enum { CV_FONT_LIGHT = 25,//QFont::Light,
58 CV_FONT_NORMAL = 50,//QFont::Normal,
59 CV_FONT_DEMIBOLD = 63,//QFont::DemiBold,
60 CV_FONT_BOLD = 75,//QFont::Bold,
61 CV_FONT_BLACK = 87 //QFont::Black
64 enum { CV_STYLE_NORMAL = 0,//QFont::StyleNormal,
65 CV_STYLE_ITALIC = 1,//QFont::StyleItalic,
66 CV_STYLE_OBLIQUE = 2 //QFont::StyleOblique
70 //for color cvScalar(blue_component, green_component, red\_component[, alpha_component])
71 //and alpha= 0 <-> 0xFF (not transparent <-> transparent)
72 CVAPI(CvFont) cvFontQt(const char* nameFont, int pointSize CV_DEFAULT(-1), CvScalar color CV_DEFAULT(cvScalarAll(0)), int weight CV_DEFAULT(CV_FONT_NORMAL), int style CV_DEFAULT(CV_STYLE_NORMAL), int spacing CV_DEFAULT(0));
74 CVAPI(void) cvAddText(const CvArr* img, const char* text, CvPoint org, CvFont *arg2);
76 CVAPI(void) cvDisplayOverlay(const char* name, const char* text, int delayms CV_DEFAULT(0));
77 CVAPI(void) cvDisplayStatusBar(const char* name, const char* text, int delayms CV_DEFAULT(0));
79 CVAPI(void) cvSaveWindowParameters(const char* name);
80 CVAPI(void) cvLoadWindowParameters(const char* name);
81 CVAPI(int) cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]);
82 CVAPI(void) cvStopLoop( void );
84 typedef void (CV_CDECL *CvButtonCallback)(int state, void* userdata);
85 enum {CV_PUSH_BUTTON = 0, CV_CHECKBOX = 1, CV_RADIOBOX = 2};
86 CVAPI(int) cvCreateButton( const char* button_name CV_DEFAULT(NULL),CvButtonCallback on_change CV_DEFAULT(NULL), void* userdata CV_DEFAULT(NULL) , int button_type CV_DEFAULT(CV_PUSH_BUTTON), int initial_button_state CV_DEFAULT(0));
87 //----------------------
90 /* this function is used to set some external parameters in case of X Window */
91 CVAPI(int) cvInitSystem( int argc, char** argv );
93 CVAPI(int) cvStartWindowThread( void );
95 // --------- YV ---------
98 //These 3 flags are used by cvSet/GetWindowProperty
99 CV_WND_PROP_FULLSCREEN = 0, //to change/get window's fullscreen property
100 CV_WND_PROP_AUTOSIZE = 1, //to change/get window's autosize property
101 CV_WND_PROP_ASPECTRATIO= 2, //to change/get window's aspectratio property
102 CV_WND_PROP_OPENGL = 3, //to change/get window's opengl support
104 //These 2 flags are used by cvNamedWindow and cvSet/GetWindowProperty
105 CV_WINDOW_NORMAL = 0x00000000, //the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size
106 CV_WINDOW_AUTOSIZE = 0x00000001, //the user cannot resize the window, the size is constrainted by the image displayed
107 CV_WINDOW_OPENGL = 0x00001000, //window with opengl support
109 //Those flags are only for Qt
110 CV_GUI_EXPANDED = 0x00000000, //status bar and tool bar
111 CV_GUI_NORMAL = 0x00000010, //old fashious way
113 //These 3 flags are used by cvNamedWindow and cvSet/GetWindowProperty
114 CV_WINDOW_FULLSCREEN = 1,//change the window to fullscreen
115 CV_WINDOW_FREERATIO = 0x00000100,//the image expends as much as it can (no ratio constraint)
116 CV_WINDOW_KEEPRATIO = 0x00000000//the ration image is respected.
120 CVAPI(int) cvNamedWindow( const char* name, int flags CV_DEFAULT(CV_WINDOW_AUTOSIZE) );
122 /* Set and Get Property of the window */
123 CVAPI(void) cvSetWindowProperty(const char* name, int prop_id, double prop_value);
124 CVAPI(double) cvGetWindowProperty(const char* name, int prop_id);
126 /* display image within window (highgui windows remember their content) */
127 CVAPI(void) cvShowImage( const char* name, const CvArr* image );
129 /* resize/move window */
130 CVAPI(void) cvResizeWindow( const char* name, int width, int height );
131 CVAPI(void) cvMoveWindow( const char* name, int x, int y );
134 /* destroy window and all the trackers associated with it */
135 CVAPI(void) cvDestroyWindow( const char* name );
137 CVAPI(void) cvDestroyAllWindows(void);
139 /* get native window handle (HWND in case of Win32 and Widget in case of X Window) */
140 CVAPI(void*) cvGetWindowHandle( const char* name );
142 /* get name of highgui window given its native handle */
143 CVAPI(const char*) cvGetWindowName( void* window_handle );
146 typedef void (CV_CDECL *CvTrackbarCallback)(int pos);
148 /* create trackbar and display it on top of given window, set callback */
149 CVAPI(int) cvCreateTrackbar( const char* trackbar_name, const char* window_name,
150 int* value, int count, CvTrackbarCallback on_change CV_DEFAULT(NULL));
152 typedef void (CV_CDECL *CvTrackbarCallback2)(int pos, void* userdata);
154 CVAPI(int) cvCreateTrackbar2( const char* trackbar_name, const char* window_name,
155 int* value, int count, CvTrackbarCallback2 on_change,
156 void* userdata CV_DEFAULT(0));
158 /* retrieve or set trackbar position */
159 CVAPI(int) cvGetTrackbarPos( const char* trackbar_name, const char* window_name );
160 CVAPI(void) cvSetTrackbarPos( const char* trackbar_name, const char* window_name, int pos );
164 CV_EVENT_MOUSEMOVE =0,
165 CV_EVENT_LBUTTONDOWN =1,
166 CV_EVENT_RBUTTONDOWN =2,
167 CV_EVENT_MBUTTONDOWN =3,
168 CV_EVENT_LBUTTONUP =4,
169 CV_EVENT_RBUTTONUP =5,
170 CV_EVENT_MBUTTONUP =6,
171 CV_EVENT_LBUTTONDBLCLK =7,
172 CV_EVENT_RBUTTONDBLCLK =8,
173 CV_EVENT_MBUTTONDBLCLK =9
178 CV_EVENT_FLAG_LBUTTON =1,
179 CV_EVENT_FLAG_RBUTTON =2,
180 CV_EVENT_FLAG_MBUTTON =4,
181 CV_EVENT_FLAG_CTRLKEY =8,
182 CV_EVENT_FLAG_SHIFTKEY =16,
183 CV_EVENT_FLAG_ALTKEY =32
186 typedef void (CV_CDECL *CvMouseCallback )(int event, int x, int y, int flags, void* param);
188 /* assign callback for mouse events */
189 CVAPI(void) cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse,
190 void* param CV_DEFAULT(NULL));
194 /* 8bit, color or not */
195 CV_LOAD_IMAGE_UNCHANGED =-1,
197 CV_LOAD_IMAGE_GRAYSCALE =0,
199 CV_LOAD_IMAGE_COLOR =1,
201 CV_LOAD_IMAGE_ANYDEPTH =2,
203 CV_LOAD_IMAGE_ANYCOLOR =4
206 /* load image from file
207 iscolor can be a combination of above flags where CV_LOAD_IMAGE_UNCHANGED
208 overrides the other flags
209 using CV_LOAD_IMAGE_ANYCOLOR alone is equivalent to CV_LOAD_IMAGE_UNCHANGED
210 unless CV_LOAD_IMAGE_ANYDEPTH is specified images are converted to 8bit
212 CVAPI(IplImage*) cvLoadImage( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
213 CVAPI(CvMat*) cvLoadImageM( const char* filename, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
217 CV_IMWRITE_JPEG_QUALITY =1,
218 CV_IMWRITE_PNG_COMPRESSION =16,
219 CV_IMWRITE_PNG_STRATEGY =17,
220 CV_IMWRITE_PNG_BILEVEL =18,
221 CV_IMWRITE_PNG_STRATEGY_DEFAULT =0,
222 CV_IMWRITE_PNG_STRATEGY_FILTERED =1,
223 CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2,
224 CV_IMWRITE_PNG_STRATEGY_RLE =3,
225 CV_IMWRITE_PNG_STRATEGY_FIXED =4,
226 CV_IMWRITE_PXM_BINARY =32
229 /* save image to file */
230 CVAPI(int) cvSaveImage( const char* filename, const CvArr* image,
231 const int* params CV_DEFAULT(0) );
233 /* decode image stored in the buffer */
234 CVAPI(IplImage*) cvDecodeImage( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
235 CVAPI(CvMat*) cvDecodeImageM( const CvMat* buf, int iscolor CV_DEFAULT(CV_LOAD_IMAGE_COLOR));
237 /* encode image and store the result as a byte vector (single-row 8uC1 matrix) */
238 CVAPI(CvMat*) cvEncodeImage( const char* ext, const CvArr* image,
239 const int* params CV_DEFAULT(0) );
247 /* utility function: convert one image to another with optional vertical flip */
248 CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0));
250 /* wait for key event infinitely (delay<=0) or for "delay" milliseconds */
251 CVAPI(int) cvWaitKey(int delay CV_DEFAULT(0));
255 typedef void (CV_CDECL *CvOpenGlDrawCallback)(void* userdata);
256 CVAPI(void) cvSetOpenGlDrawCallback(const char* window_name, CvOpenGlDrawCallback callback, void* userdata CV_DEFAULT(NULL));
258 CVAPI(void) cvSetOpenGlContext(const char* window_name);
259 CVAPI(void) cvUpdateWindow(const char* window_name);
262 /****************************************************************************************\
263 * Working with Video Files and Cameras *
264 \****************************************************************************************/
266 /* "black box" capture structure */
267 typedef struct CvCapture CvCapture;
269 /* start capturing frames from video file */
270 CVAPI(CvCapture*) cvCreateFileCapture( const char* filename );
274 CV_CAP_ANY =0, // autodetect
276 CV_CAP_MIL =100, // MIL proprietary drivers
278 CV_CAP_VFW =200, // platform native
282 CV_CAP_FIREWARE =300, // IEEE 1394 drivers
283 CV_CAP_FIREWIRE =300,
284 CV_CAP_IEEE1394 =300,
288 CV_CAP_STEREO =400, // TYZX proprietary drivers
295 CV_CAP_QT =500, // QuickTime
297 CV_CAP_UNICAP =600, // Unicap drivers
299 CV_CAP_DSHOW =700, // DirectShow (via videoInput)
300 CV_CAP_MSMF =1400, // Microsoft Media Foundation (via videoInput)
302 CV_CAP_PVAPI =800, // PvAPI, Prosilica GigE SDK
304 CV_CAP_OPENNI =900, // OpenNI (for Kinect)
305 CV_CAP_OPENNI_ASUS =910, // OpenNI (for Asus Xtion)
307 CV_CAP_ANDROID =1000, // Android
308 CV_CAP_ANDROID_BACK =CV_CAP_ANDROID+99, // Android back camera
309 CV_CAP_ANDROID_FRONT =CV_CAP_ANDROID+98, // Android front camera
311 CV_CAP_XIAPI =1100, // XIMEA Camera API
313 CV_CAP_AVFOUNDATION = 1200, // AVFoundation framework for iOS (OS X Lion will have the same API)
315 CV_CAP_GIGANETIX = 1300 // Smartek Giganetix GigEVisionSDK
318 /* start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) */
319 CVAPI(CvCapture*) cvCreateCameraCapture( int index );
321 /* grab a frame, return 1 on success, 0 on fail.
322 this function is thought to be fast */
323 CVAPI(int) cvGrabFrame( CvCapture* capture );
325 /* get the frame grabbed with cvGrabFrame(..)
326 This function may apply some frame processing like
327 frame decompression, flipping etc.
328 !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */
329 CVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture, int streamIdx CV_DEFAULT(0) );
331 /* Just a combination of cvGrabFrame and cvRetrieveFrame
332 !!!DO NOT RELEASE or MODIFY the retrieved frame!!! */
333 CVAPI(IplImage*) cvQueryFrame( CvCapture* capture );
335 /* stop capturing/reading and free resources */
336 CVAPI(void) cvReleaseCapture( CvCapture** capture );
340 // modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode)
341 // every feature can have only one mode turned on at a time
342 CV_CAP_PROP_DC1394_OFF = -4, //turn the feature off (not controlled manually nor automatically)
343 CV_CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user
344 CV_CAP_PROP_DC1394_MODE_AUTO = -2,
345 CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1,
346 CV_CAP_PROP_POS_MSEC =0,
347 CV_CAP_PROP_POS_FRAMES =1,
348 CV_CAP_PROP_POS_AVI_RATIO =2,
349 CV_CAP_PROP_FRAME_WIDTH =3,
350 CV_CAP_PROP_FRAME_HEIGHT =4,
352 CV_CAP_PROP_FOURCC =6,
353 CV_CAP_PROP_FRAME_COUNT =7,
354 CV_CAP_PROP_FORMAT =8,
356 CV_CAP_PROP_BRIGHTNESS =10,
357 CV_CAP_PROP_CONTRAST =11,
358 CV_CAP_PROP_SATURATION =12,
360 CV_CAP_PROP_GAIN =14,
361 CV_CAP_PROP_EXPOSURE =15,
362 CV_CAP_PROP_CONVERT_RGB =16,
363 CV_CAP_PROP_WHITE_BALANCE_BLUE_U =17,
364 CV_CAP_PROP_RECTIFICATION =18,
365 CV_CAP_PROP_MONOCROME =19,
366 CV_CAP_PROP_SHARPNESS =20,
367 CV_CAP_PROP_AUTO_EXPOSURE =21, // exposure control done by camera,
368 // user can adjust refernce level
369 // using this feature
370 CV_CAP_PROP_GAMMA =22,
371 CV_CAP_PROP_TEMPERATURE =23,
372 CV_CAP_PROP_TRIGGER =24,
373 CV_CAP_PROP_TRIGGER_DELAY =25,
374 CV_CAP_PROP_WHITE_BALANCE_RED_V =26,
375 CV_CAP_PROP_ZOOM =27,
376 CV_CAP_PROP_FOCUS =28,
377 CV_CAP_PROP_GUID =29,
378 CV_CAP_PROP_ISO_SPEED =30,
379 CV_CAP_PROP_MAX_DC1394 =31,
380 CV_CAP_PROP_BACKLIGHT =32,
382 CV_CAP_PROP_TILT =34,
383 CV_CAP_PROP_ROLL =35,
384 CV_CAP_PROP_IRIS =36,
385 CV_CAP_PROP_SETTINGS =37,
387 CV_CAP_PROP_AUTOGRAB =1024, // property for highgui class CvCapture_Android only
388 CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING=1025, // readonly, tricky property, returns cpnst char* indeed
389 CV_CAP_PROP_PREVIEW_FORMAT=1026, // readonly, tricky property, returns cpnst char* indeed
391 // OpenNI map generators
392 CV_CAP_OPENNI_DEPTH_GENERATOR = 1 << 31,
393 CV_CAP_OPENNI_IMAGE_GENERATOR = 1 << 30,
394 CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR,
396 // Properties of cameras available through OpenNI interfaces
397 CV_CAP_PROP_OPENNI_OUTPUT_MODE = 100,
398 CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm
399 CV_CAP_PROP_OPENNI_BASELINE = 102, // in mm
400 CV_CAP_PROP_OPENNI_FOCAL_LENGTH = 103, // in pixels
401 CV_CAP_PROP_OPENNI_REGISTRATION = 104, // flag
402 CV_CAP_PROP_OPENNI_REGISTRATION_ON = CV_CAP_PROP_OPENNI_REGISTRATION, // flag that synchronizes the remapping depth map to image map
403 // by changing depth generator's view point (if the flag is "on") or
404 // sets this view point to its normal one (if the flag is "off").
405 CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105,
406 CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106,
407 CV_CAP_PROP_OPENNI_CIRCLE_BUFFER = 107,
408 CV_CAP_PROP_OPENNI_MAX_TIME_DURATION = 108,
410 CV_CAP_PROP_OPENNI_GENERATOR_PRESENT = 109,
412 CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT,
413 CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE,
414 CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE,
415 CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH,
416 CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION,
417 CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION,
419 // Properties of cameras available through GStreamer interface
420 CV_CAP_GSTREAMER_QUEUE_LENGTH = 200, // default is 1
421 CV_CAP_PROP_PVAPI_MULTICASTIP = 300, // ip for anable multicast master mode. 0 for disable multicast
423 // Properties of cameras available through XIMEA SDK interface
424 CV_CAP_PROP_XI_DOWNSAMPLING = 400, // Change image resolution by binning or skipping.
425 CV_CAP_PROP_XI_DATA_FORMAT = 401, // Output data format.
426 CV_CAP_PROP_XI_OFFSET_X = 402, // Horizontal offset from the origin to the area of interest (in pixels).
427 CV_CAP_PROP_XI_OFFSET_Y = 403, // Vertical offset from the origin to the area of interest (in pixels).
428 CV_CAP_PROP_XI_TRG_SOURCE = 404, // Defines source of trigger.
429 CV_CAP_PROP_XI_TRG_SOFTWARE = 405, // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE.
430 CV_CAP_PROP_XI_GPI_SELECTOR = 406, // Selects general purpose input
431 CV_CAP_PROP_XI_GPI_MODE = 407, // Set general purpose input mode
432 CV_CAP_PROP_XI_GPI_LEVEL = 408, // Get general purpose level
433 CV_CAP_PROP_XI_GPO_SELECTOR = 409, // Selects general purpose output
434 CV_CAP_PROP_XI_GPO_MODE = 410, // Set general purpose output mode
435 CV_CAP_PROP_XI_LED_SELECTOR = 411, // Selects camera signalling LED
436 CV_CAP_PROP_XI_LED_MODE = 412, // Define camera signalling LED functionality
437 CV_CAP_PROP_XI_MANUAL_WB = 413, // Calculates White Balance(must be called during acquisition)
438 CV_CAP_PROP_XI_AUTO_WB = 414, // Automatic white balance
439 CV_CAP_PROP_XI_AEAG = 415, // Automatic exposure/gain
440 CV_CAP_PROP_XI_EXP_PRIORITY = 416, // Exposure priority (0.5 - exposure 50%, gain 50%).
441 CV_CAP_PROP_XI_AE_MAX_LIMIT = 417, // Maximum limit of exposure in AEAG procedure
442 CV_CAP_PROP_XI_AG_MAX_LIMIT = 418, // Maximum limit of gain in AEAG procedure
443 CV_CAP_PROP_XI_AEAG_LEVEL = 419, // Average intensity of output signal AEAG should achieve(in %)
444 CV_CAP_PROP_XI_TIMEOUT = 420, // Image capture timeout in milliseconds
446 // Properties for Android cameras
447 CV_CAP_PROP_ANDROID_FLASH_MODE = 8001,
448 CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002,
449 CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003,
450 CV_CAP_PROP_ANDROID_ANTIBANDING = 8004,
451 CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005,
452 CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006,
453 CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007,
454 CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008,
456 // Properties of cameras available through AVFOUNDATION interface
457 CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001,
458 CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002,
459 CV_CAP_PROP_IOS_DEVICE_FLASH = 9003,
460 CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004,
461 CV_CAP_PROP_IOS_DEVICE_TORCH = 9005
463 // Properties of cameras available through Smartek Giganetix Ethernet Vision interface
464 /* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */
465 ,CV_CAP_PROP_GIGA_FRAME_OFFSET_X = 10001,
466 CV_CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002,
467 CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003,
468 CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004,
469 CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005,
470 CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006
475 // Data given from depth generator.
476 CV_CAP_OPENNI_DEPTH_MAP = 0, // Depth values in mm (CV_16UC1)
477 CV_CAP_OPENNI_POINT_CLOUD_MAP = 1, // XYZ in meters (CV_32FC3)
478 CV_CAP_OPENNI_DISPARITY_MAP = 2, // Disparity in pixels (CV_8UC1)
479 CV_CAP_OPENNI_DISPARITY_MAP_32F = 3, // Disparity in pixels (CV_32FC1)
480 CV_CAP_OPENNI_VALID_DEPTH_MASK = 4, // CV_8UC1
482 // Data given from RGB image generator.
483 CV_CAP_OPENNI_BGR_IMAGE = 5,
484 CV_CAP_OPENNI_GRAY_IMAGE = 6
487 // Supported output modes of OpenNI image generator
490 CV_CAP_OPENNI_VGA_30HZ = 0,
491 CV_CAP_OPENNI_SXGA_15HZ = 1,
492 CV_CAP_OPENNI_SXGA_30HZ = 2,
493 CV_CAP_OPENNI_QVGA_30HZ = 3,
494 CV_CAP_OPENNI_QVGA_60HZ = 4
497 //supported by Android camera output formats
500 CV_CAP_ANDROID_COLOR_FRAME_BGR = 0, //BGR
501 CV_CAP_ANDROID_COLOR_FRAME = CV_CAP_ANDROID_COLOR_FRAME_BGR,
502 CV_CAP_ANDROID_GREY_FRAME = 1, //Y
503 CV_CAP_ANDROID_COLOR_FRAME_RGB = 2,
504 CV_CAP_ANDROID_COLOR_FRAME_BGRA = 3,
505 CV_CAP_ANDROID_COLOR_FRAME_RGBA = 4
508 // supported Android camera flash modes
511 CV_CAP_ANDROID_FLASH_MODE_AUTO = 0,
512 CV_CAP_ANDROID_FLASH_MODE_OFF,
513 CV_CAP_ANDROID_FLASH_MODE_ON,
514 CV_CAP_ANDROID_FLASH_MODE_RED_EYE,
515 CV_CAP_ANDROID_FLASH_MODE_TORCH
518 // supported Android camera focus modes
521 CV_CAP_ANDROID_FOCUS_MODE_AUTO = 0,
522 CV_CAP_ANDROID_FOCUS_MODE_CONTINUOUS_VIDEO,
523 CV_CAP_ANDROID_FOCUS_MODE_EDOF,
524 CV_CAP_ANDROID_FOCUS_MODE_FIXED,
525 CV_CAP_ANDROID_FOCUS_MODE_INFINITY,
526 CV_CAP_ANDROID_FOCUS_MODE_MACRO
529 // supported Android camera white balance modes
532 CV_CAP_ANDROID_WHITE_BALANCE_AUTO = 0,
533 CV_CAP_ANDROID_WHITE_BALANCE_CLOUDY_DAYLIGHT,
534 CV_CAP_ANDROID_WHITE_BALANCE_DAYLIGHT,
535 CV_CAP_ANDROID_WHITE_BALANCE_FLUORESCENT,
536 CV_CAP_ANDROID_WHITE_BALANCE_INCANDESCENT,
537 CV_CAP_ANDROID_WHITE_BALANCE_SHADE,
538 CV_CAP_ANDROID_WHITE_BALANCE_TWILIGHT,
539 CV_CAP_ANDROID_WHITE_BALANCE_WARM_FLUORESCENT
542 // supported Android camera antibanding modes
545 CV_CAP_ANDROID_ANTIBANDING_50HZ = 0,
546 CV_CAP_ANDROID_ANTIBANDING_60HZ,
547 CV_CAP_ANDROID_ANTIBANDING_AUTO,
548 CV_CAP_ANDROID_ANTIBANDING_OFF
551 /* retrieve or set capture properties */
552 CVAPI(double) cvGetCaptureProperty( CvCapture* capture, int property_id );
553 CVAPI(int) cvSetCaptureProperty( CvCapture* capture, int property_id, double value );
555 // Return the type of the capturer (eg, CV_CAP_V4W, CV_CAP_UNICAP), which is unknown if created with CV_CAP_ANY
556 CVAPI(int) cvGetCaptureDomain( CvCapture* capture);
558 /* "black box" video file writer structure */
559 typedef struct CvVideoWriter CvVideoWriter;
561 #define CV_FOURCC_MACRO(c1, c2, c3, c4) (((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24))
563 CV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4)
565 return CV_FOURCC_MACRO(c1, c2, c3, c4);
568 #define CV_FOURCC_PROMPT -1 /* Open Codec Selection Dialog (Windows only) */
569 #define CV_FOURCC_DEFAULT CV_FOURCC('I', 'Y', 'U', 'V') /* Use default codec for specified filename (Linux only) */
571 /* initialize video file writer */
572 CVAPI(CvVideoWriter*) cvCreateVideoWriter( const char* filename, int fourcc,
573 double fps, CvSize frame_size,
574 int is_color CV_DEFAULT(1));
576 //CVAPI(CvVideoWriter*) cvCreateImageSequenceWriter( const char* filename,
577 // int is_color CV_DEFAULT(1));
579 /* write frame to video file */
580 CVAPI(int) cvWriteFrame( CvVideoWriter* writer, const IplImage* image );
582 /* close video file writer */
583 CVAPI(void) cvReleaseVideoWriter( CvVideoWriter** writer );
585 /****************************************************************************************\
586 * Obsolete functions/synonyms *
587 \****************************************************************************************/
589 #define cvCaptureFromFile cvCreateFileCapture
590 #define cvCaptureFromCAM cvCreateCameraCapture
591 #define cvCaptureFromAVI cvCaptureFromFile
592 #define cvCreateAVIWriter cvCreateVideoWriter
593 #define cvWriteToAVI cvWriteFrame
594 #define cvAddSearchPath(path)
595 #define cvvInitSystem cvInitSystem
596 #define cvvNamedWindow cvNamedWindow
597 #define cvvShowImage cvShowImage
598 #define cvvResizeWindow cvResizeWindow
599 #define cvvDestroyWindow cvDestroyWindow
600 #define cvvCreateTrackbar cvCreateTrackbar
601 #define cvvLoadImage(name) cvLoadImage((name),1)
602 #define cvvSaveImage cvSaveImage
603 #define cvvAddSearchPath cvAddSearchPath
604 #define cvvWaitKey(name) cvWaitKey(0)
605 #define cvvWaitKeyEx(name,delay) cvWaitKey(delay)
606 #define cvvConvertImage cvConvertImage
607 #define HG_AUTOSIZE CV_WINDOW_AUTOSIZE
608 #define set_preprocess_func cvSetPreprocessFuncWin32
609 #define set_postprocess_func cvSetPostprocessFuncWin32
611 #if defined WIN32 || defined _WIN32
613 CVAPI(void) cvSetPreprocessFuncWin32_(const void* callback);
614 CVAPI(void) cvSetPostprocessFuncWin32_(const void* callback);
615 #define cvSetPreprocessFuncWin32(callback) cvSetPreprocessFuncWin32_((const void*)(callback))
616 #define cvSetPostprocessFuncWin32(callback) cvSetPostprocessFuncWin32_((const void*)(callback))