Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Create a vector of Mat from a three dimensional vector

Hello,

I have a vector of the type "std::vector< std::vector< std::vector "<"uint16_t> > >" and data is stored in the following order: vector[col][channel][row].

I would like to create a vector of the type "std::vector"<"cv::Mat>>" in which a grayscale image of each channel is stored. Also, the Mat vector should point to the original data.

The original vector changes dynamically as new columns are appended and so the Mat vector should grow as well.

What is the best way to create, fill and extend the Mat vector?

Thank you very much!

click to hide/show revision 2
None

updated 2018-07-02 09:48:15 -0600

berak gravatar image

Create a vector of Mat from a three dimensional vector

Hello,

I have a vector of the type "std::vector< std::vector< std::vector< std::vector "<"uint16_t> > >"> and data is stored in the following order: vector[col][channel][row].

I would like to create a vector of the type "std::vector"<"cv::Mat>>"std::vector"<"cv::Mat>> in which a grayscale image of each channel is stored. Also, the Mat vector should point to the original data.

The original vector changes dynamically as new columns are appended and so the Mat vector should grow as well.

What is the best way to create, fill and extend the Mat vector?

Thank you very much!

click to hide/show revision 3
None

updated 2018-07-02 09:49:25 -0600

berak gravatar image

Create a vector of Mat from a three dimensional vector

Hello,

I have a vector of the type

std::vector< std::vector< std::vector  "<"uint16_t> <uint16_t> > >>
 

and data is stored in the following order: vector[col][channel][row].

I would like to create a vector of the type std::vector"<"cv::Mat>>std::vector<cv::Mat> in which a grayscale image of each channel is stored. Also, the Mat vector should point to the original data.

The original vector changes dynamically as new columns are appended and so the Mat vector should grow as well.

What is the best way to create, fill and extend the Mat vector?

Thank you very much!