eeyvee
eeyvee

Reputation: 53

Displaying text under mouse cursor using OpenCV

I am reading an image using OpenCV. It looks like when I click on a pixel then I could display the pixel coordinates and info using the cv2.setMouseCallback() function. I want to display those info right under the mouse cursor.

I searched Google and it looks like I need to use GUI libraries. Is there a similar function in OpenCV?

Upvotes: 2

Views: 745

Answers (2)

TaekYoung
TaekYoung

Reputation: 110

maybe you can try matplotlib, because what you want(coordinates and values) is already satisfied in that.

import matplotlib.pyplot as plt

plt.imshow(image)
plt.show()

Upvotes: 0

Petr Blahos
Petr Blahos

Reputation: 2433

Well, it is not impossible, but you do not want to do it. OpenCV can display an image, so you would have to draw anything you need into the image and display the new image in the same window.

Upvotes: 2

Related Questions