Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# -*- coding: utf-8 -*- #import opencv import cv2 video = cv2.VideoCapture('Walk1.mpg') index=1 # extract frames and saved into the current folder if video.isOpened(): evl

# -*- coding: utf-8 -*-

#import opencv

import cv2

video = cv2.VideoCapture('Walk1.mpg')

index=1

# extract frames and saved into the current folder

if video.isOpened():

evl , frame = video.read()

else:

evl = False

while evl:

evl, frame = video.read()

cv2.imwrite(str(index) + '.jpg',frame)

index = index + 1

cv2.waitKey(1)

video.release()

Step 1: read all frames (612 frames in total) (this step has been already done in the preliminary code)

Step 2: for each pixel position, calculate standard deviation along 612 frames

Step 3: set a threshold for standard deviation (the mathematical formulation of the standard deviation is in https://en.wikipedia.org/wiki/Standard_deviation)

Step 4: based on threshold, extract the moving objects (remove static background pixels) and draw a rectangle onto the moving objects, save all frames.

Step 5: rebuild 612 frames to a video, in which moving objects are tracked.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions