(-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'这是为什么
时间: 2023-09-21 18:02:49 浏览: 183
IEEE Standard for Universal Verification Methodology Language Reference Manual
This error is typically seen in OpenCV and occurs when the width of an image or matrix is less than or equal to zero. The error message indicates that an assertion failed, meaning that a condition that was supposed to be true was not met.
To fix this error, you should check the code where the image or matrix is being created or manipulated and ensure that the width is set to a positive value. You may also need to check if the input data is valid and properly initialized.
Here is an example of how to create a matrix with a valid width:
```
cv::Mat mat(10, 20, CV_8UC1); // creates a matrix with height 10 and width 20
```
In this example, the width is set to 20 which is greater than zero.
阅读全文