Color of Keypoint with floating coordinates
There are some missunderstandings, so I changed the question:
The coordinates of a keypoint are saved with floating values.
KeyPoint(float x, float y, float _size, float _angle=-1, float _response=0, int _octave=0, int _class_id=-1)
So the coordinates do not exactly match with a certain pixel but is within one pixel. That's how I unterstand it. Maybe I missunderstood.
I detect features to get color information. When I have keypointBob he is somewhere in the image img. I can get the color value by calling: img.at<vec3b>( keypointBob.pt)[]
Is OpenCv taking directly the color of the pixel (where the keypoint is within) or does OpenCv consider the neighbors?
I hope it's more clear now.
Actually as far as I know keypoints in openCV's ML module are always extracted of the grayscale images and do not have any color information. So I am wondering where your question comes from.
Only makes sense to me that he asks for a drawing function
Actually by adding this code, you are just indexing the intensity values of your original RGB image based on the keypoints returned location. The at operator however, rounds up your floating point coordinates to integer coordinates, which is needed for matrix indexing, resulting you the intensity value at that exact location.