Skip to content

Commit 75191e8

Browse files
committed
Smartek Giganetix Cameras support (Patch opencv#2192) integrated to master.
1 parent 6107954 commit 75191e8

File tree

8 files changed

+816
-1
lines changed

8 files changed

+816
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF
129129
OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS) )
130130
OCV_OPTION(WITH_PNG "Include PNG support" ON IF (NOT IOS) )
131131
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) )
132+
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" ON IF (NOT ANDROID AND NOT IOS) )
132133
OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS) )
133134
OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE )
134135
OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS) )
@@ -705,6 +706,10 @@ if(DEFINED WITH_PVAPI)
705706
status(" PvAPI:" HAVE_PVAPI THEN YES ELSE NO)
706707
endif(DEFINED WITH_PVAPI)
707708

709+
if(DEFINED WITH_GIGEAPI)
710+
status(" GigEVisionSDK:" HAVE_GIGE_API THEN YES ELSE NO)
711+
endif(DEFINED WITH_GIGEAPI)
712+
708713
if(DEFINED WITH_QUICKTIME)
709714
status(" QuickTime:" WITH_QUICKTIME THEN YES ELSE NO)
710715
status(" QTKit:" WITH_QUICKTIME THEN NO ELSE YES)

cmake/OpenCVFindLibsVideo.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ if(WITH_PVAPI)
5656
endif(PVAPI_INCLUDE_PATH)
5757
endif(WITH_PVAPI)
5858

59+
# --- GigEVisionSDK ---
60+
ocv_clear_vars(HAVE_GIGE_API)
61+
if(WITH_GIGEAPI)
62+
find_path(GIGEAPI_INCLUDE_PATH "GigEVisionSDK.h"
63+
PATHS /usr/local /var /opt /usr ENV ProgramFiles ENV ProgramW6432
64+
PATH_SUFFIXES include "Smartek Vision Technologies/GigEVisionSDK/gige_cpp" "GigEVisionSDK/gige_cpp" "GigEVisionSDK/gige_c"
65+
DOC "The path to Smartek GigEVisionSDK header")
66+
FIND_LIBRARY(GIGEAPI_LIBRARIES NAMES GigEVisionSDK)
67+
if(GIGEAPI_LIBRARIES AND GIGEAPI_INCLUDE_PATH)
68+
set(HAVE_GIGE_API TRUE)
69+
endif()
70+
endif(WITH_GIGEAPI)
71+
5972
# --- Dc1394 ---
6073
ocv_clear_vars(HAVE_DC1394 HAVE_DC1394_2)
6174
if(WITH_1394)

modules/highgui/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@ if(HAVE_PVAPI)
171171
list(APPEND HIGHGUI_LIBRARIES ${PVAPI_LIBRARY})
172172
endif()
173173

174+
if(HAVE_GIGE_API)
175+
add_definitions(-DHAVE_GIGE_API)
176+
ocv_include_directories(${GIGEAPI_INCLUDE_PATH})
177+
set(highgui_srcs src/cap_giganetix.cpp ${highgui_srcs})
178+
list(APPEND HIGHGUI_LIBRARIES ${GIGEAPI_LIBRARIES})
179+
list(APPEND highgui_srcs src/cap_giganetix.cpp)
180+
endif(HAVE_GIGE_API)
181+
174182
if(WITH_AVFOUNDATION)
175183
add_definitions(-DHAVE_AVFOUNDATION=1)
176184
list(APPEND highgui_srcs src/cap_avfoundation.mm)

modules/highgui/include/opencv2/highgui/highgui_c.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ enum
307307

308308
CV_CAP_XIAPI =1100, // XIMEA Camera API
309309

310-
CV_CAP_AVFOUNDATION = 1200 // AVFoundation framework for iOS (OS X Lion will have the same API)
310+
CV_CAP_AVFOUNDATION = 1200, // AVFoundation framework for iOS (OS X Lion will have the same API)
311+
312+
CV_CAP_GIGANETIX = 1300 // Smartek Giganetix GigEVisionSDK
311313
};
312314

313315
/* start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) */
@@ -454,6 +456,15 @@ enum
454456
CV_CAP_PROP_IOS_DEVICE_FLASH = 9003,
455457
CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004,
456458
CV_CAP_PROP_IOS_DEVICE_TORCH = 9005
459+
460+
// Properties of cameras available through Smartek Giganetix Ethernet Vision interface
461+
/* --- Vladimir Litvinenko ([email protected]) --- */
462+
,CV_CAP_PROP_GIGA_FRAME_OFFSET_X = 10001,
463+
CV_CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002,
464+
CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003,
465+
CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004,
466+
CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005,
467+
CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006
457468
};
458469

459470
enum

modules/highgui/src/cap.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
149149
#endif
150150
#ifdef HAVE_AVFOUNDATION
151151
CV_CAP_AVFOUNDATION,
152+
#endif
153+
#ifdef HAVE_GIGE_API
154+
CV_CAP_GIGANETIX,
152155
#endif
153156
-1
154157
};
@@ -184,6 +187,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
184187
defined(HAVE_XIMEA) || \
185188
defined(HAVE_AVFOUNDATION) || \
186189
defined(HAVE_ANDROID_NATIVE_CAMERA) || \
190+
defined(HAVE_GIGE_API) || \
187191
(0)
188192
// local variable to memorize the captured device
189193
CvCapture *capture;
@@ -320,6 +324,15 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
320324
return capture;
321325
break;
322326
#endif
327+
328+
#ifdef HAVE_GIGE_API
329+
case CV_CAP_GIGANETIX:
330+
capture = cvCreateCameraCapture_Giganetix (index);
331+
if (capture)
332+
return capture;
333+
break; // CV_CAP_GIGANETIX
334+
#endif
335+
323336
}
324337
}
325338

0 commit comments

Comments
 (0)