Camlytics use case: measure vehicles speed
Such powerful video events sources, as Lines and Zones, allow a lot of custom data manipulations. Every single analytical event that comes from any video source - IP camera, webcam, NVR, video file or video folder, has a lot of properties - source ID, timestamp, video file time, object ID, origin, channel ID, type and others. This data can be used to find links between different scene events. For example, you can detect speed based on two lines on your scene.
Step 1 - Add 2 lines
Add any video source where you want to detect speed. Make sure you calibrate it properly so that all moving objects are detected correctly and in time. Place two lines one after another so that they cover the full vehicle travel distance. The bigger the distance the better. Make sure that moving vehicles are always detected and both lines generate events on each vehicle.
Step 2 - Measure distance between lines
Measure the real distance between those lines. The bigger the distance the more precise the speed calculation will be. The distance is 18 meters in our case.
Step 3 - Calculate speed
As vehicles travel through two lines, every vehicle will have the same object ID for both events generated by those lines. That is how you can match them and find the timestamp delta between those events. In our example there are two events with object ID = 1 and the timestamps are 5.024s and 6.458s. The timestamp delta = 6.458 - 5.024 = 1.434s. Knowing the delta and the distance between lines we can calculate the speed = distance / timestamp delta = 18 / 1.434 ~ 12.55 m/s = 45.18 km/h
Therefore, the vehicle traveled with the speed of approximately 45 km/h. The whole speed detection process can be automated if you have all the events imported in the Google sheets with predefined formulas. Alternatively, you can calculate the speed in your own code with Camlytics API. Both things can be done real time.