Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
42e01365
Commit
42e01365
authored
Oct 11, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1829 from tomoaki0705:fixCudaImgprocColorGray_4_0
parents
749fbda7
62f55b4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
color_cvt.hpp
...dev/include/opencv2/cudev/functional/detail/color_cvt.hpp
+16
-0
No files found.
modules/cudev/include/opencv2/cudev/functional/detail/color_cvt.hpp
View file @
42e01365
...
...
@@ -93,11 +93,15 @@ namespace color_cvt_detail
enum
{
rgb_shift
=
15
,
yuv_shift
=
14
,
xyz_shift
=
12
,
R2Y
=
4899
,
G2Y
=
9617
,
B2Y
=
1868
,
RY15
=
9798
,
GY15
=
19235
,
BY15
=
3735
,
BLOCK_SIZE
=
256
};
...
...
@@ -314,6 +318,18 @@ namespace color_cvt_detail
}
};
template
<
int
scn
,
int
bidx
>
struct
RGB2Gray
<
uchar
,
scn
,
bidx
>
:
unary_function
<
typename
MakeVec
<
uchar
,
scn
>::
type
,
uchar
>
{
__device__
uchar
operator
()(
const
typename
MakeVec
<
uchar
,
scn
>::
type
&
src
)
const
{
const
int
b
=
bidx
==
0
?
src
.
x
:
src
.
z
;
const
int
g
=
src
.
y
;
const
int
r
=
bidx
==
0
?
src
.
z
:
src
.
x
;
return
(
uchar
)
CV_CUDEV_DESCALE
(
b
*
BY15
+
g
*
GY15
+
r
*
RY15
,
rgb_shift
);
}
};
template
<
int
scn
,
int
bidx
>
struct
RGB2Gray
<
float
,
scn
,
bidx
>
:
unary_function
<
typename
MakeVec
<
float
,
scn
>::
type
,
float
>
{
...
...
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