Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
abhay-iy97 opened this issue Jun 22, 2023 · 0 comments

Comments

@abhay-iy97
Copy link

abhay-iy97 commented Jun 22, 2023

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.

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

No branches or pull requests

1 participant