Does anyone know if there is an easy way to turn a cv::Mat
into ipcMatrix<ipcRGB>
?
Does anyone know if there is an easy way to turn a cv::Mat
into ipcMatrix<ipcRGB>
?
With the help of @ karlphillip I was able to reach a solution : p>
cv::cvtColor(mat_input, mat_rgb, cv::COLOR_BGR2RGB);
int sz = mat_rgb.rows * mat_rgb.cols * mat_rgb.channels();
unsigned char* imageBuf = new unsigned char[sz];
memcpy(imageBuf,mat_rgb.data, sz);
ipcMatrix<ipcRGB> input = ipcMatrix<ipcRGB>(mat_rgb.cols, mat_rgb.rows, (ipcRGB*)imageBuf);
This way you can transform a cv::Mat
into a ipcMatrix<ipcRGB>
.