Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
2a4fb155
Commit
2a4fb155
authored
Nov 28, 2011
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added OpenGL support to Gtk realization of highgui
parent
fb2fad52
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
70 deletions
+88
-70
CMakeLists.txt
CMakeLists.txt
+0
-0
precomp.hpp
modules/highgui/src/precomp.hpp
+7
-2
window.cpp
modules/highgui/src/window.cpp
+56
-50
window_gtk.cpp
modules/highgui/src/window_gtk.cpp
+0
-0
point_cloud.cpp
samples/cpp/point_cloud.cpp
+23
-15
highgui_gpu.cpp
samples/gpu/highgui_gpu.cpp
+2
-3
No files found.
CMakeLists.txt
View file @
2a4fb155
This diff is collapsed.
Click to expand it.
modules/highgui/src/precomp.hpp
View file @
2a4fb155
...
@@ -98,7 +98,7 @@ struct CvCapture
...
@@ -98,7 +98,7 @@ struct CvCapture
virtual
bool
setProperty
(
int
,
double
)
{
return
0
;
}
virtual
bool
setProperty
(
int
,
double
)
{
return
0
;
}
virtual
bool
grabFrame
()
{
return
true
;
}
virtual
bool
grabFrame
()
{
return
true
;
}
virtual
IplImage
*
retrieveFrame
(
int
)
{
return
0
;
}
virtual
IplImage
*
retrieveFrame
(
int
)
{
return
0
;
}
virtual
int
getCaptureDomain
()
{
return
CV_CAP_ANY
;
}
// Return the type of the capture object: CV_CAP_VFW, etc...
virtual
int
getCaptureDomain
()
{
return
CV_CAP_ANY
;
}
// Return the type of the capture object: CV_CAP_VFW, etc...
};
};
/*************************** CvVideoWriter structure ****************************/
/*************************** CvVideoWriter structure ****************************/
...
@@ -176,7 +176,7 @@ CvCapture * cvCreateCameraCapture_PvAPI (const int index);
...
@@ -176,7 +176,7 @@ CvCapture * cvCreateCameraCapture_PvAPI (const int index);
CvVideoWriter
*
cvCreateVideoWriter_GStreamer
(
const
char
*
filename
,
int
fourcc
,
CvVideoWriter
*
cvCreateVideoWriter_GStreamer
(
const
char
*
filename
,
int
fourcc
,
double
fps
,
CvSize
frameSize
,
int
is_color
);
double
fps
,
CvSize
frameSize
,
int
is_color
);
//Yannick Verdie 2010
//Yannick Verdie 2010
void
cvSetModeWindow_W32
(
const
char
*
name
,
double
prop_value
);
void
cvSetModeWindow_W32
(
const
char
*
name
,
double
prop_value
);
void
cvSetModeWindow_GTK
(
const
char
*
name
,
double
prop_value
);
void
cvSetModeWindow_GTK
(
const
char
*
name
,
double
prop_value
);
void
cvSetModeWindow_CARBON
(
const
char
*
name
,
double
prop_value
);
void
cvSetModeWindow_CARBON
(
const
char
*
name
,
double
prop_value
);
...
@@ -186,8 +186,13 @@ double cvGetModeWindow_GTK(const char* name);
...
@@ -186,8 +186,13 @@ double cvGetModeWindow_GTK(const char* name);
double
cvGetModeWindow_CARBON
(
const
char
*
name
);
double
cvGetModeWindow_CARBON
(
const
char
*
name
);
double
cvGetPropWindowAutoSize_W32
(
const
char
*
name
);
double
cvGetPropWindowAutoSize_W32
(
const
char
*
name
);
double
cvGetPropWindowAutoSize_GTK
(
const
char
*
name
);
double
cvGetRatioWindow_W32
(
const
char
*
name
);
double
cvGetRatioWindow_W32
(
const
char
*
name
);
double
cvGetRatioWindow_GTK
(
const
char
*
name
);
double
cvGetOpenGlProp_W32
(
const
char
*
name
);
double
cvGetOpenGlProp_W32
(
const
char
*
name
);
double
cvGetOpenGlProp_GTK
(
const
char
*
name
);
//for QT
//for QT
#if defined (HAVE_QT)
#if defined (HAVE_QT)
...
...
modules/highgui/src/window.cpp
View file @
2a4fb155
...
@@ -49,13 +49,13 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
...
@@ -49,13 +49,13 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
{
{
//change between fullscreen or not.
//change between fullscreen or not.
case
CV_WND_PROP_FULLSCREEN
:
case
CV_WND_PROP_FULLSCREEN
:
if
(
!
name
||
(
prop_value
!=
CV_WINDOW_NORMAL
&&
prop_value
!=
CV_WINDOW_FULLSCREEN
))
//bad argument
if
(
!
name
||
(
prop_value
!=
CV_WINDOW_NORMAL
&&
prop_value
!=
CV_WINDOW_FULLSCREEN
))
//bad argument
break
;
break
;
#if defined (HAVE_QT)
#if defined (HAVE_QT)
cvSetModeWindow_QT
(
name
,
prop_value
);
cvSetModeWindow_QT
(
name
,
prop_value
);
#elif defined WIN32 || defined _WIN32
#elif defined WIN32 || defined _WIN32
cvSetModeWindow_W32
(
name
,
prop_value
);
cvSetModeWindow_W32
(
name
,
prop_value
);
#elif defined (HAVE_GTK)
#elif defined (HAVE_GTK)
cvSetModeWindow_GTK
(
name
,
prop_value
);
cvSetModeWindow_GTK
(
name
,
prop_value
);
...
@@ -63,19 +63,19 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
...
@@ -63,19 +63,19 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
cvSetModeWindow_CARBON
(
name
,
prop_value
);
cvSetModeWindow_CARBON
(
name
,
prop_value
);
#endif
#endif
break
;
break
;
case
CV_WND_PROP_AUTOSIZE
:
case
CV_WND_PROP_AUTOSIZE
:
#if defined (HAVE_QT)
#if defined (HAVE_QT)
cvSetPropWindow_QT
(
name
,
prop_value
);
cvSetPropWindow_QT
(
name
,
prop_value
);
#endif
#endif
break
;
break
;
case
CV_WND_PROP_ASPECTRATIO
:
case
CV_WND_PROP_ASPECTRATIO
:
#if defined (HAVE_QT)
#if defined (HAVE_QT)
cvSetRatioWindow_QT
(
name
,
prop_value
);
cvSetRatioWindow_QT
(
name
,
prop_value
);
#endif
#endif
break
;
break
;
default:
;
default:
;
}
}
}
}
...
@@ -83,16 +83,16 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
...
@@ -83,16 +83,16 @@ CV_IMPL void cvSetWindowProperty(const char* name, int prop_id, double prop_valu
/* return -1 if error */
/* return -1 if error */
CV_IMPL
double
cvGetWindowProperty
(
const
char
*
name
,
int
prop_id
)
CV_IMPL
double
cvGetWindowProperty
(
const
char
*
name
,
int
prop_id
)
{
{
if
(
!
name
)
if
(
!
name
)
return
-
1
;
return
-
1
;
switch
(
prop_id
)
switch
(
prop_id
)
{
{
case
CV_WND_PROP_FULLSCREEN
:
case
CV_WND_PROP_FULLSCREEN
:
#if defined (HAVE_QT)
#if defined (HAVE_QT)
return
cvGetModeWindow_QT
(
name
);
return
cvGetModeWindow_QT
(
name
);
#elif defined WIN32 || defined _WIN32
#elif defined WIN32 || defined _WIN32
return
cvGetModeWindow_W32
(
name
);
return
cvGetModeWindow_W32
(
name
);
#elif defined (HAVE_GTK)
#elif defined (HAVE_GTK)
return
cvGetModeWindow_GTK
(
name
);
return
cvGetModeWindow_GTK
(
name
);
...
@@ -102,39 +102,45 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
...
@@ -102,39 +102,45 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
return
-
1
;
return
-
1
;
#endif
#endif
break
;
break
;
case
CV_WND_PROP_AUTOSIZE
:
case
CV_WND_PROP_AUTOSIZE
:
#if defined (HAVE_QT)
#if defined (HAVE_QT)
return
cvGetPropWindow_QT
(
name
);
return
cvGetPropWindow_QT
(
name
);
#elif defined WIN32 || defined _WIN32
#elif defined WIN32 || defined _WIN32
return
cvGetPropWindowAutoSize_W32
(
name
);
return
cvGetPropWindowAutoSize_W32
(
name
);
#elif defined (HAVE_GTK)
return
cvGetPropWindowAutoSize_GTK
(
name
);
#else
#else
return
-
1
;
return
-
1
;
#endif
#endif
break
;
break
;
case
CV_WND_PROP_ASPECTRATIO
:
case
CV_WND_PROP_ASPECTRATIO
:
#if defined (HAVE_QT)
#if defined (HAVE_QT)
return
cvGetRatioWindow_QT
(
name
);
return
cvGetRatioWindow_QT
(
name
);
#elif defined WIN32 || defined _WIN32
#elif defined WIN32 || defined _WIN32
return
cvGetRatioWindow_W32
(
name
);
return
cvGetRatioWindow_W32
(
name
);
#elif defined (HAVE_GTK)
return
cvGetRatioWindow_GTK
(
name
);
#else
#else
return
-
1
;
return
-
1
;
#endif
#endif
break
;
break
;
case
CV_WND_PROP_OPENGL
:
case
CV_WND_PROP_OPENGL
:
#if defined (HAVE_QT)
#if defined (HAVE_QT)
#elif defined WIN32 || defined _WIN32
#elif defined WIN32 || defined _WIN32
return
cvGetOpenGlProp_W32
(
name
);
return
cvGetOpenGlProp_W32
(
name
);
#elif defined (HAVE_GTK)
return
cvGetOpenGlProp_GTK
(
name
);
#else
#else
return
-
1
;
return
-
1
;
#endif
#endif
break
;
break
;
default:
default:
return
-
1
;
return
-
1
;
}
}
...
@@ -198,12 +204,12 @@ int cv::getTrackbarPos( const string& trackbarName, const string& winName )
...
@@ -198,12 +204,12 @@ int cv::getTrackbarPos( const string& trackbarName, const string& winName )
{
{
return
cvGetTrackbarPos
(
trackbarName
.
c_str
(),
winName
.
c_str
());
return
cvGetTrackbarPos
(
trackbarName
.
c_str
(),
winName
.
c_str
());
}
}
void
cv
::
setMouseCallback
(
const
string
&
windowName
,
MouseCallback
onMouse
,
void
*
param
)
void
cv
::
setMouseCallback
(
const
string
&
windowName
,
MouseCallback
onMouse
,
void
*
param
)
{
{
cvSetMouseCallback
(
windowName
.
c_str
(),
onMouse
,
param
);
cvSetMouseCallback
(
windowName
.
c_str
(),
onMouse
,
param
);
}
}
int
cv
::
startWindowThread
()
int
cv
::
startWindowThread
()
{
{
return
cvStartWindowThread
();
return
cvStartWindowThread
();
...
@@ -363,13 +369,13 @@ namespace
...
@@ -363,13 +369,13 @@ namespace
addGlObj
(
glObj
);
addGlObj
(
glObj
);
icvSetOpenGlCleanCallback
(
winname
.
c_str
(),
glCleanCallback
,
glObj
);
icvSetOpenGlCleanCallback
(
winname
.
c_str
(),
glCleanCallback
,
glObj
);
}
}
setOpenGlDrawCallback
(
winname
,
glDrawTextureCallback
,
glObj
);
setOpenGlDrawCallback
(
winname
,
glDrawTextureCallback
,
glObj
);
updateWindow
(
winname
);
updateWindow
(
winname
);
}
}
}
}
#endif // HAVE_OPENGL
#endif // HAVE_OPENGL
...
@@ -397,7 +403,7 @@ void cv::imshow( const string& winname, InputArray _img )
...
@@ -397,7 +403,7 @@ void cv::imshow( const string& winname, InputArray _img )
void
cv
::
imshow
(
const
string
&
winname
,
const
gpu
::
GlBuffer
&
buf
)
void
cv
::
imshow
(
const
string
&
winname
,
const
gpu
::
GlBuffer
&
buf
)
{
{
#ifndef HAVE_OPENGL
#ifndef HAVE_OPENGL
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
#else
#else
imshowImpl
(
winname
,
buf
);
imshowImpl
(
winname
,
buf
);
#endif
#endif
...
@@ -406,7 +412,7 @@ void cv::imshow(const string& winname, const gpu::GlBuffer& buf)
...
@@ -406,7 +412,7 @@ void cv::imshow(const string& winname, const gpu::GlBuffer& buf)
void
cv
::
imshow
(
const
string
&
winname
,
const
gpu
::
GpuMat
&
d_mat
)
void
cv
::
imshow
(
const
string
&
winname
,
const
gpu
::
GpuMat
&
d_mat
)
{
{
#ifndef HAVE_OPENGL
#ifndef HAVE_OPENGL
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
#else
#else
setOpenGlContext
(
winname
);
setOpenGlContext
(
winname
);
gpu
::
GlBuffer
buf
(
d_mat
,
gpu
::
GlBuffer
::
TEXTURE_BUFFER
);
gpu
::
GlBuffer
buf
(
d_mat
,
gpu
::
GlBuffer
::
TEXTURE_BUFFER
);
...
@@ -417,7 +423,7 @@ void cv::imshow(const string& winname, const gpu::GpuMat& d_mat)
...
@@ -417,7 +423,7 @@ void cv::imshow(const string& winname, const gpu::GpuMat& d_mat)
void
cv
::
imshow
(
const
string
&
winname
,
const
gpu
::
GlTexture
&
tex
)
void
cv
::
imshow
(
const
string
&
winname
,
const
gpu
::
GlTexture
&
tex
)
{
{
#ifndef HAVE_OPENGL
#ifndef HAVE_OPENGL
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
#else
#else
namedWindow
(
winname
,
WINDOW_OPENGL
|
WINDOW_AUTOSIZE
);
namedWindow
(
winname
,
WINDOW_OPENGL
|
WINDOW_AUTOSIZE
);
...
@@ -462,9 +468,9 @@ void cv::imshow(const string& winname, const gpu::GlTexture& tex)
...
@@ -462,9 +468,9 @@ void cv::imshow(const string& winname, const gpu::GlTexture& tex)
}
}
void
cv
::
pointCloudShow
(
const
string
&
winname
,
const
gpu
::
GlCamera
&
camera
,
const
gpu
::
GlArrays
&
arr
)
void
cv
::
pointCloudShow
(
const
string
&
winname
,
const
gpu
::
GlCamera
&
camera
,
const
gpu
::
GlArrays
&
arr
)
{
{
#ifndef HAVE_OPENGL
#ifndef HAVE_OPENGL
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
#else
#else
namedWindow
(
winname
,
WINDOW_OPENGL
);
namedWindow
(
winname
,
WINDOW_OPENGL
);
...
@@ -565,27 +571,27 @@ namespace
...
@@ -565,27 +571,27 @@ namespace
#endif // HAVE_OPENGL
#endif // HAVE_OPENGL
void
cv
::
pointCloudShow
(
const
string
&
winname
,
const
gpu
::
GlCamera
&
camera
,
const
gpu
::
GlBuffer
&
points
,
const
gpu
::
GlBuffer
&
colors
)
void
cv
::
pointCloudShow
(
const
string
&
winname
,
const
gpu
::
GlCamera
&
camera
,
const
gpu
::
GlBuffer
&
points
,
const
gpu
::
GlBuffer
&
colors
)
{
{
#ifndef HAVE_OPENGL
#ifndef HAVE_OPENGL
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
#else
#else
pointCloudShowImpl
(
winname
,
camera
,
points
,
colors
);
pointCloudShowImpl
(
winname
,
camera
,
points
,
colors
);
#endif
#endif
}
}
void
cv
::
pointCloudShow
(
const
string
&
winname
,
const
gpu
::
GlCamera
&
camera
,
const
gpu
::
GpuMat
&
points
,
const
gpu
::
GpuMat
&
colors
)
void
cv
::
pointCloudShow
(
const
string
&
winname
,
const
gpu
::
GlCamera
&
camera
,
const
gpu
::
GpuMat
&
points
,
const
gpu
::
GpuMat
&
colors
)
{
{
#ifndef HAVE_OPENGL
#ifndef HAVE_OPENGL
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
#else
#else
pointCloudShowImpl
(
winname
,
camera
,
points
,
colors
);
pointCloudShowImpl
(
winname
,
camera
,
points
,
colors
);
#endif
#endif
}
}
void
cv
::
pointCloudShow
(
const
string
&
winname
,
const
gpu
::
GlCamera
&
camera
,
InputArray
points
,
InputArray
colors
)
void
cv
::
pointCloudShow
(
const
string
&
winname
,
const
gpu
::
GlCamera
&
camera
,
InputArray
points
,
InputArray
colors
)
{
{
#ifndef HAVE_OPENGL
#ifndef HAVE_OPENGL
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
#else
#else
pointCloudShowImpl
(
winname
,
camera
,
points
,
colors
);
pointCloudShowImpl
(
winname
,
camera
,
points
,
colors
);
#endif
#endif
...
@@ -596,23 +602,23 @@ void cv::pointCloudShow(const string& winname, const gpu::GlCamera& camera, Inpu
...
@@ -596,23 +602,23 @@ void cv::pointCloudShow(const string& winname, const gpu::GlCamera& camera, Inpu
#ifndef HAVE_QT
#ifndef HAVE_QT
CV_IMPL
void
cvCreateOpenGLCallback
(
const
char
*
,
CvOpenGLCallback
,
void
*
,
double
,
double
,
double
)
CV_IMPL
void
cvCreateOpenGLCallback
(
const
char
*
,
CvOpenGLCallback
,
void
*
,
double
,
double
,
double
)
{
{
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
}
}
#endif
#endif
CV_IMPL
void
cvSetOpenGlContext
(
const
char
*
)
CV_IMPL
void
cvSetOpenGlContext
(
const
char
*
)
{
{
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
}
}
CV_IMPL
void
cvUpdateWindow
(
const
char
*
)
CV_IMPL
void
cvUpdateWindow
(
const
char
*
)
{
{
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
}
}
void
icvSetOpenGlCleanCallback
(
const
char
*
,
CvOpenGlCleanCallback
,
void
*
)
void
icvSetOpenGlCleanCallback
(
const
char
*
,
CvOpenGlCleanCallback
,
void
*
)
{
{
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
}
}
#endif // !HAVE_OPENGL
#endif // !HAVE_OPENGL
...
@@ -676,7 +682,7 @@ int cv::createButton(const string& button_name, ButtonCallback on_change, void*
...
@@ -676,7 +682,7 @@ int cv::createButton(const string& button_name, ButtonCallback on_change, void*
#else
#else
// No windowing system present at compile time ;-(
// No windowing system present at compile time ;-(
//
//
// We will build place holders that don't break the API but give an error
// We will build place holders that don't break the API but give an error
// at runtime. This way people can choose to replace an installed HighGUI
// at runtime. This way people can choose to replace an installed HighGUI
// version with a more capable one without a need to recompile dependent
// version with a more capable one without a need to recompile dependent
...
@@ -695,7 +701,7 @@ CV_IMPL int cvNamedWindow( const char*, int )
...
@@ -695,7 +701,7 @@ CV_IMPL int cvNamedWindow( const char*, int )
{
{
CV_NO_GUI_ERROR
(
"cvNamedWindow"
);
CV_NO_GUI_ERROR
(
"cvNamedWindow"
);
return
-
1
;
return
-
1
;
}
}
CV_IMPL
void
cvDestroyWindow
(
const
char
*
)
CV_IMPL
void
cvDestroyWindow
(
const
char
*
)
{
{
...
@@ -763,7 +769,7 @@ CV_IMPL void* cvGetWindowHandle( const char* )
...
@@ -763,7 +769,7 @@ CV_IMPL void* cvGetWindowHandle( const char* )
CV_NO_GUI_ERROR
(
"cvGetWindowHandle"
);
CV_NO_GUI_ERROR
(
"cvGetWindowHandle"
);
return
0
;
return
0
;
}
}
CV_IMPL
const
char
*
cvGetWindowName
(
void
*
)
CV_IMPL
const
char
*
cvGetWindowName
(
void
*
)
{
{
CV_NO_GUI_ERROR
(
"cvGetWindowName"
);
CV_NO_GUI_ERROR
(
"cvGetWindowName"
);
...
@@ -799,39 +805,39 @@ CV_IMPL void cvAddText( const CvArr*, const char*, CvPoint org, CvFont* font)
...
@@ -799,39 +805,39 @@ CV_IMPL void cvAddText( const CvArr*, const char*, CvPoint org, CvFont* font)
CV_IMPL
void
cvDisplayStatusBar
(
const
char
*
name
,
const
char
*
arg2
,
int
arg3
)
CV_IMPL
void
cvDisplayStatusBar
(
const
char
*
name
,
const
char
*
arg2
,
int
arg3
)
{
{
CV_NO_GUI_ERROR
(
"cvDisplayStatusBar"
);
CV_NO_GUI_ERROR
(
"cvDisplayStatusBar"
);
}
}
CV_IMPL
void
cvDisplayOverlay
(
const
char
*
name
,
const
char
*
text
,
int
delayms
)
CV_IMPL
void
cvDisplayOverlay
(
const
char
*
name
,
const
char
*
text
,
int
delayms
)
{
{
CV_NO_GUI_ERROR
(
"cvNamedWindow"
);
CV_NO_GUI_ERROR
(
"cvNamedWindow"
);
}
}
CV_IMPL
int
cvStartLoop
(
int
(
*
pt2Func
)(
int
argc
,
char
*
argv
[]),
int
argc
,
char
*
argv
[])
CV_IMPL
int
cvStartLoop
(
int
(
*
pt2Func
)(
int
argc
,
char
*
argv
[]),
int
argc
,
char
*
argv
[])
{
{
CV_NO_GUI_ERROR
(
"cvStartLoop"
);
CV_NO_GUI_ERROR
(
"cvStartLoop"
);
return
-
1
;
return
-
1
;
}
}
CV_IMPL
void
cvStopLoop
()
CV_IMPL
void
cvStopLoop
()
{
{
CV_NO_GUI_ERROR
(
"cvStopLoop"
);
CV_NO_GUI_ERROR
(
"cvStopLoop"
);
}
}
CV_IMPL
void
cvSaveWindowParameters
(
const
char
*
name
)
CV_IMPL
void
cvSaveWindowParameters
(
const
char
*
name
)
{
{
CV_NO_GUI_ERROR
(
"cvSaveWindowParameters"
);
CV_NO_GUI_ERROR
(
"cvSaveWindowParameters"
);
}
}
CV_IMPL
void
cvLoadWindowParameterss
(
const
char
*
name
)
CV_IMPL
void
cvLoadWindowParameterss
(
const
char
*
name
)
{
{
CV_NO_GUI_ERROR
(
"cvLoadWindowParameters"
);
CV_NO_GUI_ERROR
(
"cvLoadWindowParameters"
);
}
}
CV_IMPL
int
cvCreateButton
(
const
char
*
,
void
(
*
)(
int
,
void
*
),
void
*
,
int
,
int
)
CV_IMPL
int
cvCreateButton
(
const
char
*
,
void
(
*
)(
int
,
void
*
),
void
*
,
int
,
int
)
{
{
CV_NO_GUI_ERROR
(
"cvCreateButton"
);
CV_NO_GUI_ERROR
(
"cvCreateButton"
);
return
-
1
;
return
-
1
;
}
}
#endif
#endif
...
...
modules/highgui/src/window_gtk.cpp
View file @
2a4fb155
This diff is collapsed.
Click to expand it.
samples/cpp/point_cloud.cpp
View file @
2a4fb155
...
@@ -76,7 +76,7 @@ int main(int argc, const char* argv[])
...
@@ -76,7 +76,7 @@ int main(int argc, const char* argv[])
CommandLineParser
cmd
(
argc
,
argv
,
keys
);
CommandLineParser
cmd
(
argc
,
argv
,
keys
);
if
(
cmd
.
get
<
bool
>
(
"help"
))
if
(
cmd
.
get
<
bool
>
(
"help"
))
{
{
cout
<<
"Avaible options:"
<<
endl
;
cout
<<
"Avaible options:"
<<
endl
;
cmd
.
printParams
();
cmd
.
printParams
();
...
@@ -119,13 +119,13 @@ int main(int argc, const char* argv[])
...
@@ -119,13 +119,13 @@ int main(int argc, const char* argv[])
{
{
cout
<<
"Can't load image "
<<
right
<<
endl
;
cout
<<
"Can't load image "
<<
right
<<
endl
;
return
-
1
;
return
-
1
;
}
}
Mat
Q
=
Mat
::
eye
(
4
,
4
,
CV_32F
);
Mat
Q
=
Mat
::
eye
(
4
,
4
,
CV_32F
);
if
(
!
intrinsic
.
empty
()
&&
!
extrinsic
.
empty
())
if
(
!
intrinsic
.
empty
()
&&
!
extrinsic
.
empty
())
{
{
FileStorage
fs
;
FileStorage
fs
;
// reading intrinsic parameters
// reading intrinsic parameters
fs
.
open
(
intrinsic
,
CV_STORAGE_READ
);
fs
.
open
(
intrinsic
,
CV_STORAGE_READ
);
if
(
!
fs
.
isOpened
())
if
(
!
fs
.
isOpened
())
...
@@ -133,13 +133,13 @@ int main(int argc, const char* argv[])
...
@@ -133,13 +133,13 @@ int main(int argc, const char* argv[])
cout
<<
"Failed to open file "
<<
intrinsic
<<
endl
;
cout
<<
"Failed to open file "
<<
intrinsic
<<
endl
;
return
-
1
;
return
-
1
;
}
}
Mat
M1
,
D1
,
M2
,
D2
;
Mat
M1
,
D1
,
M2
,
D2
;
fs
[
"M1"
]
>>
M1
;
fs
[
"M1"
]
>>
M1
;
fs
[
"D1"
]
>>
D1
;
fs
[
"D1"
]
>>
D1
;
fs
[
"M2"
]
>>
M2
;
fs
[
"M2"
]
>>
M2
;
fs
[
"D2"
]
>>
D2
;
fs
[
"D2"
]
>>
D2
;
// reading extrinsic parameters
// reading extrinsic parameters
fs
.
open
(
extrinsic
,
CV_STORAGE_READ
);
fs
.
open
(
extrinsic
,
CV_STORAGE_READ
);
if
(
!
fs
.
isOpened
())
if
(
!
fs
.
isOpened
())
...
@@ -147,7 +147,7 @@ int main(int argc, const char* argv[])
...
@@ -147,7 +147,7 @@ int main(int argc, const char* argv[])
cout
<<
"Failed to open file "
<<
extrinsic
<<
endl
;
cout
<<
"Failed to open file "
<<
extrinsic
<<
endl
;
return
-
1
;
return
-
1
;
}
}
Mat
R
,
T
,
R1
,
P1
,
R2
,
P2
;
Mat
R
,
T
,
R1
,
P1
,
R2
,
P2
;
fs
[
"R"
]
>>
R
;
fs
[
"R"
]
>>
R
;
fs
[
"T"
]
>>
T
;
fs
[
"T"
]
>>
T
;
...
@@ -156,15 +156,15 @@ int main(int argc, const char* argv[])
...
@@ -156,15 +156,15 @@ int main(int argc, const char* argv[])
Rect
roi1
,
roi2
;
Rect
roi1
,
roi2
;
stereoRectify
(
M1
,
D1
,
M2
,
D2
,
img_size
,
R
,
T
,
R1
,
R2
,
P1
,
P2
,
Q
,
CALIB_ZERO_DISPARITY
,
-
1
,
img_size
,
&
roi1
,
&
roi2
);
stereoRectify
(
M1
,
D1
,
M2
,
D2
,
img_size
,
R
,
T
,
R1
,
R2
,
P1
,
P2
,
Q
,
CALIB_ZERO_DISPARITY
,
-
1
,
img_size
,
&
roi1
,
&
roi2
);
Mat
map11
,
map12
,
map21
,
map22
;
Mat
map11
,
map12
,
map21
,
map22
;
initUndistortRectifyMap
(
M1
,
D1
,
R1
,
P1
,
img_size
,
CV_16SC2
,
map11
,
map12
);
initUndistortRectifyMap
(
M1
,
D1
,
R1
,
P1
,
img_size
,
CV_16SC2
,
map11
,
map12
);
initUndistortRectifyMap
(
M2
,
D2
,
R2
,
P2
,
img_size
,
CV_16SC2
,
map21
,
map22
);
initUndistortRectifyMap
(
M2
,
D2
,
R2
,
P2
,
img_size
,
CV_16SC2
,
map21
,
map22
);
Mat
img1r
,
img2r
;
Mat
img1r
,
img2r
;
remap
(
imgLeftColor
,
img1r
,
map11
,
map12
,
INTER_LINEAR
);
remap
(
imgLeftColor
,
img1r
,
map11
,
map12
,
INTER_LINEAR
);
remap
(
imgRightColor
,
img2r
,
map21
,
map22
,
INTER_LINEAR
);
remap
(
imgRightColor
,
img2r
,
map21
,
map22
,
INTER_LINEAR
);
imgLeftColor
=
img1r
(
roi1
);
imgLeftColor
=
img1r
(
roi1
);
imgRightColor
=
img2r
(
roi2
);
imgRightColor
=
img2r
(
roi2
);
}
}
...
@@ -194,7 +194,7 @@ int main(int argc, const char* argv[])
...
@@ -194,7 +194,7 @@ int main(int argc, const char* argv[])
int
mouse
[
2
]
=
{
0
,
0
};
int
mouse
[
2
]
=
{
0
,
0
};
setMouseCallback
(
"OpenGL Sample"
,
mouseCallback
,
mouse
);
setMouseCallback
(
"OpenGL Sample"
,
mouseCallback
,
mouse
);
GlArrays
pointCloud
;
GlArrays
pointCloud
;
pointCloud
.
setVertexArray
(
points
);
pointCloud
.
setVertexArray
(
points
);
...
@@ -202,7 +202,7 @@ int main(int argc, const char* argv[])
...
@@ -202,7 +202,7 @@ int main(int argc, const char* argv[])
GlCamera
camera
;
GlCamera
camera
;
camera
.
setScale
(
Point3d
(
scale
,
scale
,
scale
));
camera
.
setScale
(
Point3d
(
scale
,
scale
,
scale
));
double
yaw
=
0.0
;
double
yaw
=
0.0
;
double
pitch
=
0.0
;
double
pitch
=
0.0
;
...
@@ -214,17 +214,25 @@ int main(int argc, const char* argv[])
...
@@ -214,17 +214,25 @@ int main(int argc, const char* argv[])
while
(
true
)
while
(
true
)
{
{
int
key
=
waitKey
(
1
);
int
key
=
waitKey
(
1
);
if
(
key
>=
0
)
key
=
key
&
0xff
;
if
(
key
==
27
)
if
(
key
==
27
)
break
;
break
;
double
aspect
=
getWindowProperty
(
"OpenGL Sample"
,
WND_PROP_ASPECT_RATIO
);
double
aspect
=
getWindowProperty
(
"OpenGL Sample"
,
WND_PROP_ASPECT_RATIO
);
const
double
posStep
=
0.1
;
const
double
posStep
=
0.1
;
#ifdef _WIN32
const
double
mouseStep
=
0.001
;
const
double
mouseStep
=
0.001
;
#else
const
double
mouseStep
=
0.000001
;
#endif
const
int
mouseClamp
=
300
;
const
int
mouseClamp
=
300
;
camera
.
setPerspectiveProjection
(
30.0
+
fov
/
100.0
*
40.0
,
aspect
,
0.1
,
1000.0
);
camera
.
setPerspectiveProjection
(
30.0
+
fov
/
100.0
*
40.0
,
aspect
,
0.1
,
1000.0
);
int
mouse_dx
=
clamp
(
mouse
[
0
],
-
mouseClamp
,
mouseClamp
);
int
mouse_dx
=
clamp
(
mouse
[
0
],
-
mouseClamp
,
mouseClamp
);
int
mouse_dy
=
clamp
(
mouse
[
1
],
-
mouseClamp
,
mouseClamp
);
int
mouse_dy
=
clamp
(
mouse
[
1
],
-
mouseClamp
,
mouseClamp
);
...
...
samples/gpu/highgui_gpu.cpp
View file @
2a4fb155
...
@@ -64,7 +64,7 @@ int main(int argc, char* argv[])
...
@@ -64,7 +64,7 @@ int main(int argc, char* argv[])
GpuMat
d_img
;
GpuMat
d_img
;
if
(
haveCuda
)
if
(
haveCuda
)
d_img
.
upload
(
img
);
d_img
.
upload
(
img
);
cout
<<
"=== First call
\n\n
"
;
cout
<<
"=== First call
\n\n
"
;
{
{
...
@@ -123,4 +123,4 @@ int main(int argc, char* argv[])
...
@@ -123,4 +123,4 @@ int main(int argc, char* argv[])
}
}
return
0
;
return
0
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment