added basic support for CV_16F (the new datatype etc.)#12463
added basic support for CV_16F (the new datatype etc.)#12463vpisarev merged 4 commits intoopencv:masterfrom
Conversation
…s now equal to CV_16F, which may break some [rarely used] functionality. We'll see
…ch importer (need to find a better solution)
| #define CV_32F 5 | ||
| #define CV_64F 6 | ||
| #define CV_USRTYPE1 7 | ||
| #define CV_16F 7 |
There was a problem hiding this comment.
#define CV_USRTYPE1 7
Lets leave message for users about compatibility/migration problems:
#define CV_USRTYPE1 (void)"CV_USRTYPE1 support has been dropped in OpenCV 4.0"
There was a problem hiding this comment.
there are a few places where USRTYPE1 is still used, but need to be adjusted, e.g. Torch importer in DNN.
There was a problem hiding this comment.
New size of these elements are 2 bytes instead of previous 8.
This will lead to memory corruption.
/cc @dkurt
modules/core/src/rand.cpp
Outdated
| CV_Assert(!_mat.empty()); | ||
|
|
||
| if (_mat.empty()) | ||
| return; |
There was a problem hiding this comment.
Early error detection: #8300
Filling empty Mat with random numbers is not a normal use case of OpenCV.
| case CV_64F: *os << "64F"; break; | ||
| case CV_USRTYPE1: *os << "USRTYPE1"; break; | ||
| case CV_USRTYPE1: *os << "16F"; break; | ||
| default: *os << "INVALID_TYPE"; break; |
There was a problem hiding this comment.
It is time to replace this switch to something of:
depthToString(t)
typeToString(t)
There was a problem hiding this comment.
the naive change to typeToString(t) breaks the perf tests because of different naming conventions. Let's leave it as-is for now
|
👍 |
* added basic support for CV_16F (the new datatype etc.). CV_USRTYPE1 is now equal to CV_16F, which may break some [rarely used] functionality. We'll see * fixed just introduced bug in norm; reverted errorneous changes in Torch importer (need to find a better solution) * addressed some issues found during the PR review * restored the patch to fix some perf test failures
CV_USRTYPE1 is now equal to CV_16F, which may break some [rarely used] functionality. We'll see. The following functions and methods should support CV_16F: