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
3d222d31
Commit
3d222d31
authored
Aug 20, 2014
by
Alexander Karsakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed range for 'v' channel for 8U images
parent
de2a8d37
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
color_detail.hpp
...es/core/include/opencv2/core/cuda/detail/color_detail.hpp
+2
-2
miscellaneous_transformations.rst
modules/imgproc/doc/miscellaneous_transformations.rst
+1
-1
color.cpp
modules/imgproc/src/color.cpp
+2
-2
cvtcolor.cl
modules/imgproc/src/opencl/cvtcolor.cl
+2
-2
test_color.cpp
modules/imgproc/test/test_color.cpp
+4
-4
No files found.
modules/core/include/opencv2/core/cuda/detail/color_detail.hpp
View file @
3d222d31
...
...
@@ -1822,7 +1822,7 @@ namespace cv { namespace cuda { namespace device
dst
.
x
=
saturate_cast
<
uchar
>
(
dstf
.
x
*
2.55
f
);
dst
.
y
=
saturate_cast
<
uchar
>
(
dstf
.
y
*
0.72033898305084743
f
+
96.525423728813564
f
);
dst
.
z
=
saturate_cast
<
uchar
>
(
dstf
.
z
*
0.9
9609375
f
+
139.453125
f
);
dst
.
z
=
saturate_cast
<
uchar
>
(
dstf
.
z
*
0.9
732824427480916
f
+
136.259541984732824
f
);
}
template
<
typename
T
,
int
scn
,
int
dcn
,
bool
srgb
,
int
blueIdx
>
struct
RGB2Luv
;
...
...
@@ -1916,7 +1916,7 @@ namespace cv { namespace cuda { namespace device
srcf
.
x
=
src
.
x
*
(
100.
f
/
255.
f
);
srcf
.
y
=
src
.
y
*
1.388235294117647
f
-
134.
f
;
srcf
.
z
=
src
.
z
*
1.0
03921568627451
f
-
140.
f
;
srcf
.
z
=
src
.
z
*
1.0
27450980392157
f
-
140.
f
;
Luv2RGBConvert_f
<
srgb
,
blueIdx
>
(
srcf
,
dstf
);
...
...
modules/imgproc/doc/miscellaneous_transformations.rst
View file @
3d222d31
...
...
@@ -380,7 +380,7 @@ The function can do the following transformations:
.. math::
L \leftarrow 255/100 L, \; u \leftarrow 255/354 (u + 134), \; v \leftarrow 255/2
56
(v + 140)
L \leftarrow 255/100 L, \; u \leftarrow 255/354 (u + 134), \; v \leftarrow 255/2
62
(v + 140)
* 16-bit images
(currently not supported)
...
...
modules/imgproc/src/color.cpp
View file @
3d222d31
...
...
@@ -2090,7 +2090,7 @@ struct RGB2Luv_b
{
dst
[
j
]
=
saturate_cast
<
uchar
>
(
buf
[
j
]
*
2.55
f
);
dst
[
j
+
1
]
=
saturate_cast
<
uchar
>
(
buf
[
j
+
1
]
*
0.72033898305084743
f
+
96.525423728813564
f
);
dst
[
j
+
2
]
=
saturate_cast
<
uchar
>
(
buf
[
j
+
2
]
*
0.9
9609375
f
+
139.453125
f
);
dst
[
j
+
2
]
=
saturate_cast
<
uchar
>
(
buf
[
j
+
2
]
*
0.9
732824427480916
f
+
136.259541984732824
f
);
}
}
}
...
...
@@ -2122,7 +2122,7 @@ struct Luv2RGB_b
{
buf
[
j
]
=
src
[
j
]
*
(
100.
f
/
255.
f
);
buf
[
j
+
1
]
=
(
float
)(
src
[
j
+
1
]
*
1.388235294117647
f
-
134.
f
);
buf
[
j
+
2
]
=
(
float
)(
src
[
j
+
2
]
*
1.0
03921568627451
f
-
140.
f
);
buf
[
j
+
2
]
=
(
float
)(
src
[
j
+
2
]
*
1.0
27450980392157
f
-
140.
f
);
}
cvt
(
buf
,
buf
,
dn
);
...
...
modules/imgproc/src/opencl/cvtcolor.cl
View file @
3d222d31
...
...
@@ -1747,7 +1747,7 @@ __kernel void BGR2Luv(__global const uchar * src, int src_step, int src_offset,
dst[0]
=
SAT_CAST
(
L
*
2.55f
)
;
dst[1]
=
SAT_CAST
(
fma
(
u,
0.72033898305084743f,
96.525423728813564f
))
;
dst[2]
=
SAT_CAST
(
fma
(
v,
0.9
9609375f,
139.453125
f
))
;
dst[2]
=
SAT_CAST
(
fma
(
v,
0.9
732824427480916f,
136.259541984732824
f
))
;
++y
;
dst
+=
dst_step
;
...
...
@@ -1843,7 +1843,7 @@ __kernel void Luv2BGR(__global const uchar * src, int src_step, int src_offset,
float
d,
X,
Y,
Z
;
float
L
=
src[0]*
(
100.f/255.f
)
;
float
u
=
fma
(
convert_float
(
src[1]
)
,
1.388235294117647f,
-134.f
)
;
float
v
=
fma
(
convert_float
(
src[2]
)
,
1.0
03921568627451
f,
-
140.f
)
;
float
v
=
fma
(
convert_float
(
src[2]
)
,
1.0
27450980392157
f,
-
140.f
)
;
Y
=
(
L
+
16.f
)
*
(
1.f/116.f
)
;
Y
=
Y*Y*Y
;
d
=
(
1.f/13.f
)
/L
;
...
...
modules/imgproc/test/test_color.cpp
View file @
3d222d31
...
...
@@ -1170,8 +1170,8 @@ void CV_ColorLuvTest::convert_row_bgr2abc_32f_c3( const float* src_row, float* d
{
u_scale
=
0.720338983
f
;
u_bias
=
96.5254237
f
;
v_scale
=
0.9
9609375
f
;
v_bias
=
13
9.453125
f
;
v_scale
=
0.9
73282442
f
;
v_bias
=
13
6.2595419
f
;
}
for
(
j
=
0
;
j
<
n
*
3
;
j
+=
3
)
...
...
@@ -1223,8 +1223,8 @@ void CV_ColorLuvTest::convert_row_abc2bgr_32f_c3( const float* src_row, float* d
{
u_scale
=
1.
f
/
0.720338983
f
;
u_bias
=
96.5254237
f
;
v_scale
=
1.
f
/
0.9
9609375
f
;
v_bias
=
13
9.453125
f
;
v_scale
=
1.
f
/
0.9
73282442
f
;
v_bias
=
13
6.2595419
f
;
}
for
(
j
=
0
;
j
<
n
*
3
;
j
+=
3
)
...
...
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