1 / 18

Motion Detection

Motion Detection. CIS 601 PROJECT Student: Yegan Qian Professor: Login Jan Latecki. Why Motion Detection?. First, the world is dynamic, and motion information is one of the keys to many practical applications such as video mining, Robert navigation, intelligent traffic system, etc.

tatkins
Download Presentation

Motion Detection

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Motion Detection CIS 601 PROJECT Student: Yegan Qian Professor: Login Jan Latecki

  2. Why Motion Detection? • First, the world is dynamic, and motion information is one of the keys to many practical applications such as video mining, Robert navigation, intelligent traffic system, etc. • Motion Detection is also a basic step to machine learning, pattern recognition in dynamic context.

  3. The main principals used in this project: • Because the objects are always moving, in image space, every pixel will be disclosed after the moving objects leave. • According to the above fact, we can record every pixel’s variations along time axis. We will get some segments in which the pixel’s variation is o, along time axis. Among those segments, we select the largest segment, and select the middle point from the segment as the corresponding background pixel.

  4. The main principals used in this project: PDIFF(x,y,:,t) o t: time

  5. The main principals used in this project: • So we can get a background image in video sequences. Let it be background, we can compare any frame in video sequences with background, then we get the motion.

  6. Real process in the project: • First, we read all the data from video file, and store them in a 4D array I(:,:,:,framenum); • Let image = I(:,:,:,k) – I(:,:,:,K-1), K=2 …noOfFrameImages. • Compute the norm of each image(x,y,:), if norm > T1 then image(x,y,:) = 255 else image(x,y,:) = 0; • PDIFF(:,:,:,K-1) = image; PDIFF records all the pixels’ variation along time axis

  7. Real process in the project: • Here is PDIFF image at time(frame) 68;

  8. Real process in the project: • Denoise: Take erode operation on every PDIFF image. Carefully select the slide window size and threshold T2; The following is the denoise matlab code:

  9. function frameDif = erodeFramediff(frameDif) height = size(frameDif,1); width = size(frameDif,2); erohalfwin = 1; %half of the erode window T2 = 5;

  10. %search for the entire image to denoise for h = erohalfwin+1:1:height-erohalfwin-1 for w = erohalfwin+1:1:width-erohalfwin-1 count = 0; if frameDif(h,w,:) ~= 0 %to decide if this point is a noise or not according to its %neighbourhood for h1 = -erohalfwin:1:erohalfwin for w1 = -erohalfwin:1:erohalfwin if frameDif(h+h1,w+w1,:) ~= 0

  11. %to decide if this point is a noise or not according to its %neighbourhood for h1 = -erohalfwin:1:erohalfwin for w1 = -erohalfwin:1:erohalfwin if frameDif(h+h1,w+w1,:) ~= 0 count=count+1; end end end

  12. if count < erothreshold %this point is a noise tempdif(h,w,:) = 0; else tempdif(h,w,:) = 255; end end end end frameDif = tempdif;

  13. Get background image: • According to the PDIFF, we compute the largest length in PDIFF along time axis for every fixed pixel, select the middle point among the segment as the corresponding pixel of background. Then we get the whole background image.

  14. A background image with filtering:

  15. Motion detection: • We can locate the motion according to the comparison between a frame at any time t and the background image;

  16. Motion location

  17. Motion Location • The above result is a difference image between background image and a random frame from the video.

  18. Conclusion: • To select a suitable threshold T1 and T2 is very important to get the final result . • Take erode operations on PDIFF is necessary, the slide window size should also be carefully selected.

More Related