diff options
author | Djordje Senicic | 2019-03-04 06:43:58 -0600 |
---|---|---|
committer | Djordje Senicic | 2019-03-04 06:43:58 -0600 |
commit | d2e0c16ac1b88ff66c99c41af2fbb64a936c438a (patch) | |
tree | 1ab8c0ec7e0cec3920c9aebfabf02e2b73801e10 | |
parent | 6b64a259a99f0babdc4a2a02abd7f73d82d2e066 (diff) | |
download | tidl-api-d2e0c16ac1b88ff66c99c41af2fbb64a936c438a.tar.gz tidl-api-d2e0c16ac1b88ff66c99c41af2fbb64a936c438a.tar.xz tidl-api-d2e0c16ac1b88ff66c99c41af2fbb64a936c438a.zip |
[segmentation] Add video clip autorewind
Signed-off-by: Djordje Senicic <x0157990@ti.com>
-rw-r--r-- | examples/segmentation/main.cpp | 26 | ||||
-rw-r--r-- | examples/ssd_multibox/clips/pexels_videos_1466210.mp4 | bin | 0 -> 10687399 bytes | |||
-rw-r--r-- | examples/ssd_multibox/clips/pexels_videos_3623.mp4 | bin | 0 -> 8057846 bytes |
3 files changed, 18 insertions, 8 deletions
diff --git a/examples/segmentation/main.cpp b/examples/segmentation/main.cpp index 3e7238d..42fdfcb 100644 --- a/examples/segmentation/main.cpp +++ b/examples/segmentation/main.cpp | |||
@@ -283,14 +283,24 @@ bool ReadFrame(ExecutionObjectPipeline &eop, | |||
283 | } | 283 | } |
284 | else | 284 | else |
285 | { | 285 | { |
286 | // 640x480 camera input, process one in every 5 frames, | 286 | if(opts.is_camera_input) |
287 | // can adjust number of skipped frames to match real time processing | 287 | { |
288 | if (! cap.grab()) return false; | 288 | if (! cap.grab()) return false; |
289 | if (! cap.grab()) return false; | 289 | if (! cap.retrieve(image)) return false; |
290 | if (! cap.grab()) return false; | 290 | } |
291 | if (! cap.grab()) return false; | 291 | else |
292 | if (! cap.grab()) return false; | 292 | { //Video clip |
293 | if (! cap.retrieve(image)) return false; | 293 | if (cap.grab()) |
294 | { | ||
295 | if (! cap.retrieve(image)) return false; | ||
296 | } else { | ||
297 | //Rewind! | ||
298 | std::cout << "Video clip rewinded!" << std::endl; | ||
299 | cap.set(CAP_PROP_POS_FRAMES, 0); | ||
300 | if (! cap.grab()) return false; | ||
301 | if (! cap.retrieve(image)) return false; | ||
302 | } | ||
303 | } | ||
294 | } | 304 | } |
295 | 305 | ||
296 | // scale to network input size 1024 x 512 | 306 | // scale to network input size 1024 x 512 |
diff --git a/examples/ssd_multibox/clips/pexels_videos_1466210.mp4 b/examples/ssd_multibox/clips/pexels_videos_1466210.mp4 new file mode 100644 index 0000000..7986b5c --- /dev/null +++ b/examples/ssd_multibox/clips/pexels_videos_1466210.mp4 | |||
Binary files differ | |||
diff --git a/examples/ssd_multibox/clips/pexels_videos_3623.mp4 b/examples/ssd_multibox/clips/pexels_videos_3623.mp4 new file mode 100644 index 0000000..5ec5d68 --- /dev/null +++ b/examples/ssd_multibox/clips/pexels_videos_3623.mp4 | |||
Binary files differ | |||