使用Python實現(xiàn)圖像標(biāo)記點的坐標(biāo)輸出功能
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.
總結(jié)
以上所述是小編給大家介紹的使用Python實現(xiàn)圖像標(biāo)記點的坐標(biāo)輸出功能 ,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
如果你覺得本文對你有幫助,歡迎轉(zhuǎn)載,煩請注明出處,謝謝!
相關(guān)文章
python [::-1] [::-1,::-1]的具體使用
本文主要介紹了python [::-1] [::-1,::-1]的具體使用,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2022-05-05python GUI庫圖形界面開發(fā)之PyQt5開發(fā)環(huán)境配置與基礎(chǔ)使用
這篇文章主要介紹了python GUI庫圖形界面開發(fā)之PyQt5開發(fā)環(huán)境配置與基礎(chǔ)使用,需要的朋友可以參考下2020-02-02用python實現(xiàn)的去除win下文本文件頭部BOM的代碼
windows環(huán)境下新建或編輯文本文件,保存時會在頭部加上BOM。使用ftp上傳到linux下,在執(zhí)行時第一行即報錯。以下方法可以去除BOM頭,有需要的朋友可以參考下2013-02-02