Covert vector to python list
[trackerpp.git] / src / VideoReader.cpp
index b965fa1..cfba733 100644 (file)
@@ -47,6 +47,13 @@ UrlReader::~UrlReader()
     vcap.release();
 }
 
+static long count = 0;
+
+static void printImg(const cv::Mat& mat)
+{
+    std::cout << mat.at<int>(0,0) << std::endl;
+}
+
 bool UrlReader::read(cv::Mat& mat)
 {
     bool ret = vcap.read(mat);
@@ -54,18 +61,10 @@ bool UrlReader::read(cv::Mat& mat)
         LOG_ERROR(TAG, "blank frame grabbed");
         return false;
     }
+    count++;
+    std::string name = "./temp/image_" + std::to_string(count) + ".png";
+    if ((count % 50 == 0)){
+        imwrite(name.c_str(), mat);
+    }
     return ret;
 }
-
-//
-//void UrlReader::read()
-//{
-//}
-//
-//void FileReader::read()
-//{
-//}
-//
-//void UsbReader::read()
-//{
-//}