diff --git a/modules/features2d/src/akaze.cpp b/modules/features2d/src/akaze.cpp index 2083ce8d7..4d4c744b1 100644 --- a/modules/features2d/src/akaze.cpp +++ b/modules/features2d/src/akaze.cpp @@ -99,6 +99,9 @@ namespace cv } impl.Compute_Descriptors(keypoints, desc); + + CV_Assert((!desc.rows || desc.cols == descriptorSize()) && "Descriptor size does not match expected"); + CV_Assert((!desc.rows || (desc.type() & descriptorType())) && "Descriptor type does not match expected"); } void AKAZE::detectImpl(InputArray image, std::vector& keypoints, InputArray mask) const @@ -143,7 +146,7 @@ namespace cv impl.Create_Nonlinear_Scale_Space(img1_32); impl.Compute_Descriptors(keypoints, desc); - CV_Assert(!desc.rows || desc.cols == descriptorSize() && "Descriptor size does not match expected"); - CV_Assert(!desc.rows || (desc.type() & descriptorType()) && "Descriptor type does not match expected"); + CV_Assert((!desc.rows || desc.cols == descriptorSize()) && "Descriptor size does not match expected"); + CV_Assert((!desc.rows || (desc.type() & descriptorType())) && "Descriptor type does not match expected"); } } \ No newline at end of file diff --git a/modules/features2d/src/kaze.cpp b/modules/features2d/src/kaze.cpp index 3bba8795a..e49e1d2d7 100644 --- a/modules/features2d/src/kaze.cpp +++ b/modules/features2d/src/kaze.cpp @@ -70,8 +70,8 @@ namespace cv impl.Feature_Description(keypoints, desc); - CV_Assert(!desc.rows || desc.cols == descriptorSize() && "Descriptor size does not match expected"); - CV_Assert(!desc.rows || (desc.type() & descriptorType()) && "Descriptor type does not match expected"); + CV_Assert((!desc.rows || desc.cols == descriptorSize()) && "Descriptor size does not match expected"); + CV_Assert((!desc.rows || (desc.type() & descriptorType())) && "Descriptor type does not match expected"); } void KAZE::detectImpl(InputArray image, std::vector& keypoints, InputArray mask) const @@ -118,7 +118,7 @@ namespace cv impl.Create_Nonlinear_Scale_Space(img1_32); impl.Feature_Description(keypoints, desc); - CV_Assert(!desc.rows || desc.cols == descriptorSize() && "Descriptor size does not match expected"); - CV_Assert(!desc.rows || (desc.type() & descriptorType()) && "Descriptor type does not match expected"); + CV_Assert((!desc.rows || desc.cols == descriptorSize()) && "Descriptor size does not match expected"); + CV_Assert((!desc.rows || (desc.type() & descriptorType())) && "Descriptor type does not match expected"); } } \ No newline at end of file