mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53: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
@@ -75,14 +75,14 @@ struct Corner
|
||||
|
||||
static bool ocl_goodFeaturesToTrack( InputArray _image, OutputArray _corners,
|
||||
int maxCorners, double qualityLevel, double minDistance,
|
||||
InputArray _mask, int blockSize,
|
||||
InputArray _mask, int blockSize, int gradientSize,
|
||||
bool useHarrisDetector, double harrisK )
|
||||
{
|
||||
UMat eig, maxEigenValue;
|
||||
if( useHarrisDetector )
|
||||
cornerHarris( _image, eig, blockSize, 3, harrisK );
|
||||
cornerHarris( _image, eig, blockSize, gradientSize, harrisK );
|
||||
else
|
||||
cornerMinEigenVal( _image, eig, blockSize, 3 );
|
||||
cornerMinEigenVal( _image, eig, blockSize, gradientSize );
|
||||
|
||||
Size imgsize = _image.size();
|
||||
size_t total, i, j, ncorners = 0, possibleCornersCount =
|
||||
@@ -275,7 +275,7 @@ struct VxKeypointsComparator
|
||||
|
||||
static bool openvx_harris(Mat image, OutputArray _corners,
|
||||
int _maxCorners, double _qualityLevel, double _minDistance,
|
||||
int _blockSize, double _harrisK)
|
||||
int _blockSize, int gradiantSize, double _harrisK)
|
||||
{
|
||||
using namespace ivx;
|
||||
|
||||
@@ -357,7 +357,7 @@ static bool openvx_harris(Mat image, OutputArray _corners,
|
||||
|
||||
void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
|
||||
int maxCorners, double qualityLevel, double minDistance,
|
||||
InputArray _mask, int blockSize,
|
||||
InputArray _mask, int blockSize, int gradientSize,
|
||||
bool useHarrisDetector, double harrisK )
|
||||
{
|
||||
CV_INSTRUMENT_REGION()
|
||||
@@ -367,7 +367,7 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
|
||||
|
||||
CV_OCL_RUN(_image.dims() <= 2 && _image.isUMat(),
|
||||
ocl_goodFeaturesToTrack(_image, _corners, maxCorners, qualityLevel, minDistance,
|
||||
_mask, blockSize, useHarrisDetector, harrisK))
|
||||
_mask, blockSize, gradientSize, useHarrisDetector, harrisK))
|
||||
|
||||
Mat image = _image.getMat(), eig, tmp;
|
||||
if (image.empty())
|
||||
@@ -379,12 +379,12 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
|
||||
// Disabled due to bad accuracy
|
||||
CV_OVX_RUN(false && useHarrisDetector && _mask.empty() &&
|
||||
!ovx::skipSmallImages<VX_KERNEL_HARRIS_CORNERS>(image.cols, image.rows),
|
||||
openvx_harris(image, _corners, maxCorners, qualityLevel, minDistance, blockSize, harrisK))
|
||||
openvx_harris(image, _corners, maxCorners, qualityLevel, minDistance, blockSize, gradiantSize, harrisK))
|
||||
|
||||
if( useHarrisDetector )
|
||||
cornerHarris( image, eig, blockSize, 3, harrisK );
|
||||
cornerHarris( image, eig, blockSize, gradientSize, harrisK );
|
||||
else
|
||||
cornerMinEigenVal( image, eig, blockSize, 3 );
|
||||
cornerMinEigenVal( image, eig, blockSize, gradientSize );
|
||||
|
||||
double maxVal = 0;
|
||||
minMaxLoc( eig, 0, &maxVal, 0, 0, _mask );
|
||||
@@ -535,4 +535,12 @@ cvGoodFeaturesToTrack( const void* _image, void*, void*,
|
||||
*_corner_count = (int)ncorners;
|
||||
}
|
||||
|
||||
void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
|
||||
int maxCorners, double qualityLevel, double minDistance,
|
||||
InputArray _mask, int blockSize,
|
||||
bool useHarrisDetector, double harrisK )
|
||||
{
|
||||
cv::goodFeaturesToTrack(_image, _corners, maxCorners, qualityLevel, minDistance,
|
||||
_mask, blockSize, 3, useHarrisDetector, harrisK );
|
||||
}
|
||||
/* End of file. */
|
||||
|
||||
Reference in New Issue
Block a user