I'm huge fan of uniform initialization and I'm using it in most cases when i want to construct initialized variable. Recently, I came across weird error while i was constructing variable of type cv::Mat
.
cv::Mat lookUpTable( 1, 256, CV_8U );
uchar* p = lookUpTable.ptr();
for( int i = 0; i < 256; ++i )
{
p[i] = cv::saturate_cast<uchar>( pow( i / 255.0, gamma ) * 255.0 );
}
While this implementation works well, if uniform initialization is used
cv::Mat lookUpTable{ 1, 256, CV_8U };
following error shows up
malloc_consolidate(): invalid chunk size
I'm still not really sure what happes. Is different constructor (than supposed) used ? Can somebody explain further, please ?