1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00
This commit is contained in:
Konstantin Matskevich
2014-02-05 09:59:04 +04:00
parent f44334285b
commit b0f617bc01
5 changed files with 15 additions and 11 deletions
+2 -1
View File
@@ -187,7 +187,8 @@ void BOWImgDescriptorExtractor::compute( InputArray keypointDescriptors, InputOu
pointIdxsOfClusters->resize(clusterCount);
}
Mat( 1, clusterCount, descriptorType(), Scalar::all(0.0) ).copyTo(_imgDescriptor);
_imgDescriptor.create(1, clusterCount, descriptorType());
_imgDescriptor.setTo(Scalar::all(0));
Mat imgDescriptor = _imgDescriptor.getMat();
+2 -1
View File
@@ -176,7 +176,8 @@ void BriefDescriptorExtractor::computeImpl(InputArray image, std::vector<KeyPoin
//Remove keypoints very close to the border
KeyPointsFilter::runByImageBorder(keypoints, image.size(), PATCH_SIZE/2 + KERNEL_SIZE/2);
Mat(Mat::zeros((int)keypoints.size(), bytes_, CV_8U)).copyTo(descriptors);
descriptors.create((int)keypoints.size(), bytes_, CV_8U);
descriptors.setTo(Scalar::all(0));
test_fn_(sum, keypoints, descriptors);
}
+2 -2
View File
@@ -88,7 +88,7 @@ static inline void _drawKeypoint( InputOutputArray img, const KeyPoint& p, const
}
}
void drawKeypoints( InputArray image, const std::vector<KeyPoint>& keypoints, InputOutputArray& outImage,
void drawKeypoints( InputArray image, const std::vector<KeyPoint>& keypoints, InputOutputArray outImage,
const Scalar& _color, int flags )
{
if( !(flags & DrawMatchesFlags::DRAW_OVER_OUTIMG) )
@@ -143,7 +143,7 @@ static void _prepareImgAndDrawKeypoints( InputArray img1, const std::vector<KeyP
outImg = Scalar::all(0);
outImg1 = outImg( Rect(0, 0, img1size.width, img1size.height) );
outImg2 = outImg( Rect(img1size.width, 0, img2size.width, img2size.height) );
printf("%d %d\n", _outImg.size().width, _outImg.size().height);
if( img1.type() == CV_8U )
cvtColor( img1, outImg1, COLOR_GRAY2BGR );
else
+4 -2
View File
@@ -297,7 +297,8 @@ void FREAK::computeImpl( InputArray _image, std::vector<KeyPoint>& keypoints, Ou
if( !extAll )
{
// extract the best comparisons only
Mat(cv::Mat::zeros((int)keypoints.size(), FREAK_NB_PAIRS/8, CV_8U)).copyTo(_descriptors);
_descriptors.create((int)keypoints.size(), FREAK_NB_PAIRS/8, CV_8U);
_descriptors.setTo(Scalar::all(0));
Mat descriptors = _descriptors.getMat();
#if CV_SSE2
__m128i* ptr= (__m128i*) (descriptors.data+(keypoints.size()-1)*descriptors.step[0]);
@@ -416,7 +417,8 @@ void FREAK::computeImpl( InputArray _image, std::vector<KeyPoint>& keypoints, Ou
}
else // extract all possible comparisons for selection
{
Mat(cv::Mat::zeros((int)keypoints.size(), 128, CV_8U)).copyTo(_descriptors);
_descriptors.create((int)keypoints.size(), 128, CV_8U);
_descriptors.setTo(Scalar::all(0));
Mat descriptors = _descriptors.getMat();
std::bitset<1024>* ptr = (std::bitset<1024>*) (descriptors.data+(keypoints.size()-1)*descriptors.step[0]);