mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge pull request #9618 from vipinanand4:goodFeaturesToTrack_added_gradiantSize
Added gradiantSize param into goodFeaturesToTrack API (#9618) * Added gradiantSize param into goodFeaturesToTrack API Removed hardcode value 3 in goodFeaturesToTrack API, and added new param 'gradinatSize' in this API so that user can pass any gradiant size as 3, 5 or 7. Signed-off-by: Vipin Anand <anand.vipin@gmail.com> Signed-off-by: Nilaykumar Patel<nilay.nilpat@gmail.com> Signed-off-by: Prashanth Voora <prashanthx85@gmail.com> * fixed compilation error for java test Signed-off-by: Vipin Anand <anand.vipin@gmail.com> * Modifying code for previous binary compatibility and fixing other warnings fixed ABI break issue resolved merged conflict compilation error fix Signed-off-by: Vipin Anand <anand.vipin@gmail.com> Signed-off-by: Patel, Nilaykumar K <nilay.nilpat@gmail.com>
This commit is contained in:
committed by
Alexander Alekhin
parent
50aa4f8887
commit
39e742765a
@@ -48,10 +48,10 @@ class GFTTDetector_Impl : public GFTTDetector
|
||||
{
|
||||
public:
|
||||
GFTTDetector_Impl( int _nfeatures, double _qualityLevel,
|
||||
double _minDistance, int _blockSize,
|
||||
double _minDistance, int _blockSize, int _gradientSize,
|
||||
bool _useHarrisDetector, double _k )
|
||||
: nfeatures(_nfeatures), qualityLevel(_qualityLevel), minDistance(_minDistance),
|
||||
blockSize(_blockSize), useHarrisDetector(_useHarrisDetector), k(_k)
|
||||
blockSize(_blockSize), gradSize(_gradientSize), useHarrisDetector(_useHarrisDetector), k(_k)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -67,6 +67,9 @@ public:
|
||||
void setBlockSize(int blockSize_) { blockSize = blockSize_; }
|
||||
int getBlockSize() const { return blockSize; }
|
||||
|
||||
void setGradientSize(int gradientSize_) { gradSize = gradientSize_; }
|
||||
int getGradientSize() { return gradSize; }
|
||||
|
||||
void setHarrisDetector(bool val) { useHarrisDetector = val; }
|
||||
bool getHarrisDetector() const { return useHarrisDetector; }
|
||||
|
||||
@@ -88,7 +91,7 @@ public:
|
||||
ugrayImage = _image.getUMat();
|
||||
|
||||
goodFeaturesToTrack( ugrayImage, corners, nfeatures, qualityLevel, minDistance, _mask,
|
||||
blockSize, useHarrisDetector, k );
|
||||
blockSize, gradSize, useHarrisDetector, k );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -97,7 +100,7 @@ public:
|
||||
cvtColor( image, grayImage, COLOR_BGR2GRAY );
|
||||
|
||||
goodFeaturesToTrack( grayImage, corners, nfeatures, qualityLevel, minDistance, _mask,
|
||||
blockSize, useHarrisDetector, k );
|
||||
blockSize, gradSize, useHarrisDetector, k );
|
||||
}
|
||||
|
||||
keypoints.resize(corners.size());
|
||||
@@ -112,17 +115,26 @@ public:
|
||||
double qualityLevel;
|
||||
double minDistance;
|
||||
int blockSize;
|
||||
int gradSize;
|
||||
bool useHarrisDetector;
|
||||
double k;
|
||||
};
|
||||
|
||||
|
||||
Ptr<GFTTDetector> GFTTDetector::create( int _nfeatures, double _qualityLevel,
|
||||
double _minDistance, int _blockSize, int _gradientSize,
|
||||
bool _useHarrisDetector, double _k )
|
||||
{
|
||||
return makePtr<GFTTDetector_Impl>(_nfeatures, _qualityLevel,
|
||||
_minDistance, _blockSize, _gradientSize, _useHarrisDetector, _k);
|
||||
}
|
||||
|
||||
Ptr<GFTTDetector> GFTTDetector::create( int _nfeatures, double _qualityLevel,
|
||||
double _minDistance, int _blockSize,
|
||||
bool _useHarrisDetector, double _k )
|
||||
{
|
||||
return makePtr<GFTTDetector_Impl>(_nfeatures, _qualityLevel,
|
||||
_minDistance, _blockSize, _useHarrisDetector, _k);
|
||||
_minDistance, _blockSize, 3, _useHarrisDetector, _k);
|
||||
}
|
||||
|
||||
String GFTTDetector::getDefaultName() const
|
||||
|
||||
Reference in New Issue
Block a user