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
91678ff8
Commit
91678ff8
authored
Apr 12, 2016
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cap_v4l: allow manually controlling exposure
parent
2f0676fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
cap_v4l.cpp
modules/videoio/src/cap_v4l.cpp
+16
-2
No files found.
modules/videoio/src/cap_v4l.cpp
View file @
91678ff8
...
...
@@ -322,6 +322,8 @@ struct CvCaptureCAM_V4L : public CvCapture
return
focus
;
case
CV_CAP_PROP_AUTOFOCUS
:
return
Range
(
0
,
1
);
case
CV_CAP_PROP_AUTO_EXPOSURE
:
return
Range
(
0
,
4
);
default:
return
Range
(
0
,
255
);
}
...
...
@@ -512,7 +514,7 @@ static void v4l2_control_range(CvCaptureCAM_V4L* cap, __u32 id)
case
V4L2_CID_GAIN
:
cap
->
gain
=
range
;
break
;
case
V4L2_CID_EXPOSURE
:
case
V4L2_CID_EXPOSURE
_ABSOLUTE
:
cap
->
exposure
=
range
;
break
;
case
V4L2_CID_FOCUS_ABSOLUTE
:
...
...
@@ -1557,8 +1559,10 @@ static inline __u32 capPropertyToV4L2(int prop) {
return
V4L2_CID_HUE
;
case
CV_CAP_PROP_GAIN
:
return
V4L2_CID_GAIN
;
case
CV_CAP_PROP_AUTO_EXPOSURE
:
return
V4L2_CID_EXPOSURE_AUTO
;
case
CV_CAP_PROP_EXPOSURE
:
return
V4L2_CID_EXPOSURE
;
return
V4L2_CID_EXPOSURE
_ABSOLUTE
;
case
CV_CAP_PROP_AUTOFOCUS
:
return
V4L2_CID_FOCUS_AUTO
;
case
CV_CAP_PROP_FOCUS
:
...
...
@@ -1645,6 +1649,9 @@ static double icvGetPropertyCAM_V4L (const CvCaptureCAM_V4L* capture,
case
CV_CAP_PROP_GAIN
:
fprintf
(
stderr
,
"Gain"
);
break
;
case
CV_CAP_PROP_AUTO_EXPOSURE
:
fprintf
(
stderr
,
"Auto Exposure"
);
break
;
case
CV_CAP_PROP_EXPOSURE
:
fprintf
(
stderr
,
"Exposure"
);
break
;
...
...
@@ -1704,6 +1711,13 @@ static bool icvSetControl (CvCaptureCAM_V4L* capture,
return
false
;
}
if
(
control
.
id
==
V4L2_CID_EXPOSURE_AUTO
&&
control
.
value
==
V4L2_EXPOSURE_MANUAL
)
{
// update the control range for expose after disabling autoexposure
// as it is not read correctly at startup
// TODO check this again as it might be fixed with Linux 4.5
v4l2_control_range
(
capture
,
V4L2_CID_EXPOSURE_ABSOLUTE
);
}
/* all was OK */
return
true
;
}
...
...
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