mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
fixed gftt wrapper, update testdata
This commit is contained in:
parent
33447e0bba
commit
60019422e8
@ -1323,39 +1323,6 @@ protected:
|
||||
SURF surf;
|
||||
};
|
||||
|
||||
/*template<typename T>
|
||||
class CV_EXPORTS CalonderDescriptorExtractor : public DescriptorExtractor
|
||||
{
|
||||
public:
|
||||
CalonderDescriptorExtractor( const string& classifierFile )
|
||||
{
|
||||
classifier.read(classifierFile.c_str());
|
||||
}
|
||||
|
||||
virtual void compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors) const
|
||||
{
|
||||
// Cannot compute descriptors for keypoints on the image border.
|
||||
removeBorderKeypoints(keypoints, image.size(), BORDER_SIZE);
|
||||
|
||||
// TODO Check 16-byte aligned
|
||||
descriptors.create( keypoints.size(), classifier.classes(), DataType<T>::type );
|
||||
PatchGenerator patchGen;
|
||||
RNG rng;
|
||||
|
||||
for( size_t i = 0; i < keypoints.size(); i++ )
|
||||
{
|
||||
Mat patch;
|
||||
patchGen( image, keypoints[i].pt, patch, Size(PATCH_SIZE, PATCH_SIZE), rng );
|
||||
IplImage ipl = patch;
|
||||
classifier.getSignature( &ipl, descriptors.ptr<T>(i));
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
static const int BORDER_SIZE = 16;
|
||||
RTreeClassifier classifier;
|
||||
};*/
|
||||
|
||||
/****************************************************************************************\
|
||||
* Distance *
|
||||
\****************************************************************************************/
|
||||
|
@ -102,7 +102,7 @@ void GoodFeaturesToTrackDetector::detectImpl( const Mat& image, const Mat& mask,
|
||||
vector<KeyPoint>::iterator keypoint_it = keypoints.begin();
|
||||
for( ; corner_it != corners.end(); ++corner_it, ++keypoint_it )
|
||||
{
|
||||
*keypoint_it = KeyPoint( *corner_it, 1.f );
|
||||
*keypoint_it = KeyPoint( *corner_it, blockSize );
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,8 +127,9 @@ void MserFeatureDetector::detectImpl( const Mat& image, const Mat& mask, vector<
|
||||
vector<KeyPoint>::iterator keypoint_it = keypoints.begin();
|
||||
for( ; contour_it != msers.end(); ++contour_it, ++keypoint_it )
|
||||
{
|
||||
// TODO check transformation from MSER region to KeyPoint
|
||||
RotatedRect rect = fitEllipse(Mat(*contour_it));
|
||||
*keypoint_it = KeyPoint( rect.center, min(rect.size.height, rect.size.width), rect.angle);
|
||||
*keypoint_it = KeyPoint( rect.center, sqrt(rect.size.height*rect.size.width), rect.angle);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2006,13 +2006,13 @@ SIFT::SIFT( const CommonParams& _commParams,
|
||||
|
||||
inline KeyPoint vlKeypointToOcv( const VL::Sift::Keypoint& vlKeypoint, float angle )
|
||||
{
|
||||
return KeyPoint(vlKeypoint.x, vlKeypoint.y, vlKeypoint.sigma, angle, 0, vlKeypoint.o, 0 );
|
||||
return KeyPoint(vlKeypoint.x, vlKeypoint.y, 3*vlKeypoint.sigma, angle, 0, vlKeypoint.o, 0 );
|
||||
}
|
||||
|
||||
inline void ocvKeypointToVl( const KeyPoint& ocvKeypoint, const VL::Sift& vlSift,
|
||||
VL::Sift::Keypoint& vlKeypoint )
|
||||
{
|
||||
vlKeypoint = vlSift.getKeypoint(ocvKeypoint.pt.x, ocvKeypoint.pt.y, ocvKeypoint.size);
|
||||
vlKeypoint = vlSift.getKeypoint(ocvKeypoint.pt.x, ocvKeypoint.pt.y, ocvKeypoint.size/3);
|
||||
}
|
||||
|
||||
float computeKeypointOrientations( VL::Sift& sift, const VL::Sift::Keypoint& keypoint, int angleMode )
|
||||
|
@ -278,7 +278,7 @@ void transformToEllipticKeyPoints( const vector<KeyPoint>& src, vector<EllipticK
|
||||
dst.resize(src.size());
|
||||
for( size_t i = 0; i < src.size(); i++ )
|
||||
{
|
||||
float rad = src[i].size;
|
||||
float rad = src[i].size/2;
|
||||
assert( rad );
|
||||
float fac = 1.f/(rad*rad);
|
||||
dst[i] = EllipticKeyPoint( src[i].pt, Scalar(fac, 0, fac) );
|
||||
@ -295,7 +295,7 @@ void transformToKeyPoints( const vector<EllipticKeyPoint>& src, vector<KeyPoint>
|
||||
{
|
||||
Size_<float> axes = src[i].axes;
|
||||
float rad = sqrt(axes.height*axes.width);
|
||||
dst[i] = KeyPoint(src[i].center, rad );
|
||||
dst[i] = KeyPoint(src[i].center, 2*rad );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user