Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Split Files by QR Code, How?

Hey guys,

I'm trying to find a solution with Google Cloud with Document AI or Vision AI;

I need to split the document into another document whenever I see a QR code.

So the input will be one large document
and output should be like 3 different documents if there is 2 QR codes inside of that one input document.

I couldn't find a straight way to do this. 

Did anyone experienced this before? 

Thank you!

Onur

0 1 114
1 REPLY 1

Hi @onurbolaca,

Welcome to Google Cloud Community!

You're right. There's no direct method to achieve this with Google Cloud Document AI or Vision AI alone. However, by combining their features with some custom code, you can achieve the desired outcome.

Here’s a possible approach:

  1. Detection with Vision AI:
    • Use the Barcode Scanning feature to identify and locate QR codes within your document, providing their coordinates.
  2. Document Processing with Document AI:
    • Use the Processor API to extract text and layout information from the document, revealing its structure and where text and images are located.
  3. Combine Data:
    • Merge the barcode coordinates from Vision AI with the document layout data from Document AI to determine the precise location of each QR code within the document.

Additional options:

  • OCR-based Approach: If you need to split based on other text patterns, use OCR to extract text and implement logic to split based on text patterns or keywords.
  • Custom Vision Models: For more complex needs, consider training a custom Vision AI model to detect specific QR code patterns.

I hope the above information is helpful.