2
Does anyone know if there’s an easy way to turn a cv::Mat
in ipcMatrix<ipcRGB>
?
2
Does anyone know if there’s an easy way to turn a cv::Mat
in ipcMatrix<ipcRGB>
?
2
With the help of @karlphillip got come up with a solution:
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);
In this way it is possible to transform a cv::Mat
in a ipcMatrix<ipcRGB>
.
Browser other questions tagged c++ opencv cast
You are not signed in. Login or sign up in order to post.
Let’s translate the title of the question into English?
– karlphillip