使用Python實現(xiàn)圖像標記點的坐標輸出功能
Sometimes we have need to interact with an application,for example by marking points in an image,or you need to annotation some training data.PyLab comes with a simple function ginput() the let's you do just that .Here's a short example.
from PIL import Image
from pylab import *
im = array(Image.open('test.jpg'))
imshow(im)
print 'Please click 3 points'
x =ginput(3)
print 'you clicked:',x
show()
This plots an image and waits for the user to click three times in the image region of the figures window.The coordinates[x,y] of the clicks are saved in a list x.

總結
以上所述是小編給大家介紹的使用Python實現(xiàn)圖像標記點的坐標輸出功能 ,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
如果你覺得本文對你有幫助,歡迎轉載,煩請注明出處,謝謝!
相關文章
使用python爬取微博數(shù)據(jù)打造一顆“心”
這篇文章主要介紹了使用python基于微博數(shù)據(jù)打造一顆“心”,作為程序員,我準備了一份特別的禮物,用以往發(fā)的微博數(shù)據(jù)打造一顆“愛心”,我想她一定會感動得哭了吧,需要的朋友可以參考下2019-06-06
python實現(xiàn)selenium網(wǎng)絡爬蟲的方法小結
這篇文章主要介紹了python實現(xiàn)selenium網(wǎng)絡爬蟲的方法小結,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2021-03-03

