#include <iostream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main() try { cout << "簡易影像處理寫進avi檔\n"; VideoCapture cap("David\\GG%03d.png"); vector<Mat> xx;; while (true) { Mat im;//因vector xx cap >> im; if (!im.data) break; applyColorMap(im, im, COLORMAP_TWILIGHT_SHIFTED); namedWindow("3D影像", 1); imshow("3D影像", im); xx.push_back(im); waitKey(200); } destroyAllWindows(); cap.release(); Size S = xx[0].size(); int codec = VideoWriter::fourcc('M', 'J', 'P', 'G'); int FPS = 1000 / 200; VideoWriter output("david.avi", codec, FPS, S, true); for(Mat im :xx) { output << im; imshow("david", im); waitKey(1); } destroyAllWindows(); output.release(); return 0; } catch (exception& e) { cerr << e.what(); return 1; }
herrDeng網內搜尋

自訂搜尋
Ads
2022年11月3日 星期四
opencv C++採用VideoWriter, VideoCapture修改系列圖檔為avi影像
C++ code 請進:
訂閱:
張貼留言 (Atom)
熱門文章
-
請用CPU-Z軟體檢測Cache & Memory 註:快取(L1-L3: SRAM) 第一級快取(L1)–通常存取只需要幾個週期,通常是幾十個KB。 第二級快取(L2)–比L1約有2到10倍較高延遲性,通常是幾百個KB或更多。 第三級快取(L3)(不...
-
需要練習的Java程式:
-
Ex1 加權平均
-
請用Java顯示以下字串:
-
計算gcd(123456789,999999999)
沒有留言:
張貼留言