質問失礼します。
OpenCVのimshowについて質問です。
今以下のコードを書いていて、最初に1と2を読み込んでそのあとまた1を読み込んで~・・
と繰り返して読み込んでくれることを期待していたのですが、
現在の状況は、2を読み込んだ後は更新されなくなりました。
連続で更新するほうほうを教えていただけると幸いです。
わかりにくかったら質問していただけると幸いです。
よろしくお願いいたします。
c++
1#include <opencv2/opencv.hpp> 2#include "opencv2/highgui/highgui.hpp" 3#include "iostream" 4#include "opencv2/core/core.hpp" 5#include "opencv2/features2d/features2d.hpp" 6#include "opencv2/opencv.hpp" 7 8 9#include <windows.h> 10 11 12using namespace cv; 13using namespace std; 14 15 16 while (1) { 17 18 if (waitKey(0) == 1) break; //push anything key 19 20 Mat img; 21 22 img = imread("C:\Users\mimimi\Pictures\Saved Pictures\ball.jpg", IMREAD_UNCHANGED); 23 24 imshow("win", img); // 1 25 26 waitKey(1000); 27 28 img = imread("C:\Users\mimimi\Pictures\Saved Pictures\ball.jpg", 0); 29 30 imshow("win", img); // 2 31 32 waitKey(1000); 33 34 }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。