Aforge.net 的 BlobCounter是个不错的选择,改成Cpp 的代码也很简单 链接如下 http://www.cppblog.com/Files/mcs51a/blobcounter.rar