欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

C語言

當(dāng)前位置:主頁(yè) > 軟件編程 > C語言 >

opencv3/C++ 將圖片轉(zhuǎn)換為視頻的實(shí)例

來源:本站原創(chuàng)|時(shí)間:2020-01-10|欄目:C語言|點(diǎn)擊: 次

現(xiàn)有一些圖片按順序放置在一文件夾jogging1\下,如圖:

需要將其合并轉(zhuǎn)換為一個(gè)視頻。

示例:

環(huán)境:Win7+OpenCV3+VS2012

#include<opencv2/opencv.hpp>
#include <stdio.h>
#include <io.h>
#include <string>
#include <iostream> 
#include <fstream> 
using namespace std;
using namespace cv;

int main()
{
  _finddata_t FileInfo; 
  //讀取圖片所在的路徑
  string inPath = "E:\\image\\yu\\jogging1\\"; 
  string strfind = inPath + "*";
  long Handle = _findfirst(strfind.c_str(), &FileInfo);
  char filename[300];
  Mat src;
  if (Handle == -1L)
  { 
    cerr << "can not match the folder path" << endl; 
    exit(-1);
  }

  Mat frame;
  Mat src0 = imread("E:/image/yu/jogging1/0000.jpg");
  Size size = src0.size();
  VideoWriter writer;
  writer.open("jogging.avi", CV_FOURCC('M', 'J', 'P', 'G'), 25, size, true);

  do{
    //判斷是否有子目錄
    if (FileInfo.attrib & _A_SUBDIR) 
    { 
      if ((strcmp(FileInfo.name, ".") != 0) && (strcmp(FileInfo.name, "..") != 0)) 
      { 
        inPath += FileInfo.name;
        cout <<inPath<<endl; 
      }
    }
    else
    {
      cout <<inPath<<FileInfo.name<<endl;
      //讀取圖片所在的路徑
      string path = "E:/image/yu/jogging1/" + (string)FileInfo.name;
      src = imread(path);
      imshow("input", src);
      writer.write(src);
      waitKey(1);
    } 
  } while (_findnext(Handle, &FileInfo) == 0); 
  _findclose(Handle);  
  return 0; 
}

以上這篇opencv3/C++ 將圖片轉(zhuǎn)換為視頻的實(shí)例就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持我們。

上一篇:opencv3/C++實(shí)現(xiàn)光流點(diǎn)追蹤

欄    目:C語言

下一篇:gcc中extra qualification錯(cuò)誤的解決

本文標(biāo)題:opencv3/C++ 將圖片轉(zhuǎn)換為視頻的實(shí)例

本文地址:http://mengdiqiu.com.cn/a1/Cyuyan/93.html

網(wǎng)頁(yè)制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫(kù)服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有