Reputation: 103
I use cv2.drawKeypoints(image, keypoints, outImage, color, flags)
in Python while showing the keypoints on the image. The color parameter is used in many examples as RGB value, i.e. (0, 0, 0) to (255, 255, 255), which is fixed for all keypoints.
My problem is that I have a confidence value for each keypoint and I want to integrate this information into the color parameter as a blue-red spectrum. If the confidence value is high, I want that keypoint is drawn with blue color and red if confidence is low.
Is there a way to do it? Can you help me with that, please?
Upvotes: 1
Views: 1644
Reputation: 1433
Since you didnt really provide a minimum working example i can can only give you an answer to try yourself.
Loop through the keypoints and draw them individually:
for keypoint in keypoints:
color = *your color calculation here*
cv2.drawKeypoints(image, keypoint, outImage, color, flags)
Upvotes: 3