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
8c55d7be
Commit
8c55d7be
authored
Apr 03, 2015
by
Andrew Senin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ximea camera fix (see issue #4235)
parent
f6de0171
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
cap_ximea.cpp
modules/highgui/src/cap_ximea.cpp
+22
-5
No files found.
modules/highgui/src/cap_ximea.cpp
View file @
8c55d7be
...
@@ -52,7 +52,15 @@ CvCapture* cvCreateCameraCapture_XIMEA( int index )
...
@@ -52,7 +52,15 @@ CvCapture* cvCreateCameraCapture_XIMEA( int index )
// Enumerate connected devices
// Enumerate connected devices
void
CvCaptureCAM_XIMEA
::
init
()
void
CvCaptureCAM_XIMEA
::
init
()
{
{
#if defined WIN32 || defined _WIN32
xiGetNumberDevices
(
&
numDevices
);
xiGetNumberDevices
(
&
numDevices
);
#else
// try second re-enumeration if first one fails
if
(
xiGetNumberDevices
(
&
numDevices
)
!=
XI_OK
)
{
xiGetNumberDevices
(
&
numDevices
);
}
#endif
hmv
=
NULL
;
hmv
=
NULL
;
frame
=
NULL
;
frame
=
NULL
;
timeout
=
0
;
timeout
=
0
;
...
@@ -73,8 +81,17 @@ bool CvCaptureCAM_XIMEA::open( int wIndex )
...
@@ -73,8 +81,17 @@ bool CvCaptureCAM_XIMEA::open( int wIndex )
if
((
mvret
=
xiOpenDevice
(
wIndex
,
&
hmv
))
!=
XI_OK
)
if
((
mvret
=
xiOpenDevice
(
wIndex
,
&
hmv
))
!=
XI_OK
)
{
{
#if defined WIN32 || defined _WIN32
errMsg
(
"Open XI_DEVICE failed"
,
mvret
);
errMsg
(
"Open XI_DEVICE failed"
,
mvret
);
return
false
;
return
false
;
#else
// try opening second time if first fails
if
((
mvret
=
xiOpenDevice
(
wIndex
,
&
hmv
))
!=
XI_OK
)
{
errMsg
(
"Open XI_DEVICE failed"
,
mvret
);
return
false
;
}
#endif
}
}
int
width
=
0
;
int
width
=
0
;
...
@@ -204,7 +221,7 @@ void CvCaptureCAM_XIMEA::resetCvImage()
...
@@ -204,7 +221,7 @@ void CvCaptureCAM_XIMEA::resetCvImage()
xiGetParamInt
(
hmv
,
XI_PRM_HEIGHT
,
&
height
);
xiGetParamInt
(
hmv
,
XI_PRM_HEIGHT
,
&
height
);
xiGetParamInt
(
hmv
,
XI_PRM_IMAGE_DATA_FORMAT
,
&
format
);
xiGetParamInt
(
hmv
,
XI_PRM_IMAGE_DATA_FORMAT
,
&
format
);
if
(
(
int
)
image
.
width
!=
frame
->
width
||
(
int
)
image
.
height
!=
frame
->
height
||
image
.
frm
!=
(
XI_IMG_FORMAT
)
format
)
if
(
(
int
)
image
.
width
!=
width
||
(
int
)
image
.
height
!=
height
||
image
.
frm
!=
(
XI_IMG_FORMAT
)
format
)
{
{
if
(
frame
)
cvReleaseImage
(
&
frame
);
if
(
frame
)
cvReleaseImage
(
&
frame
);
frame
=
NULL
;
frame
=
NULL
;
...
@@ -260,7 +277,7 @@ double CvCaptureCAM_XIMEA::getProperty( int property_id )
...
@@ -260,7 +277,7 @@ double CvCaptureCAM_XIMEA::getProperty( int property_id )
case
CV_CAP_PROP_XI_AUTO_WB
:
xiGetParamInt
(
hmv
,
XI_PRM_AUTO_WB
,
&
ival
);
return
ival
;
case
CV_CAP_PROP_XI_AUTO_WB
:
xiGetParamInt
(
hmv
,
XI_PRM_AUTO_WB
,
&
ival
);
return
ival
;
case
CV_CAP_PROP_XI_AEAG
:
xiGetParamInt
(
hmv
,
XI_PRM_AEAG
,
&
ival
);
return
ival
;
case
CV_CAP_PROP_XI_AEAG
:
xiGetParamInt
(
hmv
,
XI_PRM_AEAG
,
&
ival
);
return
ival
;
case
CV_CAP_PROP_XI_EXP_PRIORITY
:
xiGetParamFloat
(
hmv
,
XI_PRM_EXP_PRIORITY
,
&
fval
);
return
fval
;
case
CV_CAP_PROP_XI_EXP_PRIORITY
:
xiGetParamFloat
(
hmv
,
XI_PRM_EXP_PRIORITY
,
&
fval
);
return
fval
;
case
CV_CAP_PROP_XI_AE_MAX_LIMIT
:
xiGetParamInt
(
hmv
,
XI_PRM_
AE_MAX_LIMIT
,
&
ival
);
return
ival
;
case
CV_CAP_PROP_XI_AE_MAX_LIMIT
:
xiGetParamInt
(
hmv
,
XI_PRM_
EXP_PRIORITY
,
&
ival
);
return
ival
;
case
CV_CAP_PROP_XI_AG_MAX_LIMIT
:
xiGetParamFloat
(
hmv
,
XI_PRM_AG_MAX_LIMIT
,
&
fval
);
return
fval
;
case
CV_CAP_PROP_XI_AG_MAX_LIMIT
:
xiGetParamFloat
(
hmv
,
XI_PRM_AG_MAX_LIMIT
,
&
fval
);
return
fval
;
case
CV_CAP_PROP_XI_AEAG_LEVEL
:
xiGetParamInt
(
hmv
,
XI_PRM_AEAG_LEVEL
,
&
ival
);
return
ival
;
case
CV_CAP_PROP_XI_AEAG_LEVEL
:
xiGetParamInt
(
hmv
,
XI_PRM_AEAG_LEVEL
,
&
ival
);
return
ival
;
case
CV_CAP_PROP_XI_TIMEOUT
:
return
timeout
;
case
CV_CAP_PROP_XI_TIMEOUT
:
return
timeout
;
...
@@ -293,7 +310,7 @@ bool CvCaptureCAM_XIMEA::setProperty( int property_id, double value )
...
@@ -293,7 +310,7 @@ bool CvCaptureCAM_XIMEA::setProperty( int property_id, double value )
case
CV_CAP_PROP_XI_OFFSET_Y
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_OFFSET_Y
,
ival
);
break
;
case
CV_CAP_PROP_XI_OFFSET_Y
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_OFFSET_Y
,
ival
);
break
;
case
CV_CAP_PROP_XI_TRG_SOURCE
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_TRG_SOURCE
,
ival
);
break
;
case
CV_CAP_PROP_XI_TRG_SOURCE
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_TRG_SOURCE
,
ival
);
break
;
case
CV_CAP_PROP_XI_GPI_SELECTOR
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_GPI_SELECTOR
,
ival
);
break
;
case
CV_CAP_PROP_XI_GPI_SELECTOR
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_GPI_SELECTOR
,
ival
);
break
;
case
CV_CAP_PROP_XI_TRG_SOFTWARE
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_TRG_SO
FTWAR
E
,
1
);
break
;
case
CV_CAP_PROP_XI_TRG_SOFTWARE
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_TRG_SO
URC
E
,
1
);
break
;
case
CV_CAP_PROP_XI_GPI_MODE
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_GPI_MODE
,
ival
);
break
;
case
CV_CAP_PROP_XI_GPI_MODE
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_GPI_MODE
,
ival
);
break
;
case
CV_CAP_PROP_XI_GPI_LEVEL
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_GPI_LEVEL
,
ival
);
break
;
case
CV_CAP_PROP_XI_GPI_LEVEL
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_GPI_LEVEL
,
ival
);
break
;
case
CV_CAP_PROP_XI_GPO_SELECTOR
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_GPO_SELECTOR
,
ival
);
break
;
case
CV_CAP_PROP_XI_GPO_SELECTOR
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_GPO_SELECTOR
,
ival
);
break
;
...
@@ -301,10 +318,10 @@ bool CvCaptureCAM_XIMEA::setProperty( int property_id, double value )
...
@@ -301,10 +318,10 @@ bool CvCaptureCAM_XIMEA::setProperty( int property_id, double value )
case
CV_CAP_PROP_XI_LED_SELECTOR
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_LED_SELECTOR
,
ival
);
break
;
case
CV_CAP_PROP_XI_LED_SELECTOR
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_LED_SELECTOR
,
ival
);
break
;
case
CV_CAP_PROP_XI_LED_MODE
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_LED_MODE
,
ival
);
break
;
case
CV_CAP_PROP_XI_LED_MODE
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_LED_MODE
,
ival
);
break
;
case
CV_CAP_PROP_XI_AUTO_WB
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_AUTO_WB
,
ival
);
break
;
case
CV_CAP_PROP_XI_AUTO_WB
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_AUTO_WB
,
ival
);
break
;
case
CV_CAP_PROP_XI_MANUAL_WB
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_
MANUAL_WB
,
ival
);
break
;
case
CV_CAP_PROP_XI_MANUAL_WB
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_
LED_MODE
,
ival
);
break
;
case
CV_CAP_PROP_XI_AEAG
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_AEAG
,
ival
);
break
;
case
CV_CAP_PROP_XI_AEAG
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_AEAG
,
ival
);
break
;
case
CV_CAP_PROP_XI_EXP_PRIORITY
:
mvret
=
xiSetParamFloat
(
hmv
,
XI_PRM_EXP_PRIORITY
,
fval
);
break
;
case
CV_CAP_PROP_XI_EXP_PRIORITY
:
mvret
=
xiSetParamFloat
(
hmv
,
XI_PRM_EXP_PRIORITY
,
fval
);
break
;
case
CV_CAP_PROP_XI_AE_MAX_LIMIT
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_
AE_MAX_LIMIT
,
ival
);
break
;
case
CV_CAP_PROP_XI_AE_MAX_LIMIT
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_
EXP_PRIORITY
,
ival
);
break
;
case
CV_CAP_PROP_XI_AG_MAX_LIMIT
:
mvret
=
xiSetParamFloat
(
hmv
,
XI_PRM_AG_MAX_LIMIT
,
fval
);
break
;
case
CV_CAP_PROP_XI_AG_MAX_LIMIT
:
mvret
=
xiSetParamFloat
(
hmv
,
XI_PRM_AG_MAX_LIMIT
,
fval
);
break
;
case
CV_CAP_PROP_XI_AEAG_LEVEL
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_AEAG_LEVEL
,
ival
);
break
;
case
CV_CAP_PROP_XI_AEAG_LEVEL
:
mvret
=
xiSetParamInt
(
hmv
,
XI_PRM_AEAG_LEVEL
,
ival
);
break
;
case
CV_CAP_PROP_XI_TIMEOUT
:
timeout
=
ival
;
break
;
case
CV_CAP_PROP_XI_TIMEOUT
:
timeout
=
ival
;
break
;
...
...
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