2019-11-02から1日間の記事一覧

C++ Opencv 画像を合成する

最初に 今回は下の3つの画像を用いて、差分処理を行って画像を合成します。 青空の画像が背景で、Opencvのロゴが前景、真っ黒な画像がロゴを抜き取るための画像になります。 ソース #include <iostream> #include <string> #include <sstream> #include <iomanip> #include <opencv2/opencv.hpp> /* img1とimg2の差分</opencv2/opencv.hpp></iomanip></sstream></string></iostream>…

C++ Opencv 静止画から動画を作成する

まずはソース #include <iostream> #include <string> #include <sstream> #include <iomanip> #include <opencv2/opencv.hpp> int image_to_video(std::string result, std::string image_name, std::string ext, int frame_num, double frame_rate) { // {image_name}_00x.ext にするための桁数の取得 int digit = s</opencv2/opencv.hpp></iomanip></sstream></string></iostream>…

C++ Opencv 動画から静止画を出力する

まずはソース #include <iostream> #include <string> #include <sstream> #include <iomanip> #include <opencv2/opencv.hpp> int video_to_image(std::string result_image_name, std::string video_path, std::string ext) { cv::VideoCapture video(video_path); if (!video.isOpened()) { return -1; } int frame</opencv2/opencv.hpp></iomanip></sstream></string></iostream>…