Skip to content

Commit

Permalink
transform features after source images decimation (#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
borongyuan authored Nov 2, 2023
1 parent 08d0ef7 commit 45a3b59
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions corelib/src/CameraThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,17 @@ void CameraThread::postUpdate(SensorData * dataPtr, CameraInfo * info) const
{
data.setStereoImage(image, depthOrRight, stereoModels);
}

std::vector<cv::KeyPoint> kpts = data.keypoints();
double log2value = log(double(_imageDecimation))/log(2.0);
for(unsigned int i=0; i<kpts.size(); ++i)
{
kpts[i].pt.x /= _imageDecimation;
kpts[i].pt.y /= _imageDecimation;
kpts[i].size /= _imageDecimation;
kpts[i].octave -= log2value;
}
data.setFeatures(kpts, data.keypoints3D(), data.descriptors());
}
if(info) info->timeImageDecimation = timer.ticks();
}
Expand Down

0 comments on commit 45a3b59

Please sign in to comment.