Search

US-12621566-B2 - Region of interest-based phase detection autofocus control for barcode decoding

US12621566B2US 12621566 B2US12621566 B2US 12621566B2US-12621566-B2

Abstract

A method includes: capturing, via an image sensor of a computing device, a first image in a sequence of images, using a first focus position of the image sensor; detecting a region of interest in the first image, the region of interest containing a barcode; determining, using a phase detection module of the image sensor, a phase difference corresponding to the region of interest; and setting a second focus position at the image sensor based on the phase difference, the second focus position configured for capturing a second image in the sequence via the image sensor, the second image having the barcode in focus.

Inventors

  • Ruth Zhang
  • Dongqing Chen
  • David S. Koch

Assignees

  • ZEBRA TECHNOLOGIES CORPORATION

Dates

Publication Date
20260505
Application Date
20240125

Claims (10)

  1. 1 . A method, comprising: capturing, via an image sensor of a computing device, a first image in a sequence of images, using a first focus position of the image sensor; detecting a first region of interest in the first image, the first region of interest containing a barcode; determining, using a phase detection module of the image sensor, a phase difference corresponding to the first region of interest; and setting a second focus position at the image sensor based on the phase difference, the second focus position configured for capturing a second image in the sequence via the image sensor, the second image having the barcode in focus; wherein the method further comprises: detecting a plurality of regions of interest in the first image, including the first region of interest, containing respective barcodes, determining respective phase differences for each of the regions of interest, and setting the second focus position based on an aggregate of a subset of the phase differences that are separated from each other by less than a threshold number of pixels.
  2. 2 . The method of claim 1 , wherein the phase detection module includes a plurality of phase detection elements corresponding to locations in the image; and wherein determining the phase difference corresponding to the region of interest comprises: determining the phase difference from a subset of the phase detection elements corresponding to locations within the region of interest.
  3. 3 . The method of claim 1 , further comprising: capturing the second image in the sequence using the second focus position; detecting a second region of interest in the second image, the second region of interest substantially matching the first region of interest and containing the barcode; and decoding the barcode from the second region of interest.
  4. 4 . The method of claim 1 , further comprising: setting a third focus position based on a further subset of the phase differences, distinct from the subset, the third focus position configured for capturing a third image in the sequence via the image sensor, the third image having the barcodes corresponding to the third subset in focus.
  5. 5 . The method of claim 1 , further comprising: in response to determining the phase difference, decoding the barcode from the first region of interest when the phase difference is smaller than the threshold.
  6. 6 . A computing device, comprising: an image sensor; and a processor configured to: capture, via the image sensor, a first image in a sequence of images, using a first focus position of the image sensor; detect a first region of interest in the first image, the first region of interest containing a barcode; determine, using a phase detection module of the image sensor, a phase difference corresponding to the region of interest; and set a second focus position at the image sensor based on the phase difference, the second focus position configured for capturing a second image in the sequence via the image sensor, the second image having the barcode in focus; wherein the processor is further configured to: detect a plurality of regions of interest in the first image, including the first region of interest, containing respective barcodes, determine respective phase differences for each of the regions of interest, and set the second focus position based on an aggregate of a subset of the phase differences that are separated from each other by less than a threshold number of pixels.
  7. 7 . The computing device of claim 6 , wherein the phase detection module includes a plurality of phase detection elements corresponding to locations in the image; and wherein the processor is configured to determine the phase difference corresponding to the region of interest by: determining the phase difference from a subset of the phase detection elements corresponding to locations within the region of interest.
  8. 8 . The computing device of claim 6 , wherein the processor is further configured to: capture the second image in the sequence using the second focus position; detect a second region of interest in the second image, the second region of interest substantially matching the first region of interest and containing the barcode; and decode the barcode from the second region of interest.
  9. 9 . The computing device of claim 6 , wherein the processor is further configured to: set a third focus position based on a further subset of the phase differences, distinct from the subset, the third focus position configured for capturing a third image in the sequence via the image sensor, the third image having the barcodes corresponding to the third subset in focus.
  10. 10 . The computing device of claim 6 , wherein the processor is further configured to: in response to determining the phase difference, decode the barcode from the first region of interest when the phase difference is smaller than the threshold.

