Configure by typical scenario
How 12 real sites were configured. Each one is written as "situation → configuration → why", so when you meet a similar site you can copy it and adjust.
Class names on this page are illustrative; in a real configuration, use the names from your class table.
Scenario 1: put the pen cap and barrel into the pen box
Situation: the worker puts the pen cap and the barrel into the pen box. The step is complete only when both are in.
Configuration: Inside container.
- Target classes: pen cap, barrel;
- Parent container: pen box;
- Match mode: 全部目标都进入父容器才通过 (Pass only when all targets are inside the container);
- Hold time 500 ms.
Why: after assembly the frame shows a stable result, so an object type is the most reliable. With multiple targets, by default all must go into the same pen box.
Scenario 2: drive 4 screws, and actually drive them
Situation: 4 screws on a housing, driven with a manual screwdriver. The risk to guard against is "screws placed but not driven".
Configuration: combined condition, 全部满足 (All of):
- Object count: screw, exactly 4.
- Action count: drive screw, position source = screw, exactly 4 times, evidence = dwell + rotation, check 同一位置只记一次 (Count each position once).
Why: Object count only proves the screws are there; Action count proves each one was driven.
Vision cannot judge whether a screw is tight
Tightness is a matter of force. Only whether the driving action happened can be judged.
Scenario 3: refill fully inserted
Situation: the refill is inserted into the barrel; if it is not in far enough, an alarm is needed. After assembly the worker lays the pen flat on the inspection spot and takes the hand away.
Configuration: combined condition, 全部满足 (All of):
- Length ratio: measured object = exposed refill, reference object = pen tip, inspection zone = inspection spot, check 超出范围报警(未插紧) (Alarm when out of range (not fully inserted)). Measure the upper and lower ratio limits with workstation 采集 (Capture) › 标定 (Calibrate) and write them back.
- Hand left zone: inspection spot.
Why:
- "Fully inserted" is about force and cannot be seen in the image; but a shallow insertion makes the exposed refill longer, and that can be measured.
- With the pen tip as the reference object, the ratio stays the same even if the camera distance changes.
- Measure after the hand leaves, so the hand does not block the view.
Scenario 4: plug a ribbon cable into the main board
Situation: a long, thin ribbon cable is plugged into a connector on the main board.
Configuration: Contact or connection.
- Object A: ribbon cable; Object B: main board;
- Overlap ratio 0.05; contact tolerance 8 px.
Why: the ribbon cable is long and thin, and its box center often falls outside the main board box, so "Inside container" would wrongly judge it not installed. Use contact + edge tolerance.
Scenario 5: peel off the protective film and discard it
Situation: peel the protective film off the screen and drop it in the scrap bin.
Configuration: Object absent: protective film. Hold time 1500 ms.
Why:
- The film is taken out of the frame, and "Objects apart" requires both parts to still be in the frame, so it does not apply.
- Set a longer hold time so that a moment when the hand blocks the film is not taken as "not visible".
Scenario 6: boxing and sealing
Situation: in steps 1~3 the product, manual and accessories go into the outer box; in step 4 the box lid is closed.
Configuration:
- Steps 1~3: Inside container, with targets product / manual / accessories respectively, parent container = outer box.
- Step 4: Object present, target = closed outer box, no zone, check 排除其他类别 (Exclude other classes); check 完成时会遮挡前置零件 (Covers earlier parts when done).
Why: once the lid is closed, everything put in earlier is out of sight. Without "Covers earlier parts when done", the system thinks parts from earlier steps were removed and reports "a part installed earlier was disturbed".
Scenario 7: is the sealing ring on the bottle base?
Situation: the bottle is turned over to check whether the base has a sealing ring; if not, an alarm must be raised immediately.
Configuration: Exclusive state check.
- Pending class: bottle on its own;
- Pass class: bottle base with sealing ring;
- Abnormal class: bottle base without sealing ring;
- Abnormal level: Abnormal;
- Abnormal code SEAL_RING_MISSING;
- Message "Sealing ring not installed, please reinstall".
Why: the two states look clearly different. They are trained as two classes, one passes and one alarms, and the operator also gets a clear instruction.
Scenario 8: pick from material boxes in order, alarm on wrong part
Situation: 3 material boxes are fixed on the left of the station, one kind of part is picked in each step, and pick lights are installed.
Configuration:
- Fix the camera and the material boxes in place.
- In ① 基本信息 (Basic info), add 3 staging areas (material boxes A / B / C) mapped to the pick light channels.
- In ④ ROI 区域 (ROI zone), draw the 3 material boxes as detection zones. Do not label the parts inside the boxes.
- For each step: set 取料区 (Pick area) to the matching material box (its light turns green); for the detection rule use the combination 依次满足 (In sequence):
- Hand in zone: material box A;
- Object present: part A, zone = assembly position.
- In ① 基本信息 (Basic info), set 拿错料检测 · 工作区 (Wrong-part check · work area) to the assembly position: when a part that should not appear in this step shows up in the work area, "wrong part" is reported.
Why:
- Once the boxes are fixed, there is no need to label piles of parts, and labeling effort drops by an order of magnitude (measured: from 43888 boxes down to 8968).
- "First reach in to pick, then place at the assembly position" is expressed in order with In sequence.
Scenario 9: dumplings on plates
Situation: 3 plates in one frame; each plate needs 6 white dumplings and 2 black dumplings.
Configuration: Per-container class count.
- Parent container: plate;
- Child classes: white dumpling = 6, black dumpling = 2;
- Pass mode: 所有容器都满足才通过(严格) (Pass only when every container meets it (strict)).
Why: Object count would add up the dumplings on all 3 plates and could not tell which plate is short.
Scenario 10: workpiece arrives on a conveyor, gets processed, leaves
Situation: a conveyor brings the workpiece to the station, the worker fits a part, the workpiece is carried away, and the next one follows.
Configuration:
- Step 1 "Workpiece in place": Object present, workpiece, zone = station area, check 仅认新目标 (New targets only).
- Step 2 "Fit part": Inside container, part → workpiece.
- Step 3 "Workpiece leaves": Object left zone, workpiece ← station area; check 仅认新目标 (New targets only); do not check 必须在区域外看到该物体 (Must be seen outside the zone first) (the workpiece is carried out of the frame).
Why: on a conveyor, when the previous workpiece has not moved far away yet, without "New targets only" it is taken as a new piece and many false skips are reported.
Scenario 11: no scrap on the station when the product is placed
Situation: when the product is placed on the inspection table, no scrap from the previous piece may be left on the table; the product counts as placed only after the worker's hand has left.
Configuration: combined condition, 全部满足 (All of):
- Object present: product, zone = inspection table;
- Object absent: scrap, zone = inspection table;
- Hand left zone: inspection table.
Why: with a zone selected, "Object absent" judges that there is no scrap on the table right now; a table that was clean from the start also satisfies it, which is exactly what this step requires. There is no need for a workaround such as "None of [Object present]".
Scenario 12: per-piece slot inspection on a two-row line (key scenario)
Situation
- A two-row work area; workpieces flow continuously along the line, with 4~6 circuit boards in one camera view at the same time.
- On each board, to the right of the LCD, there is a vertical row of slots with 4 positions from top to bottom. Each position must hold a specific component (for example, blue LED, resistor, yellow LED, red LED).
- Requirement: judge each board separately for missing, wrong or swapped components; count boards when they leave the work area; for failed boards raise an alarm and record a failed piece without stopping the line.
Approach
- Per-piece mode handles "judge each board separately and count it when it leaves".
- "Each slot has the right component" is written in the rule with Inside container: one condition per slot, "component → board (tray) + sub-zone", with all 4 required.
Configuration steps
- Define classes (③ 模型与类别 (Model & classes))
- Board / tray: used as the anchor, one box per board.
- Components that may appear in the slots: blue LED, resistor (black component), yellow LED, red LED. Do not split components that even the human eye can hardly tell apart into two classes.
- The "slot" itself does not need labeling; slot positions are drawn in the rules in step 4.
- Draw zones (④ ROI 区域 (ROI zone))
- Inference zone: fully enclose both rows of the work area, with a margin beyond it, without cutting off any board. The components are small, so use 1920×1080 capture resolution and inference size 1280.
- Detection zone "Inspection area": the range in which boards are judged. Draw its exit edge after the point where all components have been inserted; when a board leaves through it, the verdict is given and the board is counted.
- Turn on per-piece mode (bottom of ④ ROI 区域 (ROI zone)): turn on the switch; workpiece (anchor) class = tray; work area = Inspection area; keep the default tracking parameters for now.
- Configure the rule (⑤ 步骤与检测规则 (Steps & detection rules))
- Configure just one step, "Insertion check". For the detection rule, click 组合条件 (Combined condition), combination 全部满足 (All of), combined hold time 500 ms.
- Add 4 conditions, all of type "Inside container":
- Target = red LED, container class = tray, click 在参考图上框 (Draw on reference image): first draw an example tray, then draw where the red LED should be;
- One condition each for yellow LED, resistor and blue LED in the same way, each with its own position.
- For the same tray class in the same operation, the example tray box only needs to be drawn once; the following conditions remember it.
- If there are extra requirements, keep adding them to the combination, for example "Object absent: scrap" with 按整个画面判 (Judge the whole frame) checked (scrap does not belong to any one board).
- Save → submit for review → release. Production starts after the workstation syncs.
Results
| Case | Result |
|---|---|
| All 4 positions correct | Pass, counted as 1 piece |
| A position left empty (missing) | That Inside container condition is not satisfied → fail, reported as "Workpiece x: red LED should be in tray sub-zone…; actual: red LED not detected" |
| A different component inserted (wrong) | The expected component is not at that position → that condition is not satisfied → fail |
| Two components swapped | Neither position has the expected component → both conditions are not satisfied, and both are listed |
What you see on the workstation: each board has a box and a number; green = all 4 positions match, yellow = not matched yet; when a board leaves the Inspection area, the verdict is given and it is counted.
Verify before going live
Use workstation 采集 (Capture) to record a video at the production camera position, with the same camera position, focus and resolution as in production. The video should contain:
- At least 3 minutes of normal flow;
- 3~5 pieces each with missing / wrong / swapped components (note which piece has which error);
- Segments where a hand blocks the boards.
Use this video to check whether numbers get mixed up and whether the verdicts match the manual answers, then tune the tracking parameters.
Current limits
- Extra insertion (two components in one position) is not judged separately.
- It can also be configured as multiple steps (Start / Key check / Finish) that progress by batch; see Use per-piece mode. In that case, draw the Inspection area to hold only one column.
