Detecting a moving object going left or right isn’t hard. With the telescope lens you can get this working easier buy having the camera look at one place. However, noise rejection is really difficult.
The first thing you should do is to setup a rig with the camera looking outside. Buy a telephoto lens so you can zoom in on one area. Once you’ve done that record a mjpeg clip of cars passing by, and then post it. I can get more of an idea of the challenges if you do this.
Thank you for the response. I was asking this question as I listened to the Embedded podcast with Kwabena Agyeman and it seemed that this device might work for my application. I was posting this question so I could decide whether to buy the OpenMV cam.
so, does this seem like a feasible application? Or, can I get the mjpeg with my current camera and then see if this will work.
Also, wouldn’t a wide angle lens allow more time for the camera to recognize the car? I am new to this so I am curious as to why the zoom might be better.
It depends on the distance. For a fast FPS you want to stay in the 160x120 range. At that resolution if you use a wide angle lens you’re not going to really be able to see anything farther than about 8 ft or so away without having noise issues (10 pixels of an object for example is usually not enough, it will need to be closer). Anyway, basically I’m asking how you want to mount the camera. It’s still a sensor at the end of the day and you have to setup it up in a system where it can work right. If you plan to mount it inside your house more than 30 ft from the road then it’s going to have a hard time seeing enough to detect cars.
… Anyway, I’m trying not to lead you down a false path here . Um, can you take some pictures with a regular camera of what the OpenMV Cam will be looking at, where you will place it, etc?
Ah, okay, so you plan to put it near the road. Yes, the camera can be used for detecting cars and their direction from that spot.
There are a lot of different techniques you can use to detect cars and their directions… Adaptive frame differencing is one thing you can do. Probably layered with find_displacement will give you the movement direction.
Basically, you’d set the resolution to something like 80x60 pixels and use a wide angle lens. Then, since you’re at a low resolution you can store multiple frames in RAM very using the SD card as a storage area. Anyway, you’d keep track of the last frame and do frame differencing between the last frame and the current frame. Then if there’s a difference between two frames you can pass that to find displacement which will run phase correlation on two successive difference images to determine the vector of movement.
You can also do stuff based on color tracking differences between frames, etc. I’m not sure what exactly the best approach is.