1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #19392 from amirtu:OCV-165_finalize_goodFeaturesToTrack_returns_also_corner_value_PR

* goodFeaturesToTrack returns also corner value

(cherry picked from commit 4a8f06755c)

* Added response to GFTT Detector keypoints

(cherry picked from commit b88fb40c6e)

* Moved corner values to another optional variable to preserve backward compatibility

(cherry picked from commit 6137383d32)

* Removed corners valus from perf tests and better unit tests for corners values

(cherry picked from commit f3d0ef21a7)

* Fixed detector gftt call

(cherry picked from commit be2975553b)

* Restored test_cornerEigenValsVecs

(cherry picked from commit ea3e11811f)

* scaling fixed;
mineigen calculation rolled back;
gftt function overload added (with quality parameter);
perf tests were added for the new api function;
external bindings were added for the function (with different alias);
fixed issues with composition of the output array of the new function (e.g. as requested in comments) ;
added sanity checks in the perf tests;
removed C API changes.

* minor change to GFTTDetector::detect

* substitute ts->printf with EXPECT_LE

* avoid re-allocations

Co-authored-by: Anas <anas.el.amraoui@live.com>
Co-authored-by: amir.tulegenov <amir.tulegenov@xperience.ai>
This commit is contained in:
Amir Tulegenov
2021-02-16 01:55:57 +06:00
committed by GitHub
parent ad66b070a7
commit 47426a8ae5
7 changed files with 183 additions and 28 deletions
@@ -1999,6 +1999,38 @@ CV_EXPORTS_W void goodFeaturesToTrack( InputArray image, OutputArray corners,
InputArray mask, int blockSize,
int gradientSize, bool useHarrisDetector = false,
double k = 0.04 );
/** @brief Same as above, but returns also quality measure of the detected corners.
@param image Input 8-bit or floating-point 32-bit, single-channel image.
@param corners Output vector of detected corners.
@param maxCorners Maximum number of corners to return. If there are more corners than are found,
the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
and all detected corners are returned.
@param qualityLevel Parameter characterizing the minimal accepted quality of image corners. The
parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
(see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
quality measure less than the product are rejected. For example, if the best corner has the
quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
less than 15 are rejected.
@param minDistance Minimum possible Euclidean distance between the returned corners.
@param mask Region of interest. If the image is not empty (it needs to have the type
CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
@param cornersQuality Output vector of quality measure of the detected corners.
@param blockSize Size of an average block for computing a derivative covariation matrix over each
pixel neighborhood. See cornerEigenValsAndVecs .
@param gradientSize Aperture parameter for the Sobel operator used for derivatives computation.
See cornerEigenValsAndVecs .
@param useHarrisDetector Parameter indicating whether to use a Harris detector (see #cornerHarris)
or #cornerMinEigenVal.
@param k Free parameter of the Harris detector.
*/
CV_EXPORTS CV_WRAP_AS(goodFeaturesToTrackWithQuality) void goodFeaturesToTrack(
InputArray image, OutputArray corners,
int maxCorners, double qualityLevel, double minDistance,
InputArray mask, OutputArray cornersQuality, int blockSize = 3,
int gradientSize = 3, bool useHarrisDetector = false, double k = 0.04);
/** @example samples/cpp/tutorial_code/ImgTrans/houghlines.cpp
An example using the Hough line detector
![Sample input image](Hough_Lines_Tutorial_Original_Image.jpg) ![Output image](Hough_Lines_Tutorial_Result.jpg)