Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

Commit 1a8424f

Browse files
committed
fix(getFastKeypoints): remove normalizeScore option
1 parent 57597df commit 1a8424f

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

src/featureMatching/keypoints/getFastKeypoints.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ export interface GetFastKeypointsOptions extends IsFastKeypointOptions {
4343
* Options for the Harris score computation.
4444
*/
4545
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;
5346
}
5447

5548
export interface FastKeypoint {
@@ -80,7 +73,6 @@ export function getFastKeypoints(
8073
const {
8174
fastRadius = 3,
8275
scoreAlgorithm = 'FAST',
83-
normalizeScores = false,
8476
harrisScoreOptions,
8577
} = options;
8678

@@ -160,26 +152,6 @@ export function getFastKeypoints(
160152
}
161153

162154
keypoints.sort((a, b) => b.score - a.score);
163-
if (normalizeScores) {
164-
keypoints = getNormalizedKeypoints(keypoints);
165-
}
166-
return keypoints.slice(0, maxNbFeatures);
167-
}
168155

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);
185157
}

0 commit comments

Comments
 (0)