Move the sources to trunk
[opencv] / docs / ref / opencvref_highgui.htm
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2 <html><head>
3 <link rel="STYLESHEET" href="opencvref.css" charset="ISO-8859-1" type="text/css">
4 <title>OpenCV: HighGUI Reference Manual</title>
5 </head><body>
6
7 <h1>HighGUI Reference Manual</h1>
8
9 <hr><ul>
10 <li><a href="#highgui_gui">Simple GUI</a>
11 <li><a href="#highgui_loadsave">Loading and Saving Images</a>
12 <li><a href="#highgui_video">Video I/O</a>
13 <li><a href="#highgui_utils">Utility and System Functions</a>
14 <li><a href="#highgui_func_index">Alphabetical List of Functions</a>
15 </ul>
16
17
18 <hr><h2><a name="highgui_overview">HighGUI overview</a></h2>
19
20 <p>TODO</p>
21
22 <hr><h2><a name="highgui_gui">Simple GUI</a></h2>
23
24 <hr><h3><a name="decl_cvNamedWindow">cvNamedWindow</a></h3>
25 <p class="Blurb">Creates window</p>
26 <pre>
27 int cvNamedWindow( const char* name, int flags=CV_WINDOW_AUTOSIZE );
28 </pre><dl>
29 <dt>name<dd>Name of the window which is used as window identifier and appears in
30 the window caption.
31 <dt>flags<dd>Flags of the window. Currently the only
32 supported flag is <code>CV_WINDOW_AUTOSIZE</code>. If it is set,
33 window size is automatically adjusted to fit the displayed image
34 (see <a href="#decl_cvShowImage">cvShowImage</a>), while user can not change
35 the window size manually.
36 </dl><p>
37 The function <code>cvNamedWindow</code>
38 creates a window which can be used as a placeholder for images and trackbars.
39 Created windows are referred by their names.
40 </p><p>
41 If the window with such a name already exists, the function does nothing.</p>
42
43
44 <hr><h3><a name="decl_cvDestroyWindow">cvDestroyWindow</a></h3>
45 <p class="Blurb">Destroys a window</p>
46 <pre>
47 void cvDestroyWindow( const char* name );
48 </pre><dl>
49 <dt>name<dd>Name of the window to be destroyed.
50 </dl>
51 <p>
52 The function <code>cvDestroyWindow</code>
53 destroys the window with a given name.
54 </p>
55
56
57 <hr><h3><a name="decl_cvDestroyAllWindows">cvDestroyAllWindows</a></h3>
58 <p class="Blurb">Destroys all the HighGUI windows</p>
59 <pre>
60 void cvDestroyAllWindows(void);
61 </pre>
62 <p>
63 The function <code>cvDestroyAllWindows</code>
64 destroys all the opened HighGUI windows.
65 </p>
66
67
68 <hr><h3><a name="decl_cvResizeWindow">cvResizeWindow</a></h3>
69 <p class="Blurb">Sets window size</p>
70 <pre>
71 void cvResizeWindow( const char* name, int width, int height );
72 </pre><dl>
73 <dt>name<dd>Name of the window to be resized.
74 <dt>width<dd>New width
75 <dt>height<dd>New height
76 </dl><p>
77 The function <code>cvResizeWindow</code> changes size of the window.
78 </p>
79
80
81 <hr><h3><a name="decl_cvMoveWindow">cvMoveWindow</a></h3>
82 <p class="Blurb">Sets window position</p>
83 <pre>
84 void cvMoveWindow( const char* name, int x, int y );
85 </pre><dl>
86 <dt>name<dd>Name of the window to be resized.
87 <dt>x<dd>New x coordinate of top-left corner
88 <dt>y<dd>New y coordinate of top-left corner
89 </dl><p>
90 The function <code>cvMoveWindow</code> changes position of the window.
91 </p>
92
93
94 <hr><h3><a name="decl_cvGetWindowHandle">cvGetWindowHandle</a></h3>
95 <p class="Blurb">Gets window handle by name</p>
96 <pre>
97 void* cvGetWindowHandle( const char* name );
98 </pre><dl>
99 <dt>name<dd>Name of the window.
100 </dl><p>
101 The function <code>cvGetWindowHandle</code>
102 returns native window handle (HWND in case of Win32 and GtkWidget in case of GTK+).
103 </p>
104
105
106 <hr><h3><a name="decl_cvGetWindowName">cvGetWindowName</a></h3>
107 <p class="Blurb">Gets window name by handle</p>
108 <pre>
109 const char* cvGetWindowName( void* window_handle );
110 </pre><dl>
111 <dt>window_handle<dd>Handle of the window.
112 </dl><p>
113 The function <code>cvGetWindowName</code>
114 returns the name of window given its native handle
115 (HWND in case of Win32 and GtkWidget in case of GTK+).
116 </p>
117
118
119 <hr>
120 <h3><a name="decl_cvShowImage">cvShowImage</a></h3>
121 <p class="Blurb">Shows the image in the specified window</p>
122 <pre>
123 void cvShowImage( const char* name, const CvArr* image );
124 </pre><dl>
125 <dt>name<dd>Name of the window.
126 <dt>image<dd>Image to be shown.
127 </dl><p>
128 The function <code>cvShowImage</code>
129 shows the image in the specified window. If the window was created with <code>CV_WINDOW_AUTOSIZE</code>
130 flag then the image is shown with its original size, otherwise
131 the image is scaled to fit the window.
132 </p>
133
134
135 <hr><h3><a name="decl_cvCreateTrackbar">cvCreateTrackbar</a></h3>
136 <p class="Blurb">Creates the trackbar and attaches it to the specified window</p>
137 <pre>
138 CV_EXTERN_C_FUNCPTR( void (*CvTrackbarCallback)(int pos) );
139
140 int cvCreateTrackbar( const char* trackbar_name, const char* window_name,
141                       int* value, int count, CvTrackbarCallback on_change );
142 </pre><dl>
143 <dt>trackbar_name<dd>Name of created trackbar.
144 <dt>window_name<dd>Name of the window which will e used as a parent for created trackbar.
145 <dt>value<dd>Pointer to the integer variable, which value will reflect the position of the slider.
146   Upon the creation the slider position is defined by this variable.
147 <dt>count<dd>Maximal position of the slider. Minimal position is always 0.
148 <dt>on_change<dd>Pointer to the function to be called every time the slider changes the position. This
149   function should be prototyped as <code>void Foo(int);</code>Can be NULL if
150   callback is not required.
151 </dl><p>
152 The function <code>cvCreateTrackbar</code>
153 creates the trackbar (a.k.a. slider or range control) with the specified name and range,
154 assigns the variable to be synchronized with trackbar position and specifies callback function
155 to be called on trackbar position change. The created trackbar is displayed on top
156 of given window.</p>
157
158
159 <hr><h3><a name="decl_cvGetTrackbarPos">cvGetTrackbarPos</a></h3>
160 <p class="Blurb">Retrieves trackbar position</p>
161 <pre>
162 int cvGetTrackbarPos( const char* trackbar_name, const char* window_name );
163 </pre><dl>
164 <dt>trackbar_name<dd>Name of trackbar.
165 <dt>window_name<dd>Name of the window which is the parent of trackbar.
166 </dl><p>
167 The function <code>cvGetTrackbarPos</code>
168 returns the current position of the specified trackbar.</p>
169
170
171 <hr><h3><a name="decl_cvSetTrackbarPos">cvSetTrackbarPos</a></h3>
172 <p class="Blurb">Sets trackbar position</p>
173 <pre>
174 void cvSetTrackbarPos( const char* trackbar_name, const char* window_name, int pos );
175 </pre><dl>
176 <dt>trackbar_name<dd>Name of trackbar.
177 <dt>window_name<dd>Name of the window which is the parent of trackbar.
178 <dt>pos<dd>New position.
179 </dl><p>
180 The function <code>cvSetTrackbarPos</code>
181   sets the position of the specified trackbar.</p>
182
183
184 <hr><h3><a name="decl_cvSetMouseCallback">cvSetMouseCallback</a></h3>
185 <p class="Blurb">Assigns callback for mouse events</p>
186 <pre>
187 #define CV_EVENT_MOUSEMOVE      0
188 #define CV_EVENT_LBUTTONDOWN    1
189 #define CV_EVENT_RBUTTONDOWN    2
190 #define CV_EVENT_MBUTTONDOWN    3
191 #define CV_EVENT_LBUTTONUP      4
192 #define CV_EVENT_RBUTTONUP      5
193 #define CV_EVENT_MBUTTONUP      6
194 #define CV_EVENT_LBUTTONDBLCLK  7
195 #define CV_EVENT_RBUTTONDBLCLK  8
196 #define CV_EVENT_MBUTTONDBLCLK  9
197
198 #define CV_EVENT_FLAG_LBUTTON   1
199 #define CV_EVENT_FLAG_RBUTTON   2
200 #define CV_EVENT_FLAG_MBUTTON   4
201 #define CV_EVENT_FLAG_CTRLKEY   8
202 #define CV_EVENT_FLAG_SHIFTKEY  16
203 #define CV_EVENT_FLAG_ALTKEY    32
204
205 CV_EXTERN_C_FUNCPTR( void (*CvMouseCallback )(int event, int x, int y, int flags, void* param) );
206
207 void cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse, void* param=NULL );
208 </pre><dl>
209 <dt>window_name<dd>Name of the window.
210 <dt>on_mouse<dd>Pointer to the function to be called every time mouse event occurs
211                 in the specified window. This function should be prototyped as
212   <pre>void Foo(int event, int x, int y, int flags, void* param);</pre>
213   where <code>event</code> is one of <code>CV_EVENT_*</code>,
214   <code>x</code> and <code>y</code> are coordinates of mouse pointer in image coordinates
215   (not window coordinates), <code>flags</code> is a combination of <code>CV_EVENT_FLAG</code>,
216   and <code>param</code> is a user-defined parameter passed to the
217   <code>cvSetMouseCallback</code> function call.
218 <dt>param<dd>User-defined parameter to be passed to the callback function.
219 </dl><p>
220 The function <code>cvSetMouseCallback</code>
221 sets the callback function for mouse events occurring within the specified
222 window. To see how it works, look at <a href="../../samples/c/ffilldemo.c">
223 opencv/samples/c/ffilldemo.c</a> demo</p>
224
225
226 <hr><h3><a name="decl_cvWaitKey">cvWaitKey</a></h3>
227 <p class="Blurb">Waits for a pressed key</p>
228 <pre>
229 int cvWaitKey( int delay=0 );
230 </pre><dl>
231 <dt>delay<dd>Delay in milliseconds.
232 </dl><p>
233 The function <code>cvWaitKey</code> waits for key event infinitely (delay&lt;=0) or for "delay" milliseconds.
234 Returns the code of the pressed key or -1 if no key were pressed until the specified timeout has elapsed.
235 </p><p>
236 <b>Note</b>: This function is the only method in HighGUI to fetch and handle events so
237 it needs to be called periodically for normal event processing, unless HighGUI is used
238 within some environment that takes care of event processing.
239 </p>
240
241
242 <hr><h2><a name="highgui_loadsave">Loading and Saving Images</a></h2>
243
244 <hr><h3><a name="decl_cvLoadImage">cvLoadImage</a></h3>
245 <p class="Blurb">Loads an image from file</p>
246 <pre>
247 /* 8 bit, color or gray - deprecated, use CV_LOAD_IMAGE_ANYCOLOR */
248 #define CV_LOAD_IMAGE_UNCHANGED  -1
249 /* 8 bit, gray */
250 #define CV_LOAD_IMAGE_GRAYSCALE   0
251 /* 8 bit unless combined with CV_LOAD_IMAGE_ANYDEPTH, color */
252 #define CV_LOAD_IMAGE_COLOR       1
253 /* any depth, if specified on its own gray */
254 #define CV_LOAD_IMAGE_ANYDEPTH    2
255 /* by itself equivalent to CV_LOAD_IMAGE_UNCHANGED
256    but can be modified with CV_LOAD_IMAGE_ANYDEPTH */
257 #define CV_LOAD_IMAGE_ANYCOLOR    4
258
259 IplImage* cvLoadImage( const char* filename, int flags=CV_LOAD_IMAGE_COLOR );
260 </pre><dl>
261 <dt>filename<dd>Name of file to be loaded.
262 <dt>flags<dd>Specifies colorness and depth of the loaded image:<br>
263        The colorness specifies whether the loaded image is to be converted to
264        3 channels (CV_LOAD_IMAGE_COLOR), 1 channel (CV_LOAD_IMAGE_GRAYSCALE),
265        or left as it was in the input file (CV_LOAD_IMAGE_ANYCOLOR).<br>
266        Depth specifies whether the loaded image is to be converted to 8 bits
267        per pixel per color channel as was customary in previous versions of
268        OpenCV or left as they were in the input file.
269        If CV_LOAD_IMAGE_ANYDEPTH is passed the
270        pixel format can be 8 bit unsigned, 16 bit unsigned, 32 bit signed or
271        32 bit floating point.<br>
272
273        If conflicting flags are passed the flag with the smaller numerical
274        value wins. That is if
275        CV_LOAD_IMAGE_COLOR | CV_LOAD_IMAGE_ANYCOLOR
276        is passed the image is loaded with 3 channels.
277        CV_LOAD_IMAGE_ANYCOLOR is equivalent to specifying
278        CV_LOAD_IMAGE_UNCHANGED. However, CV_LOAD_IMAGE_ANYCOLOR has the
279        advantage that it can be combined with CV_LOAD_IMAGE_ANYDEPTH. So
280        CV_LOAD_IMAGE_UNCHANGED should not be used any longer.<br>
281
282        If you want to load the image as truthfully as possible pass
283        CV_LOAD_IMAGE_ANYDEPTH | CV_LOAD_IMAGE_ANYCOLOR.
284 </dl><p>
285 The function <code>cvLoadImage</code> loads an image
286 from the specified file and returns the pointer to the loaded image.
287 Currently the following file formats are supported:
288 <ul>
289 <li>Windows bitmaps - BMP, DIB;
290 <li>JPEG files - JPEG, JPG, JPE;
291 <li>Portable Network Graphics - PNG;
292 <li>Portable image format - PBM, PGM, PPM, PXM, PNM;
293 <li>Sun rasters - SR, RAS;
294 <li>TIFF files - TIFF, TIF;
295 <li>OpenEXR HDR images - EXR;
296 <li>JPEG 2000 images - jp2.
297 </ul>
298 </p>
299
300 <hr><h3><a name="decl_cvSaveImage">cvSaveImage</a></h3>
301 <p class="Blurb">Saves an image to the file</p>
302 <pre>
303 int cvSaveImage( const char* filename, const CvArr* image );
304 </pre><dl>
305 <dt>filename<dd>Name of the file.
306 <dt>image<dd>Image to be saved.
307 </dl><p>
308 The function <code>cvSaveImage</code>
309 saves the image to the specified file.
310 The image format is chosen depending on the <code>filename</code> extension, see
311 <a href="#decl_cvLoadImage">cvLoadImage</a>.
312 Only 8-bit single-channel or 3-channel
313 (with &#39;BGR&#39; channel order) images can be saved using this function.
314 If the format, depth or channel order is different, use <code>cvCvtScale</code>
315 and <code>cvCvtColor</code> to convert it before saving, or use
316 universal <code>cvSave</code> to save the image to XML or YAML format.
317 </p>
318
319
320 <hr><h2><a name="highgui_video">Video I/O functions</a></h2>
321
322 <hr><h3><a name="decl_CvCapture">CvCapture</a></h3>
323 <p class="Blurb">Video capturing structure</p>
324 <pre>
325 typedef struct CvCapture CvCapture;
326 </pre>
327 <p>
328 The structure <a href="#decl_CvCapture">CvCapture</a>
329 does not have public interface and is used only as a parameter for video
330 capturing functions.
331 </p>
332
333
334 <hr>
335 <h3><a name="decl_cvCreateFileCapture">cvCreateFileCapture</a></h3>
336 <p class="Blurb">Initializes capturing video from file</p>
337 <pre>
338 CvCapture* cvCreateFileCapture( const char* filename );
339 </pre><dl>
340 <dt>filename<dd>Name of the video file.
341 </dl><p>
342 The function <code>cvCreateFileCapture</code>
343 allocates and initialized the CvCapture structure for reading the video stream
344 from the specified file.
345 </p>
346 <p>After the allocated structure is not used any more it should be released by
347 <a href="#decl_cvReleaseCapture">cvReleaseCapture</a> function.
348 </p>
349
350
351 <hr><h3><a name="decl_cvCreateCameraCapture">cvCreateCameraCapture</a></h3>
352 <p class="Blurb">Initializes capturing video from camera</p>
353 <pre>
354 CvCapture* cvCreateCameraCapture( int index );
355 </pre><dl>
356 <dt>index<dd>Index of the camera to be used. If there is only one camera or it
357 does not matter what camera to use -1 may be passed.
358 </dl><p>
359 The function <code>cvCreateCameraCapture</code>
360 allocates and initialized the CvCapture structure for reading a video stream
361 from the camera. Currently two camera interfaces can be used on Windows: Video for
362 Windows (VFW) and Matrox Imaging Library (MIL); and two on Linux:
363 V4L and FireWire (IEEE1394).
364 </p>
365 <p>To release the structure, use <a href="#decl_cvReleaseCapture">cvReleaseCapture</a>.</p>
366
367
368 <hr><h3><a name="decl_cvReleaseCapture">cvReleaseCapture</a></h3>
369 <p class="Blurb">Releases the CvCapture structure</p>
370 <pre>
371 void cvReleaseCapture( CvCapture** capture );
372 </pre><dl>
373 <dt>capture<dd>pointer to video capturing structure.
374 </dl><p>
375 The function <code>cvReleaseCapture</code>
376 releases the CvCapture structure allocated by <a href="#decl_cvCreateFileCapture">cvCreateFileCapture</a>
377 or <a href="#decl_cvCreateCameraCapture">cvCreateCameraCapture</a>.
378 </p>
379
380
381 <hr><h3><a name="decl_cvGrabFrame">cvGrabFrame</a></h3>
382 <p class="Blurb">Grabs frame from camera or file</p>
383 <pre>
384 int cvGrabFrame( CvCapture* capture );
385 </pre><dl>
386 <dt>capture<dd>video capturing structure.
387 </dl><p>
388 The function <code>cvGrabFrame</code>
389 grabs the frame from camera or file. The grabbed frame is stored internally.
390 The purpose of this function is to grab frame <em>fast</em> that is important
391 for synchronization in case of reading from several cameras simultaneously. The
392 grabbed frames are not exposed because they may be stored in compressed format
393 (as defined by camera/driver). To retrieve the grabbed frame,
394 <a href="#decl_cvRetrieveFrame">cvRetrieveFrame</a> should be used.
395 </p>
396
397
398 <hr><h3><a name="decl_cvRetrieveFrame">cvRetrieveFrame</a></h3>
399 <p class="Blurb">Gets the image grabbed with cvGrabFrame</p>
400 <pre>
401 IplImage* cvRetrieveFrame( CvCapture* capture );
402 </pre><dl>
403 <dt>capture<dd>video capturing structure.
404 </dl><p>
405 The function <code>cvRetrieveFrame</code>
406 returns the pointer to the image grabbed with <a href="#decl_cvGrabFrame">cvGrabFrame</a>
407 function. The returned image should not be released or modified by user.
408 </p>
409
410
411 <hr><h3><a name="decl_cvQueryFrame">cvQueryFrame</a></h3>
412 <p class="Blurb">Grabs and returns a frame from camera or file</p>
413 <pre>
414 IplImage* cvQueryFrame( CvCapture* capture );
415 </pre><dl>
416 <dt>capture<dd>video capturing structure.
417 </dl><p>
418 The function <code>cvQueryFrame</code>
419 grabs a frame from camera or video file, decompresses and returns it.
420 This function is just a combination of  <a href="#decl_cvGrabFrame">cvGrabFrame</a> and
421 <a href="#decl_cvRetrieveFrame">cvRetrieveFrame</a> in one call. The
422 returned image should not be released or modified by user.
423 </p>
424
425
426 <hr><h3><a name="decl_cvGetCaptureProperty">cvGetCaptureProperty</a></h3>
427 <p class="Blurb">Gets video capturing properties</p>
428 <pre>
429 double cvGetCaptureProperty( CvCapture* capture, int property_id );
430 </pre><dl>
431 <dt>capture<dd>video capturing structure.
432 <dt>property_id<dd>property identifier. Can be one of the following:<br>
433   <code>CV_CAP_PROP_POS_MSEC</code> - film current position in milliseconds or video capture timestamp<br>
434   <code>CV_CAP_PROP_POS_FRAMES</code> - 0-based index of the frame to be decoded/captured next<br>
435   <code>CV_CAP_PROP_POS_AVI_RATIO</code> - relative position of video file (0 - start of the film, 1 - end of the film)<br>
436   <code>CV_CAP_PROP_FRAME_WIDTH</code> - width of frames in the video stream<br>
437   <code>CV_CAP_PROP_FRAME_HEIGHT</code> - height of frames in the video stream<br>
438   <code>CV_CAP_PROP_FPS</code> - frame rate<br>
439   <code>CV_CAP_PROP_FOURCC</code> - 4-character code of codec.
440   <code>CV_CAP_PROP_FRAME_COUNT</code> - number of frames in video file.
441   </dl><p>
442 The function <code>cvGetCaptureProperty</code>
443 retrieves the specified property of camera or video file.
444 </p>
445
446
447 <hr><h3><a name="decl_cvSetCaptureProperty">cvSetCaptureProperty</a></h3>
448 <p class="Blurb">Sets video capturing properties</p>
449 <pre>
450 int cvSetCaptureProperty( CvCapture* capture, int property_id, double value );
451 </pre><dl>
452 <dt>capture<dd>video capturing structure.
453 <dt>property_id<dd>property identifier. Can be one of the following:<br>
454  <code>CV_CAP_PROP_POS_MSEC</code> - position in milliseconds from the file beginning<br>
455  <code>CV_CAP_PROP_POS_FRAMES</code> - position in frames (only for video files)<br>
456  <code>CV_CAP_PROP_POS_AVI_RATIO</code> - position in relative units (0 - start of the file, 1 - end of the file)<br>
457  <code>CV_CAP_PROP_FRAME_WIDTH</code> - width of frames in the video stream (only for cameras)<br>
458  <code>CV_CAP_PROP_FRAME_HEIGHT</code> - height of frames in the video stream (only for cameras)<br>
459  <code>CV_CAP_PROP_FPS</code> - frame rate (only for cameras)<br>
460  <code>CV_CAP_PROP_FOURCC</code> - 4-character code of codec (only for cameras).
461 <dt>value<dd>value of the property.
462 </dl><p>
463 The function <code>cvSetCaptureProperty</code>
464 sets the specified property of video capturing. Currently the function supports only
465 video files: <code>CV_CAP_PROP_POS_MSEC, CV_CAP_PROP_POS_FRAMES, CV_CAP_PROP_POS_AVI_RATIO</code>
466 </p>
467
468
469 <hr><h3><a name="decl_cvCreateVideoWriter">cvCreateVideoWriter</a></h3>
470 <p class="Blurb">Creates video file writer</p>
471 <pre>
472 typedef struct CvVideoWriter CvVideoWriter;
473 CvVideoWriter* cvCreateVideoWriter( const char* filename, int fourcc, double fps, CvSize frame_size, int is_color=1 );
474 </pre><dl>
475 <dt>filename<dd>Name of the output video file.
476 <dt>fourcc<dd>4-character code of codec used to compress the frames.
477               For example, <code>CV_FOURCC('P','I','M','1')</code> is MPEG-1 codec,
478               <code>CV_FOURCC('M','J','P','G')</code> is motion-jpeg codec etc.
479                           There are two special values that can be passed, that behave as follows:<br>
480                           <code>CV_FOURCC_PROMPT</code> - Opens a dialog box where the user can 
481                           choose the compression method and parameters (WIN32 only).<br>
482                           <code>CV_FOURCC_DEFAULT</code> - Use the default compression method for the given file extension (Linux only).
483 <dt>fps<dd>Framerate of the created video stream.
484 <dt>frame_size<dd>Size of video frames.
485 <dt>is_color<dd>If it is not zero, the encoder will expect and encode color frames, otherwise it will work
486 with grayscale frames (the flag is currently supported on Windows only).
487 </dl><p>
488 The function <code>cvCreateVideoWriter</code>
489 creates video writer structure.
490 </p>
491
492 <hr><h3><a name="decl_cvReleaseVideoWriter">cvReleaseVideoWriter</a></h3>
493 <p class="Blurb">Releases video file writer</p>
494 <pre>
495 void cvReleaseVideoWriter( CvVideoWriter** writer );
496 </pre><dl>
497 <dt>writer<dd>pointer to video file writer structure.
498 </dl><p>
499 The function <code>cvReleaseVideoWriter</code>
500 finishes writing to video file and releases the structure.
501 </p>
502
503
504 <hr><h3><a name="decl_cvWriteFrame">cvWriteFrame</a></h3>
505 <p class="Blurb">Writes a frame to video file</p>
506 <pre>
507 int cvWriteFrame( CvVideoWriter* writer, const IplImage* image );
508 </pre><dl>
509 <dt>writer<dd>video writer structure.
510 <dt>image</dt><dd>the written frame
511 </dl><p>
512 The function <code>cvWriteFrame</code>
513 writes/appends one frame to video file.
514 </p>
515
516
517 <hr><h2><a name="highgui_utils">Utility and System Functions</a></h2>
518
519 <hr><h3><a name="decl_cvInitSystem">cvInitSystem</a></h3>
520 <p class="Blurb">Initializes HighGUI</p>
521 <pre>
522 int cvInitSystem( int argc, char** argv );
523 </pre><dl>
524 <dt>argc<dd>Number of command line arguments.
525 <dt>argv<dd>Array of command line arguments
526 </dl><p>
527 The function <code>cvInitSystem</code>
528 initializes HighGUI. If it wasn't called explicitly by the user before the first window
529 is created, it is called implicitly then with <code>argc</code>=0, <code>argv</code>=NULL.
530 Under Win32 there is no need to call it explicitly. Under X Window the arguments may
531 be used to customize a look of HighGUI windows and controls.
532 </p>
533
534
535 <hr><h3><a name="decl_cvConvertImage">cvConvertImage</a></h3>
536 <p class="Blurb">Converts one image to another with optional vertical flip</p>
537 <pre>
538 void cvConvertImage( const CvArr* src, CvArr* dst, int flags=0 );
539 </pre><dl>
540 <dt>src<dd>Source image.
541 <dt>dst<dd>Destination image. Must be single-channel or 3-channel 8-bit image.
542 <dt>flags</dt><dd>The operation flags:<br>
543     <code>CV_CVTIMG_FLIP</code> - flip the image vertically
544     <code>CV_CVTIMG_SWAP_RB</code> - swap red and blue channels.
545                                    In OpenCV color images have
546                                    <code><font color="blue">B</font><font color="green">G</font><font color="red">R</font></code>
547                                    channel order, however on some systems the order needs to be reversed
548                                    before displaying the image (<a href="#decl_cvShowImage">cvShowImage</a>
549                                    does this automatically).
550 </dl><p>
551 The function <code>cvConvertImage</code>
552 converts one image to another and flips the result vertically if required.
553 The function is used by <a href="#decl_cvShowImage">cvShowImage</a>.</p>
554
555 <hr><h1><a name="highgui_func_index">Alphabetical List of Functions</a></h1>
556
557 <hr><h3>C</h3>
558 <table width="100%">
559 <tr>
560 <td width="25%"><a href="#decl_cvConvertImage">ConvertImage</a></td>
561 <td width="25%"><a href="#decl_cvCreateFileCapture">CreateFileCapture</a></td>
562 <td width="25%"><a href="#decl_cvCreateVideoWriter">CreateVideoWriter</a></td>
563 </tr>
564 <tr>
565 <td width="25%"><a href="#decl_cvCreateCameraCapture">CreateCameraCapture</a></td>
566 <td width="25%"><a href="#decl_cvCreateTrackbar">CreateTrackbar</a></td>
567 <td width="25%%"></td>
568 </tr>
569 </table>
570 <hr><h3>D</h3>
571 <table width="100%">
572 <tr>
573 <td width="25%"><a href="#decl_cvDestroyAllWindows">DestroyAllWindows</a></td>
574 <td width="25%"><a href="#decl_cvDestroyWindow">DestroyWindow</a></td>
575 <td width="25%%"></td>
576 </tr>
577 </table>
578 <hr><h3>G</h3>
579 <table width="100%">
580 <tr>
581 <td width="25%"><a href="#decl_cvGetCaptureProperty">GetCaptureProperty</a></td>
582 <td width="25%"><a href="#decl_cvGetWindowHandle">GetWindowHandle</a></td>
583 <td width="25%"><a href="#decl_cvGrabFrame">GrabFrame</a></td>
584 </tr>
585 <tr>
586 <td width="25%"><a href="#decl_cvGetTrackbarPos">GetTrackbarPos</a></td>
587 <td width="25%"><a href="#decl_cvGetWindowName">GetWindowName</a></td>
588 <td width="25%%"></td>
589 </tr>
590 </table>
591 <hr><h3>I</h3>
592 <table width="100%">
593 <tr>
594 <td width="25%"><a href="#decl_cvInitSystem">InitSystem</a></td>
595 <td width="25%%"></td>
596 <td width="25%%"></td>
597 </tr>
598 </table>
599 <hr><h3>L</h3>
600 <table width="100%">
601 <tr>
602 <td width="25%"><a href="#decl_cvLoadImage">LoadImage</a></td>
603 <td width="25%%"></td>
604 <td width="25%%"></td>
605 </tr>
606 </table>
607 <hr><h3>M</h3>
608 <table width="100%">
609 <tr>
610 <td width="25%"><a href="#decl_cvMoveWindow">MoveWindow</a></td>
611 <td width="25%%"></td>
612 <td width="25%%"></td>
613 </tr>
614 </table>
615 <hr><h3>N</h3>
616 <table width="100%">
617 <tr>
618 <td width="25%"><a href="#decl_cvNamedWindow">NamedWindow</a></td>
619 <td width="25%%"></td>
620 <td width="25%%"></td>
621 </tr>
622 </table>
623 <hr><h3>Q</h3>
624 <table width="100%">
625 <tr>
626 <td width="25%"><a href="#decl_cvQueryFrame">QueryFrame</a></td>
627 <td width="25%%"></td>
628 <td width="25%%"></td>
629 </tr>
630 </table>
631 <hr><h3>R</h3>
632 <table width="100%">
633 <tr>
634 <td width="25%"><a href="#decl_cvReleaseCapture">ReleaseCapture</a></td>
635 <td width="25%"><a href="#decl_cvResizeWindow">ResizeWindow</a></td>
636 <td width="25%%"></td>
637 </tr>
638 <tr>
639 <td width="25%"><a href="#decl_cvReleaseVideoWriter">ReleaseVideoWriter</a></td>
640 <td width="25%"><a href="#decl_cvRetrieveFrame">RetrieveFrame</a></td>
641 <td width="25%%"></td>
642 </tr>
643 </table>
644 <hr><h3>S</h3>
645 <table width="100%">
646 <tr>
647 <td width="25%"><a href="#decl_cvSaveImage">SaveImage</a></td>
648 <td width="25%"><a href="#decl_cvSetMouseCallback">SetMouseCallback</a></td>
649 <td width="25%"><a href="#decl_cvShowImage">ShowImage</a></td>
650 </tr>
651 <tr>
652 <td width="25%"><a href="#decl_cvSetCaptureProperty">SetCaptureProperty</a></td>
653 <td width="25%"><a href="#decl_cvSetTrackbarPos">SetTrackbarPos</a></td>
654 <td width="25%%"></td>
655 </tr>
656 </table>
657 <hr><h3>W</h3>
658 <table width="100%">
659 <tr>
660 <td width="25%"><a href="#decl_cvWaitKey">WaitKey</a></td>
661 <td width="25%"><a href="#decl_cvWriteFrame">WriteFrame</a></td>
662 <td width="25%%"></td>
663 </tr>
664 </table>
665
666 </body>
667 </html>
668