Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

matrix concatenation 2D to 3D

hello all I was trying to convert this matlab code into c++

 imageData = toolbox.bayer.ColorOrder.cat( imageData, 0, 3);

this is imageData before

1   2   3   4   5   6   7   8   9   10
11  12  13  14  15  16  17  18  19  20
21  22  23  24  25  26  27  28  29  30
31  32  33  34  35  36  37  38  39  40

this is image data after:

val(:,:,1) =

 1     3     5     7     9
21    23    25    27    29
val(:,:,2) =

 2     4     6     8    10
22    24    26    28    30
val(:,:,3) =

11    13    15    17    19
31    33    35    37    39
val(:,:,4) =

12    14    16    18    20
32    34    36    38    40

I couldn't find a way to this with openCV cv::Mat;

can you suggest a way ?

except copying the elements one by one ?

bayer Image matrix concatenation 2D to 3D

hello all I was trying to convert this matlab code into c++

 imageData = toolbox.bayer.ColorOrder.cat( imageData, 0, 3);

this is imageData before

1   2   3   4   5   6   7   8   9   10
11  12  13  14  15  16  17  18  19  20
21  22  23  24  25  26  27  28  29  30
31  32  33  34  35  36  37  38  39  40

this is image data after:

val(:,:,1) =

 1     3     5     7     9
21    23    25    27    29
val(:,:,2) =

 2     4     6     8    10
22    24    26    28    30
val(:,:,3) =

11    13    15    17    19
31    33    35    37    39
val(:,:,4) =

12    14    16    18    20
32    34    36    38    40

I couldn't find a way to this with openCV cv::Mat;cv::Mat, is there a way to separate Bayer image into it's channels in openCV? i'm not talking about demosaicing. just getting the RGGB channels as R,G,G,B matrices

can you suggest a way ?

except copying the elements one by one ?