You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <opencv2/opencv.hpp>
using namespace cv;
int main()
{
Mat mat = Mat::zeros(3, 3, CV_16F); // But it is just fine for CV_32F, weird?
FileStorage fs("file.yml", FileStorage::WRITE);
fs << "Mat" << mat;
fs.release();
return 0;
}
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.5.1) Error: Assertion failed (depth >=0 && depth <= CV_64F)
in typeSymbol, file C:\opencv-4.5.1\modules\core\src\persistence.cpp,
line 146
Because the type is not well ordered --- CV_16F comes after CV_64F --- so I think we should define CV_DEPTH as follows to avoid using hard-coded CV_64F in the entire libraries.
#define CV_8U 0
#define CV_8S 1
#define CV_16U 2
#define CV_16S 3
#define CV_32S 4
#define CV_32F 5
#define CV_64F 6
#define CV_16F 7
#define CV_DEPTH CV_16F // just edit this line if another type is added in the future
CV_Assert(depth >=0 && depth <= CV_DEPTH); // Replace all the hard-coded CV-64F in the entire libraries with CV_DEPTH.
It is just an idea, ignore it if it does not make sense. Thank you!
Taken from the
interface.h
and the line 146 which is
CV_Assert(depth >=0 && depth <= CV_64F);
CV_16F
is not supported. Should it be supported?relates #12463
The text was updated successfully, but these errors were encountered: