Is counter available in matlab
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hi, when a vehicle crosses a line in an image(vehicles are passes along a road,road has two lines at a distance across the road),it means the pixel values along the line changes.Is there any counter to count the time when vehicle crosses first line then the counter stops when vehicle crosses the second line.this is to know time of traveling between two lines . this is useful in my academic project.
give answer to this question waiting for reply
0 commentaires
Réponses (1)
Walter Roberson
le 25 Nov 2011
No, there is not. You have to use image processing to detect that the appropriate conditions in the image.
You can use tic() and toc() to measure elapsed time, but since you are wanting to measure real-world velocity, you need to somehow figure out how real-world time that an image was taken corresponds to time that the image was processed. Measuring elapsed computer time in MATLAB is not an effective way to do that, as there can be arbitrary and variable latency delays between the time an image is taken and the time the image is fully available to your program for processing. Counting frame numbers and multiplying by frames per second could be more reliable, if not for the fact that any number of frames can get dropped at any time if you are using web-cam type image acquisition.
For any kind of serious velocity measurement, each image frame should be numbered and time-stamped by the image acquisition hardware, and continuous per-image velocity approximations should be measured so that if frames go missing then it is possible to make a projection of the actual crossing time. The approximations should take in to account acceleration and deceleration.
Having the frames numbered and time-stamped by the image acquisition hardware will likely require upgrading the hardware and will probably require using a different image acquisition routine (i.e., standard MATLAB video input routines do not have provision for transferring this kind of information.)
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!