经过一段时间的研究,我终于成功地通过阈值检测到了手。唯一的问题是背景中留下的像素非常少,这会扰乱下一步。关于如何消除少数背景像素有什么建议吗?因为我不想只为了几个像素而经历整个背景减除的过程。背景扣除不是该程序的一个选项,所以请不要建议它,
谢谢
After spending on a while on this, I finally managed to detect the hands through thresholding. The only problem is that VERY FEW pixels in the background remain, which will mess up the next step. Any suggestions on how to get rid of the few background pixels? Because I don't want to go through the whole background subtraction thing for just a few pixels. Background Subtraction is not an option for the program, so please don't suggest it
Thanks
发布评论
评论(1)
如果没有更详细的手部检测算法描述,很难确定。如果您有一些与检测到的手隔离的背景像素,我建议进行形态学操作,例如 打开以消除二进制掩模中的单像素检测。在openCV中,我认为你需要 erode 然后 扩张
It's hard to be sure without a more detailed description of your hand detection algorithm. If you have a few background pixels that are isolated from the hands you have detected, I would suggest morphological operation like opening to eliminate single pixel detections in your binary mask. In openCV, I think you need to erode and then dilate