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
05f52b69
Commit
05f52b69
authored
Oct 31, 2015
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace uyvy_to_rgb24 by tested and conformant cvtColor
parent
ad68b796
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
46 deletions
+3
-46
cap_v4l.cpp
modules/videoio/src/cap_v4l.cpp
+3
-46
No files found.
modules/videoio/src/cap_v4l.cpp
View file @
05f52b69
...
...
@@ -1066,60 +1066,17 @@ yuv411p_to_rgb24(int width, int height,
}
/* convert from 4:2:2 YUYV interlaced to RGB24 */
/* based on ccvt_yuyv_bgr32() from camstream */
#define SAT(c) \
if (c & (~255)) { if (c < 0) c = 0; else c = 255; }
static
void
yuyv_to_rgb24
(
int
width
,
int
height
,
unsigned
char
*
src
,
unsigned
char
*
dst
)
{
cvtColor
(
Mat
(
height
,
width
,
CV_8UC2
,
src
),
Mat
(
height
,
width
,
CV_8UC3
,
dst
),
COLOR_YUV2BGR_YUYV
);
}
static
void
static
inline
void
uyvy_to_rgb24
(
int
width
,
int
height
,
unsigned
char
*
src
,
unsigned
char
*
dst
)
{
unsigned
char
*
s
;
unsigned
char
*
d
;
int
l
,
c
;
int
r
,
g
,
b
,
cr
,
cg
,
cb
,
y1
,
y2
;
l
=
height
;
s
=
src
;
d
=
dst
;
while
(
l
--
)
{
c
=
width
>>
1
;
while
(
c
--
)
{
cb
=
((
*
s
-
128
)
*
454
)
>>
8
;
cg
=
(
*
s
++
-
128
)
*
88
;
y1
=
*
s
++
;
cr
=
((
*
s
-
128
)
*
359
)
>>
8
;
cg
=
(
cg
+
(
*
s
++
-
128
)
*
183
)
>>
8
;
y2
=
*
s
++
;
r
=
y1
+
cr
;
b
=
y1
+
cb
;
g
=
y1
-
cg
;
SAT
(
r
);
SAT
(
g
);
SAT
(
b
);
*
d
++
=
b
;
*
d
++
=
g
;
*
d
++
=
r
;
r
=
y2
+
cr
;
b
=
y2
+
cb
;
g
=
y2
-
cg
;
SAT
(
r
);
SAT
(
g
);
SAT
(
b
);
*
d
++
=
b
;
*
d
++
=
g
;
*
d
++
=
r
;
}
}
cvtColor
(
Mat
(
height
,
width
,
CV_8UC2
,
src
),
Mat
(
height
,
width
,
CV_8UC3
,
dst
),
COLOR_YUV2BGR_UYVY
);
}
#ifdef HAVE_JPEG
...
...
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