How to detect shift in static camera?

asked 2014-04-14 17:52:42 -0600

T gravatar image

Hi folks :)

I'm looking for help in solving my problem. I have a static camera, which is focus on one place. I download current view at every 1 second.

I would like to write a program which detects when someone moves the camera in a different direction. After that I would like to generate image with the shift . I am currently come up with this solution: 1. Create a base frame, to which I compare all future frames. 2. Generate edge with Canny Edge algorithm. 3. Then I generate the corner points with Harris algorithm. 4. Then I want to compare the current frame with a base frame (picture, where are just corner points on black background) with calcOpticalFlowPyrLK (Lucas-Kanade method).

Unfortunately I have problems, because depending on the lighting, the number of people, etc., the edges and corners are change. Because of this I don't know if there was a shift or not.

Can somebody give me some advices any solution how to detect shift?

Thanks for your help :)

edit retag flag offensive close merge delete