////////////////////////////////////////////////////////////// uchar cvBackgroundDiff( uchar *p, codeBook &c,// int minMod, int maxMod)// Given a pixel and a code book, determine if the pixel is// covered by the codebook//// p Pixel pointer (YUV interleaved)// c Codebook reference// numChannels Number of channels we are testing// maxMod Add this (possibly negative) number onto// max level when determining if new pixel is foreground// minMod Subract this (possible negative) number from// min level when determining if pixel is foreground//// NOTES:// minMod and maxMod must have length numChannels,// e.g. 3 channels => minMod[3], maxMod[3].//// Return// 0 => background, 255 => foregrounduchar cvBackgroundDiff( uchar *p, codeBook &c, int numChannels,int *minMod, int *maxMod){int matchChannel;//SEE IF THIS FITS AN EXISTING CODEWORDfor(int i=0; i<c.numEntries; i++){matchChannel = 0;for(int n=0; n<numChannels; n++){if((c.cb[i]->min[n] - minMod[n] <= *(p+n)) &&(*(p+n) <= c.cb[i]->max[n] + maxMod[n])){matchChannel++; //Found an entry for this channel}else{break;}}if(matchChannel == numChannels){break; //Found an entry that matched all channels}}if(i >= c.numEntries) return(255);return(0);}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。