背景建模与前景分割技术详解
1. 背景差分:寻找前景对象
背景差分是一种常用的计算机视觉技术,用于从背景中分割出前景对象。我们可以通过创建背景码本模型并清除其中很少使用的条目,然后使用 backgroundDiff() 函数将前景像素从之前学习到的背景中分割出来。
1.1 backgroundDiff() 函数实现
// Given a pixel and a codebook, determine whether the pixel is
// covered by the codebook
//
// NOTES:
// minMod and maxMod must have length numChannels,
// e.g. 3 channels => minMod[3], maxMod[3]. There is one min and
// one max threshold per channel.
//
uchar backgroundDiff( // return 0 => background, 255 => foreground
const cv::Vec3b& p, // Pixel (YUV)
CodeBook& c, // Codebook
int numChannels, // Number of channels we are testing
int* minMod, // Add thi
超级会员免费看
订阅专栏 解锁全文
11

被折叠的 条评论
为什么被折叠?



