Skip to content

Commit

Permalink
Remove SIFT scores (#179)
Browse files Browse the repository at this point in the history
* Remove SIFT scores
* Update doc
  • Loading branch information
sarlinpe authored Sep 21, 2023
1 parent 51ccc1d commit 05abbd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,9 @@ sift = pycolmap.Sift()

# Parameters:
# - image: HxW float array
keypoints, scores, descriptors = sift.extract(img)
keypoints, descriptors = sift.extract(img)
# Returns:
# - keypoints: Nx4 array; format: x (j), y (i), sigma, angle
# - scores: N array; DoG scores
# - keypoints: Nx4 array; format: x (j), y (i), scale, orientation
# - descriptors: Nx128 array; L2-normalized descriptors
```

Expand Down
9 changes: 3 additions & 6 deletions sift.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ using pyimage_t =
typedef Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>
descriptors_t;
typedef Eigen::Matrix<float, Eigen::Dynamic, kdim, Eigen::RowMajor> keypoints_t;
typedef Eigen::VectorXf scores_t;
typedef std::tuple<keypoints_t, scores_t, descriptors_t> sift_output_t;
typedef std::tuple<keypoints_t, descriptors_t> sift_output_t;

static std::map<int, std::unique_ptr<std::mutex>> sift_gpu_mutexes;

Expand Down Expand Up @@ -75,15 +74,13 @@ class Sift {
}

descriptors_t descriptors = descriptors_.cast<float>();
;
descriptors /= 512.0f;

scores_t scores = Eigen::VectorXf::Ones(num_features);
return std::make_tuple(keypoints, scores, descriptors);
return std::make_tuple(keypoints, descriptors);
}

sift_output_t Extract(Eigen::Ref<const pyimage_t<float>> image) {
pyimage_t<uint8_t> image_f = (image * 255.0f).cast<uint8_t>();
const pyimage_t<uint8_t> image_f = (image * 255.0f).cast<uint8_t>();
return Extract(image_f);
}

Expand Down

0 comments on commit 05abbd0

Please sign in to comment.