0

I have a matrix of a Mat object, I have to pad bigger Mat object with the last elements of every rows and cols of the original object around the original array. In

This is the way I tried but padding with all zeros(I have to change it).

 Mat padded;
 int padding = padSize;

 padded.create(img.rows+padding,img.cols+padding,img.type());
 padded.setTo(cv::Scalar::all(0));
 img.copyTo(padded(Rect(padding,padding,img.rows,img.cols);

In the last line I see an error :

no matching function for call to 'cv::Mat::copyTo(cv::Mat)'

Martin Mulder
  • 12,642
  • 3
  • 25
  • 54
Elvio
  • 17
  • 7

0 Answers0