1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

the first round of cleaning up the RST docs

This commit is contained in:
Vadim Pisarevsky
2011-02-28 21:26:43 +00:00
parent eb8c0b8b4b
commit 4bb893aa9f
48 changed files with 1664 additions and 1649 deletions
@@ -1,27 +0,0 @@
*************************************
highgui. High-level GUI and Media I/O
*************************************
While OpenCV was designed for use in full-scale
applications and can be used within functionally rich UI frameworks (such as Qt, WinForms or Cocoa) or without any UI at all, sometimes there is a need to try some functionality quickly and visualize the results. This is what the HighGUI module has been designed for.
It provides easy interface to:
*
create and manipulate windows that can display images and "remember" their content (no need to handle repaint events from OS)
*
add trackbars to the windows, handle simple mouse events as well as keyboard commmands
*
read and write images to/from disk or memory.
*
read video from camera or file and write video to a file.
.. toctree::
:maxdepth: 2
highgui_user_interface
highgui_reading_and_writing_images_and_video
highgui_qt_new_functions
+54 -62
View File
@@ -8,7 +8,7 @@ Qt new functions
This figure explains the new functionalities implemented with Qt GUI. As we can see, the new GUI provides a statusbar, a toolbar, and a control panel. The control panel can have trackbars and buttonbars attached to it.
*
To attach a trackbar, the window_ name parameter must be NULL.
To attach a trackbar, the window name parameter must be NULL.
*
To attach a buttonbar, a button must be created.
@@ -56,60 +56,59 @@ The following code is an example used to generate the figure. ::
cvReleaseCapture(&video);
return 0;
}
..
.. index:: setWindowProperty
cv::setWindowProperty
setWindowProperty
---------------------
.. cfunction:: void setWindowProperty(const string\& name, int prop_id, double prop_value)
.. c:function:: void setWindowProperty(const string& name, int prop_id, double prop_value)
Change the parameters of the window dynamically.
:param name: Name of the window.
:param prop_id: Window's property to edit. The operation flags:
:param prop_id: Window's property to edit. The operation flags:
* **CV_WND_PROP_FULLSCREEN** Change if the window is fullscreen ( ``CV_WINDOW_NORMAL`` or ``CV_WINDOW_FULLSCREEN`` ).
* **CV_WND_PROP_AUTOSIZE** Change if the user can resize the window (texttt {CV\_WINDOW\_NORMAL} or ``CV_WINDOW_AUTOSIZE`` ).
* **CV_WND_PROP_ASPECTRATIO** Change if the image's aspect ratio is preserved (texttt {CV\_WINDOW\_FREERATIO} or ``CV_WINDOW_KEEPRATIO`` ).
:param prop_value: New value of the Window's property. The operation flags:
:param prop_value: New value of the Window's property. The operation flags:
* **CV_WINDOW_NORMAL** Change the window in normal size, or allows the user to resize the window.
* **CV_WINDOW_AUTOSIZE** The user cannot resize the window, the size is constrainted by the image displayed.
* **CV_WINDOW_FULLSCREEN** Change the window to fullscreen.
* **CV_WINDOW_FREERATIO** The image expends as much as it can (no ratio constraint)
* **CV_WINDOW_KEEPRATIO** The ration image is respected.
The function `` setWindowProperty`` allows to change the window's properties.
.. index:: getWindowProperty
cv::getWindowProperty
getWindowProperty
---------------------
.. cfunction:: void getWindowProperty(const char* name, int prop_id)
.. c:function:: void getWindowProperty(const char* name, int prop_id)
Get the parameters of the window.
:param name: Name of the window.
:param prop_id: Window's property to retrive. The operation flags:
:param prop_id: Window's property to retrive. The operation flags:
* **CV_WND_PROP_FULLSCREEN** Change if the window is fullscreen ( ``CV_WINDOW_NORMAL`` or ``CV_WINDOW_FULLSCREEN`` ).
* **CV_WND_PROP_AUTOSIZE** Change if the user can resize the window (texttt {CV\_WINDOW\_NORMAL} or ``CV_WINDOW_AUTOSIZE`` ).
* **CV_WND_PROP_ASPECTRATIO** Change if the image's aspect ratio is preserved (texttt {CV\_WINDOW\_FREERATIO} or ``CV_WINDOW_KEEPRATIO`` ).
See
:ref:`setWindowProperty` to know the meaning of the returned values.
@@ -118,41 +117,40 @@ The function `` getWindowProperty`` return window's properties.
.. index:: fontQt
cv::fontQt
fontQt
----------
.. cfunction:: 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)
.. c: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)
Create the font to be used to draw text on an image.
: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 will be 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 will be used.
:param pointSize: Size of the font. If not specified, equal zero or negative, the point size of the font is set to a system-dependent default value. Generally, this is 12 points.
:param color: Color of the font in BGRA -- A = 255 is fully transparent. Use the macro CV _ RGB for simplicity.
:param weight: The operation flags:
:param weight: The operation flags:
* **CV_FONT_LIGHT** Weight of 25
* **CV_FONT_NORMAL** Weight of 50
* **CV_FONT_DEMIBOLD** Weight of 63
* **CV_FONT_BOLD** Weight of 75
* **CV_FONT_BLACK** Weight of 87
You can also specify a positive integer for more control.
You can also specify a positive integer for more control.
:param style: The operation flags:
:param style: The operation flags:
* **CV_STYLE_NORMAL** Font is normal
* **CV_STYLE_ITALIC** Font is in italic
* **CV_STYLE_OBLIQUE** Font is oblique
:param spacing: Spacing between characters. Can be negative or positive
The function ``fontQt`` creates a CvFont object. This CvFont is not compatible with putText.
@@ -161,13 +159,12 @@ A basic usage of this function is: ::
CvFont font = fontQt(''Times'');
addText( img1, ``Hello World !'', Point(50,50), font);
..
.. index:: addText
cv::addText
addText
-----------
.. cfunction:: void addText(const Mat\& img, const string\& text, Point location, CvFont *font)
.. c:function:: void addText(const Mat& img, const string& text, Point location, CvFont *font)
Create the font to be used to draw text on an image
@@ -190,9 +187,9 @@ using a specific font
.. index:: displayOverlay
cv::displayOverlay
displayOverlay
------------------
.. cfunction:: void displayOverlay(const string\& name, const string\& text, int delay)
.. c:function:: void displayOverlay(const string& name, const string& text, int delay)
Display text on the window's image as an overlay for delay milliseconds. This is not editing the image's data. The text is display on the top of the image.
@@ -208,9 +205,9 @@ The function ``displayOverlay`` aims at displaying useful information/tips on th
.. index:: displayStatusBar
cv::displayStatusBar
displayStatusBar
--------------------
.. cfunction:: void displayStatusBar(const string\& name, const string\& text, int delayms)
.. c:function:: void displayStatusBar(const string& name, const string& text, int delayms)
Display text on the window's statusbar as for delay milliseconds.
@@ -226,11 +223,10 @@ The function ``displayOverlay`` aims at displaying useful information/tips on th
.. index:: createOpenGLCallback
cv::createOpenGLCallback
createOpenGLCallback
------------------------
*_*
.. cfunction:: 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)
.. c: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)
Create a callback function called to draw OpenGL on top the the image display by windowname.
@@ -278,15 +274,13 @@ The function ``createOpenGLCallback`` can be used to draw 3D data on the window.
glEnd();
}
}
..
.. index:: saveWindowParameters
cv::saveWindowParameters
saveWindowParameters
------------------------
*_*
.. cfunction:: void saveWindowParameters(const string\& name)
.. c:function:: void saveWindowParameters(const string& name)
Save parameters of the window windowname.
@@ -297,11 +291,10 @@ The function ``saveWindowParameters`` saves size, location, flags, trackbars' v
.. index:: loadWindowParameters
cv::loadWindowParameters
loadWindowParameters
------------------------
*_*
.. cfunction:: void loadWindowParameters(const string\& name)
.. c:function:: void loadWindowParameters(const string& name)
Load parameters of the window windowname.
@@ -312,11 +305,10 @@ The function ``loadWindowParameters`` load size, location, flags, trackbars' va
.. index:: createButton
cv::createButton
createButton
----------------
*_*
.. cfunction:: 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)
.. c: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))
Create a callback function called to draw OpenGL on top the the image display by windowname.
@@ -329,7 +321,7 @@ cv::createButton
:param userdata: pointer passed to the callback function. *(Optional)*
The ``button_type`` parameter can be :
*(Optional -- Will be a push button by default.)
* (Optional -- Will be a push button by default.)
* **CV_PUSH_BUTTON** The button will be a push button.
@@ -337,8 +329,6 @@ The ``button_type`` parameter can be :
* **CV_RADIOBOX** The button will be a radiobox button. The radiobox on the same buttonbar (same line) are exclusive; one on can be select at the time.
*
* **initial_button_state** Default state of the button. Use for checkbox and radiobox, its value could be 0 or 1. *(Optional)*
The function ``createButton`` attach a button to the control panel. Each button is added to a buttonbar on the right of the last button.
@@ -351,5 +341,7 @@ Here are various example of ``createButton`` function call: ::
createButton("button3",callbackButton,&value);
createButton("button5",callbackButton1,NULL,CV_RADIOBOX);
createButton("button6",callbackButton2,NULL,CV_PUSH_BUTTON,1);
..
@@ -5,9 +5,9 @@ Reading and Writing Images and Video
.. index:: imdecode
cv::imdecode
imdecode
------------
.. cfunction:: Mat imdecode( const Mat\& buf, int flags )
.. c:function:: Mat imdecode( const Mat\& buf, int flags )
Reads an image from a buffer in memory.
@@ -22,9 +22,9 @@ See
.. index:: imencode
cv::imencode
imencode
------------
.. cfunction:: bool imencode( const string\& ext, const Mat\& img, vector<uchar>\& buf, const vector<int>\& params=vector<int>())
.. c:function:: bool imencode( const string\& ext, const Mat\& img, vector<uchar>\& buf, const vector<int>\& params=vector<int>())
Encode an image into a memory buffer.
@@ -41,9 +41,9 @@ See
.. index:: imread
cv::imread
imread
----------
.. cfunction:: Mat imread( const string\& filename, int flags=1 )
.. c:function:: Mat imread( const string\& filename, int flags=1 )
Loads an image from a file.
@@ -98,9 +98,9 @@ On Linux, BSD flavors and other Unix-like open-source operating systems OpenCV l
.. index:: imwrite
cv::imwrite
imwrite
-----------
.. cfunction:: bool imwrite( const string\& filename, const Mat\& img, const vector<int>\& params=vector<int>())
.. c:function:: bool imwrite( const string\& filename, const Mat\& img, const vector<int>\& params=vector<int>())
Saves an image to a specified file.
@@ -127,7 +127,7 @@ The function ``imwrite`` saves the image to the specified file. The image format
VideoCapture
------------
.. ctype:: VideoCapture
.. c:type:: VideoCapture
Class for video capturing from video files or cameras ::
@@ -209,13 +209,13 @@ The class provides C++ video capturing API. Here is how the class can be used: :
.. index:: VideoCapture::VideoCapture
cv::VideoCapture::VideoCapture
VideoCapture::VideoCapture
------------------------------
.. cfunction:: VideoCapture::VideoCapture()
.. c:function:: VideoCapture::VideoCapture()
.. cfunction:: VideoCapture::VideoCapture(const string\& filename)
.. c:function:: VideoCapture::VideoCapture(const string\& filename)
.. cfunction:: VideoCapture::VideoCapture(int device)
.. c:function:: VideoCapture::VideoCapture(int device)
:param filename: TOWRITE
@@ -225,9 +225,9 @@ VideoCapture constructors.
.. index:: VideoCapture::get
cv::VideoCapture::get
VideoCapture::get
---------------------
.. cfunction:: double VideoCapture::get(int property_id)
.. c:function:: double VideoCapture::get(int property_id)
:param property_id: Property identifier. Can be one of the following:
@@ -273,9 +273,9 @@ Note that when querying a property which is unsupported by the backend used by t
.. index:: VideoCapture::set
cv::VideoCapture::set
VideoCapture::set
---------------------
.. cfunction:: bool VideoCapture::set(int property_id, double value)
.. c:function:: bool VideoCapture::set(int property_id, double value)
:param property_id: Property identifier. Can be one of the following:
@@ -327,7 +327,7 @@ Sets a property in the VideoCapture backend.
VideoWriter
-----------
.. ctype:: VideoWriter
.. c:type:: VideoWriter
Video writer class ::
+12 -12
View File
@@ -5,9 +5,9 @@ User Interface
.. index:: createTrackbar
cv::createTrackbar
createTrackbar
------------------
.. cfunction:: int createTrackbar( const string\& trackbarname, const string\& winname, int* value, int count, TrackbarCallback onChange CV_DEFAULT(0), void* userdata CV_DEFAULT(0))
.. c:function:: int createTrackbar( const string\& trackbarname, const string\& winname, int* value, int count, TrackbarCallback onChange CV_DEFAULT(0), void* userdata CV_DEFAULT(0))
Creates a trackbar and attaches it to the specified window
@@ -41,9 +41,9 @@ By clicking on the label of each trackbar, it is possible to edit the trackbar's
.. index:: getTrackbarPos
cv::getTrackbarPos
getTrackbarPos
------------------
.. cfunction:: int getTrackbarPos( const string\& trackbarname, const string\& winname )
.. c:function:: int getTrackbarPos( const string\& trackbarname, const string\& winname )
Returns the trackbar position.
@@ -61,9 +61,9 @@ qt-specific details:
.. index:: imshow
cv::imshow
imshow
----------
.. cfunction:: void imshow( const string\& winname, const Mat\& image )
.. c:function:: void imshow( const string\& winname, const Mat\& image )
Displays the image in the specified window
@@ -84,9 +84,9 @@ The function ``imshow`` displays the image in the specified window. If the windo
.. index:: namedWindow
cv::namedWindow
namedWindow
---------------
.. cfunction:: void namedWindow( const string\& winname, int flags )
.. c:function:: void namedWindow( const string\& winname, int flags )
Creates a window.
@@ -122,9 +122,9 @@ qt-specific details:
.. index:: setTrackbarPos
cv::setTrackbarPos
setTrackbarPos
------------------
.. cfunction:: void setTrackbarPos( const string\& trackbarname, const string\& winname, int pos )
.. c:function:: void setTrackbarPos( const string\& trackbarname, const string\& winname, int pos )
Sets the trackbar position.
@@ -144,9 +144,9 @@ qt-specific details:
.. index:: waitKey
cv::waitKey
waitKey
-----------
.. cfunction:: int waitKey(int delay=0)
.. c:function:: int waitKey(int delay=0)
Waits for a pressed key.