reshape matrix
I can achieve the following:
with the reshape command quite easy:
Mat a = Mat(5,1, CV_32FC3); //a is 5x1, 3 channels
Mat b = a.reshape(1); //b is 5x3, 1 channel
How about the opposite:
I was also trying with .reshape
but I couldn't manage it. (bear with me but my brain is quite fried at the moment)
Update:
I have the following image where its channel is in one big image:
so what I want to do is take each part of the image (we know the dimensions) and put it in a different channel:
in order to get the final image:
I could do it with many ways but I thought that there should be a simple way to do it like using .reshape
or something similar. Therefore, I tried with the .reshape
and what @LorenaGdl suggested or .reshape(3, image.rows)
but I do not get the result I want grrrrrr, actually I am not sure if I can do that with the reshape. (by the way at the end I will be seeing nightmares with pink panthers.....:-p )