Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
party_parrot/main.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
39 lines (33 sloc)
852 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <opencv2/videoio.hpp> | |
#include <opencv2/highgui.hpp> | |
#include "color_cycle.h" | |
using namespace std; | |
using namespace cv; | |
int main(int argc, char* argv[]) | |
{ | |
if (argc < 2) | |
{ | |
std::cerr << "Usage: " << argv[0] << " <image>" << std::endl; | |
return EXIT_FAILURE; | |
} | |
VideoCapture vidcap(argv[1]); | |
if (!vidcap.isOpened()) | |
{ | |
std::cerr << "Could not open media '" << argv[1] << "'." << std::endl; | |
return EXIT_FAILURE; | |
} | |
cv::Mat3b img; | |
int c = 0; | |
while (27 != c) | |
{ | |
while (27 != (c = waitKey(1000.f/vidcap.get(CAP_PROP_FPS))) && (vidcap >> img, !img.empty())) | |
{ | |
color_cycle::rotate_hue(img, img); | |
imshow("Party!!", img); | |
} | |
vidcap.open(argv[1]); | |
} | |
waitKey(); | |
return EXIT_SUCCESS; | |
} |