Merge pull request #1776 from philippefoubert:merge_upstream_2.4_ximea
This commit is contained in:
commit
b8f5fcf3f9
@ -23,7 +23,7 @@ if(WIN32)
|
|||||||
if(EXISTS ${XIMEA_PATH})
|
if(EXISTS ${XIMEA_PATH})
|
||||||
set(XIMEA_FOUND 1)
|
set(XIMEA_FOUND 1)
|
||||||
# set LIB folders
|
# set LIB folders
|
||||||
if(CMAKE_CL_64)
|
if(X86_64)
|
||||||
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x64")
|
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x64")
|
||||||
else()
|
else()
|
||||||
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x86")
|
set(XIMEA_LIBRARY_DIR "${XIMEA_PATH}/x86")
|
||||||
|
@ -167,9 +167,9 @@ if(HAVE_XIMEA)
|
|||||||
list(APPEND highgui_srcs src/cap_ximea.cpp)
|
list(APPEND highgui_srcs src/cap_ximea.cpp)
|
||||||
ocv_include_directories(${XIMEA_PATH})
|
ocv_include_directories(${XIMEA_PATH})
|
||||||
if(XIMEA_LIBRARY_DIR)
|
if(XIMEA_LIBRARY_DIR)
|
||||||
link_directories(${XIMEA_LIBRARY_DIR})
|
link_directories("${XIMEA_LIBRARY_DIR}")
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_CL_64)
|
if(X86_64)
|
||||||
list(APPEND HIGHGUI_LIBRARIES m3apiX64)
|
list(APPEND HIGHGUI_LIBRARIES m3apiX64)
|
||||||
else()
|
else()
|
||||||
list(APPEND HIGHGUI_LIBRARIES m3api)
|
list(APPEND HIGHGUI_LIBRARIES m3api)
|
||||||
|
@ -75,34 +75,35 @@ bool CvCaptureCAM_XIMEA::open( int wIndex )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int width = 0;
|
||||||
|
int height = 0;
|
||||||
|
int isColor = 0;
|
||||||
|
|
||||||
// always use auto exposure/gain
|
// always use auto exposure/gain
|
||||||
mvret = xiSetParamInt( hmv, XI_PRM_AEAG, 1);
|
mvret = xiSetParamInt( hmv, XI_PRM_AEAG, 1);
|
||||||
HandleXiResult(mvret);
|
HandleXiResult(mvret);
|
||||||
|
|
||||||
int width = 0;
|
|
||||||
mvret = xiGetParamInt( hmv, XI_PRM_WIDTH, &width);
|
mvret = xiGetParamInt( hmv, XI_PRM_WIDTH, &width);
|
||||||
HandleXiResult(mvret);
|
HandleXiResult(mvret);
|
||||||
|
|
||||||
int height = 0;
|
|
||||||
mvret = xiGetParamInt( hmv, XI_PRM_HEIGHT, &height);
|
mvret = xiGetParamInt( hmv, XI_PRM_HEIGHT, &height);
|
||||||
HandleXiResult(mvret);
|
HandleXiResult(mvret);
|
||||||
|
|
||||||
int isColor = 0;
|
|
||||||
mvret = xiGetParamInt(hmv, XI_PRM_IMAGE_IS_COLOR, &isColor);
|
mvret = xiGetParamInt(hmv, XI_PRM_IMAGE_IS_COLOR, &isColor);
|
||||||
HandleXiResult(mvret);
|
HandleXiResult(mvret);
|
||||||
|
|
||||||
if(isColor) // for color cameras
|
if(isColor) // for color cameras
|
||||||
{
|
{
|
||||||
// default image format RGB24
|
// default image format RGB24
|
||||||
mvret = xiSetParamInt( hmv, XI_PRM_IMAGE_DATA_FORMAT, XI_RGB24);
|
mvret = xiSetParamInt( hmv, XI_PRM_IMAGE_DATA_FORMAT, XI_RGB24);
|
||||||
HandleXiResult(mvret);
|
HandleXiResult(mvret);
|
||||||
|
|
||||||
// always use auto white ballance for color cameras
|
// always use auto white balance for color cameras
|
||||||
mvret = xiSetParamInt( hmv, XI_PRM_AUTO_WB, 1);
|
mvret = xiSetParamInt( hmv, XI_PRM_AUTO_WB, 1);
|
||||||
HandleXiResult(mvret);
|
HandleXiResult(mvret);
|
||||||
|
|
||||||
// allocate frame buffer for RGB24 image
|
// allocate frame buffer for RGB24 image
|
||||||
frame = cvCreateImage(cvSize( width, height), IPL_DEPTH_8U, 3);
|
frame = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 3);
|
||||||
}
|
}
|
||||||
else // for mono cameras
|
else // for mono cameras
|
||||||
{
|
{
|
||||||
@ -111,7 +112,7 @@ bool CvCaptureCAM_XIMEA::open( int wIndex )
|
|||||||
HandleXiResult(mvret);
|
HandleXiResult(mvret);
|
||||||
|
|
||||||
// allocate frame buffer for MONO8 image
|
// allocate frame buffer for MONO8 image
|
||||||
frame = cvCreateImage(cvSize( width, height), IPL_DEPTH_8U, 1);
|
frame = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//default capture timeout 10s
|
//default capture timeout 10s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user