Video defect detection
A camera can be online and still be useless: someone knocked it out of aim, a spider built a web over the lens, the sensor drifted out of focus, or the clock burned into the picture is two hours off. Video defect detection catches that. Angelcam takes a snapshot of the camera and has an AI model compare it against a reference image — how that camera is supposed to look.
Checks run on a schedule you set per camera, and you can also run one on demand. Each check costs the space one AI check.
Set a camera up
Section titled “Set a camera up”POST /defect-detection/settings/{camera_id}/ turns detection on. It captures the first reference image from the live camera, so the camera has to be online — if it is not, the call returns 409 with camera_offline.
{ "schedule_policy": { "period": "day", "timezone": "Europe/Prague", "is_active": true, "slots": [ {"start": "08:00", "end": "18:00", "count": 3}, {"start": "22:00", "end": "06:00", "count": 1} ] }}That camera is now checked three times during the working day and once overnight.
The schedule
Section titled “The schedule”A schedule is a list of slots. Each slot is a window of the day and a number of checks to run inside it.
| Field | Meaning |
|---|---|
start, end |
The window, as HH:MM in the policy timezone. An end earlier than start wraps past midnight. They must differ — a whole day is 00:00–23:59. |
count |
How many checks run in that window per period, not per day. |
period |
day, week or month — how often the counts restart. A month counts as 30 days. |
timezone |
IANA zone, e.g. Europe/Prague. Check results report their times in it. |
is_active |
false pauses scheduled checks without deleting the settings. |
Angelcam places the runs randomly inside the window, so a camera is not checked at the same minute every day and someone watching the camera cannot predict when it is looked at.
A slot may not run more than once per hour of its window, counted over the whole period. A 10-hour window allows 10 checks with period: day, 70 with period: week and 300 with period: month; a higher count returns 400.
Changing the schedule re-plans the next check immediately. Two slots may not repeat the same window — merge them into one and raise its count.
The reference image
Section titled “The reference image”Every check compares the camera against the active reference image, so it has to match how the camera is supposed to look right now.
- After you move, clean or re-aim a camera on purpose, call
POST …/capture-reference/. Otherwise the new view keeps being reported as “camera moved”. - Older reference images are kept.
GET …/reference-snapshots/lists them, and sendingreference_snapshot_idin the settings makes one of them active again. - Capture it when the view is clear. A reference image taken at night, or with a truck parked in front of the camera, teaches the check the wrong scene.
Read the results
Section titled “Read the results”GET /defect-detection/checks/?camera_id=157 lists the finished checks of one camera, newest first; GET /defect-detection/checks/{check_id}/ returns one in full, with the reason behind each verdict.
Each check reports four categories. Each one is true, false or null (not evaluated):
| Field | true means |
|---|---|
is_camera_moved |
The view no longer matches the reference image. |
is_view_obstructed |
Something blocks the view — dirt, spray, an object in front of the lens. |
is_sensor_abnormal |
The image itself is unusable: too dark or bright, out of focus, noisy, wrong colours. |
is_time_ok |
Inverted. true is the good case: the clock in the camera overlay matches the time the image was taken. false means it is off by more than time_tolerance_seconds, or could not be read. |
Two fields are easy to confuse:
statusis about the check, not the camera.falsemeans Angelcam could not analyse the camera at all;errorsays why, and the four verdicts say nothing.is_time_okis the only category wheretrueis good. The detail endpoint shows the comparison behind it:osd_time(the clock read from the overlay),snapshot_time(when the image was taken) andtime_tolerance_seconds. Both times are local times incamera_timezone, written without a UTC offset.
To build a review queue across a whole space, use GET /defect-detection/checks/all/ and GET /defect-detection/checks/cameras/ for its camera filter. Both need the space administrator permission; the per-camera endpoints do not.
Run a check now
Section titled “Run a check now”POST /defect-detection/checks/ with {"camera_id": 157} runs one check outside the schedule. The camera must already be set up, or the call returns 404.
The check runs in the background, so the answer is 202 with is_pending: true and no results yet. Poll the check detail with the returned id until is_pending turns false.
Only one check runs on a camera at a time — a second one returns 409 with check_already_running. A check still pending after 10 minutes counts as lost, stops blocking the camera and shows up in the lists with status: false. With no AI credit left in the space, the call returns 402 with insufficient_credit.
Credit is checked twice: once when the call is accepted, and again when the check actually runs. A check that is accepted and then finds the space out of credit finishes with status: false and error: "not enough AI credits". A scheduled check in that situation simply does not run and leaves no record.
Pass reference_snapshot_id to compare against a different reference image for this one check, without changing the camera’s settings.
Get notified
Section titled “Get notified”A check that finds a problem creates a notification of message type camera_check. Create a notification rule for that type to receive it by email, push, SMS or webhook — the same way as any other Angelcam notification.
Send feedback on a check
Section titled “Send feedback on a check”POST /defect-detection/checks/{check_id}/feedback/ records whether the check got it right. For each category send the value you believe is correct, plus an optional free-text note: sending the same value the check reported confirms it, sending the opposite declines it, and null says you have no opinion.
Each field keeps the meaning it has in the check result, so true is not always the problem case:
| The check reported | You send | Means |
|---|---|---|
is_camera_moved: true |
true |
Yes, the camera really moved — the check was right. |
is_camera_moved: true |
false |
No, it did not move — the check was wrong. |
is_time_ok: false |
false |
Yes, the clock really is wrong — the check was right. |
is_time_ok: false |
true |
No, the clock is fine — the check was wrong. |
Angelcam uses the feedback to measure and improve detection quality, and is_reviewed in the lists turns true once every evaluated category has a verdict.
The body is applied field by field, so you can judge one category at a time without clearing the others.
Permissions
Section titled “Permissions”| Action | OAuth scope | Space permission |
|---|---|---|
| Read settings, reference images, checks and feedback | camera_access |
camera view |
| Create, change or delete settings, capture a reference image, run a check, give feedback | camera_manage |
camera manage |
List checks across the space (/checks/all/, /checks/cameras/) |
camera_access |
space administrator |
Requests act in the active space — the user’s default one, or the one selected with the X-Space-Id header. See Key concepts.