0

I am trying to detect motion in a video taken by non-static camera in this case UAV. what I planned to do is to remove the camera motion effect by aligning the frames as much as they overlap then make simple differencing, Here what I did - I used SURF to get matching points between frames - I supplied those points to homography to get the matrix H - I wrapped the new frame using H * all done using openCV * to save computation power and time I used mask with SURF, the mask is 4 squares one at each corner

the concept works great for static image but in the video the wrapped frame is giving strange results! sometimes good sometimes bad

https://www.youtube.com/watch?v=WKVoUR_-DFw @00:34

Karam Abo Ghalieh
  • 428
  • 1
  • 5
  • 19
  • looks like your matching failed. you should verify your computed homography before warping. – Micka Nov 04 '15 at 09:47
  • did you watch the video? it align in some frames and does not in other frames, I can't tell where is the problem – Karam Abo Ghalieh Nov 04 '15 at 10:04
  • in some frames where it does not align your homography probably isnt well. You should analyze the matching from image to image to find the error (visually display the matching and display which keypoints were used for homography computation etc). Probably you'll see that "bad point correspondences" were used to compute the homography in cases where the align failed. – Micka Nov 04 '15 at 10:09
  • I walked frame by frame and had drawn the matching points they are accurate! – Karam Abo Ghalieh Nov 06 '15 at 02:12
  • post matching images and transformations please – Micka Nov 06 '15 at 05:59
  • could 3-4 points out of 20-40 do the mismatch? for multiple masks each one has a small area then combine the matched points vector – Karam Abo Ghalieh Nov 07 '15 at 14:47
  • if those are the chosen ones in the findHomography function then definitely yes! Use the "mask" parameter to analyze that. see http://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html?highlight=findhomography#findhomography – Micka Nov 07 '15 at 18:44
  • check that link to test whether your homography is ok: http://stackoverflow.com/questions/10972438/detecting-garbage-homographies-from-findhomography-in-opencv – Micka Nov 07 '15 at 19:32
  • 3-4 out of 20-40 should do not affect the homography estimation, if you use RANSAC as it has a breakpoint near 0.5 which means in theory half of the points can be corrupted. Do you get different results, if you use CV_LMEDS or the regular 0 (least square) to resolve the homography? – Tobias Senst Nov 08 '15 at 16:45
  • CV_LMEDS, and method 0 always give bad homography, RANSAC gives the best – Karam Abo Ghalieh Nov 10 '15 at 11:35
  • I noticed that using masks with SURF or SIFT gives very bad performance – Karam Abo Ghalieh Nov 18 '15 at 09:35

0 Answers0