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
cd8a0a38
Commit
cd8a0a38
authored
Oct 15, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1771 from seiko2plus:changeUnvMultiply16
parents
334e8b20
63053499
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
grayworld_white_balance.cpp
modules/xphoto/src/grayworld_white_balance.cpp
+8
-8
No files found.
modules/xphoto/src/grayworld_white_balance.cpp
View file @
cd8a0a38
...
...
@@ -130,8 +130,8 @@ void calculateChannelSums(uint &sumB, uint &sumG, uint &sumR, uchar *src_data, i
v_expand
(
v_max_val
,
v_max1
,
v_max2
);
// Calculate masks
v_m1
=
~
(
(
v_max1
-
v_min1
)
*
v_255
>
v_thresh
*
v_max1
);
v_m2
=
~
(
(
v_max2
-
v_min2
)
*
v_255
>
v_thresh
*
v_max2
);
v_m1
=
~
(
v_mul_wrap
(
v_max1
-
v_min1
,
v_255
)
>
v_mul_wrap
(
v_thresh
,
v_max1
)
);
v_m2
=
~
(
v_mul_wrap
(
v_max2
-
v_min2
,
v_255
)
>
v_mul_wrap
(
v_thresh
,
v_max2
)
);
// Apply masks
v_iB1
=
(
v_iB1
&
v_m1
)
+
(
v_iB2
&
v_m2
);
...
...
@@ -282,12 +282,12 @@ void applyChannelGains(InputArray _src, OutputArray _dst, float gainB, float gai
v_expand
(
v_inR
,
v_sR1
,
v_sR2
);
// Multiply by gains
v_sB1
=
(
v_sB1
*
v_gainB
)
>>
8
;
v_sB2
=
(
v_sB2
*
v_gainB
)
>>
8
;
v_sG1
=
(
v_sG1
*
v_gainG
)
>>
8
;
v_sG2
=
(
v_sG2
*
v_gainG
)
>>
8
;
v_sR1
=
(
v_sR1
*
v_gainR
)
>>
8
;
v_sR2
=
(
v_sR2
*
v_gainR
)
>>
8
;
v_sB1
=
v_mul_wrap
(
v_sB1
,
v_gainB
)
>>
8
;
v_sB2
=
v_mul_wrap
(
v_sB2
,
v_gainB
)
>>
8
;
v_sG1
=
v_mul_wrap
(
v_sG1
,
v_gainG
)
>>
8
;
v_sG2
=
v_mul_wrap
(
v_sG2
,
v_gainG
)
>>
8
;
v_sR1
=
v_mul_wrap
(
v_sR1
,
v_gainR
)
>>
8
;
v_sR2
=
v_mul_wrap
(
v_sR2
,
v_gainR
)
>>
8
;
// Pack into vectors of v_uint8x16
v_store_interleave
(
&
dst_data
[
i
],
v_pack
(
v_sB1
,
v_sB2
),
v_pack
(
v_sG1
,
v_sG2
),
v_pack
(
v_sR1
,
v_sR2
));
...
...
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