Commit 83f25a34 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

merged the latest changes (grammar & style fix) and pre-latest changes (C & old…

merged the latest changes (grammar & style fix) and pre-latest changes (C & old Python interface and relocated short descriptions). Also, made some additional corrections
parent ea520d13
Qt* New Functions Qt New Functions
================ ================
.. highlight:: cpp .. highlight:: cpp
...@@ -56,15 +56,14 @@ See below the example used to generate the figure: :: ...@@ -56,15 +56,14 @@ See below the example used to generate the figure: ::
return 0; return 0;
} }
.. index:: setWindowProperty
.. _setWindowProperty:
setWindowProperty setWindowProperty
--------------------- ---------------------
Changes parameters of a window dynamically.
.. ocv:function:: void setWindowProperty(const string& name, int prop_id, double prop_value) .. ocv:function:: void setWindowProperty(const string& name, int prop_id, double prop_value)
Changes parameters of a window dynamically. .. ocv:cfunction:: void cvSetWindowProperty(const char* name, int propId, double propValue)
:param name: Name of the window. :param name: Name of the window.
...@@ -72,9 +71,9 @@ setWindowProperty ...@@ -72,9 +71,9 @@ setWindowProperty
* **CV_WND_PROP_FULLSCREEN** Change if the window is fullscreen ( ``CV_WINDOW_NORMAL`` or ``CV_WINDOW_FULLSCREEN`` ). * **CV_WND_PROP_FULLSCREEN** Change if the window is fullscreen ( ``CV_WINDOW_NORMAL`` or ``CV_WINDOW_FULLSCREEN`` ).
* **CV_WND_PROP_AUTOSIZE** Change if the window is resizable (texttt {CV\_WINDOW\_NORMAL} or ``CV_WINDOW_AUTOSIZE`` ). * **CV_WND_PROP_AUTOSIZE** Change if the window is resizable (``CV_WINDOW_NORMAL`` or ``CV_WINDOW_AUTOSIZE`` ).
* **CV_WND_PROP_ASPECTRATIO** Change if the aspect ratio of the image is preserved (texttt {CV\_WINDOW\_FREERATIO} or ``CV_WINDOW_KEEPRATIO`` ). * **CV_WND_PROP_ASPECTRATIO** Change if the aspect ratio of the image is preserved ( ``CV_WINDOW_FREERATIO`` or ``CV_WINDOW_KEEPRATIO`` ).
:param prop_value: New value of the window property. The following operation flags are available: :param prop_value: New value of the window property. The following operation flags are available:
...@@ -87,18 +86,18 @@ setWindowProperty ...@@ -87,18 +86,18 @@ setWindowProperty
* **CV_WINDOW_FREERATIO** Make the window resizable without any ratio constraints. * **CV_WINDOW_FREERATIO** Make the window resizable without any ratio constraints.
* **CV_WINDOW_KEEPRATIO** Make the window resizable but preserve the proportions of the displayed image. * **CV_WINDOW_KEEPRATIO** Make the window resizable, but preserve the proportions of the displayed image.
The function ``setWindowProperty`` enables changing properties of a window. The function ``setWindowProperty`` enables changing properties of a window.
.. index:: getWindowProperty
getWindowProperty getWindowProperty
--------------------- ---------------------
Provides parameters of a window.
.. ocv:function:: void getWindowProperty(const string& name, int prop_id) .. ocv:function:: void getWindowProperty(const string& name, int prop_id)
Provides parameters of a window. .. ocv:cfunction:: void cvGetWindowProperty(const char* name, int propId)
:param name: Name of the window. :param name: Name of the window.
...@@ -106,9 +105,9 @@ getWindowProperty ...@@ -106,9 +105,9 @@ getWindowProperty
* **CV_WND_PROP_FULLSCREEN** Change if the window is fullscreen ( ``CV_WINDOW_NORMAL`` or ``CV_WINDOW_FULLSCREEN`` ). * **CV_WND_PROP_FULLSCREEN** Change if the window is fullscreen ( ``CV_WINDOW_NORMAL`` or ``CV_WINDOW_FULLSCREEN`` ).
* **CV_WND_PROP_AUTOSIZE** Change if the window is resizable (texttt {CV\_WINDOW\_NORMAL} or ``CV_WINDOW_AUTOSIZE`` ). * **CV_WND_PROP_AUTOSIZE** Change if the window is resizable (``CV_WINDOW_NORMAL`` or ``CV_WINDOW_AUTOSIZE`` ).
* **CV_WND_PROP_ASPECTRATIO** Change if the aspect ratio of the image is preserved (texttt {CV\_WINDOW\_FREERATIO} or ``CV_WINDOW_KEEPRATIO`` ). * **CV_WND_PROP_ASPECTRATIO** Change if the aspect ratio of the image is preserved (``CV_WINDOW_FREERATIO`` or ``CV_WINDOW_KEEPRATIO`` ).
See See
...@@ -116,15 +115,13 @@ See ...@@ -116,15 +115,13 @@ See
The function ``getWindowProperty`` returns properties of a window. The function ``getWindowProperty`` returns properties of a window.
.. index:: fontQt
.. _fontQt:
fontQt fontQt
---------- ----------
Creates the font to draw a text on an image.
.. ocv:function:: CvFont fontQt(const string& nameFont, int pointSize = -1, Scalar color = Scalar::all(0), int weight = CV_FONT_NORMAL, int style = CV_STYLE_NORMAL, int spacing = 0) .. ocv:function:: CvFont fontQt(const string& nameFont, int pointSize = -1, Scalar color = Scalar::all(0), int weight = CV_FONT_NORMAL, int style = CV_STYLE_NORMAL, int spacing = 0)
Creates the font to draw a text on an image. .. ocv:cfunction:: CvFont cvFontQt(const char* nameFont, int pointSize=-1, CvScalar color=cvScalarAll(0), int weight=CV_FONT_NORMAL, int style=CV_STYLE_NORMAL, int spacing=0)
:param nameFont: Name of the font. The name should match the name of a system font (such as *Times*). If the font is not found, a default one is used. :param nameFont: Name of the font. The name should match the name of a system font (such as *Times*). If the font is not found, a default one is used.
...@@ -163,13 +160,14 @@ A basic usage of this function is the following: :: ...@@ -163,13 +160,14 @@ A basic usage of this function is the following: ::
CvFont font = fontQt(''Times''); CvFont font = fontQt(''Times'');
addText( img1, ``Hello World !'', Point(50,50), font); addText( img1, ``Hello World !'', Point(50,50), font);
.. index:: addText
addText addText
----------- -----------
Creates the font to draw a text on an image.
.. ocv:function:: void addText(const Mat& img, const string& text, Point location, CvFont *font) .. ocv:function:: void addText(const Mat& img, const string& text, Point location, CvFont *font)
Creates the font to draw a text on an image. .. ocv:cfunction:: void cvAddText(const CvArr* img, const char* text, CvPoint location, CvFont *font)
:param img: 8-bit 3-channel image where the text should be drawn. :param img: 8-bit 3-channel image where the text should be drawn.
...@@ -185,16 +183,17 @@ on an image ...@@ -185,16 +183,17 @@ on an image
*img* *img*
using a specific font using a specific font
*font* *font*
(see example (see example :ocv:func:`fontQt` )
:ocv:func:`fontQt` )
.. index:: displayOverlay .. index:: displayOverlay
displayOverlay displayOverlay
------------------ ------------------
Displays a text on a window image as an overlay for a specified duration.
.. ocv:function:: void displayOverlay(const string& name, const string& text, int delay) .. ocv:function:: void displayOverlay(const string& name, const string& text, int delay)
Displays a text on a window image as an overlay for a specified duration. .. ocv:cfunction:: void cvDisplayOverlay(const char* name, const char* text, int delay)
:param name: Name of the window. :param name: Name of the window.
...@@ -204,13 +203,14 @@ displayOverlay ...@@ -204,13 +203,14 @@ displayOverlay
The function ``displayOverlay`` displays useful information/tips on top of the window for a certain amount of time *delay*. The function does not modify the image, displayed in the window, that is, after the specified delay the original content of the window is restored. The function ``displayOverlay`` displays useful information/tips on top of the window for a certain amount of time *delay*. The function does not modify the image, displayed in the window, that is, after the specified delay the original content of the window is restored.
.. index:: displayStatusBar
displayStatusBar displayStatusBar
-------------------- --------------------
Displays a text on the window statusbar during the specified period of time.
.. ocv:function:: void displayStatusBar(const string& name, const string& text, int delay) .. ocv:function:: void displayStatusBar(const string& name, const string& text, int delay)
Displays a text on the window statusbar during the specified period of time. .. ocv:cfunction:: void cvDisplayStatusBar(const char* name, const char* text, int delayms)
:param name: Name of the window. :param name: Name of the window.
...@@ -222,14 +222,13 @@ The function ``displayOverlay`` displays useful information/tips on top of the w ...@@ -222,14 +222,13 @@ The function ``displayOverlay`` displays useful information/tips on top of the w
*delay* *delay*
. This information is displayed on the window statubar (the window must be created with the ``CV_GUI_EXPANDED`` flags). . This information is displayed on the window statubar (the window must be created with the ``CV_GUI_EXPANDED`` flags).
.. index:: createOpenGLCallback
createOpenGLCallback createOpenGLCallback
------------------------ ------------------------
Creates a callback function called to draw OpenGL on top the the image display by ``windowname``.
.. ocv:function:: void createOpenGLCallback( const string& window_name, OpenGLCallback callbackOpenGL, void* userdata CV_DEFAULT(NULL), double angle CV_DEFAULT(-1), double zmin CV_DEFAULT(-1), double zmax CV_DEFAULT(-1) .. ocv:function:: void createOpenGLCallback( const string& window_name, OpenGLCallback callbackOpenGL, void* userdata CV_DEFAULT(NULL), double angle CV_DEFAULT(-1), double zmin CV_DEFAULT(-1), double zmax CV_DEFAULT(-1)
Creates a callback function called to draw OpenGL on top the the image display by ``windowname``. .. ocv:cfunction:: void cvCreateOpenGLCallback( const char* windowName, CvOpenGLCallback callbackOpenGL, void* userdata=NULL, double angle=-1, double zmin=-1, double zmax=-1
:param window_name: Name of the window. :param window_name: Name of the window.
...@@ -243,7 +242,7 @@ createOpenGLCallback ...@@ -243,7 +242,7 @@ createOpenGLCallback
:param zmax: Parameter specifying the distance from the viewer to the far clipping plane (always positive). Default value is 1000. *(Optional)* :param zmax: Parameter specifying the distance from the viewer to the far clipping plane (always positive). Default value is 1000. *(Optional)*
The function ``createOpenGLCallback`` can be used to draw 3D data on the window. See the callback example below: :: The function ``createOpenGLCallback`` can be used to draw 3D data on the window. See the example of callback use below: ::
void on_opengl(void* param) void on_opengl(void* param)
{ {
...@@ -274,42 +273,40 @@ The function ``createOpenGLCallback`` can be used to draw 3D data on the window. ...@@ -274,42 +273,40 @@ The function ``createOpenGLCallback`` can be used to draw 3D data on the window.
} }
} }
.. index:: saveWindowParameters
saveWindowParameters saveWindowParameters
------------------------ ------------------------
Saves parameters of the specified window.
.. ocv:function:: void saveWindowParameters(const string& name) .. ocv:function:: void saveWindowParameters(const string& name)
Saves parameters of the window ``windowname`` . .. ocv:cfunction:: void cvSaveWindowParameters(const char* name)
:param name: Name of the window. :param name: Name of the window.
The function ``saveWindowParameters`` saves size, location, flags, trackbars value, zoom and panning location of the window The function ``saveWindowParameters`` saves size, location, flags, trackbars value, zoom and panning location of the window
``window_name`` . ``window_name`` .
.. index:: loadWindowParameters
loadWindowParameters loadWindowParameters
------------------------ ------------------------
Loads parameters of the specified window.
.. ocv:function:: void loadWindowParameters(const string& name) .. ocv:function:: void loadWindowParameters(const string& name)
Loads parameters of the window ``windowname`` . .. ocv:cfunction:: void cvLoadWindowParameters(const char* name)
:param name: Name of the window. :param name: Name of the window.
The function ``loadWindowParameters`` loads size, location, flags, trackbars value, zoom, and panning location of the window The function ``loadWindowParameters`` loads size, location, flags, trackbars value, zoom and panning location of the window
``window_name`` . ``window_name`` .
.. index:: createButton
createButton createButton
---------------- ----------------
Attaches a button to the control panel.
.. ocv:function:: createButton( const string& button_name CV_DEFAULT(NULL),ButtonCallback 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)) .. ocv:function:: createButton( const string& button_name CV_DEFAULT(NULL),ButtonCallback 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))
Attaches a button to the control panel. .. ocv:cfunction:: cvCreateButton( const char* buttonName=NULL, CvButtonCallback onChange=NULL, void* userdata=NULL, int buttonType=CV_PUSH_BUTTON, int initialButtonState=0
:param button_name: Name of the button. :param button_name: Name of the button.
...@@ -323,7 +320,7 @@ createButton ...@@ -323,7 +320,7 @@ createButton
* **CV_CHECKBOX** Checkbox button * **CV_CHECKBOX** Checkbox button
* **CV_RADIOBOX** Radiobox button. The radiobox on the same buttonbar (same line) are exclusive, that is, only one can be selected at a time. * **CV_RADIOBOX** Radiobox button. The radiobox on the same buttonbar (same line) are exclusive, that is only one can be selected at a time.
:param initial_button_state: Default state of the button. Use for checkbox and radiobox. Its value could be 0 or 1. *(Optional)* :param initial_button_state: Default state of the button. Use for checkbox and radiobox. Its value could be 0 or 1. *(Optional)*
......
...@@ -3,15 +3,14 @@ User Interface ...@@ -3,15 +3,14 @@ User Interface
.. highlight:: cpp .. highlight:: cpp
.. index:: createTrackbar
.. _createTrackbar:
createTrackbar createTrackbar
------------------ ------------------
Creates a trackbar and attaches it to the specified window.
.. ocv:function:: int createTrackbar( const string& trackbarname, const string& winname, int* value, int count, TrackbarCallback onChange=0, void* userdata=0) .. ocv:function:: int createTrackbar( const string& trackbarname, const string& winname, int* value, int count, TrackbarCallback onChange=0, void* userdata=0)
Creates a trackbar and attaches it to the specified window. .. ocv:cfunction:: int cvCreateTrackbar( const char* trackbarName, const char* windowName, int* value, int count, CvTrackbarCallback onChange )
.. ocv:pyoldfunction:: CreateTrackbar(trackbarName, windowName, value, count, onChange) -> None
:param trackbarname: Name of the created trackbar. :param trackbarname: Name of the created trackbar.
...@@ -25,29 +24,22 @@ createTrackbar ...@@ -25,29 +24,22 @@ createTrackbar
:param userdata: User data that is passed as is to the callback. It can be used to handle trackbar events without using global variables. :param userdata: User data that is passed as is to the callback. It can be used to handle trackbar events without using global variables.
The function ``createTrackbar`` creates a trackbar (a slider or range control) with the specified name and range, assigns a variable ``value`` to be a position syncronized with the trackbar and specifies the callback function ``onChange`` to be called on the trackbar position change. The created trackbar is displayed on top of the given window. The function ``createTrackbar`` creates a trackbar (a slider or range control) with the specified name and range, assigns a variable ``value`` to be a position syncronized with the trackbar and specifies the callback function ``onChange`` to be called on the trackbar position change. The created trackbar is displayed in the specified window ``winname``.
**[Qt Backend Only]**
Qt-specific details:
* **winname** Name of the window that will be used as a parent for created trackbar. It can be NULL if the trackbar should be attached to the control panel. .. note::
The created trackbar is displayed at the bottom of the given window if
*winname*
is correctly provided, or displayed on the control panel if
*winname*
is NULL.
Clicking the label of each trackbar enables editing the trackbar values manually for a more accurate control of it. **[Qt Backend Only]** ``winname`` can be empty (or NULL) if the trackbar should be attached to the control panel.
.. index:: getTrackbarPos Clicking the label of each trackbar enables editing the trackbar values manually.
getTrackbarPos getTrackbarPos
------------------ ------------------
Returns the trackbar position.
.. ocv:function:: int getTrackbarPos( const string& trackbarname, const string& winname ) .. ocv:function:: int getTrackbarPos( const string& trackbarname, const string& winname )
Returns the trackbar position. .. ocv:cfunction:: int cvGetTrackbarPos( const char* trackbarName, const char* windowName )
.. ocv:pyoldfunction:: GetTrackbarPos(trackbarName, windowName)-> None
:param trackbarname: Name of the trackbar. :param trackbarname: Name of the trackbar.
...@@ -55,21 +47,15 @@ getTrackbarPos ...@@ -55,21 +47,15 @@ getTrackbarPos
The function returns the current position of the specified trackbar. The function returns the current position of the specified trackbar.
.. note::
**[Qt Backend Only]** **[Qt Backend Only]** ``winname`` can be empty (or NULL) if the trackbar is attached to the control panel.
Qt-specific details:
* **winname** Name of the window that is the parent of the trackbar. It can be NULL if the trackbar is attached to the control panel.
.. index:: imshow
.. _imshow:
imshow imshow
---------- ----------
.. ocv:function:: void imshow( const string& winname, InputArray image ) Displays an image in the specified window.
Displays an image in the specified window. .. ocv:function:: void imshow( const string& winname, InputArray image )
:param winname: Name of the window. :param winname: Name of the window.
...@@ -77,28 +63,25 @@ imshow ...@@ -77,28 +63,25 @@ imshow
The function ``imshow`` displays an image in the specified window. If the window was created with the ``CV_WINDOW_AUTOSIZE`` flag, the image is shown with its original size. Otherwise, the image is scaled to fit the window. The function may scale the image, depending on its depth: The function ``imshow`` displays an image in the specified window. If the window was created with the ``CV_WINDOW_AUTOSIZE`` flag, the image is shown with its original size. Otherwise, the image is scaled to fit the window. The function may scale the image, depending on its depth:
* * If the image is 8-bit unsigned, it is displayed as is.
If the image is 8-bit unsigned, it is displayed as is.
*
If the image is 16-bit unsigned or 32-bit integer, the pixels are divided by 256. That is, the value range [0,255*256] is mapped to [0,255].
* * If the image is 16-bit unsigned or 32-bit integer, the pixels are divided by 256. That is, the value range [0,255*256] is mapped to [0,255].
If the image is 32-bit floating-point, the pixel values are multiplied by 255. That is, the value range [0,1] is mapped to [0,255].
.. index:: namedWindow * If the image is 32-bit floating-point, the pixel values are multiplied by 255. That is, the value range [0,1] is mapped to [0,255].
.. _namedWindow:
namedWindow namedWindow
--------------- ---------------
Creates a window.
.. ocv:function:: void namedWindow( const string& winname, int flags ) .. ocv:function:: void namedWindow( const string& winname, int flags )
Creates a window. .. ocv:cfunction:: int cvNamedWindow( const char* name, int flags )
.. ocv:pyoldfunction:: NamedWindow(name, flags=CV_WINDOW_AUTOSIZE)-> None
:param name: Name of the window in the window caption that may be used as a window identifier. :param name: Name of the window in the window caption that may be used as a window identifier.
:param flags: Flags of the window. Currently the only supported flag is ``CV_WINDOW_AUTOSIZE`` . If it is set, the window size is automatically adjusted to fit the displayed image (see :ocv:func:`imshow` ), and you cannot change the window size manually. :param flags: Flags of the window. Currently the only supported flag is ``CV_WINDOW_AUTOSIZE`` . If this is set, the window size is automatically adjusted to fit the displayed image (see :ocv:func:`imshow` ), and you cannot change the window size manually.
The function ``namedWindow`` creates a window that can be used as a placeholder for images and trackbars. Created windows are referred to by their names. The function ``namedWindow`` creates a window that can be used as a placeholder for images and trackbars. Created windows are referred to by their names.
...@@ -106,11 +89,9 @@ If a window with the same name already exists, the function does nothing. ...@@ -106,11 +89,9 @@ If a window with the same name already exists, the function does nothing.
You can call :ocv:func:`destroyWindow` or :ocv:func:`destroyAllWindows` to close the window and de-allocate any associated memory usage. For a simple program, you do not really have to call these functions because all the resources and windows of the application are closed automatically by the operating system upon exit. You can call :ocv:func:`destroyWindow` or :ocv:func:`destroyAllWindows` to close the window and de-allocate any associated memory usage. For a simple program, you do not really have to call these functions because all the resources and windows of the application are closed automatically by the operating system upon exit.
.. note::
**[Qt Backend Only]** Qt backend supports additional flags:
Qt-specific details:
* **flags** Flags of the window. Currently the supported flags are:
* **CV_WINDOW_NORMAL or CV_WINDOW_AUTOSIZE:** ``CV_WINDOW_NORMAL`` enables you to resize the window, whereas ``CV_WINDOW_AUTOSIZE`` adjusts automatically the window size to fit the displayed image (see :ocv:func:`imshow` ), and you cannot change the window size manually. * **CV_WINDOW_NORMAL or CV_WINDOW_AUTOSIZE:** ``CV_WINDOW_NORMAL`` enables you to resize the window, whereas ``CV_WINDOW_AUTOSIZE`` adjusts automatically the window size to fit the displayed image (see :ocv:func:`imshow` ), and you cannot change the window size manually.
...@@ -118,87 +99,70 @@ Qt-specific details: ...@@ -118,87 +99,70 @@ Qt-specific details:
* **CV_GUI_NORMAL or CV_GUI_EXPANDED:** ``CV_GUI_NORMAL`` is the old way to draw the window without statusbar and toolbar, whereas ``CV_GUI_EXPANDED`` is a new enhanced GUI. * **CV_GUI_NORMAL or CV_GUI_EXPANDED:** ``CV_GUI_NORMAL`` is the old way to draw the window without statusbar and toolbar, whereas ``CV_GUI_EXPANDED`` is a new enhanced GUI.
This parameter is optional. The default flags set for a new window are ``CV_WINDOW_AUTOSIZE`` , ``CV_WINDOW_KEEPRATIO`` , and ``CV_GUI_EXPANDED`` . By default, ``flags == CV_WINDOW_AUTOSIZE | CV_WINDOW_KEEPRATIO | CV_GUI_EXPANDED``
However, if you want to modify the flags, you can combine them using the OR operator, that is:
::
namedWindow( ``myWindow'', ``CV_WINDOW_NORMAL`` textbar ``CV_GUI_NORMAL`` );
..
.. index:: destroyWindow
.. _destroyWindow:
destroyWindow destroyWindow
------------- -------------
Destroys a window.
.. ocv:function:: void destroyWindow( const string &winname ) .. ocv:function:: void destroyWindow( const string &winname )
Destroys a window. .. ocv:cfunction:: void cvDestroyWindow( const char* name )
.. ocv:pyoldfunction:: DestroyWindow(name)-> None
:param winname: Name of the window to be destroyed. :param winname: Name of the window to be destroyed.
The function ``destroyWindow`` destroys the window with the given name. The function ``destroyWindow`` destroys the window with the given name.
.. index:: destroyAllWindows
.. _destroyAllWindows:
destroyAllWindows destroyAllWindows
----------------- -----------------
.. ocv:function:: void destroyAllWindows() Destroys all of the HighGUI windows.
Destroys all of the HighGUI windows. .. ocv:function:: void destroyAllWindows()
The function ``destroyAllWindows`` destroys all of the opened HighGUI windows. The function ``destroyAllWindows`` destroys all of the opened HighGUI windows.
.. index:: setTrackbarPos
.. _setTrackbarPos:
setTrackbarPos setTrackbarPos
------------------ ------------------
Sets the trackbar position.
.. ocv:function:: void setTrackbarPos( const string& trackbarname, const string& winname, int pos ) .. ocv:function:: void setTrackbarPos( const string& trackbarname, const string& winname, int pos )
Sets the trackbar position. .. ocv:cfunction:: void cvSetTrackbarPos( const char* trackbarName, const char* windowName, int pos )
.. ocv:pyoldfunction:: SetTrackbarPos(trackbarName, windowName, pos)-> None
:param trackbarname: Name of the trackbar. :param trackbarname: Name of the trackbar.
:param winname: Name of the window that is the parent of the trackbar. :param winname: Name of the window that is the parent of trackbar.
:param pos: New position. :param pos: New position.
The function sets the position of the specified trackbar in the specified window. The function sets the position of the specified trackbar in the specified window.
.. note::
**[Qt Backend Only]** **[Qt Backend Only]** ``winname`` can be empty (or NULL) if the trackbar is attached to the control panel.
Qt-specific details:
* **winname** Name of the window that is the parent of the trackbar. It can be NULL if the trackbar is attached to the control panel.
.. index:: waitKey
.. _waitKey:
waitKey waitKey
----------- -----------
Waits for a pressed key.
.. ocv:function:: int waitKey(int delay=0) .. ocv:function:: int waitKey(int delay=0)
Waits for a pressed key. .. ocv:cfunction:: int cvWaitKey( int delay=0 )
.. ocv:pyoldfunction:: WaitKey(delay=0)-> int
:param delay: Delay in milliseconds. 0 is the special value that means "forever". :param delay: Delay in milliseconds. 0 is the special value that means "forever".
The function ``waitKey`` waits for a key event infinitely (when The function ``waitKey`` waits for a key event infinitely (when
:math:`\texttt{delay}\leq 0` ) or for ``delay`` milliseconds, when it is positive. It returns the code of the pressed key or -1 if no key was pressed before the specified time had elapsed. :math:`\texttt{delay}\leq 0` ) or for ``delay`` milliseconds, when it is positive. Since the OS has a minimum time between switching threads, the function will not wait exactly ``delay`` ms, it will wait at least ``delay`` ms, depending on what else is running on your computer at that time. It returns the code of the pressed key or -1 if no key was pressed before the specified time had elapsed.
.. note:: .. note::
* This function is the only method in HighGUI that can fetch and handle events, so it needs to be called periodically for normal event processing unless HighGUI is used within an environment that takes care of event processing. This function is the only method in HighGUI that can fetch and handle events, so it needs to be called periodically for normal event processing unless HighGUI is used within an environment that takes care of event processing.
* The function only works if there is at least one HighGUI window created and the window is active. If there are several HighGUI windows, any of them can be active. .. note::
The function only works if there is at least one HighGUI window created and the window is active. If there are several HighGUI windows, any of them can be active.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment