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
4c433197
Commit
4c433197
authored
Jun 12, 2015
by
Seon-Wook Park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be more correct with int types
parent
ba0b4023
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
grayworld_white_balance.cpp
modules/xphoto/src/grayworld_white_balance.cpp
+6
-6
test_grayworld.cpp
modules/xphoto/test/test_grayworld.cpp
+4
-3
No files found.
modules/xphoto/src/grayworld_white_balance.cpp
View file @
4c433197
...
...
@@ -165,9 +165,9 @@ namespace cv { namespace xphoto {
}
// Fixed point arithmetic, mul by 2^8 then shift back 8 bits
unsigned
int
i_inv1
=
inv1
*
(
1
<<
8
),
i_inv2
=
inv2
*
(
1
<<
8
),
i_inv3
=
inv3
*
(
1
<<
8
);
int
i_inv1
=
cvRound
(
inv1
*
(
1
<<
8
)
),
i_inv2
=
cvRound
(
inv2
*
(
1
<<
8
)
),
i_inv3
=
cvRound
(
inv3
*
(
1
<<
8
)
);
// Scale input pixel values
uchar
*
dst_data
=
dst
.
ptr
<
uchar
>
(
0
);
...
...
@@ -175,9 +175,9 @@ namespace cv { namespace xphoto {
#if CV_SIMD128
v_uint8x16
v_outB
,
v_outG
,
v_outR
;
v_uint16x8
v_sB1
,
v_sB2
,
v_sG1
,
v_sG2
,
v_sR1
,
v_sR2
,
v_invB
=
v_setall_u16
(
i_inv1
),
v_invG
=
v_setall_u16
(
i_inv2
),
v_invR
=
v_setall_u16
(
i_inv3
);
v_invB
=
v_setall_u16
(
(
unsigned
short
)
i_inv1
),
v_invG
=
v_setall_u16
(
(
unsigned
short
)
i_inv2
),
v_invR
=
v_setall_u16
(
(
unsigned
short
)
i_inv3
);
for
(
;
i
<
N3
-
47
;
i
+=
48
)
{
...
...
modules/xphoto/test/test_grayworld.cpp
View file @
4c433197
...
...
@@ -29,6 +29,7 @@ namespace cvtest {
sum1
+=
src_data
[
i
];
sum2
+=
src_data
[
i
+
1
];
sum3
+=
src_data
[
i
+
2
];
N_good
++
;
}
// Find inverse of averages
...
...
@@ -48,9 +49,9 @@ namespace cvtest {
}
// Fixed point arithmetic, mul by 2^8 then shift back 8 bits
unsigned
int
i_inv1
=
inv1
*
(
1
<<
8
),
i_inv2
=
inv2
*
(
1
<<
8
),
i_inv3
=
inv3
*
(
1
<<
8
);
int
i_inv1
=
cvRound
(
inv1
*
(
1
<<
8
)
),
i_inv2
=
cvRound
(
inv2
*
(
1
<<
8
)
),
i_inv3
=
cvRound
(
inv3
*
(
1
<<
8
)
);
// Scale input pixel values
uchar
*
dst_data
=
dst
.
ptr
<
uchar
>
(
0
);
...
...
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