Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Just create for each point a new Keypoint with size 1:

std::vector<cv::Keypoint> keypoints;
for( size_t i = 0; i < inputs.size(); i++ ) {
  keypoints.push_back(cv::Keypoint(inputs[i], 1.f));

As berak mentioned, typically this doesn't make sense, since your descriptor is neither scale nor rotational invariant any more.

However in several circumstances it is totally valid! E.g. the combination of of a dense grid sampling + SIFT is typically used for bag of words approaches. The dense grid sampling over the image is nothing else than a Keypoint of size 1 at each step size (e.g. 5) location in the image (note that you don't need to implement it yourself, since OpenCV has the detector "Dense" which does exactly this for you).