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
afa0f80c
Commit
afa0f80c
authored
6 years ago
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
videoio: add manual white-balance and implement it for V4L2
parent
596ada51
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
videoio.hpp
modules/videoio/include/opencv2/videoio.hpp
+2
-0
cap_v4l.cpp
modules/videoio/src/cap_v4l.cpp
+19
-3
No files found.
modules/videoio/include/opencv2/videoio.hpp
View file @
afa0f80c
...
...
@@ -171,6 +171,8 @@ enum VideoCaptureProperties {
CAP_PROP_SAR_DEN
=
41
,
//!< Sample aspect ratio: num/den (den)
CAP_PROP_BACKEND
=
42
,
//!< Current backend (enum VideoCaptureAPIs). Read-only property
CAP_PROP_CHANNEL
=
43
,
//!< Video input or Channel Number (only for those cameras that support)
CAP_PROP_AUTO_WB
=
44
,
//!< enable/ disable auto white-balance
CAP_PROP_WB_TEMPERATURE
=
45
,
//!< white-balance color temperature
#ifndef CV_DOXYGEN
CV__CAP_PROP_LATEST
#endif
...
...
This diff is collapsed.
Click to expand it.
modules/videoio/src/cap_v4l.cpp
View file @
afa0f80c
...
...
@@ -1513,6 +1513,10 @@ static inline cv::String capPropertyName(int prop)
return
"sar_num"
;
case
cv
:
:
CAP_PROP_SAR_DEN
:
return
"sar_den"
;
case
CAP_PROP_AUTO_WB
:
return
"auto wb"
;
case
CAP_PROP_WB_TEMPERATURE
:
return
"wb temperature"
;
default
:
return
"unknown"
;
}
...
...
@@ -1593,6 +1597,10 @@ static inline int capPropertyToV4L2(int prop)
return
V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT
;
case
cv
:
:
CAP_PROP_SAR_DEN
:
return
V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH
;
case
CAP_PROP_AUTO_WB
:
return
V4L2_CID_AUTO_WHITE_BALANCE
;
case
CAP_PROP_WB_TEMPERATURE
:
return
V4L2_CID_WHITE_BALANCE_TEMPERATURE
;
default
:
break
;
}
...
...
@@ -1631,10 +1639,18 @@ bool CvCaptureCAM_V4L::controlInfo(int property_id, __u32 &_v4l2id, cv::Range &r
_v4l2id
=
__u32
(
v4l2id
);
range
=
cv
::
Range
(
queryctrl
.
minimum
,
queryctrl
.
maximum
);
if
(
normalizePropRange
)
{
if
(
property_id
==
cv
::
CAP_PROP_AUTOFOCUS
)
range
=
Range
(
0
,
1
);
else
if
(
property_id
==
cv
::
CAP_PROP_AUTO_EXPOSURE
)
switch
(
property_id
)
{
case
CAP_PROP_WB_TEMPERATURE
:
case
CAP_PROP_AUTO_WB
:
case
CAP_PROP_AUTOFOCUS
:
range
=
Range
(
0
,
1
);
// do not convert
break
;
case
CAP_PROP_AUTO_EXPOSURE
:
range
=
Range
(
0
,
4
);
default
:
break
;
}
}
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
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