WO2022007495A1 - 用于识别条形码的方法和终端 - Google Patents

用于识别条形码的方法和终端 Download PDF

Info

Publication number
WO2022007495A1
WO2022007495A1 PCT/CN2021/092575 CN2021092575W WO2022007495A1 WO 2022007495 A1 WO2022007495 A1 WO 2022007495A1 CN 2021092575 W CN2021092575 W CN 2021092575W WO 2022007495 A1 WO2022007495 A1 WO 2022007495A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
area
calibration
information code
preset
Prior art date
Application number
PCT/CN2021/092575
Other languages
English (en)
French (fr)
Inventor
虞海明
席志强
陈小楠
Original Assignee
北京京东振世信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京京东振世信息技术有限公司 filed Critical 北京京东振世信息技术有限公司
Priority to US18/013,822 priority Critical patent/US20230297795A1/en
Priority to EP21837074.0A priority patent/EP4148617A4/en
Publication of WO2022007495A1 publication Critical patent/WO2022007495A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14131D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10544Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation by scanning of the records by radiation in the optical part of the electromagnetic spectrum
    • G06K7/10792Special measures in relation to the object to be scanned
    • G06K7/10801Multidistance reading
    • G06K7/10811Focalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1443Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps

Definitions

  • the embodiments of the present disclosure relate to the field of computer technology, in particular to the field of information recognition technology, and in particular, to a method and a terminal for recognizing barcodes.
  • Barcodes are often used as the unique identification of goods in logistics distribution, or when managing goods in warehouses and supermarkets.
  • Logistics companies, warehouses, and supermarkets need to be equipped with equipment such as barcode scanners or sales terminals (POS machines) to scan and identify the barcodes of goods.
  • POS machines sales terminals
  • code scanning guns or sales terminals need to be purchased additionally, it will increase the operating costs of merchants.
  • Mobile terminals with camera terminals that are widely used in applications such as mobile phones or tablet computers have become a substitute for code scanning guns or sales terminals to scan and identify Alternative to barcodes.
  • the present disclosure provides a method, terminal, electronic device, and computer-readable storage medium for identifying a barcode.
  • a method for identifying a barcode wherein the barcode includes a calibration area and an information code area
  • the method includes: acquiring an image of the barcode, and identifying, according to the calibration information of the preset calibration area, The position of the calibration area in the image; according to the position of the calibration area in the image and the preset positional relationship between the calibration area and the information code area in the image, identify the position of the information code area in the image; Read the information at the location to obtain the information of the information code area.
  • acquiring the image of the barcode, and identifying the position of the calibration area in the image according to the calibration information of the preset calibration area includes: acquiring a predetermined optimal focus time; acquiring the image of the barcode, and at the most The position of the calibration area in the image is identified according to the calibration information of the preset calibration area within the best focus time.
  • the calibration area includes a pre-calibration area and a post-calibration area
  • the information code area is located between the pre-calibration area and the post-calibration area.
  • performing information reading on the position of the information code area in the image to obtain the information of the information code area includes: focusing on the position of the information code area in the image, and collecting image information of the information code area; The image information in the information code area is binarized to obtain the information of the information code area.
  • focusing on the position of the information code area in the image includes: according to the preset length of the front calibration area, the preset length of the rear calibration area, the preset interval width between the front calibration area and the information code area, The preset interval width between the post-calibration area and the information code area determines the length of the information code area; 1/2 of the length of the information code area is selected as the focus width; the focus width is used to focus the position of the information code area in the image.
  • the difference between the width of a single black striped area in the calibration area and the width of a single black striped area in the information code area is greater than a preset width difference.
  • a terminal for recognizing a barcode wherein the barcode includes a calibration area and an information code area, the terminal includes: an image capture device, a processor, and a display, and the image capture device is configured to acquire The image of the barcode, and the image of the barcode is sent to the processor; the processor is configured to receive the image of the barcode, identify the position of the calibration area in the image according to the calibration information of the preset calibration area, and according to the calibration area in the image.
  • the position and the preset positional relationship between the calibration area and the information code area in the image identify the position of the information code area in the image, and determine the focus information used to control the focus position of the image acquisition device according to the position of the information code area in the image,
  • the focus information is sent to the image acquisition device; the image acquisition device performs image acquisition according to the focus information, obtains the image of the information code area, and sends the image of the information code area to the processor; the processor receives the image of the information code area, according to the information
  • the image of the code area recognizes the information of the information code area, and sends the information of the information code area to the display; the display is configured to receive and display the information of the information code area.
  • the processor includes: a timing module configured to obtain a predetermined best focus time; a position identification module configured to perform a preset calibration within the best focus time based on the image of the barcode The calibration information for the region identifies the location of the calibration region in the image.
  • the calibration area includes a pre-calibration area and a post-calibration area
  • the information code area is located between the pre-calibration area and the post-calibration area.
  • the processor includes a focusing module configured to determine a focusing parameter according to the position of the information code area in the image, and send the focusing parameter to the image acquisition device so that the image acquisition device collects the information code area according to the focusing parameter
  • the processing module is configured to receive the image of the information code area collected by the image acquisition device, and perform binarization processing on the image information of the information code area to obtain the information of the information code area.
  • the focusing module includes: a determining module configured to determine the length of the pre-calibration area, the preset length of the post-calibration area, the predetermined interval width between the pre-calibration area and the information code area, and the post-calibration area and the preset interval width of the information code area determines the length of the information code area; the selection module is configured to select 1/2 of the length of the information code area as the focus width, and send the focus width to the image acquisition device; the image acquisition device includes : a focusing sub-module, configured to receive and focus on the position of the information code region in the image based on the focusing width.
  • the difference between the width of a single black striped area in the calibration area and the width of a single black striped area in the information code area is greater than a preset width difference.
  • the display is further configured to receive and display an image of the area of the information code.
  • an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage terminal for storing one or more programs, when the one or more programs are stored by one or more A plurality of processors execute such that the one or more processors implement the method for recognizing a barcode as provided by the first aspect.
  • an embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored, wherein, when the program is executed by a processor, the method for recognizing a barcode provided in the first aspect is implemented .
  • the method and terminal for identifying a barcode provided by the present disclosure first identify the calibration area through preset information, and then perform focus identification on the information code area according to the positional relationship between the calibration area and the information code area, which can improve the efficiency and accuracy of identifying barcode information. sex.
  • the technology according to the present application solves the problem of low efficiency when using a mobile terminal with a camera terminal, such as a mobile phone or a tablet computer, to identify barcodes.
  • FIG. 1 is an exemplary system architecture diagram to which embodiments of the present application may be applied;
  • Figure 2 is a flowchart of one embodiment of a method for identifying a barcode according to the present application
  • FIG. 3 is a flowchart of another embodiment of a method for identifying a barcode according to the present application.
  • FIG. 4 is a schematic diagram of a barcode in another embodiment of the method for identifying a barcode according to the present application.
  • FIG. 5 is a schematic structural diagram of an embodiment of a terminal for identifying barcodes according to the present application.
  • FIG. 6 is a schematic structural diagram of another embodiment of a terminal for identifying barcodes according to the present application.
  • FIG. 7 is a block diagram of an electronic device used to implement the method for recognizing a barcode according to an embodiment of the present application.
  • FIG. 1 illustrates an exemplary system architecture 100 to which embodiments of the method for recognizing barcodes or the terminal for recognizing barcodes of the present application may be applied.
  • the system architecture 100 may include terminal devices 101 , 102 , and 103 , a network 104 and a server 105 .
  • the network 104 is a medium used to provide a communication link between the terminal devices 101 , 102 , 103 and the server 105 .
  • the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
  • the user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages and the like.
  • Various client applications may be installed on the terminal devices 101 , 102 and 103 , such as an image scanning application, a pattern recognition application, an information processing application, and the like.
  • the terminal devices 101 , 102 , and 103 may be various electronic devices that have a display screen and a camera device and support receiving server messages, including but not limited to smart phones, tablet computers, barcode scanners, and the like.
  • the terminal devices 101 , 102 , and 103 can acquire barcode images by using the cameras on them, and perform image processing and image recognition on the barcode images by using a local data processing program to obtain barcode information.
  • the terminal devices 101, 102, and 103 may be hardware or software.
  • the terminal devices 101, 102, 103 are hardware, they can be various electronic devices, and when the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (eg, multiple software modules for providing distributed services), or as a single software or software module. There is no specific limitation here.
  • the server 105 may be a server that provides background services for applications running on the terminal devices 101 , 102 , and 103 , or a server that provides support for image scanning applications or image recognition applications running on the terminal devices 101 , 102 , and 103 .
  • the server 105 can obtain barcode images from the terminal devices 101 , 102 , and 103 , process the barcode images with an image processing program, identify barcode information, and return the processed barcode information to the terminal devices 101 , 102 , and 103 .
  • the methods for identifying barcodes provided by the embodiments of the present disclosure are generally performed by terminal devices 101 , 102 , and 103 , and correspondingly, the terminals for identifying barcodes are generally terminal devices 101 , 102 , and 103 .
  • terminal devices, networks and servers in FIG. 1 are merely illustrative. There can be any number of terminal devices, networks and servers according to implementation needs.
  • a method for identifying a barcode wherein the barcode includes a calibration area and an information code area, and the method includes the following steps:
  • Step 201 Acquire an image of the barcode, and identify the position of the calibration area in the image according to preset calibration information of the calibration area.
  • the barcode includes a calibration area and an information code area.
  • the calibration area is an encoding pattern formed according to a preset encoding rule, and the calibration area is used to assist in locating the position of the information code area in the image.
  • the information code area is an encoded pattern that contains the information to be identified by the barcode.
  • the execution body of the method for identifying barcodes can collect images with barcodes through the camera on it, and identify the calibration area in the image according to the information of the preset calibration area. s position.
  • the information of the preset calibration area can be a bar code pattern with high contrast or other features such as graphics and colors that are easy to be distinguished by the machine.
  • the order of black and white color blocks in the bar code is: Black, black, black, white, black, black, so that the camera device can quickly capture the code pattern and start to identify and locate, avoiding the camera device to scan and read the barcode image in a large area and waste identification time.
  • a predetermined optimal focus time is obtained first, then an image of the barcode is obtained, and the position of the calibration area in the image is identified according to the calibration information of the preset calibration area within the optimal focus time.
  • the optimal focusing time can be determined empirically, or the optimal focusing time can be determined through multiple experiments. Then, an image of the barcode is acquired, and according to the calibration information of the preset calibration area, the position of the calibration area in the image is identified within the optimal focusing time, and the identification is stopped when the optimal focusing time is exceeded.
  • the terminal device when the terminal device is used for the first time, the terminal device is restarted, or the terminal device needs to be calibrated, when the position of the calibration area in the image is identified by using the preset identification time t, the following second operation is iteratively performed: update the preset identification time t.
  • the identification time t is the second optimal focusing time, wherein ⁇ 2 is the second preset time length.
  • ⁇ 2 is the second preset time length.
  • an iterative method is used to gradually find the optimal focusing time when the terminal device is used for the first time, restarted, or calibrated, and the optimal focusing time is applied in subsequent scanning and recognition, which can improve the barcode recognition efficiency and ensure the barcode recognition accuracy. accuracy.
  • Step 202 Identify the position of the information code area in the image according to the position of the calibration area in the image and the preset positional relationship between the calibration area and the information code area in the image.
  • the position of the information code area in the image is determined according to the position of the calibration area in the image and the preset positional relationship between the calibration area and the information code area in the image.
  • the preset positional relationship between the calibration area and the information code area in the image can be the azimuth relationship between the calibration area and the information code area in the image, for example, the information code area is located above, below, to the left, to the right, or diagonally to the calibration area Angular direction;
  • the preset positional relationship between the calibration area and the information code area in the image can be the distance relationship between the calibration area and the information code area in the image, for example, the information code area is located within 3 pixels of the calibration area, and the information code area is located in the calibration area. Within 1 cm of the area, the information code area starts 1 cm to the right of the calibration area, etc.
  • Step 203 Read the information for the position of the information code area in the image, and obtain the information of the information code area.
  • the method for identifying a barcode provided in this embodiment first identifies the calibration area through preset information, and then performs focus identification on the information code area according to the positional relationship between the calibration area and the information code area, which can improve the efficiency and accuracy of identifying barcode information .
  • FIG. 3 it shows a flow 300 of another embodiment of the method for recognizing barcodes, wherein, for the schematic diagram of barcodes in this embodiment, referring to FIG. 4 , the calibration area includes a front calibration area 401 and a rear calibration area 402 , The information code area 403 is located between the front calibration area 401 and the rear calibration area 402, and the method includes the following steps:
  • Step 301 Acquire an image of the barcode, and identify the positions of the pre-calibration area and the post-calibration area in the image according to preset calibration information of the pre-calibration area and calibration information of the post-calibration area.
  • the image of the barcode is first acquired, and then according to the preset calibration information of the pre-calibration area and the post-calibration area, the positions of the information of the pre-calibration area and the information of the post-calibration area in the image are determined, and the pre-calibration area is further determined.
  • the positions of the information of the calibration area and the information of the post-calibration area in the image are the positions of the pre-calibration area and the post-calibration area in the image.
  • the pre-calibration area is an encoding pattern formed according to a preset encoding rule and is placed in front of the information code area
  • the post-calibration area is an encoding pattern formed according to a preset encoding rule and placed behind the information code area.
  • Step 302 Identify the position of the information code area in the image according to the position of the calibration area in the image and the preset positional relationship between the calibration area and the information code area in the image.
  • the middle part of the position of the pre-calibration area in the image and the position of the post-calibration area in the image is determined as the position of the information code area in the image.
  • Step 303 Read the information for the position of the information code area in the image, and obtain the information of the information code area.
  • the information reading is performed for the position of the information code area in the image, and the information of the information code area is obtained, including: for the information code area in the image Focus on the position in the information code area, and collect the image information of the information code area; perform binarization processing on the image information of the information code area to obtain the information of the information code area.
  • the position of the information code area in the image can be focused, the image of the information code area is collected, and the image is binarized to make the image appear black and white, and then the barcode recognition algorithm (for example, the Code128 recognition algorithm) processes the image of the information code area after binarization to obtain the information of the image of the information code area, that is, the information of the barcode.
  • the barcode recognition algorithm For example, the Code128 recognition algorithm
  • the information code area is easier to locate when scanning the barcode
  • the focused identification of the information code area can further improve the recognition efficiency of barcode recognition using terminal devices such as mobile phones or tablet computers.
  • focusing on the position of the information code area in the image includes: according to the front calibration area.
  • the preset length of the post-calibration area, the preset length of the post-calibration area, the preset interval width between the pre-calibration area and the information code area, and the preset interval width between the post-calibration area and the information code area determine the length of the information code area; 1/2 of the length is used as the focus width; use the focus width to focus on the position of the information code area in the image.
  • the preset length of the pre-calibration area, the preset length of the post-calibration area, and the pre-set interval between the pre-calibration area and the information code area may be determined first.
  • the width, the preset interval width of the post-calibration area and the information code area determine the length of the information code area, and then select 1/2 of the length of the information code area as the focus width, and then use the focus width to determine the position of the information code area in the image. to focus.
  • the length of the information code area can be accurately calculated, and 1/2 of the length of the information code area is used as the focus width to perform focus identification on the information code area, which can improve the focusing efficiency and thus the identification efficiency.
  • the difference between the width of a single black striped area in the calibration area and the width of a single black striped area in the information code area is greater than a preset width difference .
  • the width of a single black striped area in the calibration area is wider than the width of a single black striped area in the information code area, and the width of the single black striped area and the width of a single black striped area in the information code area are The difference is larger than the preset width difference.
  • the width of the single black strip area in the preset calibration area is wider than the width of the single black strip area in the information code area, which enables the camera to locate the calibration area faster and more accurately, thereby improving the efficiency of barcode recognition.
  • the method for identifying a barcode provided in this embodiment first identifies the calibration area through preset information, and then performs focus identification on the information code area according to the positional relationship between the calibration area and the information code area, which can improve the efficiency and accuracy of identifying barcode information .
  • the present disclosure provides an embodiment of a terminal for recognizing barcodes.
  • the terminal embodiment corresponds to the method embodiment shown in FIG. 2 .
  • the terminal can be applied to various electronic devices.
  • the terminal 500 for identifying a barcode in this embodiment wherein the barcode includes a calibration area and an information code area
  • the terminal 500 includes: an image acquisition device 501 , a processor 502 , and a display 503 .
  • the image acquisition device 501 is configured to acquire the image of the barcode and send the image of the barcode to the processor; the processor 502 is configured to receive the image of the barcode, and identify the calibration area according to the calibration information of the preset calibration area The position in the image, according to the position of the calibration area in the image and the preset positional relationship between the calibration area and the information code area in the image, identify the position of the information code area in the image, and determine according to the position of the information code area in the image Focus information used to control the focus position of the image capture device, and send the focus information to the image capture device 501; the image capture device 501 performs image capture according to the focus information, acquires the image of the information code area, and sends the image of the information code area to the processor 502; the processor 502 receives the image of the information code area, identifies the information of the information code area according to the image of the information code area, and sends the information of the information code area to the display 503; the display 503 is configured to receive and display the information code
  • the barcode includes a calibration area and an information code area.
  • the calibration area is an encoding pattern formed according to a preset encoding rule, and the calibration area is used to assist in locating the position of the information code area in the image.
  • the information code area is an encoded pattern that contains the information to be identified by the barcode.
  • the terminal 500 can collect the image with the barcode through the image collection device 501, and send the image of the information code area to the processor 502, and the processor 502 receives the image of the information code area, according to the position of the calibration area in the image, and the calibration area.
  • the position of the information code area in the image is determined according to the preset positional relationship of the information code area in the image.
  • the processor 502 determines the focus information used to control the focus position of the image acquisition device according to the position of the information code area in the image, and sends the focus information to the image acquisition device 501. After the image acquisition device 501 receives the focus information, according to the focus information Adjust the device focusing parameters of the image acquisition device, and use the adjusted image acquisition device to perform image acquisition to obtain an image of the information code area, and send the collected image of the information code area to the processor 502, and the processor 502 receives After the image of the information code area is displayed, the information of the information code area is recognized according to the image of the information code area, and the information of the information code area is sent to the display 503 . The display 503 receives the information in the information code area and displays the information.
  • the processor 502 includes: a timing module configured to obtain a predetermined optimal focus time; a position identification module configured to obtain a predetermined optimal focus time according to an image of the barcode according to a preset time
  • the calibration information for the calibration area identifies the location of the calibration area in the image.
  • the timing module in the processor 502 may receive the optimal focusing time determined and input by the terminal user according to experience. Then, the processor 502 identifies the position of the calibration area in the image within the optimal focusing time based on the image of the barcode acquired by the image acquisition device 501 and according to the preset calibration information of the calibration area. Stop identifying. The position recognition module in the processor 502 determines the position of the information code area in the image according to the position of the calibration area in the image and the preset positional relationship between the calibration area and the information code area in the image.
  • the preset recognition time t updated in the operation is the optimal focusing time; wherein t2 is the actual recognition time, and ⁇ 2 is the second preset time length.
  • the calibration area includes a pre-calibration area and a post-calibration area
  • the information code area is located between the pre-calibration area and the post-calibration area.
  • the processor 502 includes a focusing module configured to determine a focusing parameter according to the position of the information code area in the image, and send the focusing parameter to the image acquisition device, so that the image acquisition device collects the information code according to the focusing parameter The image of the area; the processing module is configured to receive the image of the information code area collected by the image acquisition device, and perform binarization processing on the image information of the information code area to obtain the information of the information code area.
  • the focus module in the processor 502 determines the focus parameter according to the position of the information code area in the image, and sends the focus parameter to the image acquisition device, so that the image acquisition device adjusts its hardware parameters according to the focus parameter, and Use the adjusted image capture device to capture the image of the information code area.
  • the processing module in the processor 502 receives the image of the information code area collected by the image acquisition device 501, the image is binarized to make the image appear black and white, and then a barcode recognition algorithm (such as the Code128 recognition algorithm) is used. ) process the image of the information code area after the binarization process to obtain the information of the image of the information code area, that is, the information of the barcode.
  • a barcode recognition algorithm such as the Code128 recognition algorithm
  • the focusing module includes: a determining module configured to determine the length of the front calibration area, the preset length of the rear calibration area, the predetermined interval width between the front calibration area and the information code area, the rear calibration area and the The preset interval width of the information code area determines the length of the information code area; the selection module is configured to select 1/2 of the length of the information code area as the focus width, and send the focus width to the image capture device; the image capture device 501 includes The focusing sub-module is configured to receive and focus on the position of the information code region in the image based on the focusing width.
  • the focusing module in the processor 502 includes a determination module and a selection module.
  • the determining module may first determine the information code area according to the preset length of the pre-calibration area, the preset length of the post-calibration area, the preset interval width between the pre-calibration area and the information code area, and the preset interval width between the post-calibration area and the information code area and send the determined length of the information code area to the selection module.
  • the selection module selects 1/2 of the length of the information code area as the focus width, and sends the focus width to the image acquisition device 501, and the focus sub-module in the image acquisition device 501 receives and based on the focus width the information code area in the image. position to focus.
  • the difference between the width of a single black striped area in the calibration area and the width of a single black striped area in the information code area is greater than a preset width difference.
  • the display 503 is further configured to receive and display an image of the information code area.
  • the display 503 can also receive the image of the information code area, and display the image of the information code area.
  • Each unit in the above-mentioned terminal 500 corresponds to the steps in the method described with reference to FIG. 2 and FIG. 3 . Therefore, the above technical effects that can be achieved by the method for recognizing barcodes are also applicable to the terminal 500 and the devices contained therein, and details are not described herein again.
  • the present disclosure provides another embodiment of a terminal for recognizing barcodes.
  • the terminal 600 for recognizing barcodes in this embodiment may be a smart phone with an image acquisition device 601 , a processor 602 , and a display device 603 , the terminal 600 acquires an image of the barcode through the image acquisition device 601 , and Identify the position of the calibration area in the image according to the calibration information of the preset calibration area; identify the information code by the processor 602 according to the position of the calibration area in the image and the preset positional relationship between the calibration area and the information code area in the image The position of the area in the image is read, and information is read according to the position of the information code area in the image, the information of the information code area is acquired, and the information is displayed on the display device 603 .
  • the present application further provides an electronic device and a readable storage medium.
  • the electronic device includes at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to The methods described in FIGS. 2 to 3 can be performed.
  • FIG. 7 it is a block diagram of an electronic device 700 for a method for recognizing a barcode according to an embodiment of the present application.
  • Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
  • Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are by way of example only, and are not intended to limit implementations of the application described and/or claimed herein.
  • the electronic device includes: one or more processors 701 , a memory 702 , and interfaces for connecting various components, including a high-speed interface and a low-speed interface.
  • the various components are interconnected using different buses and may be mounted on a common motherboard or otherwise as desired.
  • the processor may process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface.
  • multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired.
  • multiple electronic devices may be connected, each providing some of the necessary operations (eg, as a server array, a group of blade servers, or a multiprocessor system).
  • a processor 701 is taken as an example in FIG. 7 .
  • the memory 702 is the non-transitory computer-readable storage medium provided by the present application.
  • the memory stores instructions executable by at least one processor, so that the at least one processor executes the method for identifying a barcode provided by the present application.
  • the non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to perform the method for recognizing a barcode provided by the present application.
  • the memory 702 can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, such as program instructions/modules ( For example, the image acquisition device 501, the processor 502, and the display 503 shown in FIG. 5).
  • the processor 701 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 702, ie, implements the method for recognizing barcodes in the above method embodiments.
  • the memory 702 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the electronic device for recognizing barcodes Wait. Additionally, memory 702 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 702 may optionally include memory located remotely from processor 701 that may be connected via a network to an electronic device for recognizing barcodes. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the electronic device for the method of recognizing the barcode may further include: an input device 703 , an output device 704 and a bus 705 .
  • the processor 701 , the memory 702 , the input device 703 and the output device 704 may be connected through a bus 705 or other means, and the connection through the bus 705 is taken as an example in FIG. 7 .
  • the input device 703 can receive input numerical or character information, and generate key signal input related to user settings and function control of electronic equipment for recognizing barcodes, such as touch screen, keypad, mouse, trackpad, touchpad, pointing stick , one or more mouse buttons, trackballs, joysticks and other input devices.
  • Output devices 704 may include display devices, auxiliary lighting devices (eg, LEDs), haptic feedback devices (eg, vibration motors), and the like.
  • the display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
  • Various implementations of the systems and techniques described herein can be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor that The processor, which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
  • the processor which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
  • machine-readable medium and “computer-readable medium” refer to any computer program product, apparatus, and/or apparatus for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLDs), including machine-readable media that receive machine instructions as machine-readable signals.
  • machine-readable signal refers to any signal used to provide machine instructions and/or data to a programmable processor.
  • the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or trackball) through which a user can provide input to the computer.
  • a display device eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor
  • a keyboard and pointing device eg, a mouse or trackball
  • Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (eg, visual feedback, auditory feedback, or tactile feedback); and can be in any form (including acoustic input, voice input, or tactile input) to receive input from the user.
  • the systems and techniques described herein may be implemented on a computing system that includes back-end components (eg, as a data server), or a computing system that includes middleware components (eg, an application server), or a computing system that includes front-end components (eg, a user's computer having a graphical user interface or web browser through which a user may interact with implementations of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system.
  • the components of the system may be interconnected by any form or medium of digital data communication (eg, a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
  • a computer system can include clients and servers.
  • Clients and servers are generally remote from each other and usually interact through a communication network.
  • the relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Electromagnetism (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Studio Devices (AREA)

Abstract

本申请公开了用于识别条形码的方法和终端,涉及信息识别领域。该方法包括:获取条形码的图像,根据预设的校准区域的校准信息,识别校准区域在图像中的位置;根据校准区域在图像中的位置以及校准区域与信息码区域在图像中的预设位置关系,识别信息码区域在图像中的位置;针对信息码区域在图像中的位置进行信息读取,获取信息码区域的信息。采用本方法可以提高识别条形码的效率。

Description

用于识别条形码的方法和终端
本专利申请要求于2020年07月08日提交的、申请号为202010651446.6、发明名称为“用于识别条形码的方法和终端”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。
技术领域
本公开的实施例涉及计算机技术领域,具体涉及信息识别技术领域,尤其涉及用于识别条形码的方法和终端。
背景技术
在物流配送、或者仓库、超市管理货物时往往使用条形码作为货物唯一标识,物流公司或者仓库、超市需要配备如扫码枪或者销售终端(POS机)等设备用于扫描并识别货物的条形码。但是,由于扫码枪或者销售终端需要额外购置,会增加商家的运营成本,手机或平板电脑等应用普及度较高的带有摄像终端的移动终端成为了代替扫码枪或者销售终端扫描并识别条形码的替代品。
然而,使用手机或平板电脑等移动终端扫描并识别条形码时,存在识别效率低的问题。
发明内容
本公开提供了一种用于识别条形码的方法、终端、电子设备以及计算机可读存储介质。
根据本公开的第一方面,提供了一种用于识别条形码的方法,其中,条形码包括校准区域、信息码区域,该方法包括:获取条形码的图像,根据预设的校准区域的校准信息,识别校准区域在图像中的位置;根据校准区域在图像中的位置以及校准区域与信息码区域在图像中的预设位置关系,识别信息码区域在图像中的位置;针对信息码区域在图像中的位置进 行信息读取,获取信息码区域的信息。
在一些实施例中,获取所述条形码的图像,根据预设的校准区域的校准信息,识别校准区域在图像中的位置,包括:获取预先确定的最佳聚焦时间;获取条形码的图像,在最佳聚焦时间内根据预设的校准区域的校准信息识别校准区域在图像中的位置。
在一些实施例中,最佳聚焦时间按照如下方式确定:当在预设识别时间t内未识别出校准区域在图像中的位置时,迭代执行第一操作:更新预设识别时间为t=t+Δ1,以及在更新后的预设识别时间t内识别所述校准区域在所述图像中的位置;响应于在更新后的预设识别时间t内识别出校准区域在图像中的位置,停止执行第一操作,并确定在最后一次第一操作中更新的预设识别时间t为第一最佳聚焦时间;其中Δ1为第一预设时长;或:当在预设识别时间t内能识别出校准区域在图像中的位置时,迭代执行第二操作:更新预设识别时间为t=t-Δ2,以及在更新后的预设识别时间内识别所述校准区域在所述图像中的位置;响应于在更新后的预设识别时间t内未能识别出校准区域在图像中的位置,停止执行第二操作,并确定在倒数第二次第二操作中更新的预设识别时间t为第二最佳聚焦时间;其中Δ2为第二预设时长。
在一些实施例中,校准区域包括前校准区域、后校准区域,信息码区域位于前校准区域和后校准区域之间。
在一些实施例中,针对信息码区域在图像中的位置进行信息读取,获取信息码区域的信息,包括:针对信息码区域在图像中的位置进行聚焦,采集信息码区域的图像信息;对信息码区域的图像信息进行二值化处理,得到信息码区域的信息。
在一些实施例中,针对信息码区域在图像中的位置进行聚焦,包括:根据前校准区域的预设长度、后校准区域的预设长度、前校准区域与信息码区域的预设间隔宽度、后校准区域与信息码区域的预设间隔宽度确定信息码区域的长度;选取信息码区域的长度的1/2作为聚焦宽度;利用聚焦宽度对信息码区域在图像中的位置进行聚焦。
在一些实施例中,校准区域的单个黑色条状区域的宽度与信息码区域单个黑色条状区域的宽度之差大于预设的宽度差。
根据本公开的第二方面,提供了一种用于识别条形码的终端,其中,条形码包括校准区域、信息码区域,该终端包括:图像采集设备、处理器、显示器,图像采集设备被配置为获取条形码的图像,并将条形码的图像发送至处理器;处理器被配置为接收条形码的图像,根据预设的校准区域的校准信息,识别校准区域在图像中的位置,根据校准区域在图像中的位置以及校准区域与信息码区域在图像中的预设位置关系,识别信息码区域在图像中的位置,根据信息码区域在图像中的位置确定用于控制图像采集设备的聚焦位置的聚焦信息,并将聚焦信息发送至图像采集设备;图像采集设备根据聚焦信息进行图像采集,获取信息码区域的图像,并将信息码区域的图像发送至处理器;处理器接收信息码区域的图像,根据信息码区域的图像识别信息码区域的信息,并将信息码区域的信息发送至显示器;显示器被配置为接收并显示信息码区域的信息。
在一些实施例中,处理器,包括:选时模块,被配置为获取预先确定的最佳聚焦时间;位置识别模块,被配置为根据条形码的图像,在最佳聚焦时间内根据预设的校准区域的校准信息识别校准区域在图像中的位置。
在一些实施例中,最佳聚焦时间按照如下方式确定:当在预设识别时间t内未识别出校准区域在图像中的位置时,迭代执行第一操作:更新预设识别时间为t=t+Δ1,并控制图像采集设备对校准区域在图像中的位置进行区域图像采集;响应于处理器在更新后的预设识别时间t内根据图像采集设备采集的区域图像识别出校准区域在图像中的位置,停止执行第一操作,并确定在最后一次第一操作中更新的预设识别时间t为最佳聚焦时间;其中Δ1为第一预设时长;当在预设识别时间t内能识别出校准区域在图像中的位置时,迭代执行第二操作:更新预设识别时间为t=t-Δ2,并控制图像采集设备对校准区域在图像中的位置进行区域图像采集;响应于处理器在更新后的预设识别时间t内未根据图像采集设备采集的区域图像识别出校准区域在图像中的位置,停止执行第二操作,并确定在倒数第二次第二操作中更新的预设识别时间t为最佳聚焦时间;其中Δ2为第二预设时长。
在一些实施例中,校准区域包括前校准区域、后校准区域,信息码区域位于前校准区域和后校准区域之间。
在一些实施例中,处理器包括:聚焦模块,被配置为根据信息码区域在图像中的位置确定聚焦参数,并将聚焦参数发送至图像采集设备以使图像采集设备根据聚焦参数采集信息码区域的图像;处理模块,被配置为为接收图像采集设备采集的信息码区域的图像,并对信息码区域的图像信息进行二值化处理,得到信息码区域的信息。
在一些实施例中,聚焦模块,包括:确定模块,被配置为根据前校准区域的预设长度、后校准区域的预设长度、前校准区域与信息码区域的预设间隔宽度、后校准区域与信息码区域的预设间隔宽度确定信息码区域的长度;选取模块,被配置为选取信息码区域的长度的1/2作为聚焦宽度,并将聚焦宽度发送至图像采集设备;图像采集设备包括:聚焦子模块,被配置为接收并基于聚焦宽度对信息码区域在图像中的位置进行聚焦。
在一些实施例中,校准区域的单个黑色条状区域的宽度与信息码区域单个黑色条状区域的宽度之差大于预设的宽度差。
在一些实施例中,显示器还被配置为接收并显示信息码区域的图像。
根据本公开的第三方面,本公开的实施例提供了一种电子设备,包括:一个或多个处理器:存储终端,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面提供的用于识别条形码的方法。
根据本公开的第四方面,本公开的实施例提供了一种计算机可读存储介质,其上存储有计算机程序,其中,程序被处理器执行时实现第一方面提供的用于识别条形码的方法。
本公开提供的用于识别条形码的方法、终端首先通过预设信息识别校准区域,再根据校准区域与信息码区域的位置关系,针对信息码区域进行聚焦识别,可以提高识别条形码信息的效率以及准确性。
根据本申请的技术解决用手机或平板电脑等带有摄像终端的移动终端识别条形码时效率低的问题。
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。
附图说明
附图用于更好地理解本方案,不构成对本申请的限定。其中:
图1是本申请的实施例可以应用于其中的示例性系统架构图;
图2是根据本申请的用于识别条形码的方法的一个实施例的流程图;
图3是根据本申请的用于识别条形码的方法的另一个实施例的流程图;
图4是根据本申请的用于识别条形码的方法的另一个实施例中条形码的示意图;
图5是根据本申请的用于识别条形码的终端的一个实施例的结构示意图;
图6是根据本申请的用于识别条形码的终端的另一个实施例的结构示意图;
图7是用来实现本申请实施例的用于识别条形码的方法的电子设备的框图。
具体实施方式
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。
图1示出了可以应用本申请的用于识别条形码的方法或用于识别条形码的终端的实施例的示例性系统架构100。
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种客户端应用,例如图像扫描应用、图形识别应用、信息处理应用等。
终端设备101、102、103可以是具有显示屏以及摄像装置并且支持接收服务器消息的各种电子设备,包括但不限于智能手机、平板电脑、扫码枪等等。终端设备101、102、103可以利用其上的摄像装置获取条形码图像,并且利用本机数据处理程序对条形码图像进行图像处理与图像识别,获得条形码信息。
终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是各种电子设备,当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。
服务器105可以是为终端设备101、102、103上运行的应用提供后台服务的服务器,或者可以是为终端设备101、102、103上运行的图像扫描应用或图像识别应用等提供支持的服务器。服务器105可以从终端设备101、102、103获取条形码图像,利用图像处理程序对条形码图像进行处理,识别条形码信息,并将处理后得到的条形码信息返回终端设备101、102、103。
需要说明的是,本公开实施例所提供的用于识别条形码的方法一般由终端设备101、102、103执行,相应地,用于识别条形码的终端一般为终端设备101、102、103。
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。
继续参考图2,其示出了根据本公开的用于识别条形码的方法的一个实施例的流程200。用于识别条形码的方法,其中,条形码包括校准区域、信息码区域,该方法包括以下步骤:
步骤201,获取条形码的图像,根据预设的校准区域的校准信息,识别校准区域在图像中的位置。
在本实施例中,条形码包括校准区域、信息码区域。校准区域是根据预设的编码规则形成的编码图案,校准区域用于辅助定位信息码区域在图像中的位置。信息码区域是包含该条形码待识别的信息的编码图案。用于识别条形码的方法的执行主体(例如图1所示的终端设备)可以通过其上 的摄像装置采集带有条形码的图像,并根据预设的校准区域的信息,识别出校准区域在图像中的位置。预设的校准区域的信息可以采用对比度较高或具有其他易于被机器分辨的图形、色彩等特征的条形编码图案,例如,条码中黑白两种色块排列顺序依次为:黑黑白白黑黑黑黑黑白白黑黑,使摄像装置能够快速捕捉到该编码图案,并开始进行识别与定位,避免摄像装置对条形码图像进行大面积扫描读取,浪费识别时间。
可选地,在本实施例中,首先获取预先确定的最佳聚焦时间,然后获取条形码的图像,在最佳聚焦时间内根据预设的校准区域的校准信息识别校准区域在图像中的位置。
具体地,可以依照经验确定最佳聚焦时间,或者可以经过多次试验,确定最佳聚焦时间。然后,获取条形码的图像,并根据预设的校准区域的校准信息,在最佳聚焦时间内对校准区域在图像中的位置进行识别,超过最佳聚焦时间则停止识别。
可选地,在本实施例中,当在预设识别时间t内未识别出校准区域在图像中的位置时,迭代执行第一操作:更新预设识别时间为t=t+Δ1,,以及在更新后的预设识别时间t内识别所述校准区域在所述图像中的位置;响应于在更新后的预设识别时间t内识别出校准区域在图像中的位置,停止执行第一操作,并确定在最后一次第一操作中更新的预设识别时间t为第一最佳聚焦时间;其中Δ1为第一预设时长。
具体地,在首次使用该终端设备、重启该终端设备或者需要对该终端设备进行校准时,使用预设识别时间t未识别出校准区域在图像中的位置时,迭代执行以下第一操作:更新预设识别时间为t=t+Δ1,然后判断更新后的预设识别时间t内是否识别出校准区域在图像中的位置,如果不能识别出校准区域在图像中的位置,则继续执行第一操作以更新预设识别时间,直到识别出校准区域在图像中的位置,则停止执行上述第一操作,并确定在最后一次第一操作中更新的预设识别时间t为第一最佳聚焦时间,其中Δ1为第一预设时长。例如,初始设定预设识别时间t=300毫秒,第一预设时长Δ1=100毫秒,使用t=300毫秒识别校准区域在图像中的位置,若未能识别出校准区域在图像中的位置,则更新预设识别时间t=300毫秒+100毫秒=400毫秒,然后判断更新后的预设识别时间t=400毫秒内是否 识别出校准区域在图像中的位置,如果不能,则继续更新预设识别时间,如果在更新后的预设识别时间t=400毫秒内识别出校准区域在图像中的位置,则确定t=400毫秒为第一最佳聚焦时间。
可选地,在本实施例中,当预设识别时间t内能识别出校准区域在图像中的位置时,迭代执行第二操作:更新预设识别时间为t=t-Δ2,以及在更新后的预设识别时间内识别所述校准区域在所述图像中的位置;响应于在更新后的预设识别时间t内未能识别出校准区域在图像中的位置,停止执行第二操作,并确定在倒数第二次第二操作中更新的预设识别时间t为第二最佳聚焦时间;其中Δ2为第二预设时长。
具体地,在首次使用该终端设备、重启该终端设备或者需要对该终端设备进行校准时,使用预设识别时间t识别出校准区域在图像中的位置时,迭代执行以下第二操作:更新预设识别时间为t=t-Δ2,然后判断更新后的预设识别时间t内是否识别出校准区域在图像中的位置,如果识别出校准区域在图像中的位置,则继续执行第二操作以更新预设识别时间,直到在更新后的预设识别时间t内未能识别出校准区域在图像中的位置,停止执行第二操作,并确定在倒数第二次第二操作中更新的预设识别时间t为第二最佳聚焦时间,其中Δ2为第二预设时长。例如,初始设定预设识别时间t=600毫秒,第一预设时长Δ1=100毫秒,使用t=600毫秒识别校准区域在图像中的位置,若能识别出校准区域在图像中的位置,则更新预设识别时间t=600毫秒-100毫秒=500毫秒,然后判断更新后的预设识别时间t=500毫秒内是否识别出校准区域在图像中的位置,如果可以,则继续更新预设识别时间t=500毫秒-100毫秒=400毫秒,然后判断更新后的预设识别时间t=400毫秒内是否识别出校准区域在图像中的位置,如果未能识别,则停止执行第二操作,并确定t=500毫秒为第二最佳聚焦时间。
本实施例在终端设备首次使用、重启或者校准时采用迭代的方式逐步寻找最佳聚焦时间,并在之后的扫描识别时应用该最佳聚焦时间,可以在提高条形码识别效率的同时确保条形码识别的准确性。
步骤202,根据校准区域在图像中的位置以及校准区域与信息码区域在图像中的预设位置关系,识别信息码区域在图像中的位置。
在本实施例中,根据校准区域在图像中的位置,以及校准区域与信息 码区域在图像中的预设的位置关系,确定出信息码区域在图像中的位置。其中校准区域与信息码区域在图像中的预设位置关系可以是图像中校准区域与信息码区域的方位关系,例如,信息码区域位于校准区域的上方、下方、左方、右方或斜对角方向;校准区域与信息码区域在图像中的预设位置关系可以是图像中校准区域与信息码区域的距离关系,例如,信息码区域位于校准区域的3个像素内、信息码区域位于校准区域的1厘米内、信息码区域起始于校准区域右侧1厘米处等。
步骤203,针对信息码区域在图像中的位置进行信息读取,获取信息码区域的信息。
在本实施例中,识别出信息码区域在图像中的位置后,针对信息码区域在图像中的位置进行信息读取,获取并识别出信息码区域的信息。
本实施例提供的用于识别条形码的方法首先通过预设信息识别校准区域,再根据校准区域与信息码区域的位置关系,针对信息码区域进行聚焦识别,可以提高识别条形码信息的效率以及准确性。
进一步参考图3,其示出了用于识别条形码的方法的又一个实施例的流程300,其中,本实施例中的条形码示意图参考图4,校准区域包括前校准区域401、后校准区域402,信息码区域403位于前校准区域401和后校准区域402之间,该方法包括以下步骤:
步骤301,获取条形码的图像,根据预设的前校准区域的校准信息以及后校准区域的校准信息,识别前校准区域以及后校准区域在图像中的位置。
在本实施例中,首先获取条形码的图像,然后根据预设的前校准区域与后校准区域的校准信息,确定前校准区域的信息以及后校准区域的信息在图像中的位置,并进一步确定出前校准区域的信息与后校准区域的信息在图像中的位置为前校准区域与后校准区域在图像中的位置。其中,前校准区域为根据预设的编码规则形成的编码图案,并且置于信息码区域的前方,后校准区域为根据预设的编码规则形成的编码图案,并且置于信息码区域的后方。
步骤302,根据校准区域在图像中的位置以及校准区域与信息码区域在图像中的预设位置关系,识别信息码区域在图像中的位置。
在本实施例中,根据前校准区域与后校准区域在图像中的位置,以及预设的校准区域与信息码区域在图像中的位置关系,即,信息码区域位于前校准区域和后校准区域之间,确定前校准区域在图像中的位置与后校准区域在图像中的位置的中间部分为信息码区域在图像中的位置。
步骤303,针对信息码区域在图像中的位置进行信息读取,获取信息码区域的信息。
在本实施例中,识别出信息码区域在图像中的位置后,针对信息码区域在图像中的位置进行信息读取,获取并识别出信息码区域的信息。
在上述结合图2和图3描述的实施例的一些可选的实现方式中,针对信息码区域在图像中的位置进行信息读取,获取信息码区域的信息,包括:针对信息码区域在图像中的位置进行聚焦,采集信息码区域的图像信息;对信息码区域的图像信息进行二值化处理,得到信息码区域的信息。
在本实施例中,可以针对信息码区域在图像中的位置进行聚焦,采集信息码区域的图像,并对该图像进行二值化处理以使该图像呈现出黑白效果,然后采用条形码识别算法(例如Code128识别算法)对二值化处理后的信息码区域的图像进行处理,得到信息码区域的图像的信息,即,条形码的信息。本实施例通过设置前校准区域和后校准区域,使得在扫描条码时信息码区域更容易被定位,针对信息码区域进行聚焦识别,可以进一步提高使用手机或平板电脑等终端设备识别条形码的识别效率。
可选地,当校准区域包括前校准区域、后校准区域,并且信息码区域位于前校准区域和后校准区域之间时,针对信息码区域在图像中的位置进行聚焦,包括:根据前校准区域的预设长度、后校准区域的预设长度、前校准区域与信息码区域的预设间隔宽度、后校准区域与信息码区域的预设间隔宽度确定信息码区域的长度;选取信息码区域的长度的1/2作为聚焦宽度;利用聚焦宽度对信息码区域在图像中的位置进行聚焦。
在本实施例中,在针对信息码区域在图像中的位置进行聚焦前,可以首先根据前校准区域的预设长度、后校准区域的预设长度、前校准区域与信息码区域的预设间隔宽度、后校准区域与信息码区域的预设间隔宽度确定信息码区域的长度,然后选取信息码区域的长度的1/2作为聚焦宽度,之后利用该聚焦宽度对信息码区域在图像中的位置进行聚焦。采用本实施 例的方法可以准确计算出信息码区域的长度,并利用信息码区域的长度的1/2作为聚焦宽度对信息码区域进行聚焦识别,可以提高聚焦效率进而提高识别效率。
在上述结合图2和图3描述的实施例的一些可选的实现方式中,校准区域的单个黑色条状区域的宽度与信息码区域单个黑色条状区域的宽度之差大于预设的宽度差。
在本实施例中,校准区域的单个黑色条状区域的宽度比信息码区域单个黑色条状区域的宽度更宽,并且单个黑色条状区域的宽度与信息码区域单个黑色条状区域的宽度之差大于预设的宽度差。预设校准区域的单个黑色条状区域的宽度比信息码区域单个黑色条状区域的宽度更宽可以使摄像装置更快更精准的定位校准区域,从而提高识别条形码的效率。
本实施例提供的用于识别条形码的方法首先通过预设信息识别校准区域,再根据校准区域与信息码区域的位置关系,针对信息码区域进行聚焦识别,可以提高识别条形码信息的效率以及准确性。
进一步参考图5,作为对上述各图所示方法的实现,本公开提供了一种用于识别条形码的终端的一个实施例,该终端实施例与图2所示的方法实施例相对应,该终端具体可以应用于各种电子设备中。
如图5所示,本实施例的用于识别条形码的终端500,其中,条形码包括校准区域、信息码区域,该终端500包括:图像采集设备501、处理器502、显示器503。其中,图像采集设备501,被配置为获取条形码的图像,并将条形码的图像发送至处理器;处理器502,被配置为接收条形码的图像,根据预设的校准区域的校准信息,识别校准区域在图像中的位置,根据校准区域在图像中的位置以及校准区域与信息码区域在图像中的预设位置关系,识别信息码区域在图像中的位置,根据信息码区域在图像中的位置确定用于控制图像采集设备的聚焦位置的聚焦信息,并将聚焦信息发送至图像采集设备501;图像采集设备501根据聚焦信息进行图像采集,获取信息码区域的图像,并将信息码区域的图像发送至处理器502;处理器502接收信息码区域的图像,根据信息码区域的图像识别信息码区域的信息,并将信息码区域的信息发送至显示器503;显示器503,被配置为接收并显示信息码区域的信息。
在本实施例中,条形码包括校准区域、信息码区域。校准区域是根据预设的编码规则形成的编码图案,校准区域用于辅助定位信息码区域在图像中的位置。信息码区域是包含该条形码待识别的信息的编码图案。终端500可以通过图像采集设备501采集带有条形码的图像,并将信息码区域的图像发送至处理器502,处理器502接收信息码区域的图像,根据校准区域在图像中的位置,以及校准区域与信息码区域在图像中的预设的位置关系,确定出信息码区域在图像中的位置。处理器502根据信息码区域在图像中的位置确定用于控制图像采集设备的聚焦位置的聚焦信息,并将聚焦信息发送至图像采集设备501,图像采集设备501接收到聚焦信息后,根据聚焦信息对图像采集设备的设备聚焦参数进行调整,并利用调整后的图像采集设备进行图像采集以获取信息码区域的图像,并将采集到的信息码区域的图像发送至处理器502,处理器502接收信息码区域的图像后,根据信息码区域的图像识别信息码区域的信息,并将信息码区域的信息发送至显示器503。显示器503接收信息码区域的信息,并将该信息进行显示。
在一些实施例中,处理器502,包括:选时模块,被配置为获取预先确定的最佳聚焦时间;位置识别模块,被配置为根据条形码的图像,在最佳聚焦时间内根据预设的校准区域的校准信息识别校准区域在图像中的位置。
在本实施例中,处理器502中的选时模块可以接收终端使用用户依照经验确定并输入的最佳聚焦时间。然后,处理器502基于图像采集设备501获取的条形码的图像,并根据预设的校准区域的校准信息,在最佳聚焦时间内对校准区域在图像中的位置进行识别,超过最佳聚焦时间则停止识别。处理器502中的位置识别模块根据校准区域在图像中的位置,以及校准区域与信息码区域在图像中的预设的位置关系,确定出信息码区域在图像中的位置。
在一些实施例中,最佳聚焦时间按照如下方式确定:当在预设识别时间t内未识别出校准区域在图像中的位置时,迭代执行第一操作:更新预设识别时间为t=t1+Δ1,并控制图像采集设备对校准区域在图像中的位置进行区域图像采集;响应于处理器在更新后的预设识别时间t内根据图像 采集设备采集的区域图像识别出校准区域在图像中的位置,停止执行第一操作,并确定在最后一次第一操作中更新的预设识别时间t为最佳聚焦时间;其中t1为实际识别时间、Δ1为第一预设时长;当在预设识别时间t内能识别出校准区域在图像中的位置时,迭代执行第二操作:更新预设识别时间为t=t2-Δ2,并控制图像采集设备对校准区域在图像中的位置进行区域图像采集;响应于处理器在更新后的预设识别时间t内未根据图像采集设备采集的区域图像识别出校准区域在图像中的位置,停止执行第二操作,并确定在倒数第二次第二操作中更新的预设识别时间t为最佳聚焦时间;其中t2为实际识别时间、Δ2为第二预设时长。
在本实施例中,当首次使用该终端设备、重启该终端设备或者需要对该终端设备进行校准时,使用预设识别时间t未识别出校准区域在图像中的位置时,处理器502迭代执行以下第一操作:更新预设识别时间为t=t+Δ1,并控制图像采集设备501对校准区域在图像中的位置进行区域图像采集,然后处理器502判断更新后的预设识别时间t内是否识别出校准区域在图像中的位置,如果不能识别出校准区域在图像中的位置,则处理器502继续执行第一操作以更新预设识别时间,直到识别出校准区域在图像中的位置,则停止执行上述第一操作,并确定在最后一次第一操作中更新的预设识别时间t为第一最佳聚焦时间,其中Δ1为第一预设时长。
在本实施例中,当首次使用该终端设备、重启该终端设备或者需要对该终端设备进行校准时,使用预设识别时间t识别出校准区域在图像中的位置时,处理器502迭代执行以下第二操作:更新预设识别时间为t=t-Δ2,并控制图像采集设备501对校准区域在图像中的位置进行区域图像采集,然后处理器502判断更新后的预设识别时间t内是否识别出校准区域在图像中的位置,如果识别出校准区域在图像中的位置,则处理器502继续执行第二操作以更新预设识别时间,直到在更新后的预设识别时间t内未能识别出校准区域在图像中的位置,停止执行第二操作,并确定在倒数第二次第二操作中更新的预设识别时间t为第二最佳聚焦时间,其中Δ2为第二预设时长。
在一些实施例中,校准区域包括前校准区域、后校准区域,信息码区域位于前校准区域和后校准区域之间。
在一些实施例中,处理器502包括:聚焦模块,被配置为根据信息码区域在图像中的位置确定聚焦参数,并将聚焦参数发送至图像采集设备以使图像采集设备根据聚焦参数采集信息码区域的图像;处理模块,被配置为接收图像采集设备采集的信息码区域的图像,并对信息码区域的图像信息进行二值化处理,得到信息码区域的信息。
在本实施例中,处理器502中的聚焦模块根据信息码区域在图像中的位置确定聚焦参数,并将该聚焦参数发送至图像采集设备以使图像采集设备根据聚焦参数调整其硬件参数,并利用调整后的图像采集设备采集信息码区域的图像。处理器502中的处理模块接收到图像采集设备501采集的信息码区域的图像后,并对该图像进行二值化处理以使该图像呈现出黑白效果,然后采用条形码识别算法(例如Code128识别算法)对二值化处理后的信息码区域的图像进行处理,得到信息码区域的图像的信息,即,条形码的信息。
在一些实施例中,聚焦模块包括:确定模块,被配置为根据前校准区域的预设长度、后校准区域的预设长度、前校准区域与信息码区域的预设间隔宽度、后校准区域与信息码区域的预设间隔宽度确定信息码区域的长度;选取模块,被配置为选取信息码区域的长度的1/2作为聚焦宽度,并将聚焦宽度发送至图像采集设备;图像采集设备501包括聚焦子模块,被配置为接收并基于聚焦宽度对信息码区域在图像中的位置进行聚焦。
在本实施例中,处理器502中的聚焦模块包括确定模块以及选取模块。确定模块可以首先根据前校准区域的预设长度、后校准区域的预设长度、前校准区域与信息码区域的预设间隔宽度、后校准区域与信息码区域的预设间隔宽度确定信息码区域的长度,并将该确定的信息码区域的长度发送至选取模块。选取模块选取信息码区域的长度的1/2作为聚焦宽度,并将该聚焦宽度发送至图像采集设备501,图像采集设备501中的聚焦子模块接收并基于该聚焦宽度对信息码区域在图像中的位置进行聚焦。
在一些实施例中,校准区域的单个黑色条状区域的宽度与信息码区域单个黑色条状区域的宽度之差大于预设的宽度差。
在一些实施例中,显示器503还被配置为接收并显示信息码区域的图像。
在本实施例中,显示器503还可以接收信息码区域的图像,并将信息码区域的图像进行显示。
上述终端500中的各单元与参考图2和图3描述的方法中的步骤相对应。由此上文针对用于识别条形码的方法所能达到的技术效果同样适用于终端500及其中包含的设备,在此不再赘述。
进一步参考图6,本公开提供了一种用于识别条形码的终端的另一个实施例。如图6所示,本实施例的用于识别条形码的终端600可以是具有图像采集设备601、处理器602、显示装置603的智能手机,该终端600通过图像采集设备601获取条形码的图像,并根据预设的校准区域的校准信息,识别校准区域在图像中的位置;通过处理器602根据校准区域在图像中的位置以及校准区域与信息码区域在图像中的预设位置关系,识别信息码区域在图像中的位置,并针对信息码区域在图像中的位置进行信息读取,获取信息码区域的信息,并将该信息显示在显示装置603上。
根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。该电子设备包括至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,该指令被至少一个处理器执行,以使至少一个处理器能够执行图2至图3描述的方法。
如图7所示,是根据本申请实施例的用于识别条形码的方法的电子设备700的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。
如图7所示,该电子设备包括:一个或多个处理器701、存储器702,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设 备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图7中以一个处理器701为例。
存储器702即为本申请所提供的非瞬时计算机可读存储介质。其中,该存储器存储有可由至少一个处理器执行的指令,以使该至少一个处理器执行本申请所提供的用于识别条形码的方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的用于识别条形码的方法。
存储器702作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的用于识别条形码的方法对应的程序指令/模块(例如,附图5所示的图像采集设备501、处理器502、显示器503)。处理器701通过运行存储在存储器702中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的用于识别条形码的方法。
存储器702可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据用于识别条形码的电子设备的使用所创建的数据等。此外,存储器702可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器702可选包括相对于处理器701远程设置的存储器,这些远程存储器可以通过网络连接至用于识别条形码的电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
用于识别条形码的方法的电子设备还可以包括:输入装置703、输出装置704以及总线705。处理器701、存储器702、输入装置703和输出装置704可以通过总线705或者其他方式连接,图7中以通过总线705连接为例。
输入装置703可接收输入的数字或字符信息,以及产生与用于识别条形码的电子设备的用户设置以及功能控制有关的键信号输入,例如触摸 屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置704可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例 如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。

Claims (17)

  1. 一种用于识别条形码的方法,其中,所述条形码包括校准区域、信息码区域,所述方法包括:
    获取所述条形码的图像,根据预设的所述校准区域的校准信息,识别所述校准区域在所述图像中的位置;
    根据所述校准区域在所述图像中的位置以及所述校准区域与所述信息码区域在图像中的预设位置关系,识别所述信息码区域在所述图像中的位置;以及
    针对所述信息码区域在所述图像中的位置进行信息读取,获取所述信息码区域的信息。
  2. 根据权利要求1所述的方法,其中,所述获取所述条形码的图像,根据预设的所述校准区域的校准信息,识别所述校准区域在所述图像中的位置,包括:
    获取预先确定的最佳聚焦时间;以及
    获取所述条形码的图像,在所述最佳聚焦时间内根据预设的所述校准区域的校准信息识别所述校准区域在所述图像中的位置。
  3. 根据权利要求2所述的方法,其中,所述最佳聚焦时间按照如下方式确定,包括:
    当在预设识别时间t内未识别出所述校准区域在所述图像中的位置时,迭代执行第一操作:更新所述预设识别时间为t=t+Δ1,以及在更新后的预设识别时间t内识别所述校准区域在所述图像中的位置;
    响应于在更新后的预设识别时间t内识别出所述校准区域在所述图像中的位置,停止执行所述第一操作,并确定在最后一次第一操作中更新的预设识别时间t为最佳聚焦时间;其中Δ1为第一预设时长;以及
    当在预设识别时间t内识别出所述校准区域在所述图像中的位置时,迭代执行第二操作:更新所述预设识别时间为t=t-Δ2,以及在更新后的预设识别时间内识别所述校准区域在所述图像中的位置;
    响应于在更新后的预设识别时间t内未识别出所述校准区域在所述图像中的位置,停止执行所述第二操作,并确定在倒数第二次第二操作中更新的预设识别时间t为最佳聚焦时间;其中Δ2为第二预设时长。
  4. 根据权利要求1-3任一项所述的方法,其中,所述校准区域包括前校准区域、后校准区域,所述信息码区域位于所述前校准区域和所述后校准区域之间。
  5. 根据权利要求1-4任一项所述的方法,其中,所述针对所述信息码区域在所述图像中的位置进行信息读取,获取所述信息码区域的信息,包括:
    针对所述信息码区域在所述图像中的位置进行聚焦,采集所述信息码区域的图像信息;以及
    对所述信息码区域的图像信息进行二值化处理,得到所述信息码区域的信息。
  6. 根据权利要求5所述的方法,其中,所述针对所述信息码区域在所述图像中的位置进行聚焦,包括:
    根据所述前校准区域的预设长度、所述后校准区域的预设长度、所述前校准区域与所述信息码区域的预设间隔宽度、所述后校准区域与所述信息码区域的预设间隔宽度确定所述信息码区域的长度;
    选取所述信息码区域的长度的1/2作为聚焦宽度;以及
    利用所述聚焦宽度对所述信息码区域在所述图像中的位置进行聚焦。
  7. 根据权利要求1-6任一项所述的方法,其中,所述校准区域的单个黑色条状区域的宽度与所述信息码区域单个黑色条状区域的宽度之差大于预设的宽度差。
  8. 一种用于识别条形码的终端,其中,所述条形码包括校准区域、信息码区域,所述终端包括:图像采集设备、处理器、显示器,
    所述图像采集设备,被配置为获取所述条形码的图像,并将所述条形码的图像发送至所述处理器;
    所述处理器,被配置为接收所述条形码的图像,根据预设的所述校准区域的校准信息,识别所述校准区域在所述图像中的位置,根据所述校准区域在所述图像中的位置以及所述校准区域与所述信息码区域在图像中的预设位置关系,识别所述信息码区域在所述图像中的位置,根据所述信息码区域在所述图像中的位置确定用于控制所述图像采集设备的聚焦位置的聚焦信息,并将所述聚焦信息发送至所述图像采集设备;
    所述图像采集设备根据所述聚焦信息进行图像采集,获取所述信息码区域的图像,并将所述信息码区域的图像发送至所述处理器;以及
    所述处理器接收所述信息码区域的图像,根据所述信息码区域的图像识别所述信息码区域的信息,并将所述信息码区域的信息发送至所述显示器;
    所述显示器,被配置为接收并显示所述信息码区域的信息。
  9. 根据权利要求8所述的终端,其中,所述处理器,包括:
    选时模块,被配置为获取预先确定的最佳聚焦时间;以及
    位置识别模块,被配置为根据所述条形码的图像,在所述最佳聚焦时间内根据预设的所述校准区域的校准信息识别所述校准区域在所述图像中的位置。
  10. 根据权利要求9所述的终端,其中,所述最佳聚焦时间按照如下方式确定:
    当在预设识别时间t内未识别出所述校准区域在所述图像中的位置时,迭代执行第一操作:更新所述预设识别时间为t=t+Δ1,并控制所述图像采集设备对所述校准区域在所述图像中的位置进行区域图像采集;
    响应于所述处理器在更新后的预设识别时间t内根据所述图像采集设备采集的区域图像识别出所述校准区域在所述图像中的位置,停止执行所述第一操作,并确定在最后一次第一操作中更新的预设识别时间t为最佳聚焦时间;其中Δ1为第一预设时长;以及
    当在预设识别时间t内识别出所述校准区域在所述图像中的位置时,迭代执行第二操作:更新所述预设识别时间为t=t-Δ2,并控制所述图像采集设备对所述校准区域在所述图像中的位置进行区域图像采集;
    响应于所述处理器在更新后的预设识别时间t内未根据所述图像采集设备采集的区域图像识别出所述校准区域在所述图像中的位置,停止执行所述第二操作,并确定在倒数第二次第二操作中更新的预设识别时间t为最佳聚焦时间;其中Δ2为第二预设时长。
  11. 根据权利要求8-10任一项所述的终端,其中,所述校准区域包括前校准区域、后校准区域,所述信息码区域位于所述前校准区域和所述后校准区域之间。
  12. 根据权利要求8-11任一项所述的终端,其中,所述处理器,包括:
    聚焦模块,被配置为根据所述信息码区域在所述图像中的位置确定聚焦参数,并将所述聚焦参数发送至所述图像采集设备以使所述图像采集设备根据所述聚焦参数采集所述信息码区域的图像;以及
    处理模块,被配置为接收所述图像采集设备采集的所述信息码区域的图像,并对所述信息码区域的图像信息进行二值化处理,得到所述信息码区域的信息。
  13. 根据权利要求11所述的终端,其中,所述聚焦模块,包括:
    确定模块,被配置为根据所述前校准区域的预设长度、所述后校准区域的预设长度、所述前校准区域与所述信息码区域的预设间隔宽度、所述后校准区域与所述信息码区域的预设间隔宽度确定所述信息码区域的长度;
    选取模块,被配置为选取所述信息码区域的长度的1/2作为聚焦宽度,并将所述聚焦宽度发送至所述图像采集设备;
    所述图像采集设备包括:
    聚焦子模块,被配置为接收并基于所述聚焦宽度对所述信息码区域在所述图像中的位置进行聚焦。
  14. 根据权利要求8-13任一项所述的终端,其中,所述校准区域的单个黑色条状区域的宽度与所述信息码区域单个黑色条状区域的宽度之差大于预设的宽度差。
  15. 根据权利要求8-14任一项所述的终端,其中,所述显示器还被配置为接收并显示所述信息码区域的图像。
  16. 一种电子设备,包括:
    至少一个处理器;以及
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-7中任一项所述的方法。
  17. 一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行权利要求1-7中任一项所述的方法。
PCT/CN2021/092575 2020-07-08 2021-05-10 用于识别条形码的方法和终端 WO2022007495A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/013,822 US20230297795A1 (en) 2020-07-08 2021-05-10 Method and terminal for identifying barcode
EP21837074.0A EP4148617A4 (en) 2020-07-08 2021-05-10 BARCODE IDENTIFICATION METHOD AND TERMINAL

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010651446.6A CN111797643B (zh) 2020-07-08 2020-07-08 用于识别条形码的方法和终端
CN202010651446.6 2020-07-08

Publications (1)

Publication Number Publication Date
WO2022007495A1 true WO2022007495A1 (zh) 2022-01-13

Family

ID=72809783

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/092575 WO2022007495A1 (zh) 2020-07-08 2021-05-10 用于识别条形码的方法和终端

Country Status (4)

Country Link
US (1) US20230297795A1 (zh)
EP (1) EP4148617A4 (zh)
CN (1) CN111797643B (zh)
WO (1) WO2022007495A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117077083A (zh) * 2023-10-10 2023-11-17 上海英内物联网科技股份有限公司 装箱物品自动识别统计方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111797643B (zh) * 2020-07-08 2022-04-26 北京京东振世信息技术有限公司 用于识别条形码的方法和终端

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104376291A (zh) * 2013-08-12 2015-02-25 腾讯科技(深圳)有限公司 数据处理的方法及装置
CN107818282A (zh) * 2017-09-30 2018-03-20 努比亚技术有限公司 二维码识别方法、终端及计算机可读存储介质
CN207216659U (zh) * 2017-09-20 2018-04-10 华南理工大学 一种基于的led平板灯的ean‑13条形码编码解码硬件系统
CN108491748A (zh) * 2018-04-02 2018-09-04 腾讯音乐娱乐科技(深圳)有限公司 图形码的识别及生成方法、装置及计算机可读存储介质
CN109977718A (zh) * 2019-03-21 2019-07-05 连尚(新昌)网络科技有限公司 一种用于识别二维码的方法与设备
CN111797643A (zh) * 2020-07-08 2020-10-20 北京京东振世信息技术有限公司 用于识别条形码的方法和终端

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8061610B2 (en) * 2005-10-24 2011-11-22 Cognex Technology And Investment Corporation System and method for employing color illumination and color filtration in a symbology reader
TW201113815A (en) * 2009-10-09 2011-04-16 Primax Electronics Ltd QR code processing method and apparatus thereof
JP5252023B2 (ja) * 2011-03-30 2013-07-31 カシオ計算機株式会社 コード読取装置及びプログラム
JP5234133B2 (ja) * 2011-03-31 2013-07-10 カシオ計算機株式会社 コード読取装置及びプログラム
US8948445B2 (en) * 2012-05-03 2015-02-03 The Hong Kong University Of Science And Technology Embedding visual information in a two-dimensional bar code
CN203386219U (zh) * 2012-05-21 2014-01-08 计量仪器公司 一种用于读取扫描场中的码符号的系统
CN104268517B (zh) * 2014-09-19 2018-11-09 武汉虹识技术有限公司 一种应用于虹膜识别系统的自动对焦方法及系统
US9818010B2 (en) * 2014-10-09 2017-11-14 The Code Corporation Barcode-reading system
US10146975B2 (en) * 2016-11-17 2018-12-04 Datalogic Ip Tech S.R.L. Data reader with hybrid auto focus system
KR102675364B1 (ko) * 2017-07-28 2024-06-14 바오밥 스튜디오스, 인코포레이티드 실시간의 복합 캐릭터 애니메이션 및 상호작용성을 위한 시스템 및 방법
CN109214225A (zh) * 2018-07-04 2019-01-15 青岛海信移动通信技术股份有限公司 一种图形条码的扫描方法、装置、移动终端和存储介质
CN109598162A (zh) * 2018-08-20 2019-04-09 天津字节跳动科技有限公司 识别二维码的方法、装置、终端设备及存储介质
CN110749974B (zh) * 2019-11-04 2021-06-01 中南大学 全载玻片成像扫描仪的自动聚焦方法及其图像获取方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104376291A (zh) * 2013-08-12 2015-02-25 腾讯科技(深圳)有限公司 数据处理的方法及装置
CN207216659U (zh) * 2017-09-20 2018-04-10 华南理工大学 一种基于的led平板灯的ean‑13条形码编码解码硬件系统
CN107818282A (zh) * 2017-09-30 2018-03-20 努比亚技术有限公司 二维码识别方法、终端及计算机可读存储介质
CN108491748A (zh) * 2018-04-02 2018-09-04 腾讯音乐娱乐科技(深圳)有限公司 图形码的识别及生成方法、装置及计算机可读存储介质
CN109977718A (zh) * 2019-03-21 2019-07-05 连尚(新昌)网络科技有限公司 一种用于识别二维码的方法与设备
CN111797643A (zh) * 2020-07-08 2020-10-20 北京京东振世信息技术有限公司 用于识别条形码的方法和终端

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4148617A4

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117077083A (zh) * 2023-10-10 2023-11-17 上海英内物联网科技股份有限公司 装箱物品自动识别统计方法
CN117077083B (zh) * 2023-10-10 2024-01-05 上海英内物联网科技股份有限公司 装箱物品自动识别统计方法

Also Published As

Publication number Publication date
US20230297795A1 (en) 2023-09-21
CN111797643B (zh) 2022-04-26
CN111797643A (zh) 2020-10-20
EP4148617A4 (en) 2024-06-05
EP4148617A1 (en) 2023-03-15

Similar Documents

Publication Publication Date Title
WO2022007495A1 (zh) 用于识别条形码的方法和终端
CN111709878B (zh) 人脸超分辨率实现方法、装置、电子设备及存储介质
EP3916630A1 (en) Method and apparatus for identifying video
CN111722245A (zh) 定位方法、定位装置和电子设备
KR20210038854A (ko) 차량 소환 명령의 송신 방법, 장치 및 전자 기기
CN111310507B (zh) 识别码的识别方法、装置及设备
US11557062B2 (en) Method and apparatus for processing video frame
CN115345186A (zh) 眼睛注视检测控制的标记扫描系统和方法
CN111191619B (zh) 车道线虚线段的检测方法、装置、设备和可读存储介质
CN111601013B (zh) 用于处理视频帧的方法和装置
CN111861991A (zh) 计算图像清晰度的方法以及装置
CN112184837A (zh) 一种图像检测方法、装置、电子设备及存储介质
CN111967304A (zh) 基于边缘计算的获取物品信息方法、装置和结算台
CN111797647B (zh) 条码解码方法和装置
KR20210089115A (ko) 이미지 식별 방법, 장치, 전자 기기 및 컴퓨터 프로그램
CN112508964B (zh) 图像分割方法、装置、电子设备和存储介质
CN111814651B (zh) 车道线的生成方法、装置和设备
CN110798681B (zh) 成像设备的监测方法、装置和计算机设备
EP3901892A2 (en) Commodity guiding method and apparatus, electronic device, storage medium, and computer program product
CN115879486A (zh) 基于对视场中条形码位置的检测来创建优化/自适应感兴趣区域的方法
CN112651983B (zh) 拼接图识别方法、装置、电子设备和存储介质
KR20210042859A (ko) 보행자 검출 방법 및 장치
CN113419915A (zh) 云终端桌面静止确定方法和装置
CN113780045A (zh) 用于训练距离预测模型的方法和装置
CN112035210A (zh) 用于输出颜色信息的方法、装置、设备和介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21837074

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021837074

Country of ref document: EP

Effective date: 20221206

NENP Non-entry into the national phase

Ref country code: DE