Object Detection
Detects 80 kinds of common objects such as people and vehicles in real time from the camera video. The classes are the 80 of the COCO dataset, and several can be selected together.
Commands
| Command | Description |
|---|---|
| Object Detected? | Checks whether any of the selected classes is detected. |
| Count Objects | Writes the total number of objects of the selected classes. |
| Get Object | Writes the class name, confidence, center point, and width and height of one object of the selected classes, chosen by Select By. |
| Get All Objects | Writes every detected object as JSON. |
When a Detection Zone is set, every command considers only the objects inside it.
Which objects and which part of the frame are covered is set in the settings, not by the command. To watch specific objects, select only those classes in Object; to watch every object regardless of class, use Select all to select all 80 classes. To watch only part of the frame, set a Detection Zone. For example, the total number of objects inside a zone is obtained with the Count Objects command, all 80 classes selected, and a detection zone. At least one class must be selected in Object.
Settings
| Setting | Description |
|---|---|
| Object | The kinds of object to detect. Several of the 80 classes can be selected; the default is Person. |
| Confidence (%) | 0 to 100, default 50. |
| Detection Zone | See Common Items. |
| Select By | Highest Confidence (default), By Confidence Index (0-based), Largest Size, Closest From Ref. Point. |
| Index (0-based) | 0 to 15, default 0. Ordered from the highest confidence. |
| Reference Point | See Common Items. |
Output Variables
| Field | Type | Value |
|---|---|---|
| Detected | Digital | True when an object is detected. |
| Count | Number | Number of detected objects. |
| Object | Text | Class name of the selected object (English, e.g. person). |
| Confidence (%) | Number | Confidence of the selected object, 0 to 100. |
| Center Point X / Center Point Y | Number | Pixel coordinates of the selected object's center. |
| Width (Pixels) / Height (Pixels) | Number | Size of the selected object's box. |
| Output (JSON Text) | Text | Array of every detected object. |
JSON Output
An array with, per object, class_name, confidence (0 to 100), the two box corners in bbox, the center, width, and height.
[
{
"class_name": "person",
"confidence": 85,
"bbox": { "x1": 100, "y1": 50, "x2": 300, "y2": 400 },
"center": { "x": 200, "y": 225 },
"width": 200,
"height": 350
},
{
"class_name": "car",
"confidence": 72,
"bbox": { "x1": 400, "y1": 200, "x2": 550, "y2": 300 },
"center": { "x": 475, "y": 250 },
"width": 150,
"height": 100
}
]
The 80 detectable objects
The screen shows the display name; variables and JSON hold the class name in parentheses.
Person (person), Bicycle (bicycle), Car (car), Motorcycle (motorcycle), Airplane (airplane), Bus (bus), Train (train), Truck (truck), Boat (boat), Traffic Light (traffic light), Fire Hydrant (fire hydrant), Stop Sign (stop sign), Parking Meter (parking meter), Bench (bench), Bird (bird), Cat (cat), Dog (dog), Horse (horse), Sheep (sheep), Cow (cow), Elephant (elephant), Bear (bear), Zebra (zebra), Giraffe (giraffe), Backpack (backpack), Umbrella (umbrella), Handbag (handbag), Tie (tie), Suitcase (suitcase), Frisbee (frisbee), Skis (skis), Snowboard (snowboard), Sports Ball (sports ball), Kite (kite), Baseball Bat (baseball bat), Baseball Glove (baseball glove), Skateboard (skateboard), Surfboard (surfboard), Tennis Racket (tennis racket), Bottle (bottle), Wine Glass (wine glass), Cup (cup), Fork (fork), Knife (knife), Spoon (spoon), Bowl (bowl), Banana (banana), Apple (apple), Sandwich (sandwich), Orange (orange), Broccoli (broccoli), Carrot (carrot), Hot Dog (hot dog), Pizza (pizza), Donut (donut), Cake (cake), Chair (chair), Couch (couch), Potted Plant (potted plant), Bed (bed), Dining Table (dining table), Toilet (toilet), TV (tv), Laptop (laptop), Mouse (mouse), Remote (remote), Keyboard (keyboard), Cell Phone (cell phone), Microwave (microwave), Oven (oven), Toaster (toaster), Sink (sink), Refrigerator (refrigerator), Book (book), Clock (clock), Vase (vase), Scissors (scissors), Teddy Bear (teddy bear), Hair Drier (hair drier), Toothbrush (toothbrush)