Automated Inspection & Counting System for Oil Cans
This industrial project is developed for BL Agro Industries, an edible oil and food manufacturing company based in Bareilly, India. Founded in the 1950s, BL Agro has grown from an oil trading business to a high-quality edible oil producer.
The system is designed to automatically inspect and count oil cans in a container. Each container should hold six cans. If any cans's caps are missing, the system generates an "NG" (Not Good) signal, otherwise, it is marked as "OK".
- The production lane inspection system captures images of ** A containers carrying 6 oil cans**.
- The image is processed in real time to check for missing cans's caps .
**Input image 1 OK Image **
**Input image 2 NG Image **
- The system uses computer vision (OpenCV) and YOLO object detection techniques to count the total 6 number of cans in each container.
- It classifies the cans's caps as either "Open" (missing) or "Closed" (present).
- Based on the count, the system determines the status:
- "OK" → If **all 6 cans's caps ** are detected.
- "NG (Not Good)" → If any cans's caps are missing.
- The annotated image is encoded to Base64 format for easy transmission.
- A JSON response is generated with:
- Image (Base64)
- Inspection Status (OK/NG)
- Open Count (Missing Cans)
- Closed Count (Detected Cans)
- If the status is "NG", the system triggers an alarm to alert operators.
- The inspection results are displayed on a real-time dashboard over the LCD Display monitor.
# Determine status
status = "Ok" if open_count == 0 or closed_count == 6 else "Not Ok"
# Encode annotated image to base64
_, img_encoded = cv2.imencode('.jpg', frame)
img_base64 = base64.b64encode(img_encoded).decode('utf-8')
# Response data
response_data = {
"image": img_base64,
"status": status,
"open_count": open_count,
"closed_count": closed_count
}
return JSONResponse(content=response_data)- Hardware: Industrial Cameras[ Hikvision ], PLC ,IR Sensor
- Software: OpenCV, FastAPI, Uvicorn





