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:
@@ -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())));
|
||||
|
||||
@@ -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())));
|
||||
|
||||
Reference in New Issue
Block a user