Skip to content

Commit

Permalink
[feature] compatibility with opencv4
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiencastan committed Jul 18, 2019
1 parent cebc7da commit c0c9844
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/aliceVision/feature/openCV/ImageDescriber_SIFT_OCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool ImageDescriber_SIFT_openCV::describe(const image::Image<unsigned char>& ima
filtered_keypoints.reserve(std::min(v_keypoints.size(), _params.maxTotalKeypoints));
rejected_keypoints.reserve(v_keypoints.size());

cv::Mat countFeatPerCell(_params.gridSize, _params.gridSize, cv::DataType<std::size_t>::type, cv::Scalar(0));
cv::Mat countFeatPerCell(_params.gridSize, _params.gridSize, cv::DataType<int>::type, cv::Scalar(0));
const std::size_t keypointsPerCell = _params.maxTotalKeypoints / countFeatPerCell.total();
const double regionWidth = image.Width() / double(countFeatPerCell.cols);
const double regionHeight = image.Height() / double(countFeatPerCell.rows);
Expand All @@ -117,8 +117,8 @@ bool ImageDescriber_SIFT_openCV::describe(const image::Image<unsigned char>& ima
// std::cout << "- countFeatPerCell: " << countFeatPerCell << std::endl;
// std::cout << "- gridSize: " << _params.gridSize << std::endl;

const std::size_t count = countFeatPerCell.at<std::size_t>(cellX, cellY);
countFeatPerCell.at<std::size_t>(cellX, cellY) = count + 1;
const int count = countFeatPerCell.at<int>(cellX, cellY);
countFeatPerCell.at<int>(cellX, cellY) = count + 1;
if(count < keypointsPerCell)
filtered_keypoints.push_back(keypoint);
else
Expand Down

0 comments on commit c0c9844

Please sign in to comment.