#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!=?
-
請問你所使的電腦,CPU的規格 Cache多大?其他硬體配置...... 另外, "INTEL® XEON PHI™ 處理器 7230F"的大致規格為?
-
請輸出如下 * ** *** **** ***** ******
-
請用 for, array算出費式數列 其中 f[0]=f[1]=1, f[n]=f[n-1]+f[n-2] 或公式解 f(n)=1/sqrt(5)((1+sqrt(5))/2)^(n+1)-1/sqrt(5)((1-sqrt(5))/2)^(n+1)
-
計算gcd(123456789,999999999)
-
用random產生double陣列10個元素 排序
-
寫一個是否上學期成績2/3的程式
-
產生50個元素的陣列並排序
-
請用C/C++ 程式計算 S=1*1+2*2+3*3+4*4+.....+20*20=?
-
將後序算式計算答案 18,6,/,3,2,*,-
沒有留言:
張貼留言