Displaying the coordinates of the points clicked on the image using Python-OpenCV

preview_player
Показать описание
#Pyresearch

Now let us see how to display the coordinates of the points clicked on the image. We will be displaying both the points clicked by right-click as well as left-click.

Import the cv2 module.

the user-defined function as parameters.

In the user-defined function, check for left mouse clicks using the cv2.EVENT_LBUTTONDOWN attribute.

Display the coordinates on the Shell.

Display the coordinates on the created window.

Do the same for right mouse clicks using the cv2.EVENT_RBUTTONDOWN attribute. Change the color while displaying the coordinates on the image
to distinguish from left clicks.

Please let me know your valuable feedback on the video by means of comments. Please like and share the video. Do not forget to subscribe to my channel for more educational videos.

Any type of problem you can comment down.

Want more education? Connect with me here:

Related searches
python get coordinates of mouse click on image matplotlib
extract xy coordinates from image python
get coordinates of contour opencv python
get coordinates of rectangle opencv python
how to get pixel values of an image in opencv python
image coordinates python
how to crop opencv image using mouse click and movement in python
extract part of image opencv python
Рекомендации по теме
Комментарии
Автор

Can you find the coordinates for a moving image, with image recognition?

davidreis
Автор

Hey so for my Senior Project I was going to build a machine that drilled out manually placed Black Dots on a metal backplate. Is there a simple way to go about that? My plan was to develop a program that finds the coordinates of the dots then sends the drill bit directly over the dots one by one until all are completed. Would detecting the color black (within certain restraints) then finding the coordinates based, or would using something like image processing be more reliable? All I need is a simple image taken then coordinates given to each dot detected, then just signals sent to servos to position it.

spencervdp