sem 8 ppt
TRANSCRIPT
MOVING OBJECT DETECTION
Guided By :-
Mrs. Amisha J. Shah
PREPARED BY :-
Rathod Prashesh R (5255)
Tandel Ankit N (5260)
Rana Manoj R (72918)
Makwana Jignesh P (5222)
INTRODUCTION
“Moving object detection” is a software based MATLAB program, with the help of which we can observe the motion of any object in 2Dimension
Our Project is based on the principles of “Motion vector”.
In motion vector there are different approaches available among these one way of detecting motion is using “Optical flow”.
WHAT IS MOTION DETECTION ?A motion is basically the difference between
two consequent frames of a video stream.The grater is the difference the greater is the
motion levelStationary BackgroundMoving BackgroundMoving Background and ObjectsIn our project we are taking a fix back-
ground.
TYPES OF MOTION ESTIMATION1. Pixel Based Motion Estimation The pixel based motion estimation approach seeks to
determine motion vectors for every pixel in the image.
2. Block-Based Motion Estimation In this method, the candidates frame is divided into non-
overlapping blocks ( of size 16 x 16, or 8 x8 or even 4 x 4 pixels in the recent standards) and for each such candidate block, the best motion vector is determined in the reference frame.
METHODS FOR MOTION DETECTION1. Two frames difference motion detector.
2. Motion detectors based on background modeling.
3. Counting Motion Detectors.
4. Optical flow.
MOTION VECTORMotion Vector is the difference in position between the
candidates and its match in the reference frame and is defined as the displacement vector or more commonly, the motion vector.
It is called a vector since it has both horizontal and vertical components of displacement after determining the motion vectors one can predict the current frame by applying the displacements corresponding to the motion vectors on the reference frame.
Background subtraction method:-Motion detectors based on background
modeling finds the difference between current video frame and a frame representing background.
Algorithm :-Read the video sequence.Arrange the frames parallel and find the maximum occurrence of the
intensity pixel by pixel among all the frames.
Obtain the static background image by marking the intensity value of a pixel obtained from step (2) as a background pixel.
To extract the moving object from any frame of the video sequence, subtract the particular frame from the background image obtained from step (3).
Apply thresholding to the resultant image of step (4) to obtain binary image.
Original grayscale image Extracted background image
Output of background subtraction method
Drawback :-The stationary objects like tree also detects.Filtering is required to overcome this
problem.
Original gray scale image Output image
Optical flow:-Optical flow is the 2-D projection into the
camera plane of the 3-D motion information presented at the world scenario.
continue.. Optical flow is the distribution of apparent velocities of movement of
brightness patterns in an image. Optical flow can arise from relative motion of objects and the viewer [1, 2].
The optic flow experienced by a rotating observer (in this case a fly). The direction and magnitude of optic flow at each location is represented by the direction and length of each arrow.
ESTIMASTION OF THE OPTICAL FLOW:Image constraint equation can be given: (x,y,t) = I(x+δx,y+δy,t+δt)Assuming the movement to be small, Then by Taylor
series we get:
Which results inThus: IxVx + IyVy = − It Or
IT.= -I
Optical Flow In Motion Analysis:
Methods for determining optical flow:(1) Horn-Schunck method:-
(2) Lucas kanade method:
The Lucas-Kanade method assumes that the displacement of the image contents between two nearby instants frames is small and approximately constant.
So the optical flow equation is
Ix(q1)Vx + Iy(q1)Vy = − It(q1)
Ix(q2)Vx + Iy(q2)Vy = − It(q2)
. . .
. . .Ix(qn)Vx + Iy(qn)Vy = − It(qn)
where q1,q2…qn are the pixels inside the window, and Ix(qi), Iy(qi), It(qi) are the partial derivatives of the image I with respect to position x, y and time t
• These equations can be written in matrix form Av = b
• Now ATAv = ATb or
v = (ATA) − 1ATb
Where AT is the transpose of matrix A. That is, it computes
Uses of optical flow:Motion estimation and video compression
have developed as a major aspect of optical flow research.
Optical flow was used by robotics researchers in many areas such as: object detection and tracking, image dominant plane extraction, movement detection, robot navigation and visual odometry.
In estimating the three-dimensional nature and structure of the scene, as well as the 3D motion of objects and the observer relative to the scene.
IMPLEMENTATION METHOD
Video and frames:-Fix background videoVideo = number of framesTake two consecutive frames.
Grayscale conversion:-A grayscale or grayscale digital image is an image in which the
value of each pixel is a single sample.Displayed images of this sort are typically composed of shades of
gray, varying from black at the weakest intensity to white at the strongest.
Original color image Grayscale image
Grayscale result:-
Original color image Grayscale image
Lucas kanade (motion vector):-
Motion vector output
Thresholding :-Thresholding is useful to separate out the
regions of the image corresponding to objects of interest, from the background.
Original image Output of thresholding
Thresholding results:-
Original image Output of thresholding
Dilation and Erosion:-Dilation adds pixels to the boundaries of
objects in an image, while erosion removes pixels on object boundaries.
The number of pixels added or removed from the objects in an image depends on the size and shape of the structuring element used to process the image.
(a) (b) (c)
Bounding box:-
Output in bounding box
Thank you