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
b0461db4
Commit
b0461db4
authored
Aug 02, 2012
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added missed device synchronization
parent
7b025474
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
48 deletions
+68
-48
color.cpp
modules/gpu/src/color.cpp
+68
-48
No files found.
modules/gpu/src/color.cpp
View file @
b0461db4
...
...
@@ -1153,7 +1153,7 @@ namespace
funcs
[
dcn
==
4
][
src
.
channels
()
==
4
][
src
.
depth
()](
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr_to_lab
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
st
ream
)
void
bgr_to_lab
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
st
)
{
#if (CUDA_VERSION < 5000)
(
void
)
src
;
...
...
@@ -1169,13 +1169,17 @@ namespace
dst
.
create
(
src
.
size
(),
CV_MAKETYPE
(
src
.
depth
(),
dcn
));
NppStreamHandler
h
(
StreamAccessor
::
getStream
(
stream
));
cudaStream_t
stream
=
StreamAccessor
::
getStream
(
st
);
NppStreamHandler
h
(
stream
);
NppiSize
oSizeROI
;
oSizeROI
.
width
=
src
.
cols
;
oSizeROI
.
height
=
src
.
rows
;
nppSafeCall
(
nppiBGRToLab_8u_C3R
(
src
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
src
.
step
),
dst
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
dst
.
step
),
oSizeROI
)
);
if
(
stream
==
0
)
cudaSafeCall
(
cudaDeviceSynchronize
()
);
#endif
}
...
...
@@ -1185,7 +1189,7 @@ namespace
bgr_to_lab
(
dst
,
dst
,
-
1
,
stream
);
}
void
lab_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
st
ream
)
void
lab_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
st
)
{
#if (CUDA_VERSION < 5000)
(
void
)
src
;
...
...
@@ -1201,13 +1205,17 @@ namespace
dst
.
create
(
src
.
size
(),
CV_MAKETYPE
(
src
.
depth
(),
dcn
));
NppStreamHandler
h
(
StreamAccessor
::
getStream
(
stream
));
cudaStream_t
stream
=
StreamAccessor
::
getStream
(
st
);
NppStreamHandler
h
(
stream
);
NppiSize
oSizeROI
;
oSizeROI
.
width
=
src
.
cols
;
oSizeROI
.
height
=
src
.
rows
;
nppSafeCall
(
nppiLabToBGR_8u_C3R
(
src
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
src
.
step
),
dst
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
dst
.
step
),
oSizeROI
)
);
if
(
stream
==
0
)
cudaSafeCall
(
cudaDeviceSynchronize
()
);
#endif
}
...
...
@@ -1217,7 +1225,7 @@ namespace
bgr_to_rgb
(
dst
,
dst
,
-
1
,
stream
);
}
void
rgb_to_luv
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
st
ream
)
void
rgb_to_luv
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
st
)
{
#if (CUDA_VERSION < 5000)
(
void
)
src
;
...
...
@@ -1233,7 +1241,8 @@ namespace
dst
.
create
(
src
.
size
(),
CV_MAKETYPE
(
src
.
depth
(),
dcn
));
NppStreamHandler
h
(
StreamAccessor
::
getStream
(
stream
));
cudaStream_t
stream
=
StreamAccessor
::
getStream
(
st
);
NppStreamHandler
h
(
stream
);
NppiSize
oSizeROI
;
oSizeROI
.
width
=
src
.
cols
;
...
...
@@ -1243,6 +1252,9 @@ namespace
nppSafeCall
(
nppiRGBToLUV_8u_C3R
(
src
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
src
.
step
),
dst
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
dst
.
step
),
oSizeROI
)
);
else
nppSafeCall
(
nppiRGBToLUV_8u_AC4R
(
src
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
src
.
step
),
dst
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
dst
.
step
),
oSizeROI
)
);
if
(
stream
==
0
)
cudaSafeCall
(
cudaDeviceSynchronize
()
);
#endif
}
...
...
@@ -1252,7 +1264,7 @@ namespace
rgb_to_luv
(
dst
,
dst
,
-
1
,
stream
);
}
void
luv_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
st
ream
)
void
luv_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
st
)
{
#if (CUDA_VERSION < 5000)
(
void
)
src
;
...
...
@@ -1268,7 +1280,8 @@ namespace
dst
.
create
(
src
.
size
(),
CV_MAKETYPE
(
src
.
depth
(),
dcn
));
NppStreamHandler
h
(
StreamAccessor
::
getStream
(
stream
));
cudaStream_t
stream
=
StreamAccessor
::
getStream
(
st
);
NppStreamHandler
h
(
stream
);
NppiSize
oSizeROI
;
oSizeROI
.
width
=
src
.
cols
;
...
...
@@ -1278,6 +1291,9 @@ namespace
nppSafeCall
(
nppiLUVToRGB_8u_C3R
(
src
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
src
.
step
),
dst
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
dst
.
step
),
oSizeROI
)
);
else
nppSafeCall
(
nppiLUVToRGB_8u_AC4R
(
src
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
src
.
step
),
dst
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
dst
.
step
),
oSizeROI
)
);
if
(
stream
==
0
)
cudaSafeCall
(
cudaDeviceSynchronize
()
);
#endif
}
...
...
@@ -1287,7 +1303,7 @@ namespace
bgr_to_rgb
(
dst
,
dst
,
-
1
,
stream
);
}
void
rgba_to_mbgra
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
st
ream
)
void
rgba_to_mbgra
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
st
)
{
#if (CUDA_VERSION < 5000)
(
void
)
src
;
...
...
@@ -1299,7 +1315,8 @@ namespace
dst
.
create
(
src
.
size
(),
src
.
type
());
NppStreamHandler
h
(
StreamAccessor
::
getStream
(
stream
));
cudaStream_t
stream
=
StreamAccessor
::
getStream
(
st
);
NppStreamHandler
h
(
stream
);
NppiSize
oSizeROI
;
oSizeROI
.
width
=
src
.
cols
;
...
...
@@ -1309,6 +1326,9 @@ namespace
nppSafeCall
(
nppiAlphaPremul_8u_AC4R
(
src
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
src
.
step
),
dst
.
ptr
<
Npp8u
>
(),
static_cast
<
int
>
(
dst
.
step
),
oSizeROI
)
);
else
nppSafeCall
(
nppiAlphaPremul_16u_AC4R
(
src
.
ptr
<
Npp16u
>
(),
static_cast
<
int
>
(
src
.
step
),
dst
.
ptr
<
Npp16u
>
(),
static_cast
<
int
>
(
dst
.
step
),
oSizeROI
)
);
if
(
stream
==
0
)
cudaSafeCall
(
cudaDeviceSynchronize
()
);
#endif
}
...
...
@@ -1474,57 +1494,57 @@ void cv::gpu::cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn, Stream
0
,
// CV_BayerGR2GRAY = 89
//YUV 4:2:0 formats family
0
,
// C
OLOR
_YUV2RGB_NV12 = 90,
0
,
// C
OLOR
_YUV2BGR_NV12 = 91,
0
,
// C
OLOR
_YUV2RGB_NV21 = 92,
0
,
// C
OLOR
_YUV2BGR_NV21 = 93,
0
,
// C
V
_YUV2RGB_NV12 = 90,
0
,
// C
V
_YUV2BGR_NV12 = 91,
0
,
// C
V
_YUV2RGB_NV21 = 92,
0
,
// C
V
_YUV2BGR_NV21 = 93,
0
,
// C
OLOR
_YUV2RGBA_NV12 = 94,
0
,
// C
OLOR
_YUV2BGRA_NV12 = 95,
0
,
// C
OLOR
_YUV2RGBA_NV21 = 96,
0
,
// C
OLOR
_YUV2BGRA_NV21 = 97,
0
,
// C
V
_YUV2RGBA_NV12 = 94,
0
,
// C
V
_YUV2BGRA_NV12 = 95,
0
,
// C
V
_YUV2RGBA_NV21 = 96,
0
,
// C
V
_YUV2BGRA_NV21 = 97,
0
,
// C
OLOR
_YUV2RGB_YV12 = 98,
0
,
// C
OLOR
_YUV2BGR_YV12 = 99,
0
,
// C
OLOR
_YUV2RGB_IYUV = 100,
0
,
// C
OLOR
_YUV2BGR_IYUV = 101,
0
,
// C
V
_YUV2RGB_YV12 = 98,
0
,
// C
V
_YUV2BGR_YV12 = 99,
0
,
// C
V
_YUV2RGB_IYUV = 100,
0
,
// C
V
_YUV2BGR_IYUV = 101,
0
,
// C
OLOR
_YUV2RGBA_YV12 = 102,
0
,
// C
OLOR
_YUV2BGRA_YV12 = 103,
0
,
// C
OLOR
_YUV2RGBA_IYUV = 104,
0
,
// C
OLOR
_YUV2BGRA_IYUV = 105,
0
,
// C
V
_YUV2RGBA_YV12 = 102,
0
,
// C
V
_YUV2BGRA_YV12 = 103,
0
,
// C
V
_YUV2RGBA_IYUV = 104,
0
,
// C
V
_YUV2BGRA_IYUV = 105,
0
,
// C
OLOR
_YUV2GRAY_420 = 106,
0
,
// C
V
_YUV2GRAY_420 = 106,
//YUV 4:2:2 formats family
0
,
// C
OLOR
_YUV2RGB_UYVY = 107,
0
,
// C
OLOR
_YUV2BGR_UYVY = 108,
0
,
// //C
OLOR
_YUV2RGB_VYUY = 109,
0
,
// //C
OLOR
_YUV2BGR_VYUY = 110,
0
,
// C
V
_YUV2RGB_UYVY = 107,
0
,
// C
V
_YUV2BGR_UYVY = 108,
0
,
// //C
V
_YUV2RGB_VYUY = 109,
0
,
// //C
V
_YUV2BGR_VYUY = 110,
0
,
// C
OLOR
_YUV2RGBA_UYVY = 111,
0
,
// C
OLOR
_YUV2BGRA_UYVY = 112,
0
,
// //C
OLOR
_YUV2RGBA_VYUY = 113,
0
,
// //C
OLOR
_YUV2BGRA_VYUY = 114,
0
,
// C
V
_YUV2RGBA_UYVY = 111,
0
,
// C
V
_YUV2BGRA_UYVY = 112,
0
,
// //C
V
_YUV2RGBA_VYUY = 113,
0
,
// //C
V
_YUV2BGRA_VYUY = 114,
0
,
// C
OLOR
_YUV2RGB_YUY2 = 115,
0
,
// C
OLOR
_YUV2BGR_YUY2 = 116,
0
,
// C
OLOR
_YUV2RGB_YVYU = 117,
0
,
// C
OLOR
_YUV2BGR_YVYU = 118,
0
,
// C
V
_YUV2RGB_YUY2 = 115,
0
,
// C
V
_YUV2BGR_YUY2 = 116,
0
,
// C
V
_YUV2RGB_YVYU = 117,
0
,
// C
V
_YUV2BGR_YVYU = 118,
0
,
// C
OLOR
_YUV2RGBA_YUY2 = 119,
0
,
// C
OLOR
_YUV2BGRA_YUY2 = 120,
0
,
// C
OLOR
_YUV2RGBA_YVYU = 121,
0
,
// C
OLOR
_YUV2BGRA_YVYU = 122,
0
,
// C
V
_YUV2RGBA_YUY2 = 119,
0
,
// C
V
_YUV2BGRA_YUY2 = 120,
0
,
// C
V
_YUV2RGBA_YVYU = 121,
0
,
// C
V
_YUV2BGRA_YVYU = 122,
0
,
// C
OLOR
_YUV2GRAY_UYVY = 123,
0
,
// C
OLOR
_YUV2GRAY_YUY2 = 124,
0
,
// C
V
_YUV2GRAY_UYVY = 123,
0
,
// C
V
_YUV2GRAY_YUY2 = 124,
// alpha premultiplication
rgba_to_mbgra
,
// C
OLOR
_RGBA2mRGBA = 125,
0
,
// C
OLOR
_mRGBA2RGBA = 126,
rgba_to_mbgra
,
// C
V
_RGBA2mRGBA = 125,
0
,
// C
V
_mRGBA2RGBA = 126,
0
,
// C
OLOR
_COLORCVT_MAX = 127
0
,
// C
V
_COLORCVT_MAX = 127
};
CV_Assert
(
code
<
128
);
...
...
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