Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

reshape matrix

I can achieve the following:

image description

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:

image description

I was also trying with .reshape but I couldn't manage it. (bear with me but my brain is quite fried at the moment)

reshape matrix

I can achieve the following:

image description

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:

image description

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:

image description

so what I want to do is take each part of the image (we know the dimensions) and put it in a different channel:

image description

in order to get the final image:

image description

I tried with the .reshape and what @LorenaGdl suggested or .reshape(3, image.rows) but I do not get the result I want grrrrrr (at the end I will be seeing nightmares with pink panthers.....:-) )

reshape matrix

I can achieve the following:

image description

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:

image description

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:

image description

so what I want to do is take each part of the image (we know the dimensions) and put it in a different channel:

image description

in order to get the final image:

image description

I tried with the .reshape and what @LorenaGdl suggested or .reshape(3, image.rows) but I do not get the result I want grrrrrr (at 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.....:-) )

reshape matrix

I can achieve the following:

image description

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:

image description

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:

image description

so what I want to do is take each part of the image (we know the dimensions) and put it in a different channel:

image description

in order to get the final image:

image description

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.....:-) panthers.....:-p )

reshape matrix

I can achieve the following:

image description

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:

image description

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:

image description

so what I want to do is take each part of the image (we know the dimensions) and put it in a different channel:

image description

in order to get the final image:

image description

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 )