Guide 07, beginner
Count pedestrians, bicycles and cars
Count several kinds of objects with the same lines, read the counts per class, and see why a cyclist counts as a person and a bicycle.
- Time
- 15 minutes
- You need
- The street sample video
- Pages of the app
- Cameras, Scene Builder, Experiments, Analysis
- Topics
- Traffic
What you will be able to do
- Track several object classes at once
- Let a line count every tracked class
- Read counts by class
- Count one class only with a dedicated line
The street clip looks down on a parking lot. A pedestrian walks through, two cars drive through and two cyclists ride past. This guide counts all of them with two lines, one near each side of the picture, and splits the counts by kind of object.
Step 1. Add the street clip
- Open Cameras and click Add camera.
- Set Camera name to
Streetand pick a Project. - Set Connection type to Video file.
- In Or use a file already on this computer, type the full path of
samples\videos\person-bicycle-car-detection.mp4and click Use file. - Click Add camera, then Open scene builder.
Step 2. Create the experiment first
New shapes take their object classes from the experiment selected in the Scene Builder, so create the experiment before you draw.
- Click New experiment in the top bar.
- Set Name to
Street counts. - Under Objects to track, Person is already ticked. Also tick Bicycle and Car.
- Click Create experiment. It is now selected in the top bar.
Step 3. Draw two lines
- Press
L. Click at the top edge of the picture, about a tenth of the way in from the left. Then click at the bottom edge, straight below. - In the inspector, set Name to
West edge. Under Object to track, Person, Bicycle and Car are ticked. - The Line tool is still active. Click at the top edge about a tenth of the
way in from the right edge, then at the bottom edge straight below. Name the
new line
East edge. - Click Save in the top bar, or press
Ctrl+S.
Step 4. Run and read the counts
- Click Start and wait for the clip to finish.
- Click Results at the bottom of the Scene Builder.
- In Line crossings, the By class column splits each line’s total.
- The Object classes (tracks) panel shows how many different objects of each class were tracked.
With the recommended detector the sample gives these counts:
| Line | Total | By class |
|---|---|---|
| East edge | 5 | person 3, bicycle 2 |
| West edge | 3 | car 2, person 1 |
The two cars leave on the left. On the right, one pedestrian leaves and two cyclists ride out.
Why a cyclist counts twice
The detector sees the rider as a person and the bicycle as a bicycle. Both are tracked, so one cyclist adds one person and one bicycle. That explains the 3 persons on the East edge: one pedestrian and two riders.
- To count cyclists, count bicycles.
- To count pedestrians only, subtract the bicycles from the persons, or draw a line with only Person ticked where cyclists do not pass.
Count one class with its own line
A line counts only the classes ticked under Object to track. To report cars and bicycles as separate numbers, draw one line per class.
- Go back to the Scene Builder. On the results page click Experiment, then Scene builder.
- Click
East edgein the Objects list of the inspector, and pressCtrl+D. The copy,East edge copy, appears slightly to the right of and below the original, and is selected. - Name the copy
East bicycles. Under Object to track, untick Person and Car, so only Bicycle stays ticked. - Click Save, then Start.
East bicyclescounts 2.
Next
Guide 08 keeps part of the picture out of every count, using this same scene.
This page is docs/guides/07-street-by-class.md from ajm2004/CV-Scope@eaf904a
, committed 30 September 2026. The repository is the source of truth; this site renders
it.