43#ifndef OPENCV_HIGHGUI_HPP
44#define OPENCV_HIGHGUI_HPP
46#include "opencv2/core.hpp"
47#ifdef HAVE_OPENCV_IMGCODECS
48#include "opencv2/imgcodecs.hpp"
50#ifdef HAVE_OPENCV_VIDEOIO
51#include "opencv2/videoio.hpp"
273typedef void (*
MouseCallback)(
int event,
int x,
int y,
int flags,
void* userdata);
334CV_EXPORTS_W
int startWindowThread();
414CV_EXPORTS_W
void imshow(
const String& winname, InputArray mat);
427CV_EXPORTS_W
void resizeWindow(
const String& winname,
int width,
int height);
441CV_EXPORTS_W
void moveWindow(
const String& winname,
int x,
int y);
526CV_EXPORTS_W
Rect selectROI(
const String& windowName, InputArray img,
bool showCrosshair =
true,
bool fromCenter =
false);
530CV_EXPORTS_W
Rect selectROI(InputArray img,
bool showCrosshair =
true,
bool fromCenter =
false);
548CV_EXPORTS_W
void selectROIs(
const String& windowName, InputArray img,
549 CV_OUT std::vector<Rect>& boundingBoxes,
bool showCrosshair =
true,
bool fromCenter =
false);
578 int* value,
int count,
594CV_EXPORTS_W
int getTrackbarPos(
const String& trackbarname,
const String& winname);
609CV_EXPORTS_W
void setTrackbarPos(
const String& trackbarname,
const String& winname,
int pos);
624CV_EXPORTS_W
void setTrackbarMax(
const String& trackbarname,
const String& winname,
int maxval);
639CV_EXPORTS_W
void setTrackbarMin(
const String& trackbarname,
const String& winname,
int minval);
720 float hscale, vscale;
792CV_EXPORTS_W
void displayOverlay(
const String& winname,
const String& text,
int delayms = 0);
806CV_EXPORTS_W
void displayStatusBar(
const String& winname,
const String& text,
int delayms = 0);
826CV_EXPORTS
int startLoop(
int (*pt2Func)(
int argc,
char *argv[]),
int argc,
char* argv[]);
828CV_EXPORTS
void stopLoop();
858 bool initial_button_state =
false);
n-dimensional dense array class
Definition: mat.hpp:802
Template class for 2D rectangles
Definition: core/types.hpp:421
static Scalar_< double > all(double v0)
returns a scalar with all elements set to v0
Template class for specifying the size of an image or rectangle.
Definition: core/types.hpp:316
Smart pointer for OpenGL 2D texture memory with reference counting.
Definition: opengl.hpp:284
CV_EXPORTS void setOpenGlContext(const String &winname)
Sets the specified window as current OpenGL context.
CV_EXPORTS void setOpenGlDrawCallback(const String &winname, OpenGlDrawCallback onOpenGlDraw, void *userdata=0)
Sets a callback function to be called to draw on top of displayed image.
CV_EXPORTS void updateWindow(const String &winname)
Force window to redraw its context and call draw callback ( See cv::setOpenGlDrawCallback ).
CV_EXPORTS int createButton(const String &bar_name, ButtonCallback on_change, void *userdata=0, int type=QT_PUSH_BUTTON, bool initial_button_state=false)
Attaches a button to the control panel.
CV_EXPORTS void saveWindowParameters(const String &windowName)
Saves parameters of the specified window.
CV_EXPORTS_W void displayOverlay(const String &winname, const String &text, int delayms=0)
Displays a text on a window image as an overlay for a specified duration.
CV_EXPORTS QtFont fontQt(const String &nameFont, int pointSize=-1, Scalar color=Scalar::all(0), int weight=QT_FONT_NORMAL, int style=QT_STYLE_NORMAL, int spacing=0)
Creates the font to draw a text on an image.
QtFontStyles
Qt font style
Definition: highgui.hpp:250
CV_EXPORTS void addText(const Mat &img, const String &text, Point org, const QtFont &font)
Draws a text on the image.
CV_EXPORTS_W void displayStatusBar(const String &winname, const String &text, int delayms=0)
Displays a text on the window statusbar during the specified period of time.
QtFontWeights
Qt font weight
Definition: highgui.hpp:241
QtButtonTypes
Qt "button" type
Definition: highgui.hpp:257
CV_EXPORTS void loadWindowParameters(const String &windowName)
Loads parameters of the specified window.
@ QT_STYLE_OBLIQUE
Oblique font.
Definition: highgui.hpp:253
@ QT_STYLE_NORMAL
Normal font.
Definition: highgui.hpp:251
@ QT_STYLE_ITALIC
Italic font.
Definition: highgui.hpp:252
@ QT_FONT_LIGHT
Weight of 25
Definition: highgui.hpp:242
@ QT_FONT_DEMIBOLD
Weight of 63
Definition: highgui.hpp:244
@ QT_FONT_NORMAL
Weight of 50
Definition: highgui.hpp:243
@ QT_FONT_BLACK
Weight of 87
Definition: highgui.hpp:246
@ QT_FONT_BOLD
Weight of 75
Definition: highgui.hpp:245
@ QT_CHECKBOX
Checkbox button.
Definition: highgui.hpp:259
@ QT_RADIOBOX
Radiobox button.
Definition: highgui.hpp:260
@ QT_PUSH_BUTTON
Push button.
Definition: highgui.hpp:258
@ QT_NEW_BUTTONBAR
Button should create a new buttonbar
Definition: highgui.hpp:261
MouseEventTypes
Mouse Events see cv::MouseCallback
Definition: highgui.hpp:210
MouseEventFlags
Mouse Event Flags see cv::MouseCallback
Definition: highgui.hpp:226
WindowFlags
Flags for cv::namedWindow
Definition: highgui.hpp:186
WindowPropertyFlags
Flags for cv::setWindowProperty / cv::getWindowProperty
Definition: highgui.hpp:199
@ EVENT_MBUTTONDOWN
indicates that the middle mouse button is pressed.
Definition: highgui.hpp:214
@ EVENT_RBUTTONDBLCLK
indicates that right mouse button is double clicked.
Definition: highgui.hpp:219
@ EVENT_MOUSEWHEEL
positive and negative values mean forward and backward scrolling, respectively.
Definition: highgui.hpp:221
@ EVENT_LBUTTONUP
indicates that left mouse button is released.
Definition: highgui.hpp:215
@ EVENT_MOUSEHWHEEL
positive and negative values mean right and left scrolling, respectively.
Definition: highgui.hpp:222
@ EVENT_MOUSEMOVE
indicates that the mouse pointer has moved over the window.
Definition: highgui.hpp:211
@ EVENT_RBUTTONDOWN
indicates that the right mouse button is pressed.
Definition: highgui.hpp:213
@ EVENT_RBUTTONUP
indicates that right mouse button is released.
Definition: highgui.hpp:216
@ EVENT_MBUTTONUP
indicates that middle mouse button is released.
Definition: highgui.hpp:217
@ EVENT_LBUTTONDOWN
indicates that the left mouse button is pressed.
Definition: highgui.hpp:212
@ EVENT_LBUTTONDBLCLK
indicates that left mouse button is double clicked.
Definition: highgui.hpp:218
@ EVENT_MBUTTONDBLCLK
indicates that middle mouse button is double clicked.
Definition: highgui.hpp:220
@ EVENT_FLAG_RBUTTON
indicates that the right mouse button is down.
Definition: highgui.hpp:228
@ EVENT_FLAG_CTRLKEY
indicates that CTRL Key is pressed.
Definition: highgui.hpp:230
@ EVENT_FLAG_SHIFTKEY
indicates that SHIFT Key is pressed.
Definition: highgui.hpp:231
@ EVENT_FLAG_MBUTTON
indicates that the middle mouse button is down.
Definition: highgui.hpp:229
@ EVENT_FLAG_LBUTTON
indicates that the left mouse button is down.
Definition: highgui.hpp:227
@ EVENT_FLAG_ALTKEY
indicates that ALT Key is pressed.
Definition: highgui.hpp:232
@ WINDOW_FREERATIO
the image expends as much as it can (no ratio constraint).
Definition: highgui.hpp:192
@ WINDOW_NORMAL
the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal s...
Definition: highgui.hpp:187
@ WINDOW_OPENGL
window with opengl support.
Definition: highgui.hpp:189
@ WINDOW_GUI_NORMAL
old fashious way
Definition: highgui.hpp:195
@ WINDOW_FULLSCREEN
change the window to fullscreen.
Definition: highgui.hpp:191
@ WINDOW_KEEPRATIO
the ratio of the image is respected.
Definition: highgui.hpp:193
@ WINDOW_AUTOSIZE
the user cannot resize the window, the size is constrainted by the image displayed.
Definition: highgui.hpp:188
@ WINDOW_GUI_EXPANDED
status bar and tool bar
Definition: highgui.hpp:194
@ WND_PROP_VISIBLE
checks whether the window exists and is visible
Definition: highgui.hpp:204
@ WND_PROP_TOPMOST
property to toggle normal window being topmost or not
Definition: highgui.hpp:205
@ WND_PROP_OPENGL
opengl support.
Definition: highgui.hpp:203
@ WND_PROP_FULLSCREEN
fullscreen property (can be WINDOW_NORMAL or WINDOW_FULLSCREEN).
Definition: highgui.hpp:200
@ WND_PROP_AUTOSIZE
autosize property (can be WINDOW_NORMAL or WINDOW_AUTOSIZE).
Definition: highgui.hpp:201
@ WND_PROP_ASPECT_RATIO
window's aspect ration (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO).
Definition: highgui.hpp:202
@ WND_PROP_VSYNC
enable or disable VSYNC (in OpenGL mode)
Definition: highgui.hpp:206
void(* TrackbarCallback)(int pos, void *userdata)
Callback function for Trackbar see cv::createTrackbar
Definition: highgui.hpp:279
CV_EXPORTS_W Rect getWindowImageRect(const String &winname)
Provides rectangle of image in the window.
CV_EXPORTS 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.
void(* ButtonCallback)(int state, void *userdata)
Callback function for a button created by cv::createButton
Definition: highgui.hpp:290
CV_EXPORTS_W double getWindowProperty(const String &winname, int prop_id)
Provides parameters of a window.
CV_EXPORTS_W Rect selectROI(const String &windowName, InputArray img, bool showCrosshair=true, bool fromCenter=false)
Allows users to select a ROI on the given image.
CV_EXPORTS_W void setWindowTitle(const String &winname, const String &title)
Updates window title
CV_EXPORTS_W void destroyAllWindows()
Destroys all of the HighGUI windows.
CV_EXPORTS int getMouseWheelDelta(int flags)
Gets the mouse-wheel motion delta, when handling mouse-wheel events cv::EVENT_MOUSEWHEEL and cv::EVEN...
CV_EXPORTS void setMouseCallback(const String &winname, MouseCallback onMouse, void *userdata=0)
Sets mouse handler for the specified window
CV_EXPORTS_W int waitKey(int delay=0)
Waits for a pressed key.
CV_EXPORTS_W void moveWindow(const String &winname, int x, int y)
Moves the window to the specified position
CV_EXPORTS_W void setTrackbarMax(const String &trackbarname, const String &winname, int maxval)
Sets the trackbar maximum position.
CV_EXPORTS_W void imshow(const String &winname, InputArray mat)
Displays an image in the specified window.
CV_EXPORTS_W int pollKey()
Polls for a pressed key.
void(* OpenGlDrawCallback)(void *userdata)
Callback function defined to be called every frame. See cv::setOpenGlDrawCallback
Definition: highgui.hpp:284
CV_EXPORTS_W int waitKeyEx(int delay=0)
Similar to waitKey, but returns full key code.
CV_EXPORTS_W void setTrackbarMin(const String &trackbarname, const String &winname, int minval)
Sets the trackbar minimum position.
CV_EXPORTS_W void destroyWindow(const String &winname)
Destroys the specified window.
CV_EXPORTS_W void resizeWindow(const String &winname, int width, int height)
Resizes the window to the specified size
CV_EXPORTS_W int getTrackbarPos(const String &trackbarname, const String &winname)
Returns the trackbar position.
void(* MouseCallback)(int event, int x, int y, int flags, void *userdata)
Callback function for mouse events. see cv::setMouseCallback
Definition: highgui.hpp:273
CV_EXPORTS_W void setWindowProperty(const String &winname, int prop_id, double prop_value)
Changes parameters of a window dynamically.
CV_EXPORTS_W void namedWindow(const String &winname, int flags=WINDOW_AUTOSIZE)
Creates a window.
CV_EXPORTS_W void selectROIs(const String &windowName, InputArray img, CV_OUT std::vector< Rect > &boundingBoxes, bool showCrosshair=true, bool fromCenter=false)
Allows users to select multiple ROIs on the given image.
CV_EXPORTS_W void setTrackbarPos(const String &trackbarname, const String &winname, int pos)
Sets the trackbar position.
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
QtFont available only for Qt. See cv::fontQt
Definition: highgui.hpp:713
float shear
slope coefficient: 0 - normal, >0 - italic
Definition: highgui.hpp:721
int line_type
PointSize
Definition: highgui.hpp:724
float dx
horizontal interval between letters
Definition: highgui.hpp:723
const char * nameFont
Name of the font
Definition: highgui.hpp:714
const int * ascii
font data and metrics
Definition: highgui.hpp:717
int thickness
See cv::QtFontWeights
Definition: highgui.hpp:722
Scalar color
Color of the font. Scalar(blue_component, green_component, red_component[, alpha_component])
Definition: highgui.hpp:715
int font_face
See cv::QtFontStyles
Definition: highgui.hpp:716