1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

feature2d: fix descriptors allocation for AKAZE and KAZE

fix crash when descriptors are UMat
This commit is contained in:
Jiri Horner
2017-06-07 16:55:41 +02:00
parent 5860b76cbe
commit c22f72e248
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -211,8 +211,10 @@ namespace cv
if( descriptors.needed() )
{
Mat& desc = descriptors.getMatRef();
Mat desc;
impl.Compute_Descriptors(keypoints, desc);
// TODO optimize this copy
desc.copyTo(descriptors);
CV_Assert((!desc.rows || desc.cols == descriptorSize()));
CV_Assert((!desc.rows || (desc.type() == descriptorType())));
+2 -1
View File
@@ -151,8 +151,9 @@ namespace cv
if( descriptors.needed() )
{
Mat& desc = descriptors.getMatRef();
Mat desc;
impl.Feature_Description(keypoints, desc);
desc.copyTo(descriptors);
CV_Assert((!desc.rows || desc.cols == descriptorSize()));
CV_Assert((!desc.rows || (desc.type() == descriptorType())));