Skip to content

Detects multiple barcodes but displays only the latest decoded barcode value in image #32

@abhay-iy97

Description

@abhay-iy97

Describe the bug
DaisyKit is able to detect multiple barcodes and create bounding boxes for them in the image but displays only the latest decoded barcode in the top left part of the image. I'm using DaisyKit 0.3.0.5. Is this expected behavior?

To Reproduce
Steps to reproduce the behavior:

  1. Use any image with multiple barcodes and pass it through
result = barcode_scanner_flow.Process(cv_image, draw=True)

On printing results, multiple decoded barcode values are present but don't see them on the image created

Expected behavior
Should be able to display all the decoded barcode values in the newly created image along with their bounding boxes in the image

Desktop (please complete the following information):

  • OS: MacOS Ventura 13.4 (M2 MacBook Air)

Additional context
I had a look at barcode_scanner_flow.cpp (here), this looks like it hardcodes the point(10,40) where the decoded barcode must be displayed in the image. My guess is that it gets overwritten in every loop of

  for (auto&& result : results) {
    if (!result.isValid()) continue;

    if (draw) {
      DrawRect(rgb, result.position());
      visualizers::BaseVisualizer::PutText(
          rgb, ZXing::TextUtfEncoding::ToUtf8(result.text(), angle_escape),
          cv::Point(10, 40), cv::FONT_HERSHEY_SIMPLEX, 0.5, 1, 10,
          cv::Scalar(0, 0, 0), cv::Scalar(0, 255, 0));
    }

therefore only displaying the latest decoded barcode value - that could be the reason but I'm sure you might have a better idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions