@@ -43,13 +43,6 @@ export interface GetFastKeypointsOptions extends IsFastKeypointOptions {
43
43
* Options for the Harris score computation.
44
44
*/
45
45
harrisScoreOptions ?: GetHarrisScoreOptions ;
46
- /**
47
- * Should the keypoint scores be normalized between 0 (worst corner) and 1 (best corner).
48
- * This feature is only useful if you want to verify the keypoints scores.
49
- *
50
- * @default false
51
- */
52
- normalizeScores ?: boolean ;
53
46
}
54
47
55
48
export interface FastKeypoint {
@@ -80,7 +73,6 @@ export function getFastKeypoints(
80
73
const {
81
74
fastRadius = 3 ,
82
75
scoreAlgorithm = 'FAST' ,
83
- normalizeScores = false ,
84
76
harrisScoreOptions,
85
77
} = options ;
86
78
@@ -160,26 +152,6 @@ export function getFastKeypoints(
160
152
}
161
153
162
154
keypoints . sort ( ( a , b ) => b . score - a . score ) ;
163
- if ( normalizeScores ) {
164
- keypoints = getNormalizedKeypoints ( keypoints ) ;
165
- }
166
- return keypoints . slice ( 0 , maxNbFeatures ) ;
167
- }
168
155
169
- /**
170
- * Normalizes the keypoints scores, the best keypoint having a score of 1 and the worst a score of 0.
171
- *
172
- * @param keypoints - The keypoints to process.
173
- * @returns Keypoints with normalized scores.
174
- */
175
- function getNormalizedKeypoints ( keypoints : FastKeypoint [ ] ) : FastKeypoint [ ] {
176
- const minValue = keypoints [ keypoints . length - 1 ] . score ;
177
- const maxValue = keypoints [ 0 ] . score ;
178
- const scoreRange = maxValue - minValue ;
179
-
180
- for ( let keypoint of keypoints ) {
181
- keypoint . score = ( keypoint . score - minValue ) / scoreRange ;
182
- }
183
-
184
- return keypoints ;
156
+ return keypoints . slice ( 0 , maxNbFeatures ) ;
185
157
}
0 commit comments