我有一个根据以下代码动态更改的矩阵;
for( It=all_frames.begin(); It != all_frames.end(); ++It)
{
ItTemp = *It;
subtract(ItTemp, Base, NewData);
cout << "The size of the new data for ";
cout << " is \n" << NewData.rows << "x" << NewData.cols << endl;
cout << "The New Data is: \n" << NewData << endl << endl;
NewData_Vector.push_back(NewData.clone());
}
我想要做的是确定 cv::Mat NewData 为零矩阵的帧。
我尝试使用 cv::compare() 函数和简单运算符(即 NewData == NoData)将其与相同大小的零矩阵进行比较,但我什至无法编译该程序。
有没有一种简单的方法来确定 cv::Mat 何时填充零?
I used
if (countNonZero(NewData) < 1)
{
cout << "Eye contact occurs in this frame" << endl;
}
这是一种非常简单(如果可能不是最优雅)的方法。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)