Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assertion failed

OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)size.p[0] && (unsigned)(i1DataType<_Tp>::channels) < (unsigned)(size.p[1]channels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file D:\Ram\Software\OpenCV2.4.13\opencv\build\include\opencv2/core/mat.hpp, line 538

Assertion failedfailed.How can I solve

I used OpenCV2.4.13 and I got OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)size.p[0] && (unsigned)(i1DataType<_Tp>::channels) (unsigned)(i1DataType<_Tp>::channels) < (unsigned)(size.p[1]channels()) (unsigned)(size.p[1]channels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file D:\Ram\Software\OpenCV2.4.13\opencv\build\include\opencv2/core/mat.hpp, line 538538

while trying to compile the below piece of code.

myfile << shape.part(i); //std::string num = std::to_string(shape.part(i)); for (int i = 0; i < 68; i++) { myfile << shape.part(i); /fwrite(num, 40, 1, fp);/

            }

How can I solve it.

click to hide/show revision 3
No.3 Revision

updated 2016-08-20 07:09:06 -0600

berak gravatar image

Assertion failed.How can I solve

I used OpenCV2.4.13 and I got OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)size.p[0] && (unsigned)(i1DataType<_Tp>::channels) < (unsigned)(size.p[1]channels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file D:\Ram\Software\OpenCV2.4.13\opencv\build\include\opencv2/core/mat.hpp, line 538

while trying to compile the below piece of code.

 myfile << shape.part(i);
//std::string num = std::to_string(shape.part(i));
for (int i = 0; i < 68; i++)
{
myfile << shape.part(i);
/fwrite(num, /*fwrite(num, 40, 1, fp);/

fp);*/
 }

How can I solve it.