Back to Projects
Internal System
PT. Nihon Seiki Indonesia

Camera-Based NG Detection System

Computer vision quality control system that automatically counts and inspects manufactured parts in real time, flagging defective (NG) lots on the production line.

Python
OpenCV
Tkinter
Computer Vision

Overview

An automated quality inspection system built for PT. Nihon Seiki Indonesia, using a camera and computer vision to count and verify manufactured parts on the production line — replacing manual counting with an instant, camera-based check.

Problem

  • Counting parts by hand for every batch was slow and prone to human error, especially during high-volume shifts.
  • Operators had no fast, objective way to confirm a tray had the exact quantity required before it moved to the next stage.

Solution

  • Instant count: the operator places a tray under the camera and presses one key — the system counts every part in under a second.
  • Clear pass/fail signal: green, yellow, or red status with matching sound cues, so operators don't need to interpret numbers.
  • Visual verification: detected parts are outlined on screen, so operators can immediately see what the system counted.

Operator Flow

flowchart TD
    A[Operator opens the app] --> B[Live camera feed shown]
    B --> C[Place tray of parts under camera]
    C --> D[Press ENTER]
    D --> E{System processes & counts}
    E -->|count == target| F["GOOD (green) + success sound"]
    E -->|count < target| G["NO GOOD (red) + fail sound"]
    E -->|count > target| H["CHECK / CALIBRATE (yellow) + beep"]
    F --> I[Continue to next lot]
    G --> J[Recheck part quantity]
    H --> K[Recheck camera calibration/position]

Vision Processing Pipeline

flowchart TD
    A[Camera captures frame on ENTER] --> B[Save frame as image]
    B --> C[Pre-processing]
    C --> C1[Resize image]
    C --> C2[Gaussian blur]
    C --> C3[Bilateral filter - noise reduction]
    C --> C4[Grayscale conversion]
    C1 & C2 & C3 & C4 --> D[Segmentation & Binarization]
    D --> D1[Binary threshold]
    D --> D2[Invert / Otsu]
    D1 & D2 --> E[Contour Extraction & Filtering]
    E --> E1[Find external contours]
    E --> E2[Filter by contour area to remove noise]
    E1 & E2 --> F[Count valid contours = N]
    F --> G{Decision Logic}
    G -->|N < target| H1["Status: NO GOOD"]
    G -->|N > target| H2["Status: CHECK / CALIBRATE"]
    G -->|N == target| H3["Status: GOOD"]
    H1 & H2 & H3 --> I[Show result modal:<br/>count, status, contour overlay]

Application Showcase

Raw camera capture

The camera's live view of a tray of parts before processing.

Detected & counted result

The same tray after the system has isolated and counted each part against the target quantity.

Key Impact

  • Reduced manual inspection time and human error in part counting.
  • Gave operators instant, consistent pass/fail feedback on every batch.
Screenshots
Camera-Based NG Detection System — screenshot 1
Camera-Based NG Detection System — screenshot 2