Skip to content

Conversation

TamseSaso
Copy link
Collaborator

Purpose

An example of decoding barcodes on conveyor applications

Specification

new folder in object detection

Dependencies & Potential Impact

None

Deployment Plan

not applicable

Testing & Validation

None / not applicable

Copy link
Collaborator

@klemen1999 klemen1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, mainly on the structure

@@ -0,0 +1,106 @@
# Conveyor Application - Barcode Detection

This example demonstrates how to detect and decode barcodes in real-time using computer vision. The application is designed for conveyor belt applications where barcodes need to be detected and decoded from video streams. It uses a [barcode detection model](https://models.luxonis.com/luxonis/barcode-detection/768x576) for detecting barcode regions and combines multiple decoding strategies (pyzbar and zxing-cpp) to ensure robust barcode recognition across various formats and conditions.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## Demo

![Demo](example/barcode_demo.gif)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: The stream is very purpleish. Is this because of GIF compression or camera lens? Can we re-record with more true-to-life colors?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we lower the size of the GIF to be <10Mb (lower is better)? Maybe reduce width and height and use more compresion? Check out https://ezgif.com/ tool for this


**Ubuntu:**
```bash
sudo apt-get update && apt-get install -y python3-pip libglib2.0-0 libgl1-mesa-glx wget git libzbar0 libzbar-dev
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these can be left out IMO like python, git, wget (is this one even needed)? For this specific example I feel like only zbar needs to be installed right? Let's maybe link to some installation guide for the speicfic library that we need
(same comment for macOS)


This will run the example with default arguments.

Open visualizer on browser:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part can be left our, its already printed in the console

import os
from datetime import datetime

from utils.host_crop_config_creator import CropConfigsCreator
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick on the imports structure: Let's first have imports from other packages (e.g. os, time, etc.), then depthai and then imports from utils. Check out other examples for the format
Same comment for imports in other files

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, lets pin thins down to specific versions. For numpy and opencv-python check out other examples, for QR decoding libs let's pin it down at least to major version and for Pillow let's look into removing the dependency

formatter_class=argparse.ArgumentDefaultsHelpFormatter
)

parser.add_argument(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. We don't need to expose --model parameter for this example as it works with one specific model

break

if not barcodes:
inverted = ImageOps.invert(pil_img)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we replace this with some transpose on numpy array?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was generated by LLM (😉) but let's remove some of the comments that are self explanatory and some of the extra newlines as it just adds to the length of the file for now benefit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants