Skip to content

Commit e87ba1d

Browse files
committed
Merge pull request opencv#18590 from krush11:master
2 parents f9d1f51 + 1fb6c6e commit e87ba1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/imgproc/src/demosaicing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,9 +1566,9 @@ class Bayer2RGB_EdgeAware_T_Invoker :
15661566
int x = 1;
15671567
if (start_with_green)
15681568
{
1569-
D[blue<<1] = (S[-sstep] + S[sstep]) >> 1;
1569+
D[blue<<1] = (S[-sstep] + S[sstep] + 1) >> 1;
15701570
D[1] = S[0];
1571-
D[2-(blue<<1)] = (S[-1] + S[1]) >> 1;
1571+
D[2-(blue<<1)] = (S[-1] + S[1] + 1) >> 1;
15721572
D += dcn;
15731573
++S;
15741574
++x;
@@ -1584,7 +1584,7 @@ class Bayer2RGB_EdgeAware_T_Invoker :
15841584
{
15851585
D[0] = S[0];
15861586
D[1] = (std::abs(S[-1] - S[1]) > std::abs(S[sstep] - S[-sstep]) ? (S[sstep] + S[-sstep] + 1) : (S[-1] + S[1] + 1)) >> 1;
1587-
D[2] = (S[-sstep-1] + S[-sstep+1] + S[sstep-1] + S[sstep+1]) >> 2;
1587+
D[2] = (S[-sstep-1] + S[-sstep+1] + S[sstep-1] + S[sstep+1] + 2) >> 2;
15881588

15891589
D[3] = (S[0] + S[2] + 1) >> 1;
15901590
D[4] = S[1];

0 commit comments

Comments
 (0)