Commit 52b8bb67 authored by Ilya Lavrenov's avatar Ilya Lavrenov

fixed getUMatIndex

parent a7d2830d
...@@ -1940,10 +1940,16 @@ static void getUMatIndex(const std::vector<UMat> & um, int cn, int & idx, int & ...@@ -1940,10 +1940,16 @@ static void getUMatIndex(const std::vector<UMat> & um, int cn, int & idx, int &
int ccn = um[i].channels(); int ccn = um[i].channels();
totalChannels += ccn; totalChannels += ccn;
if (totalChannels >= cn) if (totalChannels == cn)
{
idx = (int)(i + 1);
cnidx = 0;
return;
}
else if (totalChannels > cn)
{ {
idx = (int)i; idx = (int)i;
cnidx = i == 0 ? cn : cn % (totalChannels - ccn); cnidx = i == 0 ? cn : (cn - totalChannels + ccn);
return; return;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment