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
9b8c3fd6
Commit
9b8c3fd6
authored
Dec 25, 2014
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite cuda::cvtColor with new device layer and fix test failures
parent
1bdd86ed
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
4 deletions
+10
-4
CMakeLists.txt
modules/cudaimgproc/CMakeLists.txt
+1
-1
color.cpp
modules/cudaimgproc/src/color.cpp
+0
-0
color.cu
modules/cudaimgproc/src/cuda/color.cu
+0
-0
cvt_color_internal.h
modules/cudaimgproc/src/cvt_color_internal.h
+0
-0
color_cvt.hpp
...dev/include/opencv2/cudev/functional/detail/color_cvt.hpp
+9
-3
No files found.
modules/cudaimgproc/CMakeLists.txt
View file @
9b8c3fd6
...
...
@@ -6,4 +6,4 @@ set(the_description "CUDA-accelerated Image Processing")
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4127 /wd4100 /wd4324 /wd4512 /wd4515 -Wundef -Wmissing-declarations -Wshadow -Wunused-parameter
)
ocv_define_module
(
cudaimgproc opencv_imgproc OPTIONAL opencv_cudaarithm opencv_cudafilters
)
ocv_define_module
(
cudaimgproc opencv_imgproc OPTIONAL opencv_cud
ev opencv_cud
aarithm opencv_cudafilters
)
modules/cudaimgproc/src/color.cpp
View file @
9b8c3fd6
This diff is collapsed.
Click to expand it.
modules/cudaimgproc/src/cuda/color.cu
View file @
9b8c3fd6
This diff is collapsed.
Click to expand it.
modules/cudaimgproc/src/cvt_color_internal.h
View file @
9b8c3fd6
This diff is collapsed.
Click to expand it.
modules/cudev/include/opencv2/cudev/functional/detail/color_cvt.hpp
View file @
9b8c3fd6
...
...
@@ -156,7 +156,7 @@ namespace color_cvt_detail
const
int
g
=
src
.
y
;
const
int
r
=
bidx
==
0
?
src
.
z
:
src
.
x
;
const
int
a
=
src
.
w
;
return
(
ushort
)
((
b
>>
3
)
|
((
g
&
~
7
)
<<
2
)
|
((
r
&
~
7
)
<<
7
)
|
(
a
*
0x800
0
));
return
(
ushort
)
((
b
>>
3
)
|
((
g
&
~
7
)
<<
2
)
|
((
r
&
~
7
)
<<
7
)
|
(
a
?
0x8000
:
0
));
}
};
...
...
@@ -263,7 +263,8 @@ namespace color_cvt_detail
{
__device__
ushort
operator
()(
uchar
src
)
const
{
return
(
ushort
)
(
src
|
(
src
<<
5
)
|
(
src
<<
10
));
const
int
t
=
src
>>
3
;
return
(
ushort
)(
t
|
(
t
<<
5
)
|
(
t
<<
10
));
}
};
...
...
@@ -272,7 +273,8 @@ namespace color_cvt_detail
{
__device__
ushort
operator
()(
uchar
src
)
const
{
return
(
ushort
)
((
src
>>
3
)
|
((
src
&
~
3
)
<<
3
)
|
((
src
&
~
7
)
<<
8
));
const
int
t
=
src
;
return
(
ushort
)((
t
>>
3
)
|
((
t
&
~
3
)
<<
3
)
|
((
t
&
~
7
)
<<
8
));
}
};
...
...
@@ -1227,6 +1229,10 @@ namespace color_cvt_detail
float
G
=
-
0.969256
f
*
X
+
1.875991
f
*
Y
+
0.041556
f
*
Z
;
float
R
=
3.240479
f
*
X
-
1.537150
f
*
Y
-
0.498535
f
*
Z
;
R
=
::
fminf
(
::
fmaxf
(
R
,
0.
f
),
1.
f
);
G
=
::
fminf
(
::
fmaxf
(
G
,
0.
f
),
1.
f
);
B
=
::
fminf
(
::
fmaxf
(
B
,
0.
f
),
1.
f
);
if
(
srgb
)
{
B
=
splineInterpolate
(
B
*
GAMMA_TAB_SIZE
,
c_sRGBInvGammaTab
,
GAMMA_TAB_SIZE
);
...
...
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