fixed getUMatIndex

This commit is contained in:
Ilya Lavrenov 2013-12-27 13:18:31 +04:00
parent a7d2830d3f
commit 52b8bb6761

View File

@ -1940,10 +1940,16 @@ static void getUMatIndex(const std::vector<UMat> & um, int cn, int & idx, int &
int ccn = um[i].channels();
totalChannels += ccn;
if (totalChannels >= cn)
if (totalChannels == cn)
{
idx = (int)(i + 1);
cnidx = 0;
return;
}
else if (totalChannels > cn)
{
idx = (int)i;
cnidx = i == 0 ? cn : cn % (totalChannels - ccn);
cnidx = i == 0 ? cn : (cn - totalChannels + ccn);
return;
}
}