I am using Windows.
This set up is to be used in real world (for about 2 hours in a stretch) This means collection of a lot of data. A simple notepad file containing the data points is of about 5-6 MB.
Ultimately, I need two things:
- A notepad file containing the data points whenever vehicles have been detected.
- A folder containing images taken by webcams whenever vehicles were detected.
There is a timer running on arduino from the start.
As the vehicle passes down the road, the Left ping marks the time stamp and offset from the road edge of the vehicle as soon as it detects the vehicle. By the time vehicle has crossed it, I will be getting 5-10 readings or even more depending upon the speed of the vehicle. Right ping does the same. Here’s an example of the collected data:
115807 0 196
115849 0 201
115893 0 197
115932 0 198
115972 0 200
(Useless data points deleted to maintain readability of this post)
117613 224 0
117653 223 0
117692 224 0
117732 226 0
117772 226 0
Now, I have added two webcams to this whole setup. Arduino sends signal to my laptop whenever a vehicle crosses any ping sensor. My job is to take pictures through the webcam and store it on my HDD so that later on, I can know whether the recorded data point corresponds to a car, a bus or just some person moving by.
I tried to do this using Matlab. Whenever I received a valid data, I commanded MATLAB to take a snapshot. To some extent it was working but it was rather slow and the incoming values from Arduino were getting piled up (in some sort of temporary memory maybe). Ultimately, it was useless for me due to the slow snap shooting rate. Any idea how to achieve faster image shooting in order to match the speed of data being collected (approx 1 picture every 40 ms).
I heard about OpenCV. Do you think it would be fast enough to accomplish the job?
Is there any other light weight application, which can intercept signals from my arduino and take pictures using webcam?