pull/2278/head
Konstantin Matskevich 11 years ago
parent f44334285b
commit b0f617bc01
  1. 10
      modules/core/include/opencv2/core.hpp
  2. 3
      modules/features2d/src/bagofwords.cpp
  3. 3
      modules/features2d/src/brief.cpp
  4. 4
      modules/features2d/src/draw.cpp
  5. 6
      modules/features2d/src/freak.cpp

@ -507,11 +507,11 @@ CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev
CV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* rng = 0); CV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* rng = 0);
//! draws the line segment (pt1, pt2) in the image //! draws the line segment (pt1, pt2) in the image
CV_EXPORTS_W void line(CV_IN_OUT InputOutputArray img, Point pt1, Point pt2, const Scalar& color, CV_EXPORTS_W void line(InputOutputArray img, Point pt1, Point pt2, const Scalar& color,
int thickness = 1, int lineType = LINE_8, int shift = 0); int thickness = 1, int lineType = LINE_8, int shift = 0);
//! draws the rectangle outline or a solid rectangle with the opposite corners pt1 and pt2 in the image //! draws the rectangle outline or a solid rectangle with the opposite corners pt1 and pt2 in the image
CV_EXPORTS_W void rectangle(CV_IN_OUT InputOutputArray img, Point pt1, Point pt2, CV_EXPORTS_W void rectangle(InputOutputArray img, Point pt1, Point pt2,
const Scalar& color, int thickness = 1, const Scalar& color, int thickness = 1,
int lineType = LINE_8, int shift = 0); int lineType = LINE_8, int shift = 0);
@ -521,18 +521,18 @@ CV_EXPORTS void rectangle(CV_IN_OUT Mat& img, Rect rec,
int lineType = LINE_8, int shift = 0); int lineType = LINE_8, int shift = 0);
//! draws the circle outline or a solid circle in the image //! draws the circle outline or a solid circle in the image
CV_EXPORTS_W void circle(CV_IN_OUT InputOutputArray img, Point center, int radius, CV_EXPORTS_W void circle(InputOutputArray img, Point center, int radius,
const Scalar& color, int thickness = 1, const Scalar& color, int thickness = 1,
int lineType = LINE_8, int shift = 0); int lineType = LINE_8, int shift = 0);
//! draws an elliptic arc, ellipse sector or a rotated ellipse in the image //! draws an elliptic arc, ellipse sector or a rotated ellipse in the image
CV_EXPORTS_W void ellipse(CV_IN_OUT InputOutputArray img, Point center, Size axes, CV_EXPORTS_W void ellipse(InputOutputArray img, Point center, Size axes,
double angle, double startAngle, double endAngle, double angle, double startAngle, double endAngle,
const Scalar& color, int thickness = 1, const Scalar& color, int thickness = 1,
int lineType = LINE_8, int shift = 0); int lineType = LINE_8, int shift = 0);
//! draws a rotated ellipse in the image //! draws a rotated ellipse in the image
CV_EXPORTS_W void ellipse(CV_IN_OUT InputOutputArray img, const RotatedRect& box, const Scalar& color, CV_EXPORTS_W void ellipse(InputOutputArray img, const RotatedRect& box, const Scalar& color,
int thickness = 1, int lineType = LINE_8); int thickness = 1, int lineType = LINE_8);
//! draws a filled convex polygon in the image //! draws a filled convex polygon in the image

@ -187,7 +187,8 @@ void BOWImgDescriptorExtractor::compute( InputArray keypointDescriptors, InputOu
pointIdxsOfClusters->resize(clusterCount); 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(); Mat imgDescriptor = _imgDescriptor.getMat();

@ -176,7 +176,8 @@ void BriefDescriptorExtractor::computeImpl(InputArray image, std::vector<KeyPoin
//Remove keypoints very close to the border //Remove keypoints very close to the border
KeyPointsFilter::runByImageBorder(keypoints, image.size(), PATCH_SIZE/2 + KERNEL_SIZE/2); 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); test_fn_(sum, keypoints, descriptors);
} }

@ -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 ) const Scalar& _color, int flags )
{ {
if( !(flags & DrawMatchesFlags::DRAW_OVER_OUTIMG) ) if( !(flags & DrawMatchesFlags::DRAW_OVER_OUTIMG) )
@ -143,7 +143,7 @@ static void _prepareImgAndDrawKeypoints( InputArray img1, const std::vector<KeyP
outImg = Scalar::all(0); outImg = Scalar::all(0);
outImg1 = outImg( Rect(0, 0, img1size.width, img1size.height) ); outImg1 = outImg( Rect(0, 0, img1size.width, img1size.height) );
outImg2 = outImg( Rect(img1size.width, 0, img2size.width, img2size.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 ) if( img1.type() == CV_8U )
cvtColor( img1, outImg1, COLOR_GRAY2BGR ); cvtColor( img1, outImg1, COLOR_GRAY2BGR );
else else

@ -297,7 +297,8 @@ void FREAK::computeImpl( InputArray _image, std::vector<KeyPoint>& keypoints, Ou
if( !extAll ) if( !extAll )
{ {
// extract the best comparisons only // 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(); Mat descriptors = _descriptors.getMat();
#if CV_SSE2 #if CV_SSE2
__m128i* ptr= (__m128i*) (descriptors.data+(keypoints.size()-1)*descriptors.step[0]); __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 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(); Mat descriptors = _descriptors.getMat();
std::bitset<1024>* ptr = (std::bitset<1024>*) (descriptors.data+(keypoints.size()-1)*descriptors.step[0]); std::bitset<1024>* ptr = (std::bitset<1024>*) (descriptors.data+(keypoints.size()-1)*descriptors.step[0]);

Loading…
Cancel
Save