For details of colour names you can use in your HTML and CSS code, see the section on named colours. (Colours marked with an asterisk* are included in the VGA colour set).
一、功能
这里的需求是,判断摄像头有没有被物体遮挡。这里只考虑用手遮挡—->判断黑色颜色的范围。
二、使用OpenCV的Mat格式图片遍历图片
下面代码里,传入的图片的尺寸是640*480,判断黑色范围。
/*
在图片里查找指定颜色的比例
*/
int Widget::Mat_color_Find(QImage qimage)
{
Mat image = QImage2cvMat(qimage);//将图片加载进来
int num = 0;//记录颜色的像素点
float r