Description

BACKGROUND An image-based barcode scanner may capture an image depicting multiple barcodes, and attempt to decode each barcode in the image. Under some conditions, however, e.g., dependent on ambient light levels and/or the distance between the scanner and the barcodes, the scanner may fail to decode certain barcodes in the image. BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS The accompanying figures, where like reference numerals refer to identical or functionally similar elements throughout the separate views, together with the detailed description below, are incorporated in and form part of the specification, and serve to further illustrate embodiments of concepts that include the claimed invention and explain various principles and advantages of those embodiments. FIG. 1 is a diagram of a computing device for image-based barcode decoding. FIG. 2 is a diagram illustrating an image including a barcode affected by sub-optimal focus settings. FIG. 3 is a flowchart of a method of region-based phase detection autofocus control for image-based barcode decoding. FIG. 4 is a diagram illustrating an example performance of blocks 305 and 310 of the method of FIG. 2. FIG. 5 is a diagram illustrating an example performance of block 315 of the method of FIG. 2. FIG. 6 is a diagram illustrating another example performance of blocks 330 and 335 of the method of FIG. 2. Skilled artisans will appreciate that elements in the figures are illustrated for simplicity and clarity and have not necessarily been drawn to scale. For example, the dimensions of some of the elements in the figures may be exaggerated relative to other elements to help to improve understanding of embodiments of the present invention. The apparatus and method components have been represented where appropriate by conventional symbols in the drawings, showing only those specific details that are pertinent to understanding the embodiments of the present invention so as not to obscure the disclosure with details that will be readily apparent to those of ordinary skill in the art having the benefit of the description herein. DETAILED DESCRIPTION Examples disclosed herein are directed to a method, comprising: capturing, via an image sensor of a computing device, a first image in a sequence of images, using a first focus position of the image sensor; detecting a region of interest in the first image, the region of interest containing a barcode; determining, using a phase detection module of the image sensor, a phase difference corresponding to the region of interest; and setting a second focus position at the image sensor based on the phase difference, the second focus position configured for capturing a second image in the sequence via the image sensor, the second image having the barcode in focus. Additional examples disclosed herein are directed to a computing device, comprising: an image sensor; and a processor configured to: capture, via the image sensor, a first image in a sequence of images, using a first focus position of the image sensor; detect a region of interest in the first image, the region of interest containing a barcode; determine, using a phase detection module of the image sensor, a phase difference corresponding to the region of interest; and set a second focus position at the image sensor based on the phase difference, the second focus position configured for capturing a second image in the sequence via the image sensor, the second image having the barcode in focus. FIG. 1 illustrates a computing device 100, such as a mobile computer, a smart phone, a barcode scanner, an imaging device mounted on a chassis of an autonomous or semi-autonomous apparatus, or the like. The device 100 includes a housing supporting various components of the device 100, discussed below. The device 100 can be operated to capture images, and is configured to detect barcodes within such images and to decode the detected barcodes. In the discussion below, the term “barcode” includes symbols using one-dimensional symbologies that encode data in linear arrays (e.g., UPC-A, Code 128, and the like), as well as symbols with two-dimensional symbologies (e.g., Data Matrix, QR Code, DotCode, and the like). In further embodiments, the mechanisms described below can be implemented to detect and decode other forms of machine-readable information, such text (e.g., to implement an optical character recognition process or the like). For example, the device 100 can be operated to capture an image representing a region 104 of a shelf or other support structure 108 that supports one or more barcodes 112 (illustrated as grey boxes in FIG. 1). In the illustrated example, the support structure 108 includes shelves, and the barcodes 112 are disposed on shelf edges, e.g., facing into an aisle of a facility in which the device 100 is deployed. A wide variety of other objects, or collections of objects, can carry the barcodes 112 in other examples. For example, the barcodes 112 ca