Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv matrix of matrix

I'm trying to calibrate a fisheye camera using opencv3. But it crashes in cv::fisheye::calibrate() in fisheye.cpp on this line:

  rvecs.getMat(i)=omc[i];

It seems that rvecs is empty, so getMat() fails. I would like to resize rvecs to contain the number of elements of omc. I tried

 if (rvecs.empty())
{
    std::vector<cv::Mat>* v = (std::vector<cv::Mat>*)&rvecs;
    v->resize(omc.size());
}

But it crashes because OpenCV dereferences things when closing the bracket.

Any hints ?