Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Create a memory continuous cv::Mat, any api could do that?

cv::Mat dst(src.size(), src.type());

I want to make sure the memory of the dst is continuous(without padding), how could I do that?

Create a memory continuous cv::Mat, any api could do that?

cv::Mat dst(src.size(), src.type());

I want to make sure the memory of the dst is continuous(without padding), how could I do that?

The most easiest answer is call the reshape after creation.

dst.reshape(0);

But how could I make sure it is continuous when construct?

click to hide/show revision 3
retagged

updated 2013-10-20 04:31:03 -0600

berak gravatar image

Create a memory continuous cv::Mat, any api could do that?

cv::Mat dst(src.size(), src.type());

I want to make sure the memory of the dst is continuous(without padding), how could I do that?

The most easiest answer is call the reshape after creation.

dst.reshape(0);

But how could I make sure it is continuous when construct?