opencv :等待密钥
等待键
Waits for a pressed key。
c:intwaitkey(intdelay=0) )。
c:intcvwaitkey(intdelay=0) () ) ) ) ) )。
parameters : delaydelayinmilliseconds.0 isthespecialvaluethatmeans“forever”。
thefunctionwaitkeywaitsforakeyeventinfinitely (when (文本TT ) delay ) leq0) or for delay milliseconds, whenitispositive.sincetheoshasaminimumtimebetweenswitchingthreads,thefunctionwillnotwaitexactlydelayms,it will wait at at at leat lat lat least dependingonwhatelseisrunningonyourcomputeratthattime.itreturnsthecodeofthepressedkeyor-1 ifnokeywaspressedbeforethespecifiecifieyor
笔记
thisfunctionistheonlymethodinhighguithatcanfetchandhandleevents,soitneedstobecalledperiodicallyfornormaleventprocessingunlesiongunlelested
笔记
thefunctiononlyworksifthereisatleastonehighguiwindowcreatedandthewindowisactive.ifthereareseveralhighghguiwindows,anyofthememchthemc