Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked Oct 20 '13

stereomatching 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?

click to hide/show revision 2
No.2 Revision

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 Oct 20 '13

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?