Commit 701760db authored by Alexander Alekhin's avatar Alexander Alekhin

calib3d: use `Mat::reserveBuffer()` instead of `.create()`

to allocate memory >2Gb
parent f9c8bb40
...@@ -1492,7 +1492,9 @@ static void computeDisparitySGBM_HH4( const Mat& img1, const Mat& img2, ...@@ -1492,7 +1492,9 @@ static void computeDisparitySGBM_HH4( const Mat& img1, const Mat& img2,
if( buffer.empty() || !buffer.isContinuous() || if( buffer.empty() || !buffer.isContinuous() ||
buffer.cols*buffer.rows*buffer.elemSize() < totalBufSize ) buffer.cols*buffer.rows*buffer.elemSize() < totalBufSize )
buffer.create(1, (int)totalBufSize, CV_8U); {
buffer.reserveBuffer(totalBufSize);
}
// summary cost over different (nDirs) directions // summary cost over different (nDirs) directions
CostType* Cbuf = (CostType*)alignPtr(buffer.ptr(), ALIGN); CostType* Cbuf = (CostType*)alignPtr(buffer.ptr(), ALIGN);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment