我想處理箭頭鍵。但是當我打印出waitKey()函數的輸入值時,它是0. 我不知道爲什麼。 我嘗試從「int」更改爲「char」,但它不起作用。 我該如何解決這個問題。opencv處理與waitKey()函數的箭頭鍵
int pos = 100;
imshow("image", image);
onChange(pos, (void *)&image);
createTrackbar("threshold", "image", &pos, 255, onChange, (void*)&image);
while (1) {
int Key = waitKey();
cout << Key << endl;
if (Key == 27) break;
if (Key == 2490368) {
pos--;
onChange(pos, (void *)&image);
}
if(Key == 2621440){
pos++;
onChange(pos, (void *)&image);
}
if (pos < 0 || pos > 255) pos = 0;
}
哇........................超級超級謝謝。這是非常有用的信息。謝謝! – Amily