我试图将elbp函数(即MAT)的输出插入到新的向量中但是我得到:向量下标超出范围错误?有什么建议吗?
vector <Mat> RefPyramids;
vector <Mat> LBPRefPyramids;
buildPyramid(PyramidDummy, RefPyramids, 3);
for (int PyramidIndex = 0; PyramidIndex <= 4; PyramidIndex++ )
{
Mat PramidLoopMat = RefPyramids[PyramidIndex];
Mat LBPLoopMat;
lbp::ELBP(PramidLoopMat, LBPLoopMat, radius, neighbors);
LBPRefPyramids[PyramidIndex] = LBPLoopMat;
}
答案 0 :(得分:1)
您说(在评论中){{1}}的大小为4.但您的代码违反了该条款:
RefPyramids
你看,你正在迭代[0,1,2,3,4]。 for (int PyramidIndex = 0; PyramidIndex <= 4; PyramidIndex++ )
{
Mat PramidLoopMat = RefPyramids[PyramidIndex];
应为<=
。