日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

cv2.waitKey(x)解析

發(fā)布時(shí)間:2025/3/20 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 cv2.waitKey(x)解析 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1.函數(shù)說(shuō)明

def waitKey(delay=None): # real signature unknown; restored from __doc__"""waitKey([, delay]) -> retval. @brief Waits for a pressed key.. . The function waitKey waits for a key event infinitely (when \f$\texttt{delay}\leq 0\f$ ) or for delay. milliseconds, when it is positive. Since the OS has a minimum time between switching threads, the. function will not wait exactly delay ms, it will wait at least delay ms, depending on what else is. running on your computer at that time. It returns the code of the pressed key or -1 if no key was. pressed before the specified time had elapsed.. . @note. . This function is the only method in HighGUI that can fetch and handle events, so it needs to be. called periodically for normal event processing unless HighGUI is used within an environment that. takes care of event processing.. . @note. . The function only works if there is at least one HighGUI window created and the window is active.. If there are several HighGUI windows, any of them can be active.. . @param delay Delay in milliseconds. 0 is the special value that means "forever"."""pass

2.解釋

函數(shù)waitKey無(wú)限地等待一個(gè)按鍵產(chǎn)生的事件即者當(dāng)它為正數(shù)時(shí),等待延遲時(shí)間單位為毫秒。由于操作系統(tǒng)在切換線程之間的時(shí)間最短,該函數(shù)將不會(huì)等待確切的延遲ms,它將等待至少延遲ms,這取決于當(dāng)時(shí)在您的計(jì)算機(jī)上運(yùn)行的其他內(nèi)容。它返回按下的鍵的代碼,如果在指定的時(shí)間之前沒(méi)有按下鍵,則返回-1。
簡(jiǎn)而言之如果有正數(shù)x輸入則 等待x ms,如果在此期間有按鍵按下,則立即結(jié)束并返回按下按鍵的ASCII碼,否則返回-1
如果x=0,那么無(wú)限等待下去,直到有按鍵按下

總結(jié)

以上是生活随笔為你收集整理的cv2.waitKey(x)解析的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。