AMCoded AMCoded - 5 months ago 29
C++ Question

OpenCV Add columns to a matrix

in OpenCV 2 and later there is method

that let's you add any number of rows with the default value to your matrix is there any equivalent method for the column. and if not what is the most efficient way to do this.

Answer Source

Use cv::hconcat:

Mat mat;
Mat cols;

cv::hconcat(mat, cols, mat);