All posts

Six ways to ask a camera a question

Event, Detect, Measure, Tracker, Read and Find: what each agent type returns, when to pick it, and the one thing a zone fixes that a better question cannot.

By Oussama Messai Published 2 December 2026 5 min read Lire cet article en français
A small car park seen from above, a row of marked spaces with cars

In the Camly API, the thing that says what to look for is called an agent: a short configuration with a type and, most of the time, a question. There are six types. Choosing the right one is most of the design work, because the type decides the shape of the answer your code receives.1

The six types at a glance

TypeYou askYou get backChecks
eventA yes or no questionflagged, a confidence, a sentence1
detectClasses of objects, optionally in a zoneflagged if at least one is there, and a point for each1
measureA value to read, with an optional conditionmeasurement with value and unit, condition_met1 (2 when calibrated)
trackerWhether one object or vehicle is the same and has movedtrack.identity, track.moved2
readA reference, a number, a labeltext, and matched if you gave what to expect1
find (beta)Given items, counted, in a picture of the pastitems with counts and boxes, found_all, score1 per picture

Every type also returns confidence, description and regions, and accepts a threshold (the confidence needed to flag, 0.7 by default), a language for the description (en or fr) and a zone.

Event: the default

{ "type": "event", "question": "Is the marked fire exit blocked?" }

If you can phrase the need as a yes or no question, start here. The exceptions go in the sentence: “a forklift setting down a pallet does not count”. Writing that sentence well is a skill of its own, covered in writing a good state.

Detect: when you want the where

{ "type": "detect", "classes": ["pallet", "forklift"],
  "zone": [[0.1, 0.5], [0.9, 0.5], [0.9, 1], [0.1, 1]] }

regions comes back with one labelled point per object found. Use it when your interface draws something on the picture, or when the presence of a kind of object is the whole question.

Measure: a number, not a verdict

{ "type": "measure", "question": "How full is the silo?",
  "measure": { "variable": "level", "unit": "%",
               "condition": { "op": "lt", "value": 20 } } }

The answer carries measurement.value and, because a condition was given, condition_met. Store the value and you have a curve; act on the condition and you have an alert.

Tracker: the same one, or another

Send an earlier picture as reference_image and a new one as image, with a subject such as “the white van”. The answer says whether it is the same, a different one or unknown, and whether it moved. It counts as two checks. Trackers never follow people.

Read: text, compared by the API

{ "type": "read", "question": "The reference printed on the label", "expect": "AB-4471" }

text is what was read, with a ? in place of any character that could not be read. The detail that matters: expect is never shown to the model. It reads blind, and the API compares, ignoring case, spaces and separators. A match is therefore not suggested by the question.

Find: counted items, in the past

Find counts named items (“two white wraps, one paper bag”) in pictures that were taken earlier. It is in beta: its accuracy has not yet been measured on real pictures, and the documentation says to check what it picks before relying on it. It does not run on a live monitor.1

What a zone fixes

Any type accepts a zone: 3 to 32 points, in units from 0 to 1 from the top-left corner. The model is shown the zone outlined on a copy of the picture and judges only what is inside.

A zone is not a cosmetic refinement. Take a row of parking spaces. The natural question is “how many spaces are free?”, and it is the wrong one: counting what is absent is hard for a vision model, and in our own tests on a row of ten marked spaces the count of free spaces was not reliable. One zone drawn on one space, with the question “is the space inside the marked zone free?”, was right every time we ran it. Ten spaces are then ten small questions rather than one large one.

The general rule: when a question fails, make it smaller before making it cleverer. A zone is the simplest way to make a question smaller.

A line, for crossings

A line counts crossings between two points, in any direction or towards one side. A crossing is movement, so a line works best with a burst: 2 to 6 pictures in time order, sent in the same call, counted as 3 checks. Bursts work with event and detect only.1

Which one, in practice

  • The answer is yes or no: event.
  • The interface must show where: detect.
  • You want a curve or a threshold on a value: measure.
  • The question is “is it still the same one”: tracker.
  • There is text to check against a reference: read.
  • The question is about a moment already gone: read or find, in a look-back.

When two types would do, take the one whose answer your code can use without parsing a sentence.

Sources

  1. Camly API, all guides as plain text: Agent types, Pictures, Limits and prices. platform.camly.ai
  2. Camly API contract (OpenAPI). api.camly.ai