#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)
熱門文章
-
11!=?
-
產生50個元素的陣列並排序
-
請輸出如下 * ** *** **** ***** ******
-
借錢500萬,年利18%,每月複利計算,請問連本帶利的金額 5, 10, 15, 20, 25, 30, 35, 40, 45, 50年的金額。並比較公式: A*exp(0.18n) A*(1+0.18/12)^(12*n), n=年數, A=本金 hint: math.h, p...
-
請問你所使的電腦,CPU的規格 Cache多大?其他硬體配置...... 另外, "INTEL® XEON PHI™ 處理器 7230F"的大致規格為?
-
寫一個是否上學期成績2/3的程式
-
計算你上學期加權平均
-
計算你的BMI
-
請用CPU-Z軟體檢測Cache & Memory 註:快取(L1-L3: SRAM) 第一級快取(L1)–通常存取只需要幾個週期,通常是幾十個KB。 第二級快取(L2)–比L1約有2到10倍較高延遲性,通常是幾百個KB或更多。 第三級快取(L3)(不...
沒有留言:
張貼留言