void PlotDegrees(const vector <TStr>& Parameters, const TFltPrV& In, const TFltPrV& Out, const TStr& Type){ const TStr& Name = Parameters[NAME]; const TStr& Plt = Parameters[PLT]; PlotPoints(In, Out, Type + Name, Plt); }
void PlotDegrees(const vector <TStr>& Parameters, const TFltPrV& In, const TFltPrV& Out, const TStr& Type){ const TStr& Name = Parameters[NAME]; const TStr& Plt = Parameters[PLT]; const TStr& PType = Parameters[PTYPE]; const TStr& BinRadix = Parameters[BINRADIX]; const TInt BinRadixV = BinRadix.GetInt(); if ( PType == "full" || PType == "all" ){ PlotPoints(In, Out, Type + Name, Plt); } if ( PType == "exp" || PType == "all" ) { PlotSparse(In, Type + Name + "Sparse", true, Plt, BinRadixV); PlotSparse(Out, Type + Name + "Sparse", false, Plt, BinRadixV); } }
void ProcessVideo(std::string videoName) { cv::VideoCapture inputVideo(videoName); cv::Size size = cv::Size((int) inputVideo.get(CV_CAP_PROP_FRAME_WIDTH), //Acquire input size (int) inputVideo.get(CV_CAP_PROP_FRAME_HEIGHT)*2); cv::VideoWriter outputVideo("output_video.avi", 0, inputVideo.get(CV_CAP_PROP_FPS),size, true); cv::Mat src, res, colourRes, stacked; PathDetect pd; std::vector<double> red{0,0,255.0}; while( true ) //Show the image captured in the window and repeat { inputVideo >> src; // read if( src.empty()) break; // check if at end std::vector< cv::Point> points; res = pd.GetPoints(src, points); cvtColor(res, colourRes, CV_GRAY2RGB); PlotPoints(colourRes, points, red); stacked = StackImages(src, colourRes); outputVideo << stacked; imwrite("finalimage.jpg", stacked); } }