WO2018059365A1 - 图形码处理方法及装置、存储介质 - Google Patents

图形码处理方法及装置、存储介质 Download PDF

Info

Publication number
WO2018059365A1
WO2018059365A1 PCT/CN2017/103272 CN2017103272W WO2018059365A1 WO 2018059365 A1 WO2018059365 A1 WO 2018059365A1 CN 2017103272 W CN2017103272 W CN 2017103272W WO 2018059365 A1 WO2018059365 A1 WO 2018059365A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
graphic code
code
scanning
distribution area
Prior art date
Application number
PCT/CN2017/103272
Other languages
English (en)
French (fr)
Other versions
WO2018059365A9 (zh
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 EP17854815.2A priority Critical patent/EP3462371B1/en
Publication of WO2018059365A1 publication Critical patent/WO2018059365A1/zh
Priority to US16/206,739 priority patent/US10783342B2/en
Publication of WO2018059365A9 publication Critical patent/WO2018059365A9/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
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • 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/14172D 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/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/1447Methods for optical code recognition including a method step for retrieval of the optical code extracting optical codes from image or text carrying said optical 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/1456Methods for optical code recognition including a method step for retrieval of the optical code determining the orientation of the optical code with respect to the reader and correcting therefore
    • 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
    • G06K7/1473Methods for optical code recognition the method including quality enhancement steps error correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • G06T5/30Erosion or dilatation, e.g. thinning

Definitions

  • the invention relates to a scanning and decoding processing technology of a graphic code, in particular to a graphic code processing method and device, and a storage medium.
  • Graphic codes such as QR codes are widely used in social and payment scenarios.
  • the scanning code device such as a mobile phone with a camera, a tablet, or the like, or a terminal dedicated to scanning a code such as a scanner
  • the user can make the image of the image displayed in the preview interface of the image acquisition.
  • the contour is consistent with the predetermined scanning area in the preview interface (for example, when the contour of the scanning area is prompted in the preview interface, so that the user adjusts the posture of the terminal), the scanning device collects and decodes the graphic code to obtain information in the graphic code. For example, the receiving account information of the payee, or the landing page address in the advertisement, etc., thereby correspondingly implementing the sending of the electronic money or the jumping of the page.
  • the embodiment of the invention provides a method and a device for processing a graphic code, and a storage medium, which can solve the problem that the size of the image code image is too small or incomplete to cause identification.
  • an embodiment of the present invention provides a method for processing a graphic code, including:
  • Collecting an environment including a graphic code determining a continuous distribution area of pixels of the acquired image in different reference directions, identifying an overlapping area of the continuous distribution area as a potential distribution area of the graphic code; from the potential distribution area Identifying a scan step size in the corresponding partial image, scanning the partial image based on the scan step to obtain a graphic code image; performing decoding processing based on the graphic code image until decoding succeeds to obtain information modulated in the graphic code .
  • an embodiment of the present invention provides a graphics code processing apparatus, including:
  • the collecting unit collects the environment including the graphic code
  • a positioning unit determining a continuous distribution area of pixels of the collected image in different reference directions, and identifying an overlapping area of the continuous distribution area as a potential distribution area of the graphic code
  • a scan step size is identified in a partial image corresponding to the potential distribution area, and the partial image is scanned based on the scan step to obtain a graphic code image;
  • a decoding unit that performs decoding processing based on the graphic code image until decoding succeeds to obtain information modulated in the graphic code.
  • an embodiment of the present invention further provides a graphics code processing apparatus, including at least a processor and a memory for storing a computer program capable of running on a processor, wherein the processor is configured to run the computer At the time of the program, the steps of the method described above are performed.
  • an embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program, the computer program being executed by a processor to implement the steps of the method described above.
  • Embodiments of the present invention have the following beneficial effects: by attempting to identify and decode a graphic code in a rendered image in a preview interface, and decoding based on an image formed only in the scanning frame Compared, the user only needs to adjust the acquisition orientation so that the graphic code can be decoded completely in the preview interface, and the orientation of the acquisition is not required to continue to form a complete graphic code in the scan frame, which significantly reduces the difficulty of scanning the code; When the limitation of the environment causes the graphic code to be unable to be completely imaged in the scanning frame, the scanning and decoding can be completed by adjusting the acquisition orientation in the preview interface, and the scanning mode provided by the related technology is overcome due to environmental constraints. The problem that the decoding failed is not fully imaged in the scan box.
  • FIG. 1-1 to FIG. 1-3 are schematic diagrams of related technologies based on scanning frame scan codes
  • FIG. 2-2 is a schematic diagram of an optional scenario of a method for processing a graphic code in an embodiment of the present invention
  • FIG. 3 is a schematic diagram showing an optional hardware and software structure of a graphics code processing apparatus according to an embodiment of the present invention
  • 4-1 is an optional schematic flowchart of a method for processing a graphic code according to an embodiment of the present invention
  • 4-2 is an optional schematic flowchart of a method for processing a graphic code according to an embodiment of the present invention
  • 5-1 to 5-3 are an optional schematic diagram of forming different graphic codes on the preview interface in the embodiment of the present invention.
  • FIG. 6 is an optional schematic flowchart of a method for processing a graphic code according to an embodiment of the present disclosure
  • FIG. 7-1 to 7-38 are schematic diagrams of respective processing results in the process of collecting an image including a two-dimensional code to identifying a two-dimensional code image in the embodiment of the present invention
  • 8-1 and 8-2 are schematic diagrams showing an optional functional structure of a graphics code processing apparatus according to an embodiment of the present invention.
  • a graphic code that uses a specific graphic element to be distributed in a plane (two-dimensional direction) according to a certain pattern.
  • the graphic code uses a number of symbols (graphic elements) corresponding to the binary code to represent information such as text or numerical values.
  • the code code has a specific character set, and each symbol in the character set occupies a certain width, has a certain check function, and the like.
  • Commonly used graphic codes include, for example, two-dimensional codes, barcodes, and the like.
  • a graphic code image including an image having at least part of a graphic code, for example, all areas of the graphic code image are displayed with a two-dimensional code, or a part of the graphic code image is displayed with a two-dimensional image, and the other part
  • the area shows the imaging of other objects in the environment such as people and objects.
  • Image binarization the gray value of the pixel on the image is set to 0 or 255, that is, the entire image is presented with a distinct black and white effect.
  • An instance that is, an instance of requesting scanning of a two-dimensional code, an application, a process, etc. of a request scan code running in a scan code device, such as a social application.
  • FIG. 1-1 an optional scenario diagram of the scanned two-dimensional code is shown.
  • the graphic code is closer to the user and the size of the graphic code is larger, if the user moves inconveniently, the graphic code is in the preview interface. Imaging exceeds the predetermined scan area, resulting in execution in the scan area Only a part of the two-dimensional code can be scanned during the line scanning operation; see an alternative scene diagram of the scanned two-dimensional code shown in FIG. 1-2.
  • the position of the two-dimensional code is high, only the scanning frame can be collected.
  • the orientation of the user using the terminal to collect the two-dimensional code cannot be adjusted (for example, the space limited by the user's environment)
  • only a part of the two-dimensional code can be scanned when the scanning operation is performed in the scanning area.
  • Step 101 Collect an environment including a graphic code; in step 102, determine a continuous distribution area of pixels of the collected image in different reference directions, and identify an overlapping area of the continuous distribution area as a potential distribution area of the graphic code; The scan step size is identified from the partial image corresponding to the potential distribution area, and the partial image is scanned based on the scan step size to obtain the graphic code image; in step 104, the decoding process is performed based on the graphic code image until the decoding succeeds to obtain the information modulated in the graphic code.
  • the embodiment of the present invention can provide a graphic code processing device that uses the above-described graphic code processing method, and the graphic code processing device can be implemented in various ways as follows.
  • the graphic code processing device may be specifically a mobile phone, a tablet computer, or the like having various image capturing functions.
  • the mobile terminal can utilize a built-in camera (such as a front camera, The rear camera) collects the graphic code, so that the mobile terminal recognizes the graphic code from the collected image.
  • the modules of the graphic code processing device are respectively disposed on the mobile terminal side and the server side of the cloud, and the mobile terminal collects an image including the graphic code and sends the image to the server in the cloud, and the cloud server identifies the graphic code from the image and Decoding is performed, and the decoded result is sent to the mobile terminal for processing.
  • the graphic code processing module can be set to have image collection function and graphic code recognition.
  • SoC system-on-system
  • ASIC application specific integrated circuit
  • FPGA logic programmable gate array
  • the graphic code processing device may be provided in a dedicated scanning device for identifying a graphic code, such as a barcode scanner, a two-dimensional code scanner, or the like.
  • the embodiment of the present invention further provides a computer readable storage medium, for example, a memory including a computer program, further storing a computer program in the storage medium, the computer program being executed by a processor in the graphic code processing device
  • a computer readable storage medium may be a magnetic random access memory (FRAM), a read only memory (ROM), a programmable read only memory (PROM), or a programmable read-only memory (PROM).
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • Flash Memory Magnetic Surface Memory
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • Flash Memory Magnetic Surface Memory
  • a memory such as an optical disk or a CD-ROM (Compact Disc Read-Only Memory); or a device including one or any combination of the above memories.
  • the computer readable storage medium stores a computer program, wherein when the computer program is executed by the processor, the following steps are implemented:
  • Collecting an environment including a graphic code determining a continuous distribution area of pixels of the acquired image in different reference directions, identifying an overlapping area of the continuous distribution area as a potential distribution area of the graphic code; from the potential distribution area Identifying a scan step size in the corresponding partial image, scanning the partial image based on the scan step to obtain a graphic code image; performing decoding processing based on the graphic code image until decoding succeeds to obtain information modulated in the graphic code .
  • the computer program when executed by the processor, further implements the step of presenting the captured image on a preview interface for adjusting the acquisition orientation until the graphic code is in the Complete imaging within the preview interface.
  • the partial image is subjected to decoding processing and detection of decoding failure.
  • the partial image is decoded, and when the information modulated by the graphic code is decoded, the environment including the graphic code is suspended.
  • the performing the decoding process based on the graphic code image comprises: adjusting to the size of the identified graphic code image to be consistent with the size of the scan frame, and decoding based on the adjusted graphic code image deal with.
  • the computer program when executed by the processor, further implements the steps of: presenting information modulated in the graphics code, and/or transmitting information modulated in the graphics code to an instance requesting scanning of the graphics code .
  • the determining the continuous distribution area of the pixels of the acquired image in different reference directions, and identifying the overlapping area of the continuous distribution area as the potential distribution area of the graphic code includes: determining the acquired image The continuous distribution area of the black pixels in different reference directions in the binarized image, and the overlapping area of the continuous distribution area is identified as the potential distribution area of the graphic code in the corresponding image.
  • the determining a continuous distribution area of black pixels in different reference directions in the binarized image of the acquired image comprises: determining a histogram of black pixels in different reference directions in the binarized image of the acquired image. a statistical graph, denoising the histogram, and mapping the continuous distribution area in the histogram after denoising to the area in the binarized image of the corresponding image area.
  • the denoising the histogram includes: dividing the histogram into equal parts according to a corresponding reference direction, and setting statistics in the aliquot that meets the predetermined condition. zero.
  • the statistical data in the halved block that satisfies the predetermined condition is zeroed, including at least one of the following:
  • the statistical data in the corresponding equal-blocking block is set to zero;
  • the statistical data in the corresponding equal block is zeroed.
  • the identifying a scan step size from the partial image corresponding to the potential distribution area comprises: expanding and etching the binarized image of the partial image, and performing binary values on the partial image
  • the cumulative number of occurrences of each black pixel block and the adjacent size black pixel block is identified in the image, and the scanning step size is identified based on the size of the black pixel block corresponding to the highest cumulative number of occurrences.
  • the number of occurrences of each black pixel block and the adjacent size black pixel block is determined in the binarized image of the partial image, and the size of the black pixel block corresponding to the highest number of occurrences is determined, including:
  • the binarized image of the partial image is sampled according to different reference directions to obtain a strip image, and the length of the continuous distribution region in the histogram of each strip image is identified, and each length and adjacent in the range of length fluctuation are counted.
  • the number of occurrences of the length, the length corresponding to the highest number of occurrences is selected as the size of the black pixel block corresponding to the highest number of occurrences.
  • the scanning the partial image based on the scanning step to obtain a graphic code image comprises: scanning a binarized image of the partial image by using the scanning step, A point set obtained by scanning the pixel points corresponding to the scan mode is mapped into the binarized image of the partial image, and a point set of the mapped pixel points is recognized as the graphic code image.
  • the scanning the binarized image of the partial image in a scan step comprises: detecting a black pixel point in a binarized image of the partial image that conforms to a predetermined scan mode, and When it is detected that the position of the scanning step from the black pixel has a white pixel point conforming to a predetermined scanning mode, the point set is formed based on the detected black pixel.
  • the computer program when executed by the processor, further implements the step of: mapping a set of points of pixels that match the scan pattern to a binarized image of the partial image, based on the pixel point
  • the histogram of the set of points performs denoising processing on the set of points of the pixel points.
  • the graphics code processing apparatus may be based on resources of a mobile terminal (or server) such as computing resources (such as computing resources implemented by a processor) and communication resources. (Improved as a communication resource realized by a network interface), at this time, the mobile terminal is an entity that executes the graphic code processing method shown in FIG. 2-1.
  • the graphic code processing method provided by the embodiment of the present invention may also be partially executed in the mobile terminal on the user side, and the other partial steps are performed on the server side, for example, the mobile terminal and the instant communication server cooperate to execute the foregoing graphic code processing method, and correspondingly
  • the graphic code processing device is also implemented based on resources such as a computing resource (such as a processor) and a communication resource (such as a network interface) on the side of the instant messaging server and the mobile terminal.
  • the graphic code processing apparatus described in this embodiment may be implemented as executable instructions stored in a storage medium, including computer executable instructions such as programs and modules, and the storage medium may be set in instant communication.
  • the server or, is distributed in the instant messaging server and the mobile terminal.
  • the graphics code processing apparatus 10 includes a software layer, a driver layer, an operating system layer, and a hardware layer.
  • a software layer a driver layer
  • an operating system layer a hardware layer
  • the structure of the graphic code processing apparatus 10 shown in FIG. 3 is only For the sake of example, the definition of the structure of the graphic code processing apparatus 10 is not formed.
  • the graphic code processing apparatus 10 sets more components than those of FIG. 3 according to implementation needs, or omits setting partial components according to implementation needs.
  • the hardware layer of the graphic code processing apparatus 10 includes a processor 11, an input/output interface 13, a storage medium 14, and a network interface 12, wherein each component communicates via a bus connection.
  • the processor 11 can be implemented by using a central processing unit (CPU), a microprocessor (MCU, Microcontroller Unit), an application specific integrated circuit (ASIC), or a Field-Programmable Gate Array (FPGA).
  • CPU central processing unit
  • MCU microprocessor
  • ASIC application specific integrated circuit
  • FPGA Field-Programmable Gate Array
  • the input/output interface 13 can be implemented using input/output devices such as a display screen, a touch screen, and a speaker.
  • the storage medium 14 may be implemented by using a non-volatile storage medium such as a flash memory, a hard disk, or an optical disk, or may be implemented by using a volatile storage medium such as a double data rate (DDR), which is stored in the storage medium 14 for storage.
  • DDR double data rate
  • the storage medium 14 may be co-located with the graphic code processing device 10 at the same place, or may be remotely disposed remotely with respect to the graphic code processing device 10, or may be distributed locally and remotely with respect to the graphic code processing device 10.
  • the network interface 12 provides the processor 11 with access capabilities of external data such as the off-site set storage medium 14.
  • the network interface 12 may be based on Near Field Communication (NFC) technology, Bluetooth technology, Zigbee (ZigBee) technology for short-range communication, and can also implement communication systems such as Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), and its evolution. Standard communication.
  • the driver layer includes middleware 15 for the operating system 16 to identify and communicate with the hardware layer components, such as a collection of drivers for the various components of the hardware layer.
  • the operating system 16 is for providing a user-oriented graphical interface, illustratively including a plug-in icon, The desktop background and the application icon, the operating system 16 supports the user to control the device via the graphical interface.
  • the software environment of the device such as the operating system type and version, is not limited, for example, it may be an Android operating system or an iOS operation. System, Linux operating system or UNIX operating system.
  • the software layer includes various applications 17 that need to scan the graphics code, such as, for example, a social application that includes adding friends, transferring funds, or giving an electronic red envelope by scanning the graphic code, and/or an electronic payment application that pays the merchant by scanning the graphic code. Wait.
  • a social application that includes adding friends, transferring funds, or giving an electronic red envelope by scanning the graphic code
  • an electronic payment application that pays the merchant by scanning the graphic code. Wait.
  • the graphics code processing method provided by the embodiment of the present invention is described as an example of the mobile terminal implementation on the user side. Accordingly, the graphics code processing apparatus shown in FIG. 3 can be implemented as a mobile terminal on the user side. Other embodiments of the graphic code processing device can be implemented by referring to the following description. Based on the implementation of the graphics code processing method provided by the embodiment of the present invention on the mobile terminal side, a person skilled in the art can easily implement partial processing to the server implementation of the cloud, so that the cloud server and the user side mobile terminal cooperate to implement the implementation of the present invention.
  • the graphic code processing method provided by the example for example, the collection of the image including the graphic code is completed by the mobile terminal, and the graphic code is located and recognized by the cloud server from the image, and the recognized two-dimensional code is sent to the mobile terminal according to Applications that process graphics code recognition results (such as social applications, electronic payment applications, etc.).
  • the graphic code processing device is implemented as a scanning device (such as a mobile terminal such as a smart phone or a scanning device such as a scanner), and the graphic device processing method is implemented by the scanning device as an example, and the invention shown in FIG. 4-1 is combined.
  • An optional flow diagram of the graphics code processing method provided by the embodiment is described. Referring to FIG. 4-1, the graphics code processing includes the following steps:
  • step 201 the graphic code scanning function is turned on.
  • the user when the user uses the social application in the mobile phone, the user scans the scanning function in the social application by a touch operation or other forms of triggering operations, such as “sweeping” to scan the QR code business card, Dimensional payment account or QR code URL.
  • the cashier of the store uses the scan code check function of the scanner to scan the barcode of the user's purchase of the product, or scan the payment QR code presented by the user for the payment.
  • the subsequent steps describe the response process of the scanning device after the graphic code scanning function is turned on.
  • the scanning device can still acquire an image including the complete two-dimensional code.
  • the scanning device when the graphic code scanning function of the scanning device is turned on, can also open the preview frame and the scanning frame located in the preview frame, thereby facilitating the user to adjust the collection position of the scanning device by viewing the captured image, thereby realizing The effect of including the complete two-dimensional code image is efficiently collected, which will be described below in connection with step 202a and step 202b.
  • step 202a the preview interface of the image acquisition is opened, and the scan frame is loaded in the preview interface.
  • Step 202b Collect an environment including a graphic code, and present an image in the collected image stream in the preview interface.
  • the user can determine whether to adjust the acquisition orientation of the scanning device by observing whether the two-dimensional code is completed in the preview frame, so that the acquired orientation of the scanning device is targeted.
  • the adjustment laid the foundation and laid the foundation for the fast and complete imaging of the QR code in the preview frame.
  • the scan box located inside the preview frame is used to assist the user to adjust the acquisition position of the scanning device, so that the image size of the graphic code in the environment is consistent with the scan frame or inside the scan frame, so as to realize the fast image code.
  • Scanning and decoding lay the foundation.
  • the position and shape of the scan frame can be various.
  • the scan frame is located at the center of the preview interface (of course, it can be located at other parts such as the upper part of the preview interface) and presents the outer contour of the scan frame. Shapes such as circles, which can be either solid or dashed.
  • the complete imaging of the two-dimensional code on the preview interface includes several cases: 1) as shown in Figure 5-3, the two-dimensional code is completely imaged in the scan frame; 2) as shown in Figure 5-2.
  • the QR code is completely imaged in the preview frame and partially imaged in the scan frame; 3)
  • the QR code is completely imaged in the preview frame except the scan frame.
  • the scanning device collects a stream formed by forming a frame image (abbreviated as an image) through a camera (for example, a camera set by the scanning device itself or an external camera controlled by a wired or wireless method), and real-times in the preview interface. Each image in the image stream is rendered.
  • a camera for example, a camera set by the scanning device itself or an external camera controlled by a wired or wireless method
  • the orientation of the scanning device is affected by the user's holding posture, after the scanning device starts to collect, it is often difficult for the user to quickly adjust the orientation of the scanning device to call the camera, so that the imaging code is imaged on the preview interface.
  • the scan box is matched.
  • the image code may not be presented in the image originally presented in the preview interface.
  • a partial graphic code is presented in the preview interface. Until full imaging in the preview interface.
  • Step 203 Determine a continuous distribution area of pixels of the acquired image in different reference directions, and identify an overlapping area of the continuous distribution area as a potential distribution area of the graphic code.
  • the potential distribution area, the potential distribution area refers to the area with the highest probability of having a graphic code in the collected area.
  • Step 204 Identify a scan step size from a partial image corresponding to the potential distribution area, and scan the partial image based on the scan step size to obtain a graphic code image.
  • the acquisition orientation of the scanning device is often in the process of dynamic adjustment.
  • the image collected by the potential distribution area scanning device is distributed with the graphic code.
  • the area may also include other objects.
  • a scan is identified for a partial image corresponding to a potential distribution area Step size, when scanning a partial image based on the scan step size to obtain a graphic code image, the following steps can be implemented:
  • Step (1) analyzes the size of the symbol in the graphic code as the scanning step size in the binarized image of the partial image.
  • the binarized image of the partial image is expanded and etched, and each black pixel block (which is a collection of continuously distributed black pixels) and adjacent dimensions are identified in the binarized image of the partial image.
  • the cumulative number of occurrences of the black pixel block determines the size of the black pixel block corresponding to the highest cumulative number of occurrences, and the intermediate size pixel block in the black pixel block corresponding to the highest cumulative number of occurrences is taken as the size of the symbol in the graphic code.
  • the number of occurrences of each black pixel block and the adjacent size black pixel block is identified, and when the size of the black pixel block corresponding to the highest number of occurrences is determined, the binary value of the partial image is determined.
  • the image is sampled according to different reference directions to obtain a strip image, and the length of the continuous distribution area in the histogram of each strip image is identified, and the lengths of each length and the adjacent length in the range of length fluctuation are counted, and the highest occurrence occurs.
  • the corresponding length of the number of times is taken as the size of the black pixel block corresponding to the highest number of occurrences.
  • Step (2) scanning the partial image based on the scanning step to obtain a graphic code image.
  • the binarized image of the partial image is scanned by the size of the symbol as the scan step, and the set of points of the pixel obtained by scanning the scan pattern is mapped to the binarized image of the partial image, and the mapping is performed.
  • the point set of the obtained pixel points is recognized as a graphic code image.
  • the binarized image of the partial image may be expanded and etched to remove noise, and the noise pair image in the binarized image is avoided. The accuracy of the size of the symbols in the code adversely affects.
  • each black pixel in the binarized image of the partial image is a black pixel corresponding to a predetermined scanning mode, and Detects scanning from black pixels that match the predetermined scan mode Whether the position of the step has a white pixel point conforming to the predetermined scanning mode, thereby obtaining a point set of black pixel points conforming to the predetermined scanning mode, and the point set of the black pixel point conforming to the predetermined scanning mode is taken as the point of the pixel point conforming to the scanning mode
  • the set further constitutes a graphic code image in the form of a point set.
  • the histogram based on the point set of the pixel point performs denoising processing on the point set of the pixel point, which can effectively remove the decoding. Interference, improve the success rate of decoding.
  • the embodiment of the present invention can analyze the binarized image of the partial image and analyze the symbol.
  • the size therefore, achieves an effect of adaptively determining the scan step size of the graphics code in the corresponding image based on the acquisition orientation of each image in the image stream, as compared to scanning the two-dimensional code in the image using a fixed scan step size, The scan results are more accurate.
  • Step 205 adjusting to the size of the graphic code image and the size of the scan frame, performing decoding processing based on the adjusted graphic code image, and determining whether the decoding is successful. If successful, performing step 206; otherwise, returning to step 203 to continue processing the collected Next image.
  • the scanning device decodes the graphic code image that is consistent with the size of the scanning frame. Since the size of the graphic code image in the scanning frame is determined, the positioning symbol of the graphic code can be quickly identified and decoded, and the decoding efficiency is high. However, the image code image identified in the preview interface is not consistent with the size of the scan frame. Therefore, by adjusting the size of the image code image to the same scan frame, the scan frame-based scan code processing scheme can be invoked. It lays the foundation for improving the efficiency and accuracy of graphics decoding.
  • step 206 the collection of the environment including the graphic code is suspended.
  • At least one of the following steps 207 and 208 may also be performed:
  • Step 207 presenting information modulated in the graphic code.
  • the graphic code is a two-dimensional code business card
  • the name of the contact modulated in the two-dimensional code is presented.
  • Step 208 transmitting the information modulated in the graphic code to an instance requesting scanning of the graphic code.
  • the page address is sent to the browser for the browser to load the corresponding page data.
  • the browser running by the user using the scanning device needs to scan the URL QR code
  • the browser is opened.
  • Scanning code function the camera of the scanning device collects images according to the current acquisition orientation, loads the scanning frame in the preview interface, and presents the image in the image stream in real time on the preview interface.
  • the scanning device does not acquire the orientation. Aligning the graphic code causes the graphic code to not be imaged in the preview interface 51.
  • the user adjusts the acquisition orientation of the scanning device, so that the graphic code presents a partial two-dimensional code image in the preview interface 52, and the calibration is continuously calibrated with the acquisition orientation.
  • a complete two-dimensional code image is presented in the preview interface 53.
  • the graphic code processing method according to the embodiment of the present invention can be used for two-dimensional The code image is decoded and the page address modulated therein is obtained, thus overcoming the related art and requiring the user to continue to adjust Collection azimuth described equipment to scan box presents a complete two-dimensional code decoding graphics to limit and reduce the difficulty of the operation of the two-dimensional code scan code to improve the efficiency of the two-dimensional code scan code.
  • the two-dimensional code to be scanned is located in a small space and the area is very large, the user cannot move to a position far enough away from the two-dimensional code so that the two-dimensional code is completely scanned in the preview interface.
  • the two-dimensional code image in the preview interface 53 is decoded based on the above-mentioned graphic code processing method, and the related technology relies on the scanning frame.
  • the size of the dimension code is too large to scan the code.
  • step 203 referring to an optional flowchart of the graphics code processing method shown in FIG. 4-2, based on FIG. 4-1, before step 203, the following steps are further included:
  • Step 209 Perform decoding processing on the partial image formed in the scan frame based on the acquired image, and detect whether the decoding is successful. If successful, proceed to step 206 and perform step 207; if not, proceed to step 203.
  • the application scenario of the graphic code processing method shown in FIG. 5-2 and FIG. 5-3 is still described by taking the two-dimensional code scanning code as an example.
  • the distance is compared with the two-dimensional code.
  • the decoding is first attempted based on the partial image in the scan frame.
  • the QR code is completely imaged in the scan frame, it is based on The partial image in the scan box can be decoded successfully; for the case of Figure 5-2, the decoding fails due to the lack of complete imaging of the QR code in the scan frame; then, the potential of the QR code based on the currently presented image in the preview interface
  • the distribution area identifies and decodes the two-dimensional code based on the potential distribution area. Since the two-dimensional code is completely imaged on the preview interface in FIG. 5-3, the information modulated in the two-dimensional code can be decoded.
  • the decoding can be guaranteed by first using the scheme of intra-dimensional code decoding.
  • Efficiency on the other hand, the use of image decoding in the preview interface when image decoding fails in the scan frame can maximize the decoding success rate, avoid the problem of frequent adjustment of the acquisition orientation by the user, and cannot adjust the acquisition orientation due to environmental constraints. The problem of fully imaging a QR code within a scan frame.
  • the embodiment of the present invention performs decoding of the graphic code based on the collected image (optionally, the captured image is presented in the preview frame), loading the scan frame in the preview frame is not implemented.
  • the necessary conditions of the graphic code processing method for example, in another scene, the user adjusts the acquisition orientation through the preview frame until the graphic code completes the imaging in the preview frame. At this time, regardless of whether the graphic code is imaged in the scanning frame, the image can be passed through the image. 4-1 and the graphic code processing method shown in FIG. 6 are identified and decoded, so that it is easier for the user to complete the imaging of the graphic code in the preview interface, because the graphic code is completely imaged in the scanning frame (because the preview) The interface has a larger acquisition angle. For the user, it is not necessary to use the scan box to align the graphic code, so the scan code is simpler.
  • FIG. 6 a specific example of the two-dimensional code scanning code is used to describe the implementation of the foregoing graphic code processing method, and the following steps are included in FIG. 6:
  • step 401 an image is input, that is, an image including a single two-dimensional code is acquired by a camera of the scanning device.
  • step 402 the image is binarized.
  • the image binarization threshold is calculated, and the image is binarized according to the binarization threshold.
  • the preview interface binarization in Figure 1-1, Figure 1-2 and Figure 1-3 The subsequent images correspond to Figures 7-1, 7-2, and 7-3.
  • step 403 the binarized image is expanded and etched to remove noise points in the image.
  • the binarized graphs shown in 7-1, 7-2, and 7-3 are expanded and filtered as shown in Figures 7-4, 7-5, and 7-6.
  • Step 404 performing histogram statistics on the denoised image, and counting the number of black pixels per row and each column (statistical data).
  • the histogram of the black pixels of each row in the binarized image shown in FIG. 7-4 corresponds to the binarized image shown in FIG. 7-7 and FIG. 7-8, and the graph shown in FIG. 7-5.
  • Straight black pixels in each row The square chart corresponds to Figure 7-9 and Figure 7-10.
  • the histogram of the black pixel of each row in the binarized image shown in Figure 7-6 corresponds to Figure 7-11 and Figure 7-12. Show.
  • Step 405 denoising the black pixel histogram according to the histogram denoising algorithm.
  • the histogram statistical data denoising algorithm provided by the embodiment of the present invention is as follows:
  • rightHistSum is represented as a histogram aliquoting the right half of each
  • leftHistSum is represented as a histogram aliquoting the left half of each.
  • maxHist is expressed as the maximum value in each of the histogram aliquots
  • minHist is expressed as the minimum value in each of the histogram aliquots.
  • Block 2 equal block 3, equal block 4, and equal block 1 and equal block 5 are both set to 0, the total statistical value of the equal block 2 is a, and the total statistical value of the equal block 4 is b. , the total statistic of equal block 1 is c, and the total statistic of equal block 5 is d, then,
  • Step 406 Map the entire histogram connection region back to the expansion corrosion (aluminum foil) image for the entire histogram connection region, and take out the image block corresponding to the entire connection region in the image to obtain a local binary image.
  • the statistical sum of the left half of the aliquot 1 is: 17372, the statistical sum of the right half is: 2644, the maximum value is: 1276, and the minimum value is: 30.
  • the statistical sum of the left half of the aliquot 2 is: 9162, the statistical sum of the right half is: 10568, the maximum value is 398, and the minimum value is: 25.
  • the statistical sum of the left half of the aliquot 3 is: 10657, the statistical sum of the right half is: 9879, the maximum value is 421, and the minimum value is: 111.
  • the statistical sum of the left half of the aliquot 4 is: 11269, the statistical sum of the right half is: 8966, the maximum value is 408, and the minimum value is 154.
  • the statistical sum of the left half of the aliquot 5 is: 11301, the statistical sum of the right half is: 9363, the maximum value is 384, and the minimum value is 164.
  • the statistical sum of the left half of the aliquot 6 is: 7654, the right half of the statistical sum is: 12156, the maximum value is: 426, and the minimum value is: 146.
  • the statistical sum of the left half of the aliquot 7 is: 10010, and the right half of the statistical sum is: 12871, the most The large value is 430 and the minimum value is 228.
  • the statistical sum of the left half of the aliquot 8 is: 10326, the statistical sum of the right half is: 8773, the maximum value is 394, and the minimum value is 42.
  • the statistical sum of the left half of the aliquot 9 is: 8129, the right half of the statistical sum is: 2199, the maximum value is: 483, and the minimum value is 28.
  • the statistical sum of the left half of the aliquot 10 is: 3179, the statistical sum of the right half is: 15489, the maximum value is: 1154, and the minimum value is 46.
  • Figure 7-13 shows the statistics of the aliquot 1 to the aliquot 10 from left to right:
  • the aliquot which can set 0 in 10 equal parts is marked as 1, and the aliquot of the original statistic is marked as 0, so that the aliquot of the image from left to right is divided into 1 to aliquots.
  • the result of marking 10 is:
  • the statistical sum of the left half of the aliquot 1 is: 4509, the statistical sum of the right half is: 2577, the maximum value is 177, and the minimum value is: 0.
  • the statistical sum of the left half of the aliquot 2 is: 7892, and the right half of the statistical sum is: 11714, the maximum value is 289, and the minimum value is 39.
  • the statistical sum of the left half of the aliquot 3 is: 1114, the statistical sum of the right half is: 1167, the maximum value is: 45, and the minimum value is: 5.
  • the statistical sum of the left half of the aliquot 4 is: 5825, the statistical sum of the right half is: 3346, the maximum value is 170, and the minimum value is 9.
  • the statistical sum of the left half of the aliquot 5 is: 8609, the statistical sum of the right half is: 16759, the maximum value is 346, and the minimum value is 9.
  • the statistical sum of the left half of the aliquot 6 is: 17127, the right half of the statistical sum is: 13688, the maximum value is: 342, and the minimum value is: 134.
  • the statistical sum of the left half of the aliquot 7 is: 14353, the statistical sum of the right half is: 16442, the maximum value is 326, and the minimum value is 109.
  • the statistical sum of the left half of the aliquot 8 is: 17223, the statistical sum of the right half is: 10382, the maximum value is 363, and the minimum value is 20.
  • the statistical sum of the left half of the aliquot 9 is: 3461, the right half of the statistical sum is: 2928, the maximum value is 115, and the minimum value is 24.
  • the statistical sum of the left half of the aliquot 10 is: 6838, the statistical sum of the right half is: 26013, the maximum value is 708, and the minimum value is 23.
  • the aliquot of 0 can be set to 1 in the aliquot, and the aliquot of the original statistic is marked as 0, so that the unequal 1 to aliquot of the graph from bottom to top is shown in FIG.
  • the result of marking 10 is:
  • the statistical interference data is removed, and the denoised data is obtained. Histograms 7-15 and 7-16 are shown.
  • the statistics range of the columns retained in Figure 7-15 is 144 to 503.
  • the statistics of the rows retained in Figure 7-16 are 640 to 895. Obtain image blocks within the intersection of the row statistics range and the column statistics range as shown in Figure 7-17.
  • step 407 image strip sampling is performed on the partial image block.
  • Step 408 Obtain 6 partial image sample strip images, perform x-axis histogram statistics on 3 sample images in the 6 images, and perform y-axis histogram statistics on 3 column samples:
  • the width of the image block is the width of the image in the boundary region
  • the height is b
  • b is temporarily set to 10 pixels
  • b is adjustable
  • the image is expanded and etched After processing, an image as shown in Figures 7-18 is obtained.
  • the image block in the boundary region is divided into upper and lower strip regions from the middle in the row direction, and one image block is taken in the row direction at 1/2 of the two strip regions.
  • the width of the image block is the width of the image in the boundary region
  • the height is b
  • b is temporarily set to 20 pixels
  • b is adjustable.
  • the image block in the boundary region is divided into two left and right strip regions from the middle in the column direction, and one image block is taken in the column direction at 1/2 of the two strip regions.
  • the width of the image block is a
  • a is temporarily set to 20 pixel points
  • a is adjustable
  • the height is the height of the image taken out by the statistical boundary.
  • the adaptive step size calculation method is as follows:
  • the algorithm obtains 6 small image area blocks, 3 line direction image blocks, and 3 column direction image blocks.
  • the histogram statistics are performed on the black pixels, and the statistical values thereof are recorded on the x coordinate axis.
  • Figures 7-18, 7-20, and 7-21 show the histograms on the X-axis as shown in Figures 7-24, 7-25, and 7-26, respectively.
  • Step 409 performing length statistics according to the length of the continuous line segment formed by the histogram statistics, and root
  • the adaptive step size is calculated according to an adaptive step size statistical algorithm.
  • the length of the line segment 13 and its length 12, 14 can be determined.
  • Step 410 Scan the binarized image by scanning the two-dimensional code scanning mode with the adaptive step size as a unit.
  • step 411 a two-dimensional code region dot map is obtained.
  • the entire image is scanned according to the following scanning mode, thereby obtaining a point set of the region where the two-dimensional code is located.
  • the QR code scanning mode is shown in Figure 7-30:
  • the pixel value of the detection point must match the black point with a pixel value of 0;
  • the distance from the detection point is one step at the detection step stepLen, and the pixel value of the auxiliary point is 255 as a white point.
  • the pixel value of the auxiliary point is 255 as a white point.
  • Figure 7-4 is scanned by scan mode to obtain data points with two-dimensional code characteristics, as shown in Figure 7-31.
  • step 412 the histogram statistics of the two-dimensional code area point map are performed, and the largest block statistical area is taken.
  • the histogram statistics are performed on the points detected by the two-dimensional code through the scanning mode, as shown in Fig. 7-32 and Fig. 7-33, and the images after the histogram denoising are shown in Fig. 7-34 and Fig. 7-35.
  • Step 413 mapping back to the binarized image to obtain an accurate two-dimensional code image block.
  • the maximum block area x ranges from 79 to 576, and the y range is from 539 to 993, that is, the width.
  • the value is 497 and the height is 454.
  • the area is mapped to the binarized image as shown in Figure 7-36.
  • Step 414 Perform scaling according to the size ratio of the two-dimensional code image block to the scan code frame.
  • Step 415 The two-dimensional code image block is scaled into a size image recognizable by the scan code frame for decoding, thereby completing the process of adaptive positioning identification of the entire single two-dimensional code.
  • x range is: 59-596
  • y range is: 519-1013
  • the corresponding image is shown in Figure 7-37.
  • the size of the original scan frame is 409 wide and 370 high.
  • the original picture is: 537*494, after scaling: 375*345.
  • the image will not exceed the scan box area after scaling: 409*370.
  • an optional functional structure diagram of the graphic code processing apparatus 20 includes:
  • the collecting unit 21 can be implemented by an image capturing module including a camera, and collects an environment including a graphic code;
  • the preview interface unit 22 loads a scan box in the preview interface, and presents an image in the collected image stream on the preview interface;
  • the positioning unit 23 identifies a scanning step size in a partial image corresponding to the potential distribution area, and scans the partial image based on the scanning step to obtain a graphic code image;
  • the identifying unit 24 identifies a scanning step size in a partial image corresponding to the potential distribution area, and scans the partial image based on the scanning step to obtain a graphic code image;
  • the decoding unit 25 attempts to perform decoding processing based on the graphic code image until the decoding is successful.
  • the information modulated in the graphic code is obtained.
  • the functional units of the acquisition unit 21, that is, the preview interface unit 22, the positioning unit 23, the identification unit 24, and the decoding unit 25 in the graphics code processing apparatus can all run the storage medium 14 by the processor 11 shown in FIG.
  • a unit having a corresponding function is implemented in the executable instruction, and the function unit in the graphic code processing device as shown in FIG. 8-1 can be implemented on the side of the scanning code device (such as a smart phone), that is, the pair includes the graphic code.
  • the image acquisition, the positioning and identification of the graphic code, and the decoding are all performed on the mobile terminal side; of course, as shown in FIG. 8-2, the functional unit of the graphic code processing device 20 can be implemented on the scanning device side and the server side of the cloud, and the scanning code is performed.
  • the device is responsible for collecting images including the graphic code
  • the cloud server is responsible for positioning and identifying the graphic code and decoding, and transmitting the decoding result to the scanning code device.
  • the acquisition unit 21 can be implemented by a camera.
  • the decoding unit 25 decodes a partial image formed in a scan frame of the preview interface based on the image before the potential distribution area of the graphic code is located in the image acquired by the acquisition unit 21. Processing and detecting that the decoding failed.
  • the decoding unit 25 decodes the partial image formed within the scan frame of the preview interface based on the image before the potential distribution area of the graphic code is located in the image acquired by the acquisition unit 21;
  • the collecting unit 21 is further configured to: when the decoding unit 25 decodes the information modulated in the graphic code, suspend collecting the environment including the graphic code.
  • the decoding unit 25 adjusts to the size of the graphic code image to match the size of the scan frame, and performs decoding processing based on the adjusted graphic code image.
  • the decoding unit 25 presents information modulated in the graphics code and/or transmits information modulated in the graphics code to an instance requesting scanning of the graphics code.
  • the positioning unit 23 may adopt a continuous distribution area of pixels of the acquired image in different reference directions, and identify an overlapping area of the continuous distribution area as a potential distribution area of the graphic code. The following manner: determining that the acquisition unit 21 collects an image A continuous distribution area of black pixels in different reference directions in the binarized image, and an overlapping area of the continuous distribution area is identified as a potential distribution area of the graphic code in the corresponding image.
  • the positioning unit 23 determines a continuous distribution area of black pixels in different reference directions in the binarized image of the image
  • the following manner may be adopted: determining that the black pixel in the binarized image of the image is A histogram of different reference directions is used to denoise the histogram, and it is determined that the continuous distribution area in the histogram after denoising is mapped to the area in the binarized image of the corresponding image.
  • the locating unit 23 performs denoising on the histogram, and may adopt the following manner: averaging the histogram along the corresponding reference direction to obtain an aliquot, and halving the predetermined condition.
  • the statistics in the block are set to zero.
  • the positioning unit 23 zeros the statistical data in the halved block that satisfies the predetermined condition, including at least one of the following:
  • the statistical data in the corresponding equal-blocking block is set to zero; when the statistical data of the adjacent equal-blocking block of the equal-divided block is zero, correspondingly, etc.
  • the statistical data in the block is set to zero; when the signal-to-noise ratio of the equal block and the adjacent equal block is the minimum value of the signal-to-noise ratio between the adjacent equal blocks, the statistical data in the corresponding equal block is Zero.
  • the positioning unit 23 identifies the scanning step size from the partial image corresponding to the potential distribution area, and may adopt a method of performing an expansion and etching operation on the binarized image of the partial image, in the local portion.
  • the cumulative number of occurrences of each black pixel block and the adjacent size black pixel block is identified in the binarized image of the image, and the size of the black pixel block corresponding to the highest cumulative number of occurrences is determined.
  • the positioning unit 23 identifies the number of occurrences of each black pixel block and the adjacent size black pixel block in the binarized image of the partial image, and determines the size of the black pixel block corresponding to the highest number of occurrences, which may be adopted.
  • the binarized image of the partial image is sampled according to different reference directions to obtain a strip image, and the rectus of each strip image is identified. Calculate the length of the continuous distribution area in the graph, count the length of each length and the number of occurrences of the adjacent length within the range of the length fluctuation, and select the length corresponding to the highest occurrence number as the size of the black pixel block corresponding to the highest occurrence number.
  • the identification unit 24 identifies the graphic code image from the partial image based on the size of the symbol, and may adopt a manner in which the size of the symbol is the scanning step size of the partial image.
  • the valued image is scanned, and a point set obtained by scanning the pixel points corresponding to the scan mode is mapped into the binarized image of the partial image, and the set of points of the mapped pixel points is recognized as the graphic code image.
  • the identification unit 24 scans the binarized image of the partial image with the size of the symbol as a scan step, and may adopt a method of detecting a binarized image of the partial image. Whether a black pixel point is a black pixel point that conforms to a predetermined scanning mode and a position of a scanning step size from the black pixel point has a white pixel point that conforms to a predetermined scanning mode, and a point set of the black pixel point is obtained.
  • the identification unit 24 pairs the set of points of the pixel points that match the scan mode to the binarized image of the partial image before the pixel is based on the histogram of the point set of the pixel point.
  • the point set of the point is denoised.
  • An embodiment of the present invention further provides a graphics code processing apparatus, including: a processor and a memory for storing a computer program capable of running on a processor, where the processor may be an integrated circuit chip having a signal Processing power.
  • each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software.
  • the above processor may be a general purpose processor, a digital signal processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like.
  • DSP digital signal processor
  • the processor may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present invention.
  • a general purpose processor can be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present invention may be directly embodied as a hardware decoding processor. Execution is complete, or the combination of hardware and software modules in the decoding processor is performed.
  • the software module can be located in a storage medium, the storage medium being located in the memory, the processor reading the information in the memory, and completing the steps of the foregoing methods in combination with the hardware thereof.
  • Collecting an environment including a graphic code determining a continuous distribution area of pixels of the acquired image in different reference directions, identifying an overlapping area of the continuous distribution area as a potential distribution area of the graphic code; from the potential distribution area Identifying a scan step size in the corresponding partial image, scanning the partial image based on the scan step to obtain a graphic code image; performing decoding processing based on the graphic code image until decoding succeeds to obtain information modulated in the graphic code .
  • the following steps are also performed: presenting the captured image on a preview interface for adjusting the acquisition orientation until the graphic code is fully imaged within the preview interface.
  • the following steps are further performed: before localizing the potential distribution area of the graphic code in the acquired image, performing decoding processing on the partial image formed in the scan frame of the preview interface based on the acquired image, and detecting The decoding failed.
  • the performing the decoding process based on the graphic code image comprises:
  • the size of the identified graphic code image is adjusted to match the size of the scan frame, and the decoding process is performed based on the adjusted graphic code image.
  • the determining the continuous distribution area of the pixels of the acquired image in different reference directions, and identifying the overlapping area of the continuous distribution area as the potential distribution area of the graphic code includes: determining the acquired image A continuous distribution area of black pixels in different reference directions in the binarized image, and an overlapping area of the continuous distribution area is identified as a potential distribution area of the graphic code in the corresponding image.
  • the determining a continuous distribution area of black pixels in different reference directions in the binarized image of the acquired image comprises: determining a histogram of black pixels in different reference directions in the binarized image of the acquired image. And performing denoising on the histogram, and mapping the continuous distribution area in the denoised histogram to the area in the binarized image of the corresponding image.
  • the denoising the histogram includes: equally dividing the histogram along a corresponding reference direction to obtain an aliquot, and zeroing the statistic in the aliquot that satisfies the predetermined condition. .
  • the statistical data in the halved block that satisfies the predetermined condition is zeroed, including at least one of the following:
  • the statistical data in the corresponding equal-blocking block is set to zero;
  • the statistical data in the corresponding equal block is zeroed.
  • the identifying a scan step size from the partial image corresponding to the potential distribution area comprises: performing an expansion and etching operation on the binarized image of the partial image, and binarizing the partial image
  • the cumulative number of occurrences of each black pixel block and the adjacent size black pixel block is identified in the image, and is identified based on the size of the black pixel block corresponding to the highest cumulative number of occurrences Scan step size.
  • the number of occurrences of each black pixel block and the adjacent size black pixel block is identified in the binarized image of the partial image, and the size of the black pixel block corresponding to the highest number of occurrences is determined, including: The binarized image of the partial image is sampled according to different reference directions to obtain a strip image, and the length of the continuous distribution region in the histogram of each strip image is identified, and each length and the adjacent length within the length fluctuation range are counted. The number of occurrences, the length corresponding to the highest number of occurrences is selected as the size of the black pixel block corresponding to the highest number of occurrences.
  • the scanning the partial image based on the scanning step to obtain a graphic code image comprises: scanning a binarized image of the partial image by using the scanning step, and scanning is matched to scan A point set of the pixel points of the pattern is mapped into the binarized image of the partial image, and a point set of the mapped pixel points is recognized as the graphic code image.
  • the scanning the binarized image of the partial image in a scan step comprises: detecting a black pixel point in a binarized image of the partial image that conforms to a predetermined scan mode, and detecting The set of points is formed based on the detected black pixel points when a white pixel point conforming to a predetermined scan mode is reached at a position spaced apart from the black pixel point by a scan step.
  • the point set of the pixel is denoised.
  • the foregoing storage medium includes: a mobile storage device, a random access memory (RAM), a read-only memory (ROM), a magnetic disk, or an optical disk.
  • RAM random access memory
  • ROM read-only memory
  • magnetic disk or an optical disk.
  • optical disk A medium that can store program code.
  • the above-described integrated unit of the present invention may be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a standalone product.
  • the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for making
  • a computer device which may be a personal computer, server, or network device, etc.
  • the foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a RAM, a ROM, a magnetic disk, or an optical disk.
  • the user by attempting to identify and decode the graphic code in the presented image in the preview interface, the user only needs to adjust the acquisition orientation so that the graphic code is completely imaged on the preview interface, compared to decoding based on the image formed in the scan frame. It can be decoded without further adjustment of the acquired orientation so that the graphic code forms a complete graphic code in the scanning frame, which significantly reduces the difficulty of scanning the code; and, due to environmental limitations, the graphic code cannot be completed in the scanning frame.
  • the scanning and decoding can be completed, which overcomes the problem that the scanning method provided by the related art is limited due to environmental limitations, and the recognition and decoding fails due to the incomplete imaging in the scanning frame. .

