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
e161f428
Commit
e161f428
authored
May 24, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed PvAPI search on Windows #1927
parent
6455488f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
23 deletions
+36
-23
CMakeLists.txt
CMakeLists.txt
+22
-1
CMakeLists.txt
modules/highgui/CMakeLists.txt
+1
-12
cap_pvapi.cpp
modules/highgui/src/cap_pvapi.cpp
+13
-10
No files found.
CMakeLists.txt
View file @
e161f428
...
...
@@ -408,11 +408,32 @@ endif(WITH_UNICAP)
ocv_clear_vars
(
HAVE_PVAPI
)
if
(
WITH_PVAPI
)
find_path
(
PVAPI_INCLUDE_PATH
"PvApi.h"
PATHS
"/usr/local/include"
"/usr/include"
PATHS /usr/local /opt /usr ENV ProgramFiles ENV ProgramW6432
PATH_SUFFIXES include
"Allied Vision Technologies/GigESDK/inc-pc"
"AVT GigE SDK/inc-pc"
"GigESDK/inc-pc"
DOC
"The path to PvAPI header"
)
if
(
PVAPI_INCLUDE_PATH
)
if
(
X86 AND NOT WIN32
)
set
(
PVAPI_SDK_SUBDIR x86
)
elseif
(
X86_64
)
set
(
PVAPI_SDK_SUBDIR x64
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES arm
)
set
(
PVAPI_SDK_SUBDIR arm
)
endif
()
get_filename_component
(
_PVAPI_LIBRARY
"
${
PVAPI_INCLUDE_PATH
}
/../lib-pc"
ABSOLUTE
)
if
(
PVAPI_SDK_SUBDIR
)
set
(
_PVAPI_LIBRARY
"
${
_PVAPI_LIBRARY
}
/
${
PVAPI_SDK_SUBDIR
}
"
)
endif
()
if
(
NOT WIN32 AND CMAKE_COMPILER_IS_GNUCXX
)
set
(
_PVAPI_LIBRARY
"
${
_PVAPI_LIBRARY
}
/
${
CMAKE_OPENCV_GCC_VERSION_MAJOR
}
.
${
CMAKE_OPENCV_GCC_VERSION_MINOR
}
"
)
endif
()
set
(
PVAPI_LIBRARY
"
${
_PVAPI_LIBRARY
}
/
${
CMAKE_STATIC_LIBRARY_PREFIX
}
PvAPI
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
"
CACHE PATH
"The PvAPI library"
)
if
(
EXISTS
"
${
PVAPI_LIBRARY
}
"
)
set
(
HAVE_PVAPI TRUE
)
endif
()
endif
(
PVAPI_INCLUDE_PATH
)
endif
(
WITH_PVAPI
)
# --- Dc1394 ---
...
...
modules/highgui/CMakeLists.txt
View file @
e161f428
...
...
@@ -157,19 +157,8 @@ endif(HAVE_FFMPEG)
if
(
HAVE_PVAPI
)
add_definitions
(
-DHAVE_PVAPI
)
ocv_include_directories
(
${
PVAPI_INCLUDE_PATH
}
)
if
(
X86
)
set
(
PVAPI_SDK_SUBDIR x86
)
elseif
(
X86_64
)
set
(
PVAPI_SDK_SUBDIR x64
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES arm
)
set
(
PVAPI_SDK_SUBDIR arm
)
endif
()
if
(
PVAPI_SDK_SUBDIR AND CMAKE_COMPILER_IS_GNUCXX
)
get_filename_component
(
PVAPI_EXPECTED_LIB_PATH
"
${
PVAPI_INCLUDE_PATH
}
/../lib-pc/
${
PVAPI_SDK_SUBDIR
}
/
${
CMAKE_OPENCV_GCC_VERSION_MAJOR
}
.
${
CMAKE_OPENCV_GCC_VERSION_MINOR
}
"
ABSOLUTE
)
link_directories
(
${
PVAPI_EXPECTED_LIB_PATH
}
)
endif
()
set
(
highgui_srcs src/cap_pvapi.cpp
${
highgui_srcs
}
)
set
(
HIGHGUI_LIBRARIES
${
HIGHGUI_LIBRARIES
}
PvAPI
)
list
(
APPEND HIGHGUI_LIBRARIES
${
PVAPI_LIBRARY
}
)
endif
()
if
(
WITH_IMAGEIO
)
...
...
modules/highgui/src/cap_pvapi.cpp
View file @
e161f428
...
...
@@ -57,7 +57,12 @@
#endif
#include <PvApi.h>
#include <unistd.h>
#ifdef WIN32
# include <io.h>
#else
# include <unistd.h>
#endif
#include <string>
//#include <arpa/inet.h>
...
...
@@ -86,23 +91,22 @@ public:
}
protected
:
#ifndef WIN32
virtual
void
Sleep
(
unsigned
int
time
);
#endif
typedef
struct
{
unsigned
long
UID
;
tPvHandle
Handle
;
tPvFrame
Frame
;
}
tCamera
;
IplImage
*
frame
;
IplImage
*
grayframe
;
tCamera
Camera
;
tPvErr
Errcode
;
bool
monocrome
;
};
...
...
@@ -111,6 +115,8 @@ CvCaptureCAM_PvAPI::CvCaptureCAM_PvAPI()
monocrome
=
false
;
memset
(
&
this
->
Camera
,
0
,
sizeof
(
this
->
Camera
));
}
#ifndef WIN32
void
CvCaptureCAM_PvAPI
::
Sleep
(
unsigned
int
time
)
{
struct
timespec
t
,
r
;
...
...
@@ -121,6 +127,8 @@ void CvCaptureCAM_PvAPI::Sleep(unsigned int time)
while
(
nanosleep
(
&
t
,
&
r
)
==-
1
)
t
=
r
;
}
#endif
void
CvCaptureCAM_PvAPI
::
close
()
{
// Stop the acquisition & free the camera
...
...
@@ -366,9 +374,4 @@ CvCapture* cvCreateCameraCapture_PvAPI( int index )
delete
capture
;
return
NULL
;
}
#ifdef _MSC_VER
#pragma comment(lib, "PvAPI.lib")
#endif
#endif
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