I want to read video file(.avi or .mov) and detect motion and edges using Opencv.Can u help me with code?I want to create a GUI in which we can select the video file,then we can
You should look at the samples included in the python folder for opencv. They will be found here: opencv\samples\python2
There you will find many of the basic and advanced features of opencv (in the cv2 format) demonstrated. There are also many tutorials (mainly in c++) on the website here: http://opencv.itseez.com/doc/tutorials/tutorials.html
Reading and writing video images is here: http://opencv.itseez.com/trunk/modules/highgui/doc/reading_and_writing_images_and_video.html
For initial video capture from AVI:
import cv2
import cv2.cv as cv
import numpy as np
cap = cv2.VideoCapture(filename)
img = cv2.VideoCapture.read()
if img:
print img.get(cv.CV_CAP_PROP_FRAME_HEIGHT)
print type(img)
# loop through rest of frames reading one at a time