Abstract

本发明实施例公开了一种图形码处理方法及装置、存储介质;方法包括:对包括图形码的环境进行采集;确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域;从所述潜在分布区域对应的局部图像中识别出扫描步长,基于所述扫描步长扫描所述局部图像得到图形码图像;基于所述图形码图像进行解码处理,直至解码成功得到所述图形码中所调制的信息。利用本发明实施例,能够解决图形码成像的尺寸过小或者不完整导致无法进行识别的问题。

Description

图形码处理方法及装置、存储介质
相关申请的交叉引用
本申请基于申请号为201610878832.2、申请日为2016年09月30日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本发明涉及图形码的扫描、解码处理技术,尤其涉及一种图形码处理方法及装置、存储介质。
背景技术
二维码等图形码在社交、支付等场景中得到广泛应用。用户通过调整扫码设备(如具有摄像头的智能手机、平板电脑等移动终端,或者,专用于扫码的终端如扫描枪)的位姿,使得图形码在图像采集的预览界面中呈现的图像的轮廓与预览界面中预定的扫描区域一致(例如,在预览界面中提示扫描区域的轮廓,以使用户调整终端的位姿)时,扫码设备对图形码进行采集并解码得到图形码中的信息,如收款方的接收账户信息,或者广告中的落地页地址等,从而对应实现电子货币的发送、或者页面的跳转。
实际应用中,用户扫描图形码时经常遇到图形码在图像采集的预览界面中成像与预览界面中设定的扫描框不一致的情况,导致采集到的图形码相对扫描框过小,或者在扫描框内没有形成完整的图形码图形,从而无法对采集到的图形码进行解码。
发明内容
本发明实施例提供一种图形码处理方法及装置、存储介质,能够解决图形码成像的尺寸过小或者不完整进而导致无法进行识别的问题。
本发明实施例的技术方是这样实现的:第一方面,本发明实施例提供了一种图形码处理方法,包括:
对包括图形码的环境进行采集;确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域;从所述潜在分布区域对应的局部图像中识别出扫描步长,基于所述扫描步长扫描所述局部图像得到图形码图像;基于所述图形码图像进行解码处理,直至解码成功得到所述图形码中所调制的信息。
第二方面,本发明实施例提供了一种图形码处理装置,包括:
采集单元,对包括图形码的环境进行采集;
定位单元,确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域;;
识别单元,所述潜在分布区域对应的局部图像中识别出扫描步长,基于所述扫描步长扫描所述局部图像得到图形码图像;
解码单元,基于所述图形码图像进行解码处理,直至解码成功得到所述图形码中所调制的信息。
第三方面,本发明实施例还提供了一种图形码处理装置,至少包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行权利要求以上所述方法的步骤。
第四方面,本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以上所述方法的步骤。
本发明实施例具有以下有益效果:通过在预览界面中对呈现的图像中尝试识别图形码并进行解码,与仅基于在扫描框中形成的图像进行解码相 比,用户只要调整采集方位使得图形码在预览界面完整成像即可进行解码,不需要继续调整采集的方位使图形码在扫描框中形成完整的图形码,显著降低了扫码的操作难度;因环境的限制导致图形码无法在扫描框内无法完整成像时,只要调整采集方位在预览界面内完整成像即可完成扫码和解码,克服了相关技术提供的扫码方式因环境限制时,因在扫描框内无法完整成像而导致识别解码失败的问题。
附图说明
图1-1至图1-3为相关技术基于扫描框扫码的示意图;
图2-1是本发明实施例中图形码处理方法的一个可选的流程示意图;
图2-2是本发明实施例中图形码处理方法的一个可选的场景示意图;
图3是本发明实施例中图形码处理装置的一个可选的软硬件结构示意图;
图4-1是本发明实施例提供的图形码处理方法的一个可选的流程示意图;
图4-2是本发明实施例提供的图形码处理方法的一个可选的流程示意图;
图5-1至图5-3是本发明实施例中在预览界面形成不同图形码的一个可选的示意图;
图6是本发明实施例提供的图形码处理方法的一个可选的流程示意图;
图7-1至图7-38是本发明实施例中从采集包括二维码的图像到识别出二维码图像处理过程中的各处理结果示意图;
图8-1和图8-2为本发明实施例中图形码处理装置的可选的功能结构示意图。
具体实施方式
以下结合附图及实施例,对本发明实施例进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
对本发明实施例进行进一步详细说明之前,对本发明实施例中涉及的名词和术语进行说明,本发明实施例中涉及的名词和术语适用于如下的解释。
1)图形码,使用特定的图形元素按一定规律在平面(二维方向上)分布形成的图形。示例性地,图形码使用若干个与二进制码相对应的符号(图形元素)来表示文字或数值等信息。通常,图形码的码制有其特定的字符集,字符集中的每个符号占有一定的宽度,具有一定的校验功能等。常用的图形码包括如二维码、条形码等。
2)图形码图像,包括有至少部分图形码的图像,例如,图形码图像的全部区域都显示有二维码的成像,或者,图形码图像的一部分区域显示有二维码的成像,另外部分区域显示有环境中其他对象如人、物的成像。
3)图像二值化,将图像上像素点的灰度值设置为0或255,也就是将整个图像呈现出明显的黑白效果。
4)解码,将二维码图像中的符号还原为二进制码,并基于二进制码得到特定信息(如页面地址、联系人信息等)的过程。
5)实例,也即请求扫描二维码的实例,扫码设备中运行的请求扫码的应用、进程等,如社交应用。
这里以图形码为二维码为例,针对相关技术提供的二维码扫描、以及解码方式进行说明。参见图1-1示出的扫描二维码的一个可选的场景示意图,当图形码距离用户较近且图形码的尺寸较大时,如果用户移动不方便,会使得图形码在预览界面的成像超出预定的扫描区域,导致在扫描区域执 行扫描操作时仅能够扫描到部分二维码;参见图1-2示出的扫描二维码的一个可选的场景示意图,当二维码的位置较高时,在扫描框内仅能够采集到部分的二维码;参见图1-3示出的扫描二维码的一个可选的场景示意图,用户使用终端采集二维码的方位无法调整(例如,受限于用户所处环境的空间有限的情况),导致在扫描区域执行扫描操作时仅能够扫描到部分二维码。
上述情况都会出现无法对采集到图形码进行解码的问题,针对上述问题,本发明实施例提供一种图形码处理方法,参见图2-1示出的图形码处理方法的一个可选的流程示意图,步骤101,对包括图形码的环境进行采集;步骤102,确定所采集图像的像素在不同参考方向的连续分布区域,将连续分布区域的重叠区域识别为图形码的潜在分布区域;步骤103,从潜在分布区域对应的局部图像中识别出扫描步长,基于扫描步长扫描局部图像得到图形码图像;步骤104,基于图形码图像进行解码处理,直至解码成功得到图形码中所调制的信息。
本发明实施例可以提供应用上述图形码处理方法的图形码处理装置,图形码处理装置可以采用如下各种方式来实现。
例如,如图2-2所示,图形码处理装置可以具体为具有图像采集功能的智能手机、平板电脑等各种移动终端,这里,所述移动终端能够利用内置的摄像头(如前置摄像头、后置摄像头)对图形码进行采集,进而使所述移动终端从采集到的图像中识别出图形码。
又例如,图形码处理装置的模块分别设置在移动终端侧和云端的服务器侧,由移动终端采集到包括图形码的图像并发送到云端的服务器,由云端的服务器从图像中识别出图形码并进行解码,将解码的结果发送到移动终端进行处理。
又例如,可以图形码处理模块设置于具有图像采集功能以及图形码识 别功能、解码功能的片上系统(SoC,System on System)中,并采用专用集成电路(ASIC)和逻辑可编程门阵列(FPGA)等技术实现,例如,支持在采集的图像中进行图形码图形识别和解码,以及支持以通信方式与移动终端或者服务器进行交互,在满足输出条件(如时间达到)输出定位和/或识别的结果。
再例如,图形码处理装置可以设置于用于识别图形码的专用扫描设备,比如条形码扫描枪、二维码扫描枪等。
本发明实施例还提供了一种计算机可读存储介质,例如,包括计算机程序的存储器,进一步地,该存储介质中存储有计算机程序,该计算机程序被所述图形码处理装置中的处理器执行时实现本实施例所述的图形码处理方法。这里,计算机可读存储介质可以是磁性随机存取存储器(FRAM,ferromagnetic random access memory)、只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory)等存储器;也可以是包括上述存储器之一或任意组合的各种设备。
进一步地,所述计算机可读存储介质上存储有计算机程序,其中,该计算机程序被处理器执行时实现以下步骤:
对包括图形码的环境进行采集;确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域;从所述潜在分布区域对应的局部图像中识别出扫描步长,基于所述扫描步长扫描所述局部图像得到图形码图像;基于所述图形码图像进行解码处理,直至解码成功得到所述图形码中所调制的信息。
在一种实施例中,该计算机程序被处理器执行时还实现以下步骤:在预览界面呈现所采集的图像,所述基于所采集的图像用于供调整采集方位直至所述图形码在所述预览界面内完整成像。
在一种实施例中,该计算机程序被处理器执行时还实现以下步骤:在所采集的图像中定位所述图形码的潜在分布区域之前,基于所采集的图像在预览界面的扫描框内形成的局部图像进行解码处理,并检测到解码失败。
在一种实施例中,该计算机程序被处理器执行时还实现以下步骤:在所采集的图像中定位所述图形码的潜在分布区域之前,基于所采集的图像在预览界面的扫描框内形成的局部图像进行解码,当解码得到所述图形码所调制的信息时,中止对包括所述图形码的环境进行采集。
在一种实施例中,所述基于所述图形码图像进行解码处理,包括:调整至所识别出的图形码图像的尺寸与所述扫描框的尺寸一致,基于调整后的图形码图像进行解码处理。
在一种实施例中,该计算机程序被处理器执行时还实现以下步骤:呈现所述图形码中调制的信息,和/或,发送所述图形码中调制的信息至请求扫描图形码的实例。
在一种实施例中,所述确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域,包括:确定所采集图像的二值化图像中黑色像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码在相应图像的潜在分布区域。
在一种实施例中,所述确定所采集图像的二值化图像中黑色像素在不同参考方向的连续分布区域,包括:确定所采集图像的二值化图像中黑色像素在不同参考方向的直方统计图,对所述直方统计图进行去噪,将去噪后直方统计图中的连续分布区域映射到相应图像的二值化图像中的区 域。
在一种实施例中,所述对直方统计图进行去噪,包括:将所述直方统计图沿相应的参考方向等分得到等分块,将满足预定条件的等分块中的统计数据置零。
在一种实施例中,所述将满足预定条件的等分块中的统计数据置零,包括以下至少之一:
当所述等分块中统计数据的差异程度超出阈值时,将相应等分块中的统计数据置零;
当所述等分块的相邻等分块的统计数据为零时,将相应等分块中的统计数据置零;
当所述等分块与相邻等分块的信噪比为相邻等分块之间信噪比的最小值时,将相应等分块中的统计数据置零。
在一种实施例中,所述从潜在分布区域对应的局部图像中识别出扫描步长,包括:对所述局部图像的二值化图像进行膨胀和腐蚀操作,在所述局部图像的二值化图像中识别出各黑色像素块以及相邻尺寸的黑色像素块的累计出现次数,基于最高累计出现次数对应的黑色像素块的尺寸识别出扫描步长。
在一种实施例中,所述在局部图像的二值化图像中识别出各黑色像素块以及相邻尺寸的黑色像素块的出现次数,确定最高出现次数对应的黑色像素块的尺寸,包括:对所述局部图像的二值化图像按照不同的参考方向进行抽样得到条状图像,识别各条状图像的直方统计图中连续分布区域的长度,统计各长度以及在长度波动范围内的相邻长度的出现次数,选取最高出现次数对应的长度作为最高出现次数对应的黑色像素块的尺寸。
在一种实施例中,所述基于所述扫描步长扫描所述局部图像得到图形码图像,包括:以所述扫描步长对所述局部图像的二值化图像进行扫描, 将扫描得到符合扫描模式的像素点的点集映射到所述局部图像的二值化图像中,将映射得到的像素点的点集识别为所述图形码图像。
在一种实施例中,所述以扫描步长对所述局部图像的二值化图像进行扫描,包括:检测到所述局部图像的二值化图像中符合预定扫描模式的黑色像素点、以及检测到与所述黑色像素点相距扫描步长的位置具有符合预定扫描模式的白色像素点时,基于所检测到的黑色像素点形成所述点集。
在一种实施例中,该计算机程序被处理器执行时还实现以下步骤:将扫描得到符合扫描模式的像素点的点集映射到所述局部图像的二值化图像之前,基于所述像素点的点集的直方图对所述像素点的点集进行去噪处理。
在实际应用中,在硬件层面上,示例性地,本实施例所述的图形码处理装置可以基于移动终端(或者服务器)的资源如计算资源(如利用处理器实现的计算资源)和通信资源(如利用网络接口实现的通信资源)实现,此时,移动终端即为执行图2-1示出的图形码处理方法的实体。
当然,本发明实施例提供的图形码处理方法还可以部分步骤在用户侧的移动终端执行,另外部分步骤在服务器侧执行,例如由移动终端和即时通信服务器协同执行上述图形码处理方法,相应地,图形码处理装置也是基于即时通信服务器侧和移动终端侧的资源如计算资源(如处理器)和通信资源(如网络接口)共同实现。
同理,在软件层面上,本实施例所述的图形码处理装置可以实施为存储于存储介质的可执行指令,包括诸如程序、模块之类的计算机可执行指令,存储介质可以设置于即时通信服务器,或者,分布设置在即时通信服务器和移动终端中。
如上,参见图3示出的图形码处理装置10的一个可选的软硬件结构示意图,图形码处理装置10包括软件层、驱动层、操作系统层和硬件层。然而,本领域的技术人员应当理解,图3示出的图形码处理装置10的结构仅 为示例,并不构成对图形码处理装置10结构的限定。例如,图形码处理装置10以根据实施需要设置较图3更多的组件,或者根据实施需要省略设置部分组件。
在实际应用中,如图3所示,所述图形码处理装置10的硬件层包括处理器11、输入/输出接口13,存储介质14以及网络接口12,其中,各组件经总线连接通信。进一步地,
处理器11可以采用中央处理器(CPU)、微处理器(MCU,Microcontroller Unit)、专用集成电路(ASIC,Application Specific Integrated Circuit)或逻辑可编程门阵列(FPGA,Field-Programmable Gate Array)实现。
输入/输出接口13可以采用如显示屏、触摸屏、扬声器等输入/输出器件实现。
存储介质14可以采用闪存、硬盘、光盘等非易失性存储介质实现,也可以采用双倍率(DDR,Double Data Rate)动态缓存等易失性存储介质实现,其中该存储介质14中存储有用以执行上述信息处理方法的可执行指令。
示例性地,存储介质14可以与图形码处理装置10共同在同一地点设置,也可以相对于图形码处理装置10异地远程设置,或者相对图形码处理装置10本地和异地分布设置。网络接口12向处理器11提供外部数据如异地设置的存储介质14的访问能力,示例性地,网络接口12可以基于近场通信(NFC,Near Field Communication)技术、蓝牙(Bluetooth)技术、紫蜂(ZigBee)技术进行的近距离通信,另外,还可以实现如基于码分多址(CDMA,Code Division Multiple Access)、宽带码分多址(WCDMA,Wideband Code Division Multiple Access)等通信制式及其演进制式的通信。
驱动层包括用于供操作系统16识别硬件层并与硬件层各组件通信的中间件15,例如可以为针对硬件层的各组件的驱动程序的集合。
操作系统16用于提供面向用户的图形界面,示例性地,包括插件图标、 桌面背景和应用图标,操作系统16支持用户经由图形界面对设备的控制,这里,本发明实施例对上述设备的软件环境如操作系统类型、版本不做限定,例如可以是安卓操作系统、iOS操作系统、Linux操作系统或UNIX操作系统等。
软件层包括需要扫描图形码的各种应用17,示例性地,如包括通过扫描图形码添加好友、转账或赠送电子红包的社交应用,和/或通过扫描图形码向商家进行支付的电子支付应用等。
基于图2-1示出的图形码处理方法以及图3示出图形码处理装置提出本发明以下具体实施例。
下面,以本发明实施例提供的图形码处理方法在用户侧的移动终端实施为例进行说明,相应地,图3示出的图形码处理装置可以实施为用户侧的移动终端。对于图形码处理装置的其他实施方式可以参照下述的记载而实施。基于本发明实施例提供的图形码处理方法在移动终端侧的实施,本领域技术人员可以轻易将部分处理迁移到云端的服务器实施,从而由云端的服务器与用户侧的移动终端协同实施本发明实施例提供的图形码处理方法,例如,由移动终端完成对包括图形码的图像的采集,由云端的服务器从图像中定位图形码并进行识别,将识别的二维码发送到移动终端中需要基于图形码识别结果进行处理的应用(如社交应用、电子支付应用等)。
以下,以图形码处理装置实施为扫描设备(如智能手机等移动终端,或者扫描枪等中扫描设备),并由扫描设备实施图形码处理方法为例,结合图4-1示出的本发明实施例提供的图形码处理方法的一个可选的流程示意图进行说明,参见图4-1,图形码处理包括以下步骤:
步骤201,开启图形码扫描功能。
例如,用户在使用手机中的社交应用时,通过触控操作或其他形式的触发操作启动社交应用中的扫码功能如“扫一扫”,以扫描二维码名片、二 维码收款账号或者二维码网址。又例如,商场的收银人员使用扫描枪的扫码收银功能,以扫描用户采购商品的条形码,或者扫描用户出示的付款二维码以进行划款。
后续步骤对图形码扫描功能被开启后扫描设备的响应过程进行说明。
在扫描设备的图形码扫描功能开启时,即使扫描设备没有开启预览界面以及扫描框,当用户将扫描设备调整至合适的采集方位时,扫描设备仍然可以采集到包括完整二维码的图像。
在一个实施例中,在扫描设备的图形码扫描功能开启时,扫描设备还可以开启预览框以及位于预览框内的扫描框,从而便于用户通过观看采集的图像而调整扫描设备的采集方位,实现高效采集到包括完整二维码图像的效果,以下结合步骤202a和步骤202b进行说明。
步骤202a,开启图像采集的预览界面,并在预览界面中加载扫描框。
步骤202b,对包括图形码的环境进行采集,并在预览界面中呈现采集得到的图像流中的图像。
若扫描功能开启时开启预览框,则用户即可通过观察二维码是否在预览框内完成成像来确定是否对扫描设备的采集方位进行调整,如此,为有针对性对扫描设备的采集方位进行调整奠定了基础,同时也为二维码在预览框内快速的完整成像奠定了基础。
这里,位于预览框内部的扫描框用于辅助用户调整扫描设备的采集方位,从而使环境中的图形码在预览界面的成像尺寸与扫描框一致或者位于扫描框内部,为实现对图形码的快速扫描和解码奠定了基础。
可以理解地,扫描框的位置和形状可以有多种方式,例如,扫描框位于预览界面的中心部位(当然,可以位于其他部位如预览界面的上部)并呈现扫描框的外部轮廓,轮廓采用方形、圆形等形状(可以采用实线也可以采用虚线方框)。
实际应用中,二维码在预览界面的完整成像包括这样的几种情况:1)如图5-3所示,二维码在扫描框内完整成像;2)如图5-2所示,二维码在预览框内完整成像,在扫描框内部分成像;3)二维码在预览框内除扫描框之外的区域完整成像。
扫描设备通过摄像头(例如,扫描设备自身设置的摄像头、或通过有线、无线方式进行控制的外部的摄像头)对包括图形码的环境采集形成帧图像(简称图像)构成的流,并在预览界面实时呈现图像流中的各图像。
需要指出的是,由于扫描设备采集的方位受到用户握持位姿的影响,在扫描设备开始采集后,用户往往难以快速调整扫描设备调用摄像头采集的方位,以使得图形码在预览界面的成像与扫描框匹配,例如,如图5-1所示,预览界面中最初呈现的图像中可能未呈现图形码,随着用户对扫描设备采集方位的调整,在预览界面中呈现有部分的图形码,直至在预览界面中完整成像。
步骤203,确定所采集图像的像素在不同参考方向的连续分布区域,将连续分布区域的重叠区域识别为图形码的潜在分布区域。
对采集图像进行二值化处理,确定所采集图像的二值化图像中黑色像素在不同参考方向例如x轴、y轴的连续分布区域,将连续分布区域的重叠区域识别为图形码在相应图像的潜在分布区域,潜在分布区域是指在所采集区域中具有图形码的概率最大的区域。
步骤204,从潜在分布区域对应的局部图像中识别出扫描步长,基于扫描步长扫描局部图像得到图形码图像。
扫描设备的采集方位往往处于动态调整过程中,采集的图像中不可避免地存在图像码之外的其他对象,如环境中的景物等,所以潜在分布区域扫描设备采集的图像中分布有图形码的区域,还可能包括其他的对象。
在一个实施例中,对于从潜在分布区域对应的局部图像中识别出扫描 步长,基于扫描步长扫描局部图像得到图形码图像时,可以通过如下步骤实现:
步骤(1)在局部图像的二值化图像中分析出所述图形码中符号的尺寸作为扫描步长。
在一个实施例中,对局部图像的二值化图像进行膨胀和腐蚀操作,在局部图像的二值化图像中识别出各黑色像素块(是由连续分布的黑色像素的集合)以及相邻尺寸的黑色像素块的累计出现次数,确定最高累计出现次数对应的黑色像素块的尺寸,进而将最高累计出现次数对应的黑色像素块中中间尺寸的像素块作为图形码中符号的尺寸。
例如,在局部图像的二值化图像中识别出各黑色像素块以及相邻尺寸的黑色像素块的出现次数,确定最高出现次数对应的黑色像素块的尺寸时,对所述局部图像的二值化图像按照不同的参考方向进行抽样得到条状图像,识别各条状图像的直方统计图中连续分布区域的长度,统计各长度以及在长度波动范围内的相邻长度的出现次数,选取最高出现次数的对应的长度作为最高出现次数对应的黑色像素块的尺寸。
步骤(2)基于所述扫描步长扫描所述局部图像得到图形码图像。
在一个实施例中,以符号的尺寸为扫描步长对局部图像的二值化图像进行扫描,将扫描得到符合扫描模式的像素点的点集映射到局部图像的二值化图像中,将映射得到的像素点的点集识别为图形码图像。一般地,以符号的尺寸为扫描步长对局部图像的二值化图像进行扫描之前,可以对局部图像的二值化图像进行膨胀和腐蚀操作以去除噪声,避免二值化图像中噪声对图形码中的符号的尺寸的精度产生不利影响。
例如,在以符号的尺寸为扫描步长对局部图像的二值化图像进行扫描时,检测所述局部图像的二值化图像中各黑色像素点是否为符合预定扫描模式的黑色像素点、以及检测与符合预定扫描模式的黑色像素点相距扫描 步长的位置是否具有符合预定扫描模式的白色像素点,进而得到符合预定扫描模式的黑色像素点的点集,将符合预定扫描模式的黑色像素点的点集作为符合扫描模式的像素点的点集,进而以点集的形式构成图形码图像。
另外,在将扫描得到符合扫描模式的像素点的点集映射到局部图像的二值化图像之前,基于像素点的点集的直方图对像素点的点集进行去噪处理,可以有效去除解码的干扰,提升解码的成功率。
这样,由于扫描设备采集的每个图像的方位不同,所以,图像中图形码对应的符号的尺寸也存在区别,而本发明实施例能够对局部图像的二值化图像进行分析,并分析出符号的尺寸,所以,实现了基于图像流中每个图像的采集方位自适应确定相应图像中图形码的扫描步长的效果,与使用固定的扫描步长对图像中二维码进行扫描相比,扫描结果更精确。
步骤205,调整至图形码图像与扫描框的尺寸一致,基于调整后的图形码图像进行解码处理,并判断解码是否成功,如果成功,则执行步骤206,否则,返回步骤203继续处理采集到的下一图像。
一般地,扫描设备对与扫描框的尺寸一致的图形码图像进行解码,由于扫描框中图形码图像的尺寸是确定的,所以可以快速识别出图形码的定位符号并进行解码,解码的效率高,然而上述在预览界面中识别出的图形码图像往往不会与扫描框的尺寸一致,所以,将图形码图像的尺寸调整到扫描框一致,即可调用基于扫描框的扫码处理方案,进而为提升图形码解码的效率和精度奠定了基础。
步骤206,中止对包括图形码的环境进行采集。
在一个实施例中,当解码成功即得到图形码中调制的信息后,还可以执行以下步骤207和步骤208至少之一:
步骤207,呈现图形码中调制的信息。
例如,当图形码为二维码名片时,呈现二维码中调制的联系人的名称 等基本信息,或者,当图形码为页面地址时,呈现二维码中调制的地址信息。
步骤208,发送图形码中调制的信息至请求扫描图形码的实例。
例如,当对浏览器请求扫描的图形码解码得到页面地址时,将页面地址发送给浏览器供浏览器加载相应的页面数据。
仍然结合图5-1示出的二维码扫码的一个示例对上述图形码处理方法的实际应用场景进行说明,用户使用扫描设备运行的浏览器需要扫描网址二维码时,开启浏览器中的扫码功能,扫描设备的摄像头根据当前采集方位采集图像,在预览界面中加载扫描框,并在预览界面实时呈现图像流中的图像,用户开启扫码功能时,由于扫描设备的采集方位没有对准图形码,导致图形码没有在预览界面51中成像,用户调整扫描设备的采集方位,使图形码在预览界面52中呈现有部分的二维码图像,随着采集方位的不断校准,在预览界面53中呈现完整的二维码图像,在预览界面53中二维码图像虽然没有全部位于扫描框中,如前所述,但是基于本发明实施例的图形码处理方法即可对二维码图像进行解码并得到其中调制的页面地址,这样,就克服了相关技术需要用户继续调整扫描设备的采集方位,以在扫描框内呈现完整的二维码图形才能进行解码的限制,降低了二维码扫码的操作难度,提升了二维码扫码的效率。
另外,对于这样的情况,当需要扫描的二维码位于狭小的空间内且面积非常大时,用户无法移动至距离二维码足够远的位置以使得二维码在预览界面内成像完全位于扫描框内,但是使二维码完全在预览界面内成像则相对容易,那么基于上述的图形码处理方法对在预览界面53内的二维码图像进行解码,克服了相关技术依赖扫描框时因二维码面积过大而无法扫码的限制。
再有,对于这样的情况,当需要扫描的二维码位于较高的位置,用户 因不能调整扫描设备至足够高的位置,导致二维码在扫描框内的成像不完整,但是,调整扫描设备的采集高度而使二维码在预览界面53形成完整成像则相对容易,从而克服了因二维码面积过大而无法扫码的限制。
在一个实施例中,参见图4-2示出的图形码处理方法的一个可选的流程示意图,基于图4-1,在步骤203之前,还包括以下步骤:
步骤209,基于所采集的图像在扫描框内形成的局部图像进行解码处理,检测到是否解码成功,如果成功,则转入步骤206并执行步骤207;如果失败,则转入步骤203。
仍以二维码扫码为例对图5-2、图5-3示出的图形码处理方法的应用场景进行说明,当用户使用扫码设备扫描二维码时,因距离二维码较近而无法使二维码在扫描框内完整成像时,首先基于扫描框内的局部图像尝试解码,对于图5-3所示的情况,由于二维码在扫描框内已经完整成像,因此基于扫描框内的局部图像可以解码成功;而对于图5-2的情况,由于二维码在扫描框内没有完整成像导致解码失败;然后,基于预览界面中当前呈现的图像定位二维码的潜在分布区域,基于潜在分布区域识别出二维码并进行解码,由于在图5-3中二维码在预览界面完整成像,从而可以解码得到二维码中调制的信息。
可以看出,通过首先尝试使用在扫描框内的图像进行界面,然后尝试使用预览界面中的图像(也就是预览界面中当前所呈现的图像流中的图像)进行解码,由于基于扫描框内图像解码时更容易定位二维码的分区区域,因此扫码效率相对基于预览框内图像定位二维码并进行解码要高,一方面,通过首先使用二维码内图形解码的方案能够保证解码的效率,另一方面,在基于扫描框内图像解码失败时使用预览界面中图像解码,能够最大程度提升解码成功率,避免用户频繁调整采集方位的问题,以及因环境限制无法如何调整采集方位也无法使二维码在扫描框内完整成像的问题。
另外,需要说明的是,由于本发明实施例是基于所采集的图像(可选地,在预览框内呈现所采集的图像)进行图形码的解码,因此预览框中加载扫描框并不是实施上述图形码处理方法的必要条件,例如,在另一个场景中,用户通过预览框调整采集方位直至图形码在预览框内完成成像,此时,无论图形码是否在扫描框内成像,均可以通过图4-1以及后续图6示出的图形码处理方法进行识别和解码,从而,对于用户来说,使图形码在预览界面内完成成像较使图形码在扫描框内完整成像更加容易(因为预览界面的采集角度更大),对于用户来说,不需要使用扫描框对准图形码,因此扫码更加简单。
结合图6示出的图形码处理方法的一个可选的流程示意图,对二维码扫码的具体示例对前述的图形码处理方法的实施进行说明,在图6中包括以下步骤:
步骤401,输入图像,也就是通过扫码设备的摄像头采集到包含单个二维码的图像。
步骤402,图像二值化。
首先根据整幅图像的像素值分布,计算出图像二值化阈值,根据二值化阈值对图像进行二值化,图1-1、图1-2和图1-3中预览界面二值化后的图像对应如图7-1、图7-2和图7-3所示。
步骤403,对二值化后的图像进行膨胀和腐蚀,去除图像中噪声点。
示例性地,7-1、图7-2和图7-3示出的二值化图形进行膨胀滤波后如图7-4、图7-5和图7-6所示。
步骤404,对去噪后的图像进行直方图统计,统计每行与每列黑色像素的个数(统计数据)。
示例性地,图7-4所示的二值化图像中每行的黑色像素的直方统计图对应如图7-7和图7-8所示,图7-5所示的二值化图像中每行的黑色像素的直 方统计图对应如图7-9和图7-10所示,图7-6所示的二值化图像中每行的黑色像素的直方统计图对应如图7-11和图7-12所示。
步骤405,根据直方图去噪算法对黑色像素直方图进行去噪。
要根据黑色像素统计直方图最大可能的找出二维码图像所在区域,需要先去掉直方图中的干扰统计,本发明实施例提供的直方图统计数据去噪算法如下:
直方图统计数据去噪算法:
(1)将直方图分成n等分,暂设n=10,将每个等分划分为左右两半,将左右两半统计数据之差与较小一半的相差a(设a=3)倍的等分统计数据置为0,每等分中最大值与最小值相差b(设b=4)倍以上的,统计数据置为0,可以表述为:
rightHistSum表示为直方图等分每一份中的右半部分,leftHistSum表示为直方图等分每一份中的左半部分。maxHist表示为直方图等分每一份中的最大值,minHist表示为直方图等分每一份中的最小值。
当rightHistSum>leftHistSum时,
errorRightLeft=rightHistSum-leftHistSum;
如果:errorRightLeft/leftHistSum>3,则将等分内的所有直方图统计值设置为0.;或者,当maxHist/minHist>=4时,则将等分内的所有直方图统计值设置为0。
(2)将等分块中左右相邻块的所有统计值都设置为0的统计块的所有统计值也设置为0,假设将10等分中所有统计值可设置0的等分标记为‘1’,保持原统计数据所有统计值不变的等分标记为‘0’,则符合标记模式为‘101’的直方图等分时,需要将‘101’中标记为‘0’的等分即原来保持直方图统计数据的等分也需要将其等分内的所有统计值置为0。
(3)计算等分块中正常信号与相邻噪声的比值,去除信噪比较小的数据分块,保留信噪比最大的数据块,即假设保留下来的直方图统计块为等分 块2、等分块3、等分块4,而等分块1与等分块5均被置为0,等分块2的总统计值为a,等分块4的总统计值为b,等分块1的总统计值为c,等分块5的总统计值为d,则,
等分块2与等分块1的信噪比为:z1=a/c;
等分块4与等分块5的信噪比为:z2=b/d;
去除掉噪声之后,从而获得直方图去噪后的统计图。
步骤406,对于形成的直方图连接区域整体,将直方图连接区域整体映射回膨胀腐蚀(铝箔)图像,将图像中连接区域整体对应的图像块取出,获得局部二值(化)图像。
以图7-7,图7-8示出的直方统计图为例,将直方统计图如图7-13和图7-14进行n等分,暂设n=10:图7-13中,10等分从左到右标记为:等分1,等分2,等分3,等分4,......,等分10。
等分1中左半部分统计和为:17372,右半部分统计和为:2644,最大值为:1276,最小值为:30。
等分2中左半部分统计和为:9162,右半部分统计和为:10568,最大值为:398,最小值为:25。
等分3中左半部分统计和为:10657,右半部分统计和为:9879,最大值为:421,最小值为:111。
等分4中左半部分统计和为:11269,右半部分统计和为:8966,最大值为:408,最小值为:154。
等分5中左半部分统计和为:11301,右半部分统计和为:9363,最大值为:384,最小值为:164。
等分6中左半部分统计和为:7654,右半部分统计和为:12156,最大值为:426,最小值为:146。
等分7中左半部分统计和为:10010,右半部分统计和为:12871,最 大值为:430,最小值为:228。
等分8中左半部分统计和为:10326,右半部分统计和为:8773,最大值为:394,最小值为:42。
等分9中左半部分统计和为:8129,右半部分统计和为:2199,最大值为:483,最小值为:28。
等分10中左半部分统计和为:3179,右半部分统计和为:15489,最大值为:1154,最小值为:46。
图7-13从左到右的等分1到等分10的统计和分别为:
20016;19730;20536;20235;20664;19810;22881;19099;10328;18668。
根据直方图去噪算法第一步,将10等分中可设置0的等分标记为1,保持原统计数据的等分标记为0,于是图16从左到右的等分1到等分10的标记结果分别为:
1;1;0;0;0;0;0;1;1;1。
标记中没有101的模式,于是不需要去掉独立分块统计图。
分块3与分块2的信噪比为:z1=20536/19730=1.04;
分块7与分块8的信噪比为:z2=22881/19099=1.198。
图7-14中,10等分从下到上标记为:等分1,等分2,等分3,等分4,......,等分10。
等分1中左半部分统计和为:4509,右半部分统计和为:2577,最大值为:177,最小值为:0。
等分2中左半部分统计和为:7892,右半部分统计和为:11714,最大值为:289,最小值为:39。
等分3中左半部分统计和为:1114,右半部分统计和为:1167,最大值为:45,最小值为:5。
等分4中左半部分统计和为:5825,右半部分统计和为:3346,最大值为:170,最小值为:9。
等分5中左半部分统计和为:8609,右半部分统计和为:16759,最大值为:346,最小值为:9。
等分6中左半部分统计和为:17127,右半部分统计和为:13688,最大值为:342,最小值为:134。
等分7中左半部分统计和为:14353,右半部分统计和为:16442,最大值为:326,最小值为:109。
等分8中左半部分统计和为:17223,右半部分统计和为:10382,最大值为:363,最小值为:20。
等分9中左半部分统计和为:3461,右半部分统计和为:2928,最大值为:115,最小值为:24。
等分10中左半部分统计和为:6838,右半部分统计和为:26013,最大值为:708,最小值为:23。
图7-14从下到上的等分1到等分10的统计和分别为:
7086;19606;2281;9171;25368;30815;30795;27605;6389;32851。
根据直方图去噪算法第一步,将10等分中可设置0的等分标记为1,保持原统计数据的等分标记为0,于是图17从下到上的等分1到等分10的标记结果分别为:
1;1;1;1;1;0;0;1;1;1。
标记中没有101的模式,于是不需要去掉独立分块统计图。
分块6与分块5的信噪比为:z1=30815/25368=1.215;
分块7与分块8的信噪比为:z2=30795/27605=1.115。
根据直方图统计数据去噪算法,去除统计的干扰数据,得到去噪后的 直方图7-15和图7-16所示。图7-15中保留的列统计范围为:144~503,图7-16中保留的行统计范围为:640~895。获得行统计范围与列统计范围其相交范围内的图像块如如图7-17所示。
步骤407,对局部图像块进行图像条抽样。
步骤408,获得6块局部图像抽样条图像,对这6块图像中的3块行抽样图像进行x轴直方图统计,3块列抽样进行y轴直方图统计:包括:
(1)从中间按行方向取一个图像块,该图像块的宽为边界区域内图像的宽,高为b,b暂时设10个像素点,b是可调节的,并且对图像进行膨胀腐蚀处理后获得如图7-18所示的图像。
(2)从中间按列方向取一个如图7-19所示的图像块,该图像块的宽为a,a暂时设为10个像素点,a是可调节的,高为统计边界取出来的图像的高度。
(3)对边界区域内的图像块中以行方向从中间将图像块分为上下两个长条区域,在两个长条区域内的1/2处,分别再以行方向取一条图像块,如图7-20和图7-21所示,该图像块的宽为边界区域内图像的宽,高为b,b暂时设20个像素点,b是可调节的。
(4)对边界区域内的图像块中以列方向从中间将图像块分为左右两个长条区域,在两个长条区域内的1/2处,分别以列方向取一条图像块,如图7-22和图7-23所示,该图像块的宽为a,a暂时设为20个像素点,a是可调节的,高为统计边界取出来的图像的高度。
自适应步长计算方法如下:
目前,算法获得了6个小的图像区域块,3个行方向的图像块,3个列方向的图像块。
(1)对行方向的图像,对黑色像素进行直方图统计,将其统计值记录在x坐标轴上。
(2)对列方向的图像,对黑色像素进行统计,将其统计值记录在y坐标 轴上。
(3)对x,y轴上统计值连成的线段按长度进行统计,获得每条线段的统计数目。
(4)计算每条线段长度值以长度波动值为h(设h=2)范围内的线段长度总数,并将该数目标记在该长度值上。
(5)将线段长度值本身长度波动值统计数与左右相邻长度波动值h2(设h2=1)内的统计数相加之和最大的长度选为自适应步长。
举例说明:
图7-18,图7-20,图7-21在X轴上的直方统计图分别如图7-24、图7-25和图7-26所示。
图7-19、图7-22和图7-23在Y轴上的直方统计图分别如如图7-27、图7-28和图7-29所示。
图7-24在X轴从左到右的线段长度值为:
26;26;10;7;9;16;6;3;12;22;7;16。
图7-25在X轴从左到右的线段长度值为:
10;42;27;34;14;30;41。
图7-26在X轴从左到右的线段长度值为:
11;14;15;16;14;19;39;55;17;12。
图7-27在Y轴从上到下的线段长度值为:
11;15;50;12;13;14;16;12。
图7-28在Y轴从上到下的线段长度值为:
5;10;26;8;36。
图7-29在Y轴从上到下的线段长度值为:
104;14;24;48。
步骤409,根据直方图统计构成的连续线段长度进行长度数目统计,根 据自适应步长统计算法,计算自适应步长。
对以上长度值分别以长度波动值为2和长度波动值为3的进行数目统计,得到统计数目如下表1所示:
Figure PCTCN2017103272-appb-000001
表1
取长度波动值为2时的统计值,求统计数据在线段长度相距为1的统计数目之和:
可求得线段长度13与其相距为1的长度12,14,三个长度的统计总和为:15+14+16=45,45为最大值,于是选定长度13为自适应步长。
步骤410,以自适应步长为单元的二维码扫描模式对滤波二值化图像按行进行扫描。
步骤411,获得二维码区域点图。
检测二维码覆盖范围:
在获得二维码探测步长后,按照以下扫描模式,对整幅图像进行扫描,从而获得二维码所在区域的点集。二维码扫描模式如图7-30所示:
扫描模式描述:
(1)扫描模式中,检测点像素值必须符合像素值为0的黑色点;
(2)扫描模式中,检测点的上下2个像素处各有一个黑色点,检测点斜对角方向,行方向相距2个像素,列方向相距1个像素处有4个黑色点,检测点左右相距4个像素点处各有一个黑色点;
扫描模式中,相距检测点距离为检测步长stepLen处各有一辅助点,辅助点的像素值为255为白色点,辅助点周围必须分布有8个其他白色点,分布规则和检测点周围点的分布一致,如图7-30所示。
通过扫描模式对图7-4进行扫描,获得具有二维码特性数据点,如图7-31所示。
步骤412,对二维码区域点图进行行列直方图统计,取最大块统计区域。
对二维码通过扫描模式检测到的点进行直方图统计,如图7-32和图7-33所示,直方图去噪后图像如图7-34和图7-35所示。
步骤413,映射回二值化图像,获得精确的二维码图像块。
根据直方图最大块区域x范围为:79~576,y范围为:539~993,即宽 为497,高为454,将该区域映射到二值化图像中如图7-36所示。
步骤414,根据二维码图像块与扫码框的大小比值进行缩放。
步骤415,将二维码图像块缩放成扫码框可识别的大小图像进行解码,从而完成整个单个二维码自适应定位识别的过程。
为了保留跟多的边界信息,将xy范围扩大为:x范围为:59~596,y范围为:519~1013,对应的图像如图7-37所示。
而原扫描框的大小为:宽409,高370。于是可以算得截取出的二维码图像的缩放比为:宽度缩放比=扫描框宽/二维码截取图像宽=409/497=0.82。
高度缩放比=扫描框高/二维码截取图像高370/454=0.81。
于是取缩放比0.7,将截取出来的二维码图像(图40)缩小为原来的0.7,获得图像如图7-38所示。
原图为:537*494,缩放后为:375*345。缩放后图像不会超出扫描框区域:409*370。
再对前述的图形码处理装置的功能结构进行说明,参见图8-1和图8-2示出的图形码处理装置20的一个可选的功能结构示意图,包括:
采集单元21,可由包括摄像头的摄像模组实现,对包括图形码的环境进行采集;
预览界面单元22,在预览界面中加载扫描框,并在所述预览界面呈现采集得到的图像流中的图像;
定位单元23,潜在分布区域对应的局部图像中识别出扫描步长,基于所述扫描步长扫描所述局部图像得到图形码图像;
识别单元24,在所述潜在分布区域对应的局部图像中识别出扫描步长,基于所述扫描步长扫描所述局部图像得到图形码图像;
解码单元25,基于所述图形码图像尝试进行解码处理,直至解码成功 得到所述图形码中所调制的信息。
实际应用中,图形码处理装置中除采集单元21的功能单元,也即预览界面单元22、定位单元23、识别单元24以及解码单元25均可由图3示出的处理器11通过运行存储介质14中的可执行指令而实现具有相应功能的单元,如图8-1所述图形码处理装置中的功能单元可在扫码设备(如智能手机)侧实现,也就是说,对包括图形码的图像的采集、图形码的定位识别以及解码均在移动终端侧完成;当然,如8-2所示,图形码处理装置20的功能单元可以在扫码设备侧和云端的服务器侧实现,扫码设备负责采集包括图形码的图像,云端的服务器负责定位识别图形码以及解码,并将解码结果发送到扫码设备。而所述采集单元21可由摄像头实现。
在一个实施例中,所述解码单元25,在所述采集单元21采集的图像中定位图形码的潜在分布区域之前,基于所述图像在所述预览界面的扫描框内形成的局部图像进行解码处理,并检测到解码失败。
在一个实施例中,解码单元25在所述采集单元21采集的图像中定位图形码的潜在分布区域之前,基于所述图像在所述预览界面的扫描框内形成的局部图像进行解码;所述采集单元21,还用于当所述解码单元25解码得到所述图形码中所调制的信息时,中止对包括所述图形码的环境进行采集。
在一个实施例中,所述解码单元25,调整至所述图形码图像的尺寸与所述扫描框的尺寸一致,基于调整后的图形码图像进行解码处理。
在一个实施例中,所述解码单元25,呈现所述图形码中调制的信息,和/或,发送所述图形码中调制的信息至请求扫描图形码的实例。
在一个实施例中,所述定位单元23在确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域时,可以采用如下的方式:确定采集单元21采集图像的 二值化图像中黑色像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码在相应图像的潜在分布区域。
在一个实施例中,定位单元23确定所述图像的二值化图像中黑色像素在不同参考方向的连续分布区域时,可以采用如下的方式:确定所述图像的二值化图像中黑色像素在不同参考方向的直方统计图,对所述直方统计图进行去噪,确定去噪后直方统计图中的连续分布区域映射到相应图像的二值化图像中的区域。
在一个实施例中,定位单元23所述对直方统计图进行去噪,可以采用如下的方式:将所述直方统计图沿相应的参考方向等分得到等分块,将满足预定条件的等分块中的统计数据置零。
在一个实施例中,定位单元23所述将满足预定条件的等分块中的统计数据置零,包括以下至少之一:
当所述等分块中统计数据的差异程度超出阈值时,将相应等分块中的统计数据置零;当所述等分块的相邻等分块的统计数据为零时,将相应等分块中的统计数据置零;当所述等分块与相邻等分块的信噪比为相邻等分块之间信噪比的最小值时,将相应等分块中的统计数据置零。
在一个实施例中,定位单元23从潜在分布区域对应的局部图像中识别出扫描步长,可以采用如下的方式:对所述局部图像的二值化图像进行膨胀和腐蚀操作,在所述局部图像的二值化图像中识别出各黑色像素块以及相邻尺寸的黑色像素块的累计出现次数,确定最高累计出现次数对应的黑色像素块的尺寸。
在一个实施例中,定位单元23在局部图像的二值化图像中识别出各黑色像素块以及相邻尺寸的黑色像素块的出现次数,确定最高出现次数对应的黑色像素块的尺寸,可以采用如下的方式:对所述局部图像的二值化图像按照不同的参考方向进行抽样得到条状图像,识别各条状图像的直方统 计图中连续分布区域的长度,统计各长度以及在长度波动范围内的相邻长度的出现次数,选取最高出现次数对应的长度,作为最高出现次数对应的黑色像素块的尺寸。
在一个实施例中,识别单元24基于所述符号的尺寸从所述局部图像中识别出图形码图像,可以采用如下的方式:以所述符号的尺寸为扫描步长对所述局部图像的二值化图像进行扫描,将扫描得到符合扫描模式的像素点的点集映射到所述局部图像的二值化图像中,将映射得到的像素点的点集识别为所述图形码图像。
在一个实施例中,识别单元24以所述符号的尺寸为扫描步长对所述局部图像的二值化图像进行扫描,可以采用如下的方式:检测到所述局部图像的二值化图像中各黑色像素点是否为符合预定扫描模式的黑色像素点、以及与所述黑色像素点相距扫描步长的位置是否具有符合预定扫描模式的白色像素点时,得到所述黑色像素点的点集。
在一个实施例中,识别单元24在将扫描得到符合扫描模式的像素点的点集映射到所述局部图像的二值化图像之前,基于所述像素点的点集的直方图对所述像素点的点集进行去噪处理。
本发明实施例还提供了一种图形码处理装置,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,这里,所述处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(DSP,Digital Signal Processor),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤,可以直接体现为硬件译码处理器 执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成前述方法的步骤。
其中,所述处理器用于运行所述计算机程序时,执行以下步骤:
对包括图形码的环境进行采集;确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域;从所述潜在分布区域对应的局部图像中识别出扫描步长,基于所述扫描步长扫描所述局部图像得到图形码图像;基于所述图形码图像进行解码处理,直至解码成功得到所述图形码中所调制的信息。
在一个实施例中,还执行以下步骤:在预览界面呈现所采集的图像,所述采集的图像用于供调整采集方位直至所述图形码在所述预览界面内完整成像。
在一个实施例中,还执行以下步骤:在所采集的图像中定位所述图形码的潜在分布区域之前,基于所采集的图像在预览界面的扫描框内形成的局部图像进行解码处理,并检测到解码失败。
在一个实施例中,还执行以下步骤:在所采集的图像中定位所述图形码的潜在分布区域之前,基于所采集的图像在预览界面的扫描框内形成的局部图像进行解码,当解码得到所述图形码所调制的信息时,中止对包括所述图形码的环境进行采集。
在一个实施例中,所述基于所述图形码图像进行解码处理,包括:
调整至所识别出的图形码图像的尺寸与所述扫描框的尺寸一致,基于调整后的图形码图像进行解码处理。
在一个实施例中,还执行以下步骤:
呈现所述图形码中调制的信息,和/或,发送所述图形码中调制的信息至请求扫描图形码的实例。
在一个实施例中,所述确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域,包括:确定所采集图像的二值化图像中黑色像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码在相应图像的潜在分布区域。
在一个实施例中,所述确定所采集图像的二值化图像中黑色像素在不同参考方向的连续分布区域,包括:确定所采集图像的二值化图像中黑色像素在不同参考方向的直方统计图,对所述直方统计图进行去噪,将去噪后直方统计图中的连续分布区域映射到相应图像的二值化图像中的区域。
在一个实施例中,所述对直方统计图进行去噪,包括:将所述直方统计图沿相应的参考方向等分得到等分块,将满足预定条件的等分块中的统计数据置零。
在一个实施例中,所述将满足预定条件的等分块中的统计数据置零,包括以下至少之一:
当所述等分块中统计数据的差异程度超出阈值时,将相应等分块中的统计数据置零;
当所述等分块的相邻等分块的统计数据为零时,将相应等分块中的统计数据置零;
当所述等分块与相邻等分块的信噪比为相邻等分块之间信噪比的最小值时,将相应等分块中的统计数据置零。
在一个实施例中,所述从潜在分布区域对应的局部图像中识别出扫描步长,包括:对所述局部图像的二值化图像进行膨胀和腐蚀操作,在所述局部图像的二值化图像中识别出各黑色像素块以及相邻尺寸的黑色像素块的累计出现次数,基于最高累计出现次数对应的黑色像素块的尺寸识别出 扫描步长。
在一个实施例中,所述在局部图像的二值化图像中识别出各黑色像素块以及相邻尺寸的黑色像素块的出现次数,确定最高出现次数对应的黑色像素块的尺寸,包括:对所述局部图像的二值化图像按照不同的参考方向进行抽样得到条状图像,识别各条状图像的直方统计图中连续分布区域的长度,统计各长度以及在长度波动范围内的相邻长度的出现次数,选取最高出现次数对应的长度作为最高出现次数对应的黑色像素块的尺寸。
在一个实施例中,所述基于所述扫描步长扫描所述局部图像得到图形码图像,包括:以所述扫描步长对所述局部图像的二值化图像进行扫描,将扫描得到符合扫描模式的像素点的点集映射到所述局部图像的二值化图像中,将映射得到的像素点的点集识别为所述图形码图像。
在一个实施例中,所述以扫描步长对所述局部图像的二值化图像进行扫描,包括:检测到所述局部图像的二值化图像中符合预定扫描模式的黑色像素点、以及检测到与所述黑色像素点相距扫描步长的位置具有符合预定扫描模式的白色像素点时,基于所检测到的黑色像素点形成所述点集。
在一个实施例中,还执行以下步骤:将扫描得到符合扫描模式的像素点的点集映射到所述局部图像的二值化图像之前,基于所述像素点的点集的直方图对所述像素点的点集进行去噪处理。
这里需要指出的是:以上装置实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果,因此不做赘述。对于本发明装置实施例中未披露的技术细节,请参照本发明方法实施例的描述而理解,为节约篇幅,因此不再赘述。
综上所述,本发明实施例具有以下有益效果:
1)通过在预览界面中对依次呈现的图像中识别完整图形码并进行解码,与仅基于在扫描框中形成的图像进行解码相比,用户只要调整采集方 位使得图形码在预览界面形成完整的图形码即可进行解码,不需要继续调整采集的方位使图形码在扫描框中形成完整的图形码,显著降低了扫码的操作难度;
2)因环境的限制导致图形码无法在扫描框形成完整的图形码时,只要用户调整采集方位在预览界面形成完整的图形码即可完成扫码和解码,克服了相关技术提供的扫码方式因环境限制而无法扫码的限制。
3)针对这种二维码与扫码设备因距离问题而无法扫码定位的情况,提出了一种自适应识别二维码的方法。通过数据采样与聚类实现了二维码的定位问题,根据采样数据半径与扫码框的比例进行缩放,使得二维码图像大小能够自适应调节,达到快速定位解码的效果,使得二维码与扫码设备不会因为太近或太远而无法识别。
本领域的技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、随机存取存储器(RAM,Random Access Memory)、只读存储器(ROM,Read-Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
或者,本发明上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、RAM、ROM、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。
工业实用性
本发明实施例通过在预览界面中对呈现的图像中尝试识别图形码并进行解码,与仅基于在扫描框中形成的图像进行解码相比,用户只要调整采集方位使得图形码在预览界面完整成像即可进行解码,不需要继续调整采集的方位使图形码在扫描框中形成完整的图形码,显著降低了扫码的操作难度;而且,因环境的限制导致图形码无法在扫描框内无法完整成像时,只要调整采集方位在预览界面内完整成像即可完成扫码和解码,克服了相关技术提供的扫码方式因环境限制时,因在扫描框内无法完整成像而导致识别解码失败的问题。

Claims (23)

  1. 一种图形码处理方法,包括:
    对包括图形码的环境进行采集;
    确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域;
    从所述潜在分布区域对应的局部图像中识别出扫描步长,基于所述扫描步长扫描所述局部图像得到图形码图像;
    基于所述图形码图像进行解码处理,直至解码成功得到所述图形码中所调制的信息。
  2. 如权利要求1所述的方法,其中,所述方法还包括:
    在预览界面呈现所采集的图像,所述采集的图像用于供调整采集方位直至所述图形码在所述预览界面内完整成像。
  3. 如权利要求1所述的方法,其中,所述方法还包括:
    在所采集的图像中定位所述图形码的潜在分布区域之前,基于所采集的图像在预览界面的扫描框内形成的局部图像进行解码处理,并检测到解码失败。
  4. 如权利要求1所述的方法,其中,所述方法还包括:
    在所采集的图像中定位所述图形码的潜在分布区域之前,基于所采集的图像在预览界面的扫描框内形成的局部图像进行解码,当解码得到所述图形码所调制的信息时,中止对包括所述图形码的环境进行采集。
  5. 如权利要求1所述的方法,其中,所述基于所述图形码图像进行解码处理,包括:
    调整至所识别出的图形码图像的尺寸与所述扫描框的尺寸一致,基于调整后的图形码图像进行解码处理。
  6. 如权利要求1所述的方法,其中,所述方法还包括:
    呈现所述图形码中调制的信息,和/或,发送所述图形码中调制的信息至请求扫描图形码的实例。
  7. 如权利要求1所述的方法,其中,所述确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域,包括:
    确定所采集图像的二值化图像中黑色像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码在相应图像的潜在分布区域。
  8. 如权利要求7所述的方法,其中,所述确定所采集图像的二值化图像中黑色像素在不同参考方向的连续分布区域,包括:
    确定所采集图像的二值化图像中黑色像素在不同参考方向的直方统计图,对所述直方统计图进行去噪,将去噪后直方统计图中的连续分布区域映射到相应图像的二值化图像中的区域。
  9. 如权利要求8所述的方法,其中,所述对直方统计图进行去噪,包括:
    将所述直方统计图沿相应的参考方向等分得到等分块,将满足预定条件的等分块中的统计数据置零。
  10. 如权利要求9所述的方法,其中,所述将满足预定条件的等分块中的统计数据置零,包括以下至少之一:
    当所述等分块中统计数据的差异程度超出阈值时,将相应等分块中的统计数据置零;
    当所述等分块的相邻等分块的统计数据为零时,将相应等分块中的统计数据置零;
    当所述等分块与相邻等分块的信噪比为相邻等分块之间信噪比的最小 值时,将相应等分块中的统计数据置零。
  11. 如权利要求1所述的方法,其中,所述从潜在分布区域对应的局部图像中识别出扫描步长,包括:
    对所述局部图像的二值化图像进行膨胀和腐蚀操作,在所述局部图像的二值化图像中识别出各黑色像素块以及相邻尺寸的黑色像素块的累计出现次数,基于最高累计出现次数对应的黑色像素块的尺寸识别出扫描步长。
  12. 如权利要求11所述的方法,其中,所述在局部图像的二值化图像中识别出各黑色像素块以及相邻尺寸的黑色像素块的出现次数,确定最高出现次数对应的黑色像素块的尺寸,包括:
    对所述局部图像的二值化图像按照不同的参考方向进行抽样得到条状图像,识别各条状图像的直方统计图中连续分布区域的长度,统计各长度以及在长度波动范围内的相邻长度的出现次数,选取最高出现次数对应的长度作为最高出现次数对应的黑色像素块的尺寸。
  13. 如权利要求1所述的方法,其中,所述基于所述扫描步长扫描所述局部图像得到图形码图像,包括:
    以所述扫描步长对所述局部图像的二值化图像进行扫描,将扫描得到符合扫描模式的像素点的点集映射到所述局部图像的二值化图像中,将映射得到的像素点的点集识别为所述图形码图像。
  14. 如权利要求13所述的方法,其中,所述以扫描步长对所述局部图像的二值化图像进行扫描,包括:
    检测到所述局部图像的二值化图像中符合预定扫描模式的黑色像素点、以及检测到与所述黑色像素点相距扫描步长的位置具有符合预定扫描模式的白色像素点时,基于所检测到的黑色像素点形成所述点集。
  15. 如权利要求14所述的方法,其中,所述方法还包括:
    将扫描得到符合扫描模式的像素点的点集映射到所述局部图像的二值 化图像之前,基于所述像素点的点集的直方图对所述像素点的点集进行去噪处理。
  16. 一种图形码处理装置,包括:
    采集单元,对包括图形码的环境进行采集;
    定位单元,确定所采集图像的像素在不同参考方向的连续分布区域,将所述连续分布区域的重叠区域识别为所述图形码的潜在分布区域;;
    识别单元,在所述潜在分布区域对应的局部图像中识别出扫描步长,基于所述扫描步长扫描所述局部图像得到图形码图像;
    解码单元,基于所述图形码图像进行解码处理,直至解码成功得到所述图形码中所调制的信息。
  17. 如权利要求16所述的图形码处理装置,其中,还包括:
    预览界面单元,在预览界面呈现所采集的图像,所述采集的图像用于供调整采集方位直至所述图形码在所述预览界面内完整成像。
  18. 如权利要求16所述的图形码处理装置,其中,所述解码单元,在所述采集单元采集的图像中定位所述图形码的潜在分布区域之前,基于所述采集单元采集的图像在预览界面的扫描框内形成的局部图像进行解码处理,并检测到解码失败。
  19. 如权利要求16所述的图形码处理装置,其中,
    所述解码单元,在所述采集单元采集的图像中定位所述图形码的潜在分布区域之前,基于所述采集单元采集的图像在预览界面的扫描框内形成的局部图像进行解码;
    所述采集单元,当所述解码单元解码得到所述图形码中所调制的信息时,中止对包括所述图形码的环境进行采集。
  20. 如权利要求16所述的图形码处理装置,其中,所述解码单元,调整至所述图形码图像的尺寸与所述扫描框的尺寸一致,基于调整后的图形 码图像进行解码处理。
  21. 如权利要求16所述的图形码处理装置,其中,所述解码单元,呈现所述图形码中调制的信息,和/或,发送所述图形码中调制的信息至请求扫描图形码的实例。
  22. 一种图形码处理装置,至少包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行权利要求1至15所述方法的步骤。
  23. 一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现权利要求1至15所述方法的步骤。
PCT/CN2017/103272 2016-09-30 2017-09-25 图形码处理方法及装置、存储介质 WO2018059365A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP17854815.2A EP3462371B1 (en) 2016-09-30 2017-09-25 Graphical code processing method and apparatus, and storage medium
US16/206,739 US10783342B2 (en) 2016-09-30 2018-11-30 Graphic code processing method and apparatus, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610878832.2 2016-09-30
CN201610878832.2A CN107886026B (zh) 2016-09-30 2016-09-30 图形码处理方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/206,739 Continuation US10783342B2 (en) 2016-09-30 2018-11-30 Graphic code processing method and apparatus, and storage medium

Publications (2)

Publication Number Publication Date
WO2018059365A1 true WO2018059365A1 (zh) 2018-04-05
WO2018059365A9 WO2018059365A9 (zh) 2019-03-07

Family

ID=61763706

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/103272 WO2018059365A1 (zh) 2016-09-30 2017-09-25 图形码处理方法及装置、存储介质

Country Status (4)

Country Link
US (1) US10783342B2 (zh)
EP (1) EP3462371B1 (zh)
CN (1) CN107886026B (zh)
WO (1) WO2018059365A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111899841A (zh) * 2020-08-06 2020-11-06 北京奥康达体育产业股份有限公司 一种人体运动生物力学监测管理系统
CN116151290A (zh) * 2023-02-21 2023-05-23 广州玺明机械科技有限公司 一种智能化扫码调制奶茶机器人的信息采集系统及方法

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110267232A (zh) * 2019-05-17 2019-09-20 浙江口碑网络技术有限公司 应用程序安装方法和装置
CN110674660B (zh) * 2019-09-26 2021-11-05 珠海格力电器股份有限公司 图形码信息的确定方法及装置、终端设备、家电设备
CN110705329B (zh) * 2019-09-30 2021-09-14 联想(北京)有限公司 一种处理方法、装置及电子设备
CN112287933B (zh) * 2019-12-20 2022-09-06 中北大学 一种汽车轮毂x射线图像文字干扰的去除方法及系统
CN112749769A (zh) * 2020-08-19 2021-05-04 腾讯科技(深圳)有限公司 图形码检测方法、装置、计算机设备及存储介质
CN111923599B (zh) * 2020-09-18 2021-02-26 季华实验室 喷头模组步长计算方法、设备、存储介质和喷墨打印机
USD959552S1 (en) * 2021-07-21 2022-08-02 Speedfind, Inc Display sign
CN113822091B (zh) * 2021-11-23 2022-03-15 北京紫光青藤微系统有限公司 用于二维码码图纠错的方法及装置、电子设备、存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101147157A (zh) * 2005-01-26 2008-03-19 数字逻辑扫描公司 用于将目标对象成像到镜面反射的数据读取器和方法
CN104112153A (zh) * 2014-07-17 2014-10-22 上海透云物联网科技有限公司 基于移动终端的条维码识别方法及其系统
CN104700062A (zh) * 2015-03-20 2015-06-10 中国联合网络通信集团有限公司 一种识别二维码的方法及设备
CN104850815A (zh) * 2015-05-20 2015-08-19 杭州晟元芯片技术有限公司 手机上所显示条码的解码方法

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3994595B2 (ja) * 1998-11-16 2007-10-24 株式会社デンソー バーコード読取方法及び記録媒体
US7770799B2 (en) * 2005-06-03 2010-08-10 Hand Held Products, Inc. Optical reader having reduced specular reflection read failures
CN101882207B (zh) * 2010-06-01 2012-06-20 福建新大陆电脑股份有限公司 Data Matrix码条码解码芯片及其解码方法
WO2012124123A1 (ja) * 2011-03-17 2012-09-20 富士通株式会社 画像処理装置、画像処理方法及び画像処理プログラム
US9064168B2 (en) * 2012-12-14 2015-06-23 Hand Held Products, Inc. Selective output of decoded message data
US9942546B2 (en) * 2013-12-12 2018-04-10 Qualcomm Incorporated POC value design for multi-layer video coding
CN104933688B (zh) * 2014-03-19 2021-06-15 联想(北京)有限公司 一种数据处理方法及电子设备
CN104794421B (zh) * 2015-04-29 2017-09-26 华中科技大学 一种qr码定位及识别方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101147157A (zh) * 2005-01-26 2008-03-19 数字逻辑扫描公司 用于将目标对象成像到镜面反射的数据读取器和方法
CN104112153A (zh) * 2014-07-17 2014-10-22 上海透云物联网科技有限公司 基于移动终端的条维码识别方法及其系统
CN104700062A (zh) * 2015-03-20 2015-06-10 中国联合网络通信集团有限公司 一种识别二维码的方法及设备
CN104850815A (zh) * 2015-05-20 2015-08-19 杭州晟元芯片技术有限公司 手机上所显示条码的解码方法

Non-Patent Citations (1)

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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111899841A (zh) * 2020-08-06 2020-11-06 北京奥康达体育产业股份有限公司 一种人体运动生物力学监测管理系统
CN116151290A (zh) * 2023-02-21 2023-05-23 广州玺明机械科技有限公司 一种智能化扫码调制奶茶机器人的信息采集系统及方法
CN116151290B (zh) * 2023-02-21 2023-10-24 广州玺明机械科技有限公司 一种智能化扫码调制奶茶机器人的信息采集系统及方法

Also Published As

Publication number Publication date
US20190197276A1 (en) 2019-06-27
US10783342B2 (en) 2020-09-22
CN107886026B (zh) 2019-12-13
WO2018059365A9 (zh) 2019-03-07
CN107886026A (zh) 2018-04-06
EP3462371B1 (en) 2021-03-17
EP3462371A4 (en) 2020-02-26
EP3462371A1 (en) 2019-04-03

Similar Documents

Publication Publication Date Title
WO2018059365A1 (zh) 图形码处理方法及装置、存储介质
US11798253B2 (en) Determining a position of an object in a rotation corrected image
CN110046529B (zh) 二维码识别方法、装置及设备
US11423633B2 (en) Image processing to detect a rectangular object
US20110311100A1 (en) Method, Apparatus and Computer Program Product for Providing Object Tracking Using Template Switching and Feature Adaptation
US9679354B2 (en) Duplicate check image resolution
US10747993B2 (en) Detecting a fragmented object in an image
TW201447775A (zh) 資訊識別方法、設備和系統
US11216685B2 (en) Dynamically optimizing photo capture for multiple subjects
US10609293B2 (en) Real-time glare detection inside a dynamic region of an image
WO2019179234A1 (zh) 一种图像识别的方法、装置及设备
JP5656768B2 (ja) 画像特徴量抽出装置およびそのプログラム
WO2018184255A1 (zh) 图像校正的方法和装置
JP2019517079A (ja) 形状検知
US20230137300A1 (en) Advanced hough-based on-device document localization
CN115358252A (zh) 二维码图像处理方法、装置、存储介质与电子设备
JP6194677B2 (ja) 画像処理装置およびプログラム
CN112036205A (zh) 二维码识别方法、电子设备及存储介质
CN115917586A (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: 17854815

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2017854815

Country of ref document: EP

Effective date: 20181227

NENP Non-entry into the national phase

Ref country code: DE