diff --git a/opencv-webcam-demo/opencv-webcam-demo.cpp b/opencv-webcam-demo/opencv-webcam-demo.cpp index fe0f67d..59a2eb0 100644 --- a/opencv-webcam-demo/opencv-webcam-demo.cpp +++ b/opencv-webcam-demo/opencv-webcam-demo.cpp @@ -16,8 +16,10 @@ #include "PlottingImageListener.hpp" #include "StatusListener.hpp" + using namespace std; using namespace affdex; +using namespace cv; std::string getAsJson(int framenr, const std::map faces, const double timeStamp) @@ -35,6 +37,7 @@ std::string getAsJson(int framenr, const std::map faces, const dou if(i > 0) { ss << ","; } i++; + ss << "{"; @@ -231,12 +234,14 @@ int main(int argsc, char ** argsv) int framenr = 0; do{ - cv::Mat img; + /* cv::Mat img; if (!webcam.read(img)) //Capture an image from the camera { std::cerr << "Failed to read frame from webcam! " << std::endl; break; - } + }*/ + std::string infile = "/home/crowd/capt0000.jpg"; + cv::Mat img = imread(infile, 1); //~ imread(img); @@ -249,10 +254,11 @@ int main(int argsc, char ** argsv) capture_fps = 1.0f / (seconds - last_timestamp); last_timestamp = seconds; frameDetector->process(f); //Pass the frame to detector - + std::cerr << "test1"; // For each frame processed if (listenPtr->getDataSize() > 0) { + std::cerr << "test2"; framenr++; std::pair > dataPoint = listenPtr->getData(); @@ -287,7 +293,7 @@ int main(int argsc, char ** argsv) } - + break; }