WO2020034850A1 - 识别码识别方法、装置、计算机设备和存储介质 - Google Patents

识别码识别方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2020034850A1
WO2020034850A1 PCT/CN2019/098862 CN2019098862W WO2020034850A1 WO 2020034850 A1 WO2020034850 A1 WO 2020034850A1 CN 2019098862 W CN2019098862 W CN 2019098862W WO 2020034850 A1 WO2020034850 A1 WO 2020034850A1
Authority
WO
WIPO (PCT)
Prior art keywords
identification code
code
picture
target
computer device
Prior art date
Application number
PCT/CN2019/098862
Other languages
English (en)
French (fr)
Inventor
许典平
冉辰
苗捷
贾晓义
姜媚
林榆耿
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to JP2020551561A priority Critical patent/JP7164127B2/ja
Priority to EP19849577.2A priority patent/EP3764282A4/en
Publication of WO2020034850A1 publication Critical patent/WO2020034850A1/zh
Priority to US17/003,507 priority patent/US11494577B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1443Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/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/146Methods for optical code recognition the method including quality enhancement steps
    • G06K7/1469Methods for optical code recognition the method including quality enhancement steps using sub-pixel interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4007Interpolation-based scaling, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4053Super resolution, i.e. output image resolution higher than sensor resolution
    • G06T3/4069Super resolution, i.e. output image resolution higher than sensor resolution by subpixel displacement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • G06V10/449Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters
    • G06V10/451Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters with interaction between the filter responses, e.g. cortical complex cells
    • G06V10/454Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/66Trinkets, e.g. shirt buttons or jewellery items
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19173Classification techniques

Definitions

  • the present application relates to the technical field of identification codes, and in particular, to an identification code identification method, device, computer device, and storage medium.
  • identification code technology has appeared, and the appearance of identification code technology has made people's lifestyles more convenient and faster. For example, convenient and fast lifestyles such as traveling by identification code, paying by identification code, and running applets through identification code are inseparable from the support of identification code technology.
  • the identification code identification method of the related art is to perform operations such as sampling and decoding the entire picture to be detected.
  • This identification method usually has the following problems: as shown in FIG. 1, the entire picture to be detected may be large, and the identification code only accounts for a small part of the entire picture; or, as shown in FIG. 2, the entire picture to be detected There may be a lot of interference information in it. For the above two cases, the entire identification process will take a lot of time to identify the non-identification code area. Therefore, the recognition efficiency is low.
  • the embodiments of the present application provide an identification code identification method, device, computer equipment, and storage medium.
  • This identification method has high identification efficiency and can solve the above technical problems.
  • An identification code identification method runs on a computer device.
  • the method includes:
  • the computer equipment detects an identification code in the picture to be detected to obtain a detection result, and the detection result includes target information of a target code corresponding to the identification code;
  • the computer device samples the target code according to the target information to obtain a sampled image
  • the computer device decodes the sampled image to obtain a recognition result corresponding to the identification code.
  • An identification code identification device runs on a computer device.
  • the device includes:
  • a picture acquisition module for obtaining pictures to be detected
  • An object detection module configured to perform object detection on the identification code in the picture to be detected to obtain the information of the to-be-identified code
  • a sampling module configured to sample the target code to obtain a sampled image
  • a decoding module configured to decode the sampled image to obtain a recognition result of the identification code in the picture to be detected.
  • a computer device includes a memory and a processor.
  • the memory stores a computer program
  • the processor implements the following steps when the computer program is executed:
  • a computer-readable storage medium stores a computer program thereon.
  • the computer program is executed by a processor, the following steps are implemented:
  • identification code identification method after obtaining a picture to be detected, first detecting the identification code in the picture to be detected to obtain a detection result, and the detection result includes target information corresponding to the identification code of the identification code; , Sampling the target code according to the target information to obtain a sample image; finally, decoding the sample image to obtain a recognition result corresponding to the identification code.
  • the whole picture is first detected to obtain a detection result for the identification code, which includes the identification code Target information of the corresponding target code. Then, the target code is sampled and decoded. In this way, the interference in the non-identification code region in the picture to be detected can be reduced, and the identification code identification efficiency can be improved.
  • Figure 1 is an example picture of a large picture and a small code
  • FIG. 2 is an example diagram of a picture with more interference
  • FIG. 3 is an application environment diagram of an identification code identification method in an embodiment
  • FIG. 4 is a schematic flowchart of an identification code identification method in an embodiment
  • FIG. 5 is a comparison diagram of an original image and forward compression and multiple forward compression of the original image in an example
  • FIG. 6 is a comparison diagram of a result of performing double-line difference on an object code and an image super-resolution reconstruction result in an example
  • FIG. 7 is a comparison diagram between a recognition method provided by the related art and a sample image obtained in an embodiment
  • FIG. 8 is a schematic structural diagram of a box network used in an identification code identification method according to an embodiment
  • FIG. 9 is a comparison diagram of the effects of the identification code identification method and the solutions provided by related technologies in the two embodiments.
  • FIG. 10 is a comparison diagram of the effects of the identification code identification method and the solutions provided by related technologies in two other embodiments.
  • FIG. 11 is a schematic flowchart of an embodiment
  • FIG. 12 is a structural block diagram of an identification code identification device in an embodiment
  • FIG. 13 is an internal structural diagram of a computer device in an embodiment
  • FIG. 14 is an internal structural diagram of a computer device in another embodiment.
  • the identification code identification method provided in this application can be applied to an identification code identification engine, and the identification engine can be started by scanning the identification code or setting a picture to be detected. Its application environment is shown in Figure 3.
  • the scanning device 302 communicates with the computer device 304.
  • the scanning device 302 can collect the pictures to be detected and send the pictures to the computer device 304.
  • the computer device 304 detects the identification code in the pictures to obtain the detection result, and the detection result includes the identification Target information of the target code corresponding to the code; sampling the target code according to the target information to obtain a sample image; and decoding the sample image to obtain a recognition result corresponding to the identification code.
  • the computer device 304 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
  • the computer device 304 may also be a server, and the server may be implemented by an independent server or a server cluster composed of multiple servers.
  • an identification code identification method is provided, and the method can be run on the computer device 304 in FIG. 3.
  • the identification code identification method includes the following steps:
  • the computer device acquires a picture to be detected.
  • the picture to be detected is a picture including an identification code.
  • the pictures to be detected can be obtained by scanning or taking photos; the pictures to be detected can also be obtained by setting the pictures.
  • the picture may be a picture stored locally or a picture browsed on the Internet, that is, the picture is set as a picture to be detected.
  • the picture to be detected may be a large picture, and the identification code occupies a small proportion in the picture to be detected, that is, the case of a large picture and a small code.
  • the recognition efficiency of the identification code in the picture to be detected will be improved to a greater extent.
  • the computer device detects the identification code in the picture to be detected to obtain a detection result, and the detection result includes target information of a target code corresponding to the identification code.
  • the identification code may be a two-dimensional code, a one-dimensional code (also referred to as a barcode), a small program code, a PDF417 barcode, and the like, which are not specifically limited in this embodiment of the present application.
  • PDF417 barcode is a portable data format with high density and high information content.
  • the PDF417 barcode can be used to automatically store, carry, and automatically read large-capacity, high-reliability information such as documents and cards.
  • the object code is detected by the computer equipment and recognized as an identification code by the computer equipment. Understandably, the target code identified as the identification code and the actual identification code may not completely overlap, but the intersection ratio of the target code and the identification code should be greater than a preset value. In a possible implementation manner, the preset value is not less than 0.5.
  • the intersection ratio of the target code and the identification code is 1, it indicates that the detected target code and the identification code completely coincide.
  • the intersection ratio is usually a concept used in object detection, which refers to the overlap ratio of the generated candidate frame and the original labeled frame, that is, the ratio of their intersection to union. In the embodiment of the present application, the intersection ratio refers to the ratio of the intersection and union of the target code and the identification code.
  • the target information may be position information of the target code in the picture to be detected, or may be directly image information of the target code.
  • the image information may refer to information of each pixel point of the target code.
  • the manner of detecting the identification code in the picture to be detected to obtain the detection result may be: detecting the identification code as a target through an object detection algorithm to obtain target information including the target code corresponding to the identification code. Test results.
  • the target detection algorithm may be implemented by a neural network.
  • a DPM model Discrete Phase Model
  • the computer device samples the target code according to the target information to obtain a sampled image.
  • the obtained sampled image can greatly reduce the non-identification code area. Interference.
  • the sampling method includes sampling the original image according to a 1: 1 ratio, and may also include upsampling according to a 1: n ratio, and may also include downsampling according to a n: 1 ratio. For example, 4: 1 1/4 downsampling, 4 pixels take one point; or 16: 1 1/16 downsampling, 16 pixels take one point.
  • the computer device decodes the sampled image to obtain a recognition result corresponding to the identification code.
  • the sampled image obtained by the sampling may be decoded by a decoder to obtain a recognition result of an identification code corresponding to the target code.
  • the decoder may include a one-dimensional code decoder, a two-dimensional code decoder, an applet code decoder, a PDF417 barcode decoder, and the like.
  • the identification result corresponding to the identification code is a decoding result obtained by decoding the target code.
  • the decoding result may include information carried by the two-dimensional code; when the identification code is an applet code, the decoding result may include applet information corresponding to the applet code.
  • a sample image corresponding to one target code may include multiple pictures with different sampling ratios.
  • the sampled image can include a 1: 1 original image, a 1: 2 upsampling image, and a 4: 1 downsampling image.
  • the sampled image may include a 1: 1 original image, a 4: 1 down-sampled image, and a 16: 1 down-sampled image.
  • the computer device after obtaining a picture to be detected, the computer device first detects the identification code in the picture to be detected to obtain a detection result, and the detection result includes target information of a target code corresponding to the identification code; The code is sampled to obtain a sampled image; finally, the sampled image is decoded to obtain a recognition result corresponding to the identification code. Because after obtaining the picture to be detected, the computer device does not directly sample and decode the entire picture to be detected, but first detects the whole picture to obtain the detection result for the identification code, where the detection result includes Target information of the target code corresponding to the identification code. Then, the target code is sampled and decoded. In this way, the interference in the non-identification code region in the picture to be detected can be reduced, and the identification code identification efficiency can be improved.
  • sampling the target code according to the target information to obtain a sampled image includes: when the target code meets the resolution condition, upsampling the target code according to the target information to obtain a sampled image.
  • the resolution condition may be that the resolution is less than a preset value, for example, the resolution is less than 300dpi * 300dpi, or 400dpi * 400dpi, etc., where dpi represents the number of dots per inch.
  • the resolution condition may also be that the resolution is within a preset range, for example, a resolution greater than 200dpi * 200dpi is less than 300pdi * 300pdi, or a resolution greater than 180dpi * 200dpi is less than 400dpi * 400dpi.
  • upsampling is to insert new elements between pixels based on the pixels of the original image, so that the obtained sampled image is sharper than the original image.
  • a new element may be inserted using an interpolation algorithm, which is not specifically limited in the embodiment of the present application.
  • the target code when the target code meets the resolution condition, the target code is up-sampled according to the target information to obtain a sampled image.
  • the resolution does not satisfy the resolution condition, for example, when the resolution is sufficiently large, upsampling is still performed, thereby causing waste of resources.
  • it can also be more suitable for setting a picture that has been forwarded and compressed multiple times as a picture to be detected. Therefore, based on the identification code identification method of this embodiment, system resources can be saved on the basis of ensuring the identification efficiency of the identification code.
  • the target code when the resolution of the target code is less than a preset value, the target code is up-sampled according to the target information to obtain a sampled image. In this way, the target code with smaller resolution is up-sampled to reduce factors that reduce the recognition efficiency due to the lower resolution, thereby improving the recognition efficiency of the recognition code.
  • the target code can be down-sampled according to the target information to obtain a adopted image when the target code's scaling ratio is greater than another preset value.
  • the another preset value is larger than the above-mentioned preset value. In this way, the target code with excessive resolution is down-sampled to reduce the number of pixels to be identified, thereby improving the identification code identification efficiency.
  • the original code is sampled 1: 1 based on the target information.
  • the target code with a proper resolution does not need to perform an upsampling or a downsampling operation.
  • the sampling method is determined according to the resolution of the target code. There is no need to sample the target code in various ways, and the number of sampled images obtained is small.
  • the sampling method includes upsampling, downsampling, and original image sampling.
  • the number of the sampled images may be a preset number, and the preset number may be at least one. In this way, the sampling time can be reduced, and the number of decoded sampled images can be reduced, thereby improving the recognition efficiency of the identification code.
  • the step of obtaining a picture to be detected includes any of the following two methods:
  • the picture to be detected is obtained by setting a picture.
  • the preset picture may be set as the picture to be detected by a preset instruction.
  • the preset picture may be a currently displayed picture, or may be a recently stored or displayed picture.
  • the currently displayed picture can be a local picture or a picture browsed online; the recently displayed picture can be a local picture or a picture browsed online.
  • the preset instruction can be triggered by the function menu to set the preset picture as the picture to be detected, and the preset picture can also be set as the picture to be detected by a preset action.
  • a preset action For example, a recently displayed picture is set as a picture to be detected by a circled motion on the screen.
  • the preset action may not only be a screen action such as making a circle on the screen or a preset pattern, but also a button action such as pressing a preset button, or a combination of a screen action and a button action. This application implements Examples do not specifically limit this.
  • obtaining a picture to be detected by setting a picture is different from obtaining a picture to be detected by scanning.
  • the way to obtain the picture to be detected by setting the picture is generally to obtain a picture. Therefore, when identifying the identification code of the picture, it is necessary to ensure the resolution of the picture, thereby improving the identification of the identification code. effectiveness.
  • Obtaining the pictures to be detected by scanning may be to obtain the pictures to be detected by scanning the identification code of the scanning device, or obtain the pictures to be detected by collecting the image of the identification code by the camera device. Multiple images can be obtained by scanning. Because multiple pictures can be combined for identification of the identification code, the resolution requirements for the multiple pictures can be relatively low, and at the same time, the identification efficiency of the identification code can be guaranteed, thereby improving the applicability of identification code identification.
  • the first resolution is used to detect the identification code in the picture to be detected to obtain a detection result; if a picture to be detected is obtained by scanning, the first Two resolutions: The detection result is obtained by detecting the identification code in the picture to be detected; the first resolution is greater than the second resolution.
  • the first resolution may be 400dpi * 400dpi.
  • the second resolution may be 300dpi * 300dpi.
  • sampling the target code according to the target information to obtain a sample image includes: when the target code meets a resolution condition, the target code is based on the target information. Upsampling is performed to obtain a sampled image.
  • the target code is up-sampled according to the target information to obtain a sampled image. In this way, in the case where the picture to be detected is obtained by setting a picture, the resolution of the sampled image is guaranteed, thereby improving the recognition efficiency of the identification code.
  • the target code is up-sampled according to the target information to obtain a sampled image, which is: performing bilinear interpolation on each adjacent four pixel points in the target code according to the target information to obtain a sampled image.
  • the difference algorithm used in the upsampling may be a bilinear difference algorithm.
  • Bilinear difference is a linear interpolation extension of an interpolation function with two variables.
  • the method of bilinear difference may perform linear interpolation in two directions respectively. Linear interpolation is performed on each of the four adjacent pixels in the target code in two directions to obtain the result of bilinear difference. This improves the accuracy of the sampled image, reduces the difficulty of decoding, and improves the identification of the identification code. effectiveness.
  • the target code is up-sampled according to the target information to obtain a sampled image, which is: up-sampling the target code based on the image super-resolution reconstruction technology to obtain a sampled image.
  • the target code is up-sampled based on the target information and based on the image super-resolution reconstruction technology to obtain a sampled image.
  • Image super-resolution reconstruction technology refers to the use of a set of target codes of low-quality, low-resolution images (or motion sequences) to generate a sample image of high-quality, high-resolution images. In this way, the quality and resolution of the sampled image can be improved, thereby improving the identification efficiency of the identification code.
  • the method of upsampling the target code based on the image super-resolution reconstruction technology is compared with the method of performing bilinear interpolation on each adjacent four pixel points in the target code according to the target information.
  • the resolution of the obtained sampled image is higher.
  • the target code can be upsampled by a neural network model based on the image super-resolution reconstruction technology to obtain a sampled image.
  • the neural network model may be a deep neural network model, a convolutional neural network model, a recurrent neural network, and the like.
  • it may be FSRCNN (Fast Region-based Convolutional Network, Fast Regional Basic Convolutional Network).
  • ShuffleNet reorganized channel network, a kind of lightweight network
  • DenseNet denseNet
  • the neural network model based on the image super-resolution reconstruction technology for upsampling the target code may be a lightweight neural network model.
  • the loss function is related to the recognition success rate. For example, when the recognition success rate is greater than a preset value, the model is optimal.
  • the model is smaller, which can save running time, thereby further improving the identification code identification efficiency.
  • the weight corresponding to the edge region of the target code is greater than a preset value.
  • the neural network model includes an input layer, an output layer, and a hidden layer connected between the input layer and the output layer.
  • the number of hidden layers can be no less than 1.
  • the hidden layer may include a weight corresponding to each feature region of the target code. Due to the object such as the identification code, whether the edge region is clear or not is strongly related to the recognition efficiency.
  • the weight corresponding to the edge region of the target code is greater than a preset value, which can improve the clarity of the edge region.
  • the preset value may be an average value of the weights of the regions, or may be a fixed value, or may be a value determined according to a preset method.
  • the preset method includes Weights are summed or averaged. In this way, the sharpness of the edge region is improved, so that the recognition efficiency can be improved.
  • an edge detection algorithm in the process of training the neural network, when calculating the loss function, can be used to extract the edge information of the target code and appropriately increase the weight corresponding to the edge area, so that the neural network model is hidden.
  • the weight corresponding to the edge region of the target code is greater than the preset value, thereby improving the recognition efficiency.
  • the edge detection algorithm may be a Sobel (Sobel operator) edge detection algorithm, which is not specifically limited in this embodiment of the present application.
  • a neural network model corresponding to the edge region of the target code with a weight greater than a preset value is used to perform upsampling, and the obtained sample image is compared with the sample image obtained by the related technology, as shown in FIG. 7. .
  • a neural network model corresponding to the edge area of the target code with a weight greater than a preset value upsampling, the sharpness of the sampled image obtained is significantly greater than that obtained by the related technology. For example, in the image obtained by the related technology, a rectangle is used. Framed part. Therefore, by using a neural network model corresponding to the edge region of the target code with a weight greater than a preset value, the method of upsampling to obtain a sampled image can improve the recognition efficiency of the recognition code.
  • the label region of the target code in the training sample is filtered.
  • the center area of the two-dimensional code may have a label (Logo).
  • the label regions in the training samples can be filtered.
  • the filtering method may be to obtain the position of the label region, and then set the label region to a blank form according to the position of the label region, or it may be manually removed, which is not specifically limited in this embodiment of the present application. Since the interference in the decoding process can be reduced, the decoding efficiency can be improved, and the identification efficiency of the identification code can be improved.
  • a dense network is used as the network prototype, and the network is simplified on the premise of ensuring the recognition rate.
  • the final model size is 13K (kilobyte). Time is 6ms (milliseconds).
  • the detection result further includes an identification code type.
  • Decoding the sampled image to obtain the identification result corresponding to the identification code includes decoding the sampled image according to the type of identification code to obtain the identification result corresponding to the identification code.
  • the identification code type may include a two-dimensional code, a one-dimensional code (also referred to as a barcode), a small program code, a PDF417 barcode, and the like. Since each type of identification code can correspond to a decoder, in the case of indeterminate identification code types, each type of decoder needs to be decoded separately, and the decoding result corresponding to the successfully decoded decoder is used as the final. Decoding result.
  • a one-dimensional code is decoded by a one-dimensional code decoder
  • a two-dimensional code is decoded by a two-dimensional decoder
  • a small program code is decoded by a small program decoder
  • a PDF417 barcode is decoded by a PDF417 barcode decoder. Therefore, based on the identification code identification method of this embodiment, the identification code type is determined before decoding, and only decoding by the decoder corresponding to the identification code type is required during decoding, and each decoder does not need to be decoded. Increasing the decoding efficiency can further improve the identification efficiency of the identification code.
  • a neural network model is used to detect the identification code in the picture to be detected to obtain a detection result.
  • the neural network model can be CNN (Convolutional Neural Networks, Convolutional Neural Networks), RCNN (Regions with CNN Features, Regional Convolutional Neural Networks), FastRCNN (Fast Regions with CNN Features, Fast Regional Convolutional Neural Networks) , FasterRCNN (Faster Regions with CNN, Faster Region Convolutional Neural Networks), etc.
  • the neural network model can obtain more accurate detection results, which can improve the recognition efficiency of the identification code.
  • the neural network model can use an SSD (Single Shot Multibox Detector, single-shot multi-box detection) algorithm. Further, based on the SSD algorithm, it can be improved based on HcNet (High Concurrency Convolutional Neural Network), using the good implementation of the Depthwise Separable Convolution structure in the ncnn framework (Tencent open source deep learning framework), All 3x3 convolutions in the network residuals are transformed into a deep separable convolution structure, and a smaller network coefficient is selected in multiple experiments. In this way, the neural network model is made smaller and consumes less time, thereby further improving the recognition efficiency of the identification code.
  • SSD Single Shot Multibox Detector, single-shot multi-box detection
  • the basic size of the BoxNet (box network) pre-trained on the ImageNet (image network) is only 3M (megabytes), and its detection result ranks first in the detection result.
  • the accuracy rate that is, the Top-1 accuracy rate reaches 56%, and the algorithm effect is the same as that of AlexNet (Alex Network), while the model size of AlexNet is nearly 200M, and the calculation amount is more than ten times larger.
  • the structure diagram of BoxNet is shown in Fig. 8.
  • Three-channel 300dpi * 300dpi images are convolved to obtain four 80-channel 38dpi * 38dpi images.
  • Continuation operations are performed to obtain eight images. 160 channel 19dpi * 19dpi image; continue the convolution operation to get 4 320 channel 10dpi * 10dpi images; continue the convolution operation to get 3 80 channel 10dpi * 10dpi images; continue the convolution operation,
  • the image network is finally obtained.
  • the box network is further quantified. For example, if the picture to be detected is obtained by setting a picture, the first resolution is used to detect the identification code in the picture to be detected to obtain the detection result; if the picture to be detected is obtained by scanning, Then, the second resolution is used to detect the identification code in the picture to be detected to obtain a detection result; the first resolution is greater than the second resolution.
  • the box network based on the SSD algorithm, after quantizing 16 bits, the model size is 500K, and it takes only 15ms to detect a single frame.
  • intersection ratio of the target code and the identification code corresponding to the positive samples used in the training process of the neural network model is greater than a preset value.
  • the identification code in the positive sample needs to be more strictly to ensure its integrity; when sampling the data enhancement sample, the minimum object coverage in the positive sample needs to be strictly limited, and the target code in the sampled image needs to be as close as possible Contains the entire identification code.
  • the intersection ratio of the target code corresponding to the positive sample to the identification code during the training process is increased.
  • the intersection ratio may be the ratio of the intersection and union of the corresponding target code and identification code in the positive sample, that is, the ratio of the intersection of the corresponding target code and identification code in the positive sample to the union of the target code and identification code.
  • the ratio of the intersection to the union may be a ratio of an area of the intersection to an area of the union, or a ratio of the number of pixels of the intersection to the number of pixels of the union. In this way, the corresponding weight of the integrity of the identification code in the neural network model is improved, thereby improving the identification efficiency of the identification code.
  • decoding the sampled image to obtain a recognition result corresponding to the identification code includes: binarizing the sampled image to obtain a binary image; and decoding the binary image to obtain a correspondence to the identification code. Recognition results.
  • the binarization process is to set the gray value of the pixels on the sampled image to one of two values.
  • the two values can be 0 or 255.
  • the binarized image thus obtained will show obvious black and white effects.
  • the binarization methods may include hybrid binarization, fast window binarization, and adaptive binarization. Since the purpose of this application is to identify the identification code, the identification code may only involve the identification of black and white images. Therefore, performing the binarization process before decoding can improve the decoding efficiency during decoding, thereby improving the identification efficiency of the identification code.
  • a picture to be detected is acquired by scanning.
  • the identification code in the picture to be detected is detected to obtain a detection result.
  • the intersection ratio of the target code corresponding to the positive sample used in the training process of the neural network model to the identification code is greater than a preset value.
  • the target code is sampled according to the target information to obtain a sampled image; the sampled image is decoded to obtain a recognition result corresponding to the identification code.
  • scanning can be performed based on a scanning entry provided by an application to obtain a picture to be detected.
  • the above applications include, but are not limited to, social applications, payment applications, and the like, which are not specifically limited in the embodiments of the present application.
  • sampling the target code according to the target information to obtain a sampled image includes: when the target code satisfies a resolution condition, performing double-line on each adjacent four pixel points in the target code according to the target information. Sexual interpolation to obtain sampled images.
  • FIG. 9 A comparison between the effects of the two embodiments and the identification method of the related art is shown in FIG. 9. Based on the solution of the previous embodiment, the average time consumption of a single frame is reduced by about 150% while reducing the decoding success rate during identification code identification. Therefore, its identification efficiency is higher than that provided by related technologies. Based on the solution of the latter embodiment, the decoding success rate is increased from about 32% to about 36% in the case that the single frame consumes less time than the previous embodiment.
  • a picture to be detected is obtained by setting a picture. Then, through the neural network model, the identification code in the picture to be detected is detected to obtain a detection result. The intersection ratio of the target code corresponding to the positive sample used in the training process of the neural network model to the identification code is greater than a preset value. Finally, the target code is sampled according to the target information to obtain a sampled image; the sampled image is decoded to obtain a recognition result corresponding to the identification code.
  • the way of setting the picture may be a long-press operation on the picture, that is, the user's long-press operation on the picture may trigger the computer device to obtain the picture to be detected, which is not specifically limited in this embodiment of the present application.
  • sampling the target code according to the target information to obtain a sampled image includes: when the target code meets the resolution condition, upsampling the target code based on the target information based on the image super-resolution reconstruction technology to obtain Sampling the image.
  • FIG. 10 A comparison between the effects of the two embodiments and the identification methods of the related art is shown in FIG. 10. Based on the solution of the previous embodiment, the average time consumption of a single frame is reduced by about 150% while reducing the decoding success rate during identification code identification. Therefore, its identification efficiency is higher than that provided by related technologies. Based on the solution of the latter embodiment, the decoding success rate is increased from about 70% to about 90% in the case that the single frame consumes less time than the previous embodiment.
  • the detection result includes target information and an identification code type of a target code corresponding to the identification code;
  • the identification code type includes two-dimensional code, one-dimensional code and applet code.
  • the target code is up-sampled according to the target information to obtain a sampled image.
  • the sampled image is binarized to obtain a binarized image.
  • the binarization includes hybrid binarization, fast window binarization, and adaptive binarization.
  • the binary image is decoded by a decoder corresponding to the type of identification code.
  • the identification code is detected before sampling to obtain the detection result including the target information and the type of identification code, the entire picture to be detected does not need to be processed during the sampling and binarization process. At the same time, only the The decoder corresponding to the type of the identification code performs decoding, therefore, the identification efficiency of the identification code can be improved.
  • steps in the flowchart of FIG. 4 are sequentially displayed in accordance with the directions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless explicitly stated in this document, the execution of these steps is not strictly limited, and these steps can be performed in other orders. Moreover, at least a part of the steps in FIG. 4 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution of these sub-steps or stages The sequence is not necessarily performed sequentially, but may be performed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
  • an identification code identification device running on the computer device 304 in FIG. 3 including:
  • a picture obtaining module 202 for obtaining a picture to be detected
  • a target detection module 204 configured to detect an identification code in the picture to be detected to obtain a detection result, where the detection result includes target information of a target code corresponding to the identification code;
  • a sampling module 206 configured to sample the target code according to the target information to obtain a sampled image
  • a decoding module 208 is configured to decode the sampled image to obtain a recognition result corresponding to the identification code.
  • the foregoing identification code identification device after acquiring a picture to be detected, first detects an identification code in the picture to be detected to obtain a detection result, and the detection result includes target information of a target code corresponding to the identification code; The target information samples the target code to obtain a sample image; and finally, decodes the sample image to obtain a recognition result corresponding to the identification code.
  • the whole picture is first detected to obtain a detection result for the identification code, which includes the identification code Target information of the corresponding target code. Then, the target code is sampled and decoded. In this way, the interference in the non-identification code region in the picture to be detected can be reduced, and the identification code identification efficiency can be improved.
  • the sampling module is configured to up-sample the target code according to the target information to obtain a sampled image when the target code meets a resolution condition.
  • the sampling module is configured to, if a picture to be detected is obtained by setting a picture, when the target code meets a resolution condition, upsampling the target code according to the target information To get the sampled image.
  • the sampling module is configured to up-sample the target code according to the target information to obtain a sampled image when the resolution of the target code is less than a preset value.
  • the sampling module is configured to perform bilinear interpolation on each adjacent four pixel points in the target code according to the target information to obtain a sampled image
  • the sampling module is configured to up-sample the target code based on the target information based on image super-resolution reconstruction technology to obtain a sampled image.
  • the target code is up-sampled by a neural network model based on image super-resolution reconstruction technology to obtain a sampled image; in the hidden layer of the neural network model, the weight corresponding to the edge region of the target code is greater than default value.
  • the device further includes a filtering module, which is configured to filter the label region of the target code in the training sample before training the neural network model.
  • the picture acquisition module is configured to obtain a picture to be detected by setting a picture.
  • the picture obtaining module is configured to obtain a picture to be detected by scanning.
  • the picture acquisition module is configured to obtain a picture to be detected by setting a picture; and the target detection module is configured to detect the identification code in the picture to be detected by using a first resolution. Test results.
  • the picture acquisition module is configured to obtain a picture to be detected by scanning; and the target detection module is configured to detect the identification code in the picture to be detected by using a second resolution. result.
  • the first resolution is greater than the second resolution.
  • the detection result further includes an identification code type
  • the decoding module is configured to decode the sampled image according to the type of the identification code to obtain an identification result corresponding to the identification code.
  • the apparatus further includes a binarization module
  • the binarization module is configured to perform binarization processing on the sampled image to obtain a binarized image
  • the decoding module is configured to decode the binary image to obtain a recognition result corresponding to the identification code.
  • the target detection module is configured to detect the identification code in the picture to be detected by a neural network model to obtain a detection result; the target corresponding to the positive sample used in the training process of the neural network model The intersection ratio of the code and the identification code is greater than a preset value.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 13.
  • the computer device includes a processor, a memory, and a network interface connected through a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for running an operating system and computer programs in a non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by a processor to implement an identification code identification method.
  • a computer device is provided.
  • the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 14.
  • the computer equipment includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for running an operating system and computer programs in a non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by a processor to implement an identification code identification method.
  • the display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen.
  • the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the computer device casing. , Or an external keyboard, trackpad, or mouse.
  • FIGS. 13 and 14 are only block diagrams of some structures related to the solution of the application, and do not constitute a limitation on the computer equipment to which the solution of the application is applied.
  • the specific computer The device may include more or fewer components than shown in the figure, or some components may be combined, or have different component arrangements.
  • a computer device which includes a memory and a processor.
  • the memory stores a computer program.
  • the processor executes the computer program, the steps of the identification code identification method are implemented.
  • a computer-readable storage medium on which a computer program is stored.
  • the steps of the foregoing identification code identification method are implemented.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM dual data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Synchlink DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Abstract

本申请涉及一种识别码识别方法、装置、设备和存储介质,获取待检测图片;检测所述待检测图片中的识别码得到检测结果,所述检测结果包括与所述识别码对应的目标码的目标信息;根据所述目标信息对所述目标码进行采样,得到采样图像;对所述采样图像进行解码,得到与所述识别码对应的识别结果。由于在获取到待检测图片后,并不是直接对整张待检测图片进行采样、解码等操作,而是先对整张图片进行检测,得到针对识别码的检测结果,该检测结果包括与识别码对应的目标码的目标信息。然后,再针对该目标码进行采样、解码等操作。如此,可以降低待检测图片中非识别码区域的干扰,提高识别码的识别效率。

Description

识别码识别方法、装置、计算机设备和存储介质
本申请要求于2018年08月16日提交的申请号为201810934332.5、发明名称为“识别码识别方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及识别码技术领域,特别是涉及一种识别码识别方法、装置、计算机设备和存储介质。
背景技术
随着计算机信息技术的发展,出现了识别码技术,而识别码技术的出现使得人们的生活方式变得更加方便快捷。比如,通过识别码乘车、通过识别码支付、通过识别码运行小程序等方便快捷的生活方式都离不开识别码技术的支持。
相关技术的识别码识别方式,是对整张待检测图片进行采样及解码等操作。该种识别方式通常存在以下问题:如图1所示,整张待检测图片可能很大,而识别码只占整张图片很小的一部分;或者,如图2所示,整张待检测图片中可能存在很多干扰信息。针对上述两种情况,均会使得整个识别过程耗费大量时间在非识别码区域的识别上。因此,识别效率低。
发明内容
本申请实施例提供了一种识别码识别方法、装置、计算机设备和存储介质,该种识别方式的识别效率高,能够解决上述技术问题。
一种识别码识别方法,所述方法运行于计算机设备,所述方法包括:
所述计算机设备获取待检测图片;
所述计算机设备检测所述待检测图片中的识别码得到检测结果,所述检测结果包括与所述识别码对应的目标码的目标信息;
所述计算机设备根据所述目标信息对所述目标码进行采样,得到采样图像;
所述计算机设备对所述采样图像进行解码,得到与所述识别码对应的识别结果。
一种识别码识别装置,所述装置运行于计算机设备,所述装置包括:
图片获取模块,用于获取待检测图片;
目标检测模块,用于对所述待检测图片中的识别码进行目标检测,得到待识别码信息;
采样模块,用于对所述目标码进行采样,得到采样图像;
解码模块,用于对所述采样图像进行解码,得到对所述待检测图片中所述识别码的识别结果。
一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:
获取待检测图片;
检测所述待检测图片中的识别码得到检测结果,所述检测结果包括与所述识别码对应的目标码的目标信息;
根据所述目标信息对所述目标码进行采样,得到采样图像;
对所述采样图像进行解码,得到与所述识别码对应的识别结果。
一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:
获取待检测图片;
检测所述待检测图片中的识别码得到检测结果,所述检测结果包括与所述识别码对应的目标码的目标信息;
根据所述目标信息对所述目标码进行采样,得到采样图像;
对所述采样图像进行解码,得到与所述识别码对应的识别结果。
上述识别码识别方法、装置、计算机设备和存储介质,在获取到待检测图片后,首先检测待检测图片中的识别码得到检测结果,检测结果包括与识别码对应的目标码的目标信息;之后,根据目标信息对目标码进行采样,得到采样图像;最后,对采样图像进行解码,得到与识别码对应的识别结果。由于在获取到待检测图片后,并不是直接对整张待检测图片进行采样、解码等操作,而是先对整张图片进行检测,得到针对识别码的检测结果,该检测结果包括与识别码对应的目标码的目标信息。然后,再针对该目标码进行采样、解码等操作。如此,可以降低待检测图片中非识别码区域的干扰,提高识别码的识别效率。
附图说明
图1为一大图小码的示例图片;
图2为一存在较多干扰的图片示例图;
图3为一实施例中识别码识别方法的应用环境图;
图4为一实施例中识别码识别方法的流程示意图;
图5为一示例中原图及对原图进行转发压缩及多次转发压缩的对比图;
图6为一示例中对目标码进行双线差值的结果与图像超分辨率重建结果的对比图;
图7为相关技术提供的识别方式与一实施例中得到的采样图像的对比图;
图8为一实施例中识别码识别方法中采用的盒子网络的结构示意图;
图9为两个实施例中识别码识别方法与相关技术提供的方案的效果对比图;
图10为另外两个实施例中识别码识别方法与相关技术提供的方案的效果对比图;
图11为一实施例的流程示意图;
图12为一实施例中识别码识别装置的结构框图;
图13为一实施例中计算机设备的内部结构图;
图14为另一实施例中计算机设备的内部结构图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供的识别码识别方法,可应用于识别码的识别引擎中,该识别引擎可以通过扫描识别码或设置待检测图片的方式启动。其应用环境如图3所示。
其中,扫描设备302与计算机设备304进行通信。可以通过扫描设备302采集待检测图片,并将待检测图片发送至计算机设备304,计算机设备304在获取到待检测图片后,检测待检测图片中的识别码得到检测结果,该检测结果包括与识别码对应的目标码的目标信息;根据目标信息对目标码进行采样,得到采样图像;对采样图像进行解码,得到与识别码对应的识别结果。
其中,计算机设备304可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。在一种可能的实现方式中,计算机设备304还可以是服务器,该服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在一个实施例中,如图4所示,提供了一种识别码识别方法,该方法可运行于图3中的计算机设备304。该识别码识别方法包括以下步骤:
S402,计算机设备获取待检测图片。
待检测图片是包括识别码的图片。
可以通过扫描或拍摄照片的方式获取待检测图片;还可以通过对图片进行设置的方式获取待检测图片。在一种可能的实现方式中,该图片可以为已存储在本地的图片或联网浏览的图片,即将该图片设置为待检测图片。
待检测图片可以是一张较大的图片,而识别码在该待检测图片中所占比例较小,即大图小码的情况。对于这种大图小码情况下的待检测图片,将更大程度上提高对待检测图片中识别码的识别效率。
S404,计算机设备检测待检测图片中的识别码得到检测结果,检测结果包括与识别码对应的目标码的目标信息。
识别码可以是二维码、一维码(也可以称为条形码)、小程序码、PDF417条码等,本申请实施例对此不进行具体限定。其中,PDF417条码是一种高密度、高信息含量的便携式数据格式。该PDF417条码可以用于实现证件及卡片等大容量、高可靠性信息自动存储、携带并可用机器自动识读。
目标码是计算机设备检测到的、且被计算机设备认定为识别码。可以理解地,被认定为识别码的目标码与实际的识别码可以不完全重合,但目标码与识别码的交并比应该大于预设值。在一种可能的实现方式中,该预设值不小于0.5。当目标码与识别码的交并比为1时,表明检测到的目标码与识别码完全重合。其中,交并比通常为目标检测中使用的一个概念,它指代的是产生的候选框与原标记框的交叠率,即它们的交集与并集之比。在本申请实施例中,交并比指代的是目标码与识别码的交集和并集之比。
目标信息可以为目标码在待检测图片中的位置信息,也可以直接为目标码的图像信息。在一种可能的实现方式中,该图像信息可以是指目标码的每个像素点的信息。
在一种可能的实现方式中,检测待检测图片中的识别码得到检测结果的方式,可以是:通过目标检测算法将识别码作为目标进行检测,得到包括与识别码对应的目标码的目标信息的检测结果。作为一个示例,该目标检测算法可以通过神经网络实现。比如,可以采用DPM模型(Discrete Phase Model,离散相位模型)。
S406,计算机设备根据目标信息对目标码进行采样,得到采样图像。
在本实施例中,无需对整张待检测图片进行采样,只需要对检测得到的目标信息对应的目标码进行采样即可,如此,得到的采样图像能够在很大程度上降低非识别码区域的干扰。
在一种可能的实现方式中,采样的方式包括按照1:1的比例进行原图采样,也可以包括按照1:n的比例进行上采样,还可以包括按照n:1的比例进行下采样。比如,4:1的1/4下采样,4个像素点取一个点;或,16:1的1/16下采样,16个像素点取一个点。
S408,计算机设备对采样图像进行解码,得到与识别码对应的识别结果。
在对目标码采样之后,可以通过解码器对采样得到的采样图像进行解码,得到与该目标码对应的识别码的识别结果。解码器可以包括一维码解码器、二维码解码器、小程序码解码器、PDF417条码解码器等。识别码对应的识别结果为对目标码进行解码得到的解码结果。比如,当识别码为二维码时,解码结果可以包括二维码所携带的信息;当识别码为小程序码时,解码结果可以包括小程序码对应的小程序信息。
可以理解地,一个目标码对应的采样图像,可以包括不同采样比例的多个图片。比如,采样图像可以包括一个1:1的原图,一个1:2的上采样图,一个4:1的下采样图。又比如,采样图像可以包括一个1:1的原图,一个4:1的下采样图,一个16:1的下采样图。
上述识别码识别方法,计算机设备在获取到待检测图片后,首先检测待检测图片中的识别码得到检测结果,检测结果包括与识别码对应的目标码的目标信息;之后,根据目标信息对目标码进行采样,得到采样图像;最后,对采样图像进行解码,得到与识别码对应的识别结果。由于在获取到待检测图片后,计算机设备并不是直接对整张待检测图片进行采样及解码操作,而是先对整张图片进行检测,得到针对识别码的检测结果,其中,该检测结果包括与识别码对应的目标码的目标信息。然后,再针对该目标码进行采样及解码操作。如此,可以降低待检测图片中非识别码区域的干扰,提高识别码的识别效率。
针对将经过多次转发压缩的图片设置为待检测图片的场景,选择30%识别失败的案例进行分析,发现识别失败的案例中有70%的案例,解码失败是由于识别码太小而又被压缩导致的,最终使得识别失败。如图5所示,由于流量等因素限制,用户在转发图片时往往需要进行图片压缩,经过多次转发压缩的图片,其分辨率较低,通过原图采样和下采样的方式,在后续解码过程中将导致解码失败,最终使得识别失败,该种现象也称之为压缩失真。
在其中一实施例中,根据目标信息对目标码进行采样,得到采样图像,包 括:当目标码满足分辨率条件时,根据目标信息对目标码进行上采样,得到采样图像。
在一种可能的实现方式中,分辨率条件可以是分辨率小于预设值,比如,分辨率小于300dpi*300dpi,或400dpi*400dpi等,其中dpi表示每英寸点数。
在另一种可能的实现方式中,分辨率条件也可以是分辨率在预设范围内,比如,分辨率大于200dpi*200dpi小于300pdi*300pdi,或分辨率大于180dpi*200dpi小于400dpi*400dpi等。
其中,上采样是在原有图像像素的基础上在像素点之间插入新的元素,从而使得到的采样图像相比原有图像更清晰。一般地,可以采用插值算法插入新的元素,本申请实施例对此不进行具体限定。
基于本实施例的识别码识别方法,需要在目标码满足分辨率条件时,才根据目标信息对目标码进行上采样,得到采样图像。如此,一方面,可以避免分辨率不满足分辨率条件,比如当分辨率已经足够大时,仍然进行上采样,进而造成资源浪费的情况。另一方面,还可以更适用于将经过多次转发压缩的图片设置为待检测图片的场景。从而,基于本实施例的识别码识别方法,能够在保证识别码的识别效率的基础上,节约系统资源。
在其中一实施例中,当目标码的分辨率小于预设值时,根据目标信息对目标码进行上采样,得到采样图像。如此,对分辨率较小的目标码进行上采样,减少因为分辨率较低而使得识别效率下降的因素,从而提高识别码的识别效率。
对应地,可以在目标码的分标率大于另一预设值时,根据目标信息对目标码进行下采样,得到采用图像。可以理解地,该另一预设值大于上述预设值,如此将分辨率过大的目标码进行下采样,减少需要识别的像素点数量,从而提高识别码的识别效率。
可以理解地,当目标码的分辨率在该预设值与另一预设值之间时,根据目标信息对目标码进行1:1原图采样。如此,使得分辨率合适的目标码无需进行上采样或下采样的操作。
需要说明的是,基于本实施例的识别码识别方法,根据目标码的分辨率确 定采样方式,无需对目标码进行各种方式的采样,且得到的采样图像的数量较少。该采样方式包括上采样、下采样及原图采样。该采样图像的数量可以为预设数量,该预设数量最少可以为1。如此,可以减少采样的时间,并减少解码的采样图像的数量,从而提高识别码的识别效率。
在其中一实施例中,获取待检测图片的步骤,包括以下两种方式中的任意一种:
(1)、通过设置图片的方式获取待检测图片;
(2)、通过扫描的方式获取待检测图片。
通过设置图片的方式获取待检测图片,可以是通过预设指令将预设图片设置为待检测图片。该预设图片可以是当前显示的图片,也可以是最近存储或显示的图片。当前显示的图片可以是本地图片,也可以是联网浏览的图片;最近显示的图片可以是本地图片,也可以是联网浏览的图片。
可以通过功能菜单触发该预设指令将预设图片设置为待检测图片,也可以通过预设动作将预设图片设置为待检测图片。比如,通过在屏幕上划圈的动作将最近显示的图片设置为待检测图片。可以理解地,预设动作不仅可以是在屏幕上划圈、划预设图案等屏幕动作,还可以是按下预设按钮等按钮动作,还可以是屏幕动作与按钮动作的结合,本申请实施例对此不进行具体限定。
需要说明的是,通过设置图片的方式获取待检测图片区别于通过扫描的方式获取待检测图片。通过设置图片的方式获取待检测图片的方式,一般是可以获取到一张图片,因此,在对该一张图片的识别码进行识别时,需要保证该图片的分辨率,从而提高识别码的识别效率。
通过扫描的方式获取待检测图片,可以是通过扫码设备扫描识别码得到待检测图片,或通过摄像设备采集识别码的图像得到待检测图片。通过扫描的方式可以获取到多张图片。由于可以联合多张图片进行识别码的识别,因此,对该多张图片的分辨率的要求可以相对低一些,且同时可以保证识别码的识别效率,从而提高识别码识别的适用性。
在其中一实施例中,若通过设置图片的方式获取待检测图片,则采用第一 分辨率,检测待检测图片中的识别码得到检测结果;若通过扫描的方式获取待检测图片,则采用第二分辨率,检测待检测图片中的识别码得到检测结果;第一分辨率大于第二分辨率。
如此,保证通过设置图片的方式获取待检测图片对应的目标码的分辨率,大于通过扫描的方式获取待检测图片对应的目标码的分辨率,从而可以在保证两种方式的识别效率的基础上,提高识别码识别的适用性。
在其中一实施例中,由于通过设置图片的方式获取待检测图片,对于精度要求高、耗时长,为了提高识别效率,第一分辨率可以为400dpi*400dpi。而对于通过扫描的方式获取待检测图片,第二分辨率可以为300dpi*300dpi。
在其中一实施例中,若通过设置本地图片的方式获取待检测图片,则根据目标信息对目标码进行采样,得到采样图像,包括:当目标码满足分辨率条件时,根据目标信息对目标码进行上采样,得到采样图像。
由于通过设置图片的方式获取待检测图片,相较于通过扫描的方式获取待检测图片,需要更高的分辨率,因此,在本实施例中,在通过设置图片的方式获取待检测图片的情况下,若目标码满足分辨率条件,则根据目标信息对目标码进行上采样,得到采样图像。如此,保证在通过设置图片的方式获取待检测图片的情况下,采样图像的分辨率,从而提高识别码的识别效率。
在其中一实施例中,根据目标信息对目标码进行上采样,得到采样图像,为:根据目标信息对目标码中每相邻的四个像素点进行双线性插值,得到采样图像。
即在本实施例中,上采样中采用的差值算法可以为双线性差值算法。双线性差值是有两个变量的插值函数的线性插值扩展。在一种可能的实现方式中,双线性差值的方式可以在两个方向分别进行一次线性插值。对目标码中每相邻的四个像素点在两个方向上分别进行一次线性插值,得到双线性差值的结果,如此提高采样图像的准确性,降低解码难度,从而提高识别码的识别效率。
在其中一实施例中,根据目标信息对目标码进行上采样,得到采样图像, 为:基于图像超分辨率重建技术对目标码进行上采样,得到采样图像。
即根据目标信息、基于图像超分辨率重建技术对目标码进行上采样,得到采样图像。图像超分辨率重建技术是指利用一组低质量、低分辨率图像(或运动序列)的目标码,来生成一幅高质量、高分辨率图像的采样图像。如此,可以提高采样图像的质量及分辨率,从而提高识别码的识别效率。
一般地,如图6所示,基于图像超分辨率重建技术对目标码进行上采样的方式,相较于根据目标信息对目标码中每相邻的四个像素点进行双线性插值的方式,得到的采样图像的分辨率更高。
进一步地,为了进一步保证上采样的准确性,从而提高识别效率,可以通过神经网络模型,基于图像超分辨率重建技术对目标码进行上采样,得到采样图像。在一种可能的实现方式中,神经网络模型可以为深度神经网络模型、卷积神经网络模型及循环神经网络等,比如可以是FSRCNN(Fast Region-based Convolutional Network,快速区域基础卷积神经网络),ShuffleNet(重组通道网络,一种轻量即神经网络),DenseNet(密集网络)等网络。
更进一步地,由于识别码的纹理比较简单,该基于图像超分辨率重建技术对目标码进行上采样的神经网络模型可以为轻量型神经网络模型。在该轻量型神经网络模型的训练过程中,损失函数与识别成功率相关,比如,当识别成功率大于预设值时模型达到最优。相较于损失函数与PSNR(Peak Signal to Noise Ratio,峰值信噪比)相关的实施方式,其模型较小,可以节约运行时间,从而可进一步提高识别码的识别效率。
在其中一实施例中,神经网络模型的隐藏层中、与目标码的边缘区域对应的权重大于预设值。
神经网络模型包括输入层、输出层及连接在输入层和输出层之间的隐藏层。隐藏层的数量可以不少于1。该隐藏层中可以包括目标码的各特征区域对应的权重。由于识别码这种对象,对于边缘区域是否清晰与识别效率强相关,神经网络模型的隐藏层中、与目标码边缘区域对应的权重大于预设值,可以提高边缘区域的清晰度。在一种可能的实现方式中,该预设值可以为各区域权重的平均 值,也可以为一固定值,还可以为根据预设方式确定的值,预设方式包括对预设区域对应的权值进行加权求和或求平均值等方式。如此,提高边缘区域的清晰度,从而可以提高识别效率。
在其中一实施例中,在训练该神经网络的过程中,计算损失函数时,可以采用边缘检测算法,提取目标码的边缘信息,并对边缘区域对应的权重适当提高,使得神经网络模型的隐藏层中、与目标码的边缘区域对应的权重大于预设值,从而提高识别效率。作为一个示例,边缘检测算法可以为Sobel(索贝尔算子)边缘检测算法,本申请实施例对此不进行具体限定。
在其中一实施例中,通过与目标码的边缘区域对应的权重大于预设值的神经网络模型,进行上采样,得到的采样图像,与相关技术得到的采样图像的对比,如图7所示。通过与目标码的边缘区域对应的权重大于预设值的神经网络模型,进行上采样,得到的采样图像的清晰度明显大于相关技术得到的采样图像,比如,在相关技术得到的图像中用矩形框框出的部分。从而,通过与目标码的边缘区域对应的权重大于预设值的神经网络模型,进行上采样,得到采样图像的方式,可以使得识别码的识别效率得到提升。
在其中一实施例中,在训练神经网络模型之前,对训练样本中的目标码的标签区域进行过滤。
识别码中可能存在一些没有实质解码意义的信息,如二维码的中心区域可能有标签(Logo)。为了减少解码过程中的干扰,可以对训练样本中的标签区域进行滤除。作为一个示例,滤除的方式可以为获取标签区域位置,然后根据标签区域位置将标签区域设置为空白的形式,也可以通过人工方式抠除,本申请实施例对此不进行具体限定。由于能够降低解码过程中的干扰,因此能够提高解码效率,从而可以提高识别码的识别效率。
在其中一实施例中,采用密集网络作为网络原型,在保证识别率的前提下精简网络,最终模型大小为13K(千字节,Kilobyte),对于识别码为100dpi*100dpi的待检测图片,耗时为6ms(毫秒)。
在其中一实施例中,检测结果还包括识别码类型。对采样图像进行解码,得 到与识别码对应的识别结果,包括:根据识别码类型对采样图像进行解码,得到与识别码对应的识别结果。
其中,识别码类型可以包括二维码、一维码(也可以称为条形码)、小程序码、PDF417条码等。由于每种类型的识别码可以分别对应一种解码器,在不确定识别码类型的情况下,需要通过各种类型的解码器,分别进行解码,将解码成功的解码器对应的解码结果作为最终的解码结果。比如,一维码通过一维码解码器进行解码,二维码通过二维解码器解码,小程序码通过小程序解码器解码,PDF417条码通过PDF417条码解码器解码。因此,基于本实施例的识别码识别方法,在解码之前确定识别码类型,在解码时只需要通过识别码类型对应的解码器进行解码即可,而无需各个解码器均进行解码,从而可以进一步提高解码效率,进而可以提高识别码的识别效率。
为了进一步提高检测待检测图片中的识别码的检测效率,在其中一实施例中,通过神经网络模型,检测待检测图片中的识别码得到检测结果。
作为一个示例,神经网络模型可以为CNN(Convolutional Neural Networks,卷积神经网络),RCNN(Regions with CNN features,区域卷积神经网络),FastRCNN(Fast Regions with CNN features,快速区域卷积神经网络),FasterRCNN(Faster Regions with CNN features,更快速区域卷积神经网络)等。通过神经网络模型可以得到更为准确的检测结果,从而可以提高识别码的识别效率。
为了更加适用于移动场景,即方便在移动终端使用,该神经网络模型可以采用SSD(Single Shot multibox Detector,单发多盒检测)算法。进一步地,可以在SSD算法的基础上基于HcNet(高并发卷积神经网络)进行改进,利用ncnn框架(腾讯开源深度学习框架)中对深度可分离卷积结构(Depthwise Separable Convolution)的良好实现,将网络残差中所有3x3卷积都改造成深度可分离卷积结构,并选择多次实验中一个较小的网络系数。如此,使得该神经网络模型更小,耗费时间更少,从而进一步提高识别码的识别效率。
需要说明的是,基于本实施例的方案,最终在ImageNet(图像网络)上预训练的BoxNet(盒子网络)基础网络大小只有3M(兆),其检测结果中排在第一位的检测结果的准确率,即Top-1准确率达到56%,算法效果与AlexNet(亚历克斯网络)相同,而AlexNet的模型大小近200M的,且计算量大十倍以上。
在其中一实施例中,BoxNet的结构示意图如图8所示,将三通道300dpi*300dpi的图像进行卷积,得到4个80通道的38dpi*38dpi的图像;继续进行卷积操作,得到8个160通道的19dpi*19dpi的图像;继续进行卷积操作,得到4个320通道的10dpi*10dpi的图像;继续进行卷积操作得到3个80通道的10dpi*10dpi的图像;继续进行卷积操作,最终得到该图像网络。
再对盒子网络进行进一步量化,比如,若通过设置图片的方式获取待检测图片,则采用第一分辨率,检测待检测图片中的识别码得到检测结果;若通过扫描的方式获取待检测图片,则采用第二分辨率,检测待检测图片中的识别码得到检测结果;第一分辨率大于第二分辨率。最终,基于SSD算法的盒子网络,在量化16位后,模型大小为500K,检测单帧耗时只需15ms。
进一步地,神经网络模型的训练过程中使用的正样本对应的目标码与识别码的交并比大于预设值。
由于不完整的识别码被检测出来并不能解码,识别码的检测相较于普通的目标检测,对完整性的要求更高。因此,在训练过程中,正样本中的识别码需要更严格的保证其完整性;在进行数据增强样本采样时,需要对正样本中最小对象覆盖进行严格限制,采样图像中的目标码需要尽量包含整个识别码。
在本实施例中,通过将训练过程中,正样本对应的目标码与识别码的交并比,设置为大于预设值的方式,提高正样本对应的目标码与识别码的交并比。该交并比可以是正样本中对应的目标码和识别码的交集与并集的比值,即正样本中对应的目标码和识别码的交集,与目标码和识别码的并集的比值。在一种可能的实现方式中,该交集与该并集的比值可以是交集的面积与并集的面积的比值,也可以是交集的像素点的数量与并集的像素点的数量的比值。如此,提 高识别码的完整性在神经网络模型中对应的权值,从而提高识别码的识别效率。
在其中一实施例中,对采样图像进行解码,得到与识别码对应的识别结果,包括:对采样图像进行二值化处理,得到二值化图像;解码二值化图像,得到与识别码对应的识别结果。
二值化处理是将采样图像上的像素点的灰度值设置为两个值中的一个,该两个值可以为0或255,如此得到的二值化图像将呈现出明显的黑白效果。二值化的方式可以包括混合二值化、快速窗口二值化及自适应二值化等方式。由于本申请的目的是进行识别码的识别,而识别码的识别可以仅涉及黑白图像的识别。因此在解码之前进行二值化处理,可以提高在解码时的解码效率,从而提高识别码的识别效率。
在其中一实施例中,首先,通过扫描的方式获取待检测图片。然后通过神经网络模型,检测待检测图片中的识别码得到检测结果,神经网络模型的训练过程中使用的正样本对应的目标码与识别码的交并比大于预设值。最后,根据目标信息对目标码进行采样,得到采样图像;并对采样图像进行解码,得到与识别码对应的识别结果。在一种可能的实现方式中,可基于应用提供的扫描入口进行扫描,获取待检测图片。其中,上述应用包括但不限于社交应用、支付应用等,本申请实施例对此不进行具体限定。
在进一步的详细实施例中,根据目标信息对目标码进行采样,得到采样图像,包括:当目标码满足分辨率条件时,根据目标信息对目标码中每相邻的四个像素点进行双线性插值,得到采样图像。
这两个实施例的效果与相关技术的识别方式的对比图,如图9所示。基于前一实施例的方案,识别码识别时,在降低较小解码成功率的情况下,单帧平均耗时减少了大约150%,因此,其识别效率高于相关技术提供的识别方案。基于后一实施例的方案,在比前一实施例增加较少单帧耗时的情况下,将解码成功率由32%左右提升到36%左右。
在另一实施例中,首先,通过设置图片的方式获取待检测图片。然后通过神经网络模型,检测待检测图片中的识别码得到检测结果,神经网络模型的训练过程中使用的正样本对应的目标码与识别码的交并比大于预设值。最后,根据目标信息对目标码进行采样,得到采样图像;并对采样图像进行解码,得到与识别码对应的识别结果。在一种可能的实现方式中,设置图片的方式可为对图片的长按操作,即用户的长按图片操作可能会触发计算机设备获取待检测图片,本申请实施例对此不进行具体限定。
在进一步的实施例中,根据目标信息对目标码进行采样,得到采样图像,包括:当目标码满足分辨率条件时,根据目标信息、基于图像超分辨率重建技术对目标码进行上采样,得到采样图像。
这两个实施例的效果与相关技术的识别方式的对比图,如图10所示。基于前一实施例的方案,识别码识别时,在降低较小解码成功率的情况下,单帧平均耗时减少了大约150%,因此,其识别效率高于相关技术提供的识别方案。基于后一实施例的方案,在比前一实施例增加较少单帧耗时的情况下,将解码成功率由70%左右提升到90%左右。
在其中一实施例中,如图11所示,在获取待检测图片之后,检测待检测图片中的识别码得到检测结果,检测结果包括与识别码对应的目标码的目标信息及识别码类型;该识别码类型包括二维码、一维码及小程序码。当目标码满足分辨率条件时,根据目标信息对目标码进行上采样,得到采样图像。然后,对采样图像进行二值化处理,得到二值化图像;该二值化处理包括混合二值化、快速窗口二值化及自适应二值化。最后,通过与识别码类型对应的解码器对二值化图像进行解码。
由于在采样之前,检测识别码,得到包括目标信息及识别码类型的检测结果,因此在采样、二值化的过程中,无需对整张待检测图片进行处理,同时,解码时只需要采用与识别码类型对应的解码器进行解码,因此,可以提高识别码的识别效率。
应该理解的是,虽然图4的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图4中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图12所示,提供了一种运行于图3中的计算机设备304的识别码识别装置,包括:
图片获取模块202,用于获取待检测图片;
目标检测模块204,用于检测所述待检测图片中的识别码得到检测结果,所述检测结果包括与所述识别码对应的目标码的目标信息;
采样模块206,用于根据所述目标信息对所述目标码进行采样,得到采样图像;
解码模块208,用于对所述采样图像进行解码,得到与所述识别码对应的识别结果。
上述识别码识别装置,在获取到待检测图片后,首先检测所述待检测图片中的识别码得到检测结果,所述检测结果包括与所述识别码对应的目标码的目标信息;之后,根据所述目标信息对所述目标码进行采样,得到采样图像;最后,对所述采样图像进行解码,得到与所述识别码对应的识别结果。由于在获取到待检测图片后,并不是直接对整张待检测图片进行采样、解码等操作,而是先对整张图片进行检测,得到针对识别码的检测结果,该检测结果包括与识别码对应的目标码的目标信息。然后,再针对该目标码进行采样、解码等操作。如此,可以降低待检测图片中非识别码区域的干扰,提高识别码的识别效率。
在其中一实施例中,所述采样模块,用于当所述目标码满足分辨率条件时, 根据所述目标信息对所述目标码进行上采样,得到采样图像。
在其中一实施例中,所述采样模块,用于若通过设置图片的方式获取待检测图片,则当所述目标码满足分辨率条件时,根据所述目标信息对所述目标码进行上采样,得到采样图像。
在其中一实施例中,所述采样模块,用于当所述目标码的分辨率小于预设值时,根据所述目标信息对所述目标码进行上采样,得到采样图像。
在其中一实施例中,所述采样模块,用于根据所述目标信息对所述目标码中每相邻的四个像素点进行双线性插值,得到采样图像;
在其中一实施例中,所述采样模块,用于根据所述目标信息、基于图像超分辨率重建技术对所述目标码进行上采样,得到采样图像。
进一步地,通过神经网络模型,基于图像超分辨率重建技术对所述目标码进行上采样,得到采样图像;所述神经网络模型的隐藏层中、与所述目标码的边缘区域对应的权重大于预设值。
在其中一实施例中,该装置还包括过滤模块,所述过滤模块,用于在训练所述神经网络模型之前,对训练样本中的目标码的标签区域进行过滤。
在其中一实施例中,所述图片获取模块,用于通过设置图片的方式获取待检测图片。
在其中一实施例中,所述图片获取模块,用于通过扫描的方式获取待检测图片。
在其中一实施例中,所述图片获取模块,用于通过设置图片的方式获取待检测图片;所述目标检测模块,用于采用第一分辨率,检测所述待检测图片中的识别码得到检测结果。
在其中一实施例中,所述图片获取模块,用于通过扫描的方式获取待检测图片;所述目标检测模块,用于采用第二分辨率,检测所述待检测图片中的识别码得到检测结果。
其中,所述第一分辨率大于所述第二分辨率。
在其中一实施例中,所述检测结果还包括识别码类型;
所述解码模块,用于根据所述识别码类型对所述采样图像进行解码,得到与所述识别码对应的识别结果。
在其中一实施例中,所述装置还包括二值化模块;
所述二值化模块,用于对所述采样图像进行二值化处理,得到二值化图像;
所述解码模块,用于解码所述二值化图像,得到与所述识别码对应的识别结果。
在其中一实施例中,所述目标检测模块,用于通过神经网络模型,检测所述待检测图片中的识别码得到检测结果;所述神经网络模型的训练过程中使用的正样本对应的目标码与识别码的交并比大于预设值。
在一个实施例中,提供了一种计算机设备,该计算机设备可以为服务器,其内部结构图可以如图13所示。该计算机设备包括通过系统总线连接的处理器、存储器和网络接口。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种识别码识别方法。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图14所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种识别码识别方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或 鼠标等。
本领域技术人员可以理解,图13、14中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现上述识别码识别方法的步骤。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述识别码识别方法的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特 征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (15)

  1. 一种识别码识别方法,所述方法运行于计算机设备,所述方法包括:
    所述计算机设备获取待检测图片;
    所述计算机设备检测所述待检测图片中的识别码得到检测结果,所述检测结果包括与所述识别码对应的目标码的目标信息;
    所述计算机设备根据所述目标信息对所述目标码进行采样,得到采样图像;
    所述计算机设备对所述采样图像进行解码,得到与所述识别码对应的识别结果。
  2. 根据权利要求1所述的方法,其特征在于,所述计算机设备根据所述目标信息对所述目标码进行采样,得到采样图像,包括:当所述目标码满足分辨率条件时,所述计算机设备根据所述目标信息对所述目标码进行上采样,得到所述采样图像。
  3. 根据权利要求1所述的方法,其特征在于,所述计算机设备根据所述目标信息对所述目标码进行采样,得到采样图像,包括:若通过设置图片的方式获取待检测图片,则当所述目标码满足所述分辨率条件时,所述计算机设备根据所述目标信息对所述目标码进行上采样,得到所述采样图像。
  4. 根据权利要求2所述的方法,其特征在于,所述当所述目标码满足分辨率条件时,所述计算机设备根据所述目标信息对所述目标码进行上采样,得到所述采样图像,包括:当所述目标码的分辨率小于预设值时,所述计算机设备根据所述目标信息对所述目标码进行上采样,得到所述采样图像。
  5. 根据权利要求2所述的方法,其特征在于,所述计算机设备根据所述目标信息对所述目标码进行上采样,得到所述采样图像,包括以下两项中的任意 一项:
    所述计算机设备根据所述目标信息对所述目标码中每相邻的四个像素点进行双线性插值,得到所述采样图像;
    所述计算机设备基于图像超分辨率重建技术对所述目标码进行上采样,得到所述采样图像。
  6. 根据权利要求5所述的方法,其特征在于,所述计算机设备基于图像超分辨率重建技术对所述目标码进行上采样,得到所述采样图像,包括:
    所述计算机设备通过神经网络模型,基于所述图像超分辨率重建技术对所述目标码进行上采样,得到所述采样图像;所述神经网络模型的隐藏层中、与所述目标码的边缘区域对应的权重大于预设值。
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:
    在训练所述神经网络模型之前,所述计算机设备对训练样本中的目标码的标签区域进行过滤。
  8. 根据权利要求1所述的方法,其特征在于,所述计算机设备获取待检测图片,包括以下两种方式中的任意一种:
    所述计算机设备通过设置图片的方式获取待检测图片;
    所述计算机设备通过扫描的方式获取待检测图片。
  9. 根据权利要求8所述的方法,其特征在于,所述计算机设备检测所述待检测图片中的识别码得到检测结果,包括:
    若通过设置图片的方式获取待检测图片,则所述计算机设备采用第一分辨率,检测所述待检测图片中的识别码得到检测结果;
    若通过扫描的方式获取待检测图片,则所述计算机设备采用第二分辨率,检测所述待检测图片中的识别码得到检测结果;所述第一分辨率大于所述第二 分辨率。
  10. 根据权利要求1所述的方法,其特征在于,所述检测结果还包括识别码类型;
    所述计算机设备对所述采样图像进行解码,得到与所述识别码对应的识别结果,包括:所述计算机设备根据所述识别码类型对所述采样图像进行解码,得到与所述识别码对应的识别结果。
  11. 根据权利要求1所述的方法,其特征在于,所述计算机设备对所述采样图像进行解码,得到与所述识别码对应的识别结果,包括:
    所述计算机设备对所述采样图像进行二值化处理,得到二值化图像;
    所述计算机设备解码所述二值化图像,得到与所述识别码对应的识别结果。
  12. 根据权利要求1所述的方法,其特征在于,所述计算机设备检测所述待检测图片中的识别码得到检测结果,包括:
    所述计算机设备通过神经网络模型,检测所述待检测图片中的识别码得到检测结果;所述神经网络模型的训练过程中使用的正样本对应的目标码与识别码的交并比大于预设值。
  13. 一种识别码识别装置,所述装置运行于计算机设备,所述装置包括:
    图片获取模块,用于获取待检测图片;
    目标检测模块,用于检测所述待检测图片中的识别码得到检测结果,所述检测结果包括与所述识别码对应的目标码的目标信息;
    采样模块,用于根据所述目标信息对所述目标码进行采样,得到采样图像;
    解码模块,用于对所述采样图像进行解码,得到与所述识别码对应的识别结果。
  14. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至12中任一项所述方法的步骤。
  15. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至12中任一项所述的方法的步骤。
PCT/CN2019/098862 2018-08-16 2019-08-01 识别码识别方法、装置、计算机设备和存储介质 WO2020034850A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2020551561A JP7164127B2 (ja) 2018-08-16 2019-08-01 識別コードの識別方法並びに、その装置、コンピュータ機器及びコンピュータプログラム
EP19849577.2A EP3764282A4 (en) 2018-08-16 2019-08-01 IDENTIFICATION PROCESS FOR IDENTIFICATION CODE, DEVICE, COMPUTER DEVICE AND INFORMATION MEDIA
US17/003,507 US11494577B2 (en) 2018-08-16 2020-08-26 Method, apparatus, and storage medium for identifying identification code

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810934332.5A CN109325491B (zh) 2018-08-16 2018-08-16 识别码识别方法、装置、计算机设备和存储介质
CN201810934332.5 2018-08-16

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/003,507 Continuation US11494577B2 (en) 2018-08-16 2020-08-26 Method, apparatus, and storage medium for identifying identification code

Publications (1)

Publication Number Publication Date
WO2020034850A1 true WO2020034850A1 (zh) 2020-02-20

Family

ID=65264104

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/098862 WO2020034850A1 (zh) 2018-08-16 2019-08-01 识别码识别方法、装置、计算机设备和存储介质

Country Status (5)

Country Link
US (1) US11494577B2 (zh)
EP (1) EP3764282A4 (zh)
JP (1) JP7164127B2 (zh)
CN (1) CN109325491B (zh)
WO (1) WO2020034850A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113160170A (zh) * 2021-04-19 2021-07-23 国网山东省电力公司威海供电公司 电力巡检销钉级故障识别检测方法、系统、介质及设备
CN113608793A (zh) * 2021-08-10 2021-11-05 深圳豪杰创新电子有限公司 Bios参数修改方法、装置、工具和可读存储介质
JP2022070512A (ja) * 2020-10-27 2022-05-13 株式会社コジマプラスチックス 作業管理システム及び教師データの生成方法
WO2023011155A1 (zh) * 2021-08-02 2023-02-09 深圳思谋信息科技有限公司 条码识别方法、装置、计算机设备和存储介质

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109325491B (zh) 2018-08-16 2023-01-03 腾讯科技(深圳)有限公司 识别码识别方法、装置、计算机设备和存储介质
CN110147864B (zh) * 2018-11-14 2022-02-22 腾讯科技(深圳)有限公司 编码图案的处理方法和装置、存储介质、电子装置
CN110070092A (zh) * 2019-03-15 2019-07-30 平安科技(深圳)有限公司 车型识别方法、装置、计算机设备及存储介质
CN110188605B (zh) * 2019-04-18 2021-07-06 浙江大华技术股份有限公司 目标物体识别方法、装置、系统、计算机设备和存储介质
CN110493600B (zh) * 2019-08-23 2023-07-04 腾讯科技(深圳)有限公司 图像编码方法、装置、计算机设备及存储介质
CN110991201B (zh) * 2019-11-25 2023-04-18 浙江大华技术股份有限公司 条码检测方法及相关装置
CN111476050B (zh) * 2020-04-02 2023-10-10 北京致胜宏达科技有限公司 一种条码识别方法、装置、电子设备及存储介质
CN117372011A (zh) * 2020-06-15 2024-01-09 支付宝(杭州)信息技术有限公司 交通卡的计次方法、装置、扫码设备和计次卡服务器
CN111767754B (zh) * 2020-06-30 2024-05-07 创新奇智(北京)科技有限公司 一种识别码的识别方法、装置、电子设备及存储介质
CN112069853A (zh) * 2020-09-16 2020-12-11 福州大学 基于深度学习的二维条码图像超分辨方法
GB2614688A (en) * 2020-09-30 2023-07-12 Snap Inc Location-guided scanning of visual codes
CN113378598B (zh) * 2021-06-21 2023-04-25 北方工业大学 一种基于深度学习的动态条码检测方法
CN113486898A (zh) * 2021-07-08 2021-10-08 西安电子科技大学 一种基于改进ShuffleNet的雷达信号RD图像干扰辨识方法及系统
CN113468906B (zh) * 2021-07-12 2024-03-26 深圳思谋信息科技有限公司 图形码提取模型构建方法、识别方法、装置、设备和介质
CN113780492A (zh) * 2021-08-02 2021-12-10 南京旭锐软件科技有限公司 一种二维码二值化方法、装置、设备及可读存储介质
CN113658164A (zh) * 2021-08-24 2021-11-16 凌云光技术股份有限公司 一种二维码信息提取准确性的评估方法及装置
CN113709006B (zh) * 2021-10-29 2022-02-08 上海闪马智能科技有限公司 一种流量确定方法、装置、存储介质及电子装置
CN114419306A (zh) * 2021-11-23 2022-04-29 西南交通大学 基于改进型ssd的小目标物体高精度检测方法、系统及装置
EP4290403A1 (de) 2022-06-07 2023-12-13 Sick Ag Lesen eines eindimensionalen optischen codes
CN117438056B (zh) * 2023-12-20 2024-03-12 达州市中心医院(达州市人民医院) 用于消化内镜影像数据的编辑筛选与存储控制方法和系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120273563A1 (en) * 2011-04-27 2012-11-01 Kyocera Document Solutions, Inc. Image Processing Apparatus
CN103530590A (zh) * 2013-10-19 2014-01-22 高韬 Dpm二维码识别系统
CN105046186A (zh) * 2015-08-27 2015-11-11 北京恒华伟业科技股份有限公司 一种二维码的识别方法及装置
CN107609525A (zh) * 2017-09-19 2018-01-19 吉林大学 基于剪枝策略构建卷积神经网络的遥感图像目标检测方法
CN109325491A (zh) * 2018-08-16 2019-02-12 腾讯科技(深圳)有限公司 识别码识别方法、装置、计算机设备和存储介质

Family Cites Families (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003337941A (ja) * 2002-05-20 2003-11-28 Matsushita Electric Ind Co Ltd 画像認識装置と画像認識方法とプログラム
JP2008027157A (ja) * 2006-07-20 2008-02-07 Nippon Telegr & Teleph Corp <Ntt> 2次元コードの処理装置、2次元コードの処理方法およびこの方法のプログラム
JP2009272982A (ja) * 2008-05-09 2009-11-19 Konica Minolta Business Technologies Inc ファクシミリ装置
US8881984B2 (en) * 2009-12-31 2014-11-11 Samsung Electrônica da Amazônia Ltda. System and automatic method for capture, reading and decoding barcode images for portable devices having digital cameras
JP5482327B2 (ja) 2010-03-12 2014-05-07 富士通株式会社 撮像装置、撮像方法および撮像プログラム
US8905314B2 (en) * 2010-09-30 2014-12-09 Apple Inc. Barcode recognition using data-driven classifier
US9152834B2 (en) * 2012-08-09 2015-10-06 Symbol Technologies, Llc Image capture based on scanning resolution setting compared to determined scanning resolution relative to target distance in barcode reading
CN104781834B (zh) * 2012-11-13 2018-01-19 共同印刷株式会社 二维码、二维码的生成系统以及分析程序
CN104573601A (zh) * 2013-10-28 2015-04-29 江苏联海通信技术有限公司 一种复杂环境下器件dpm二维码识别系统
CN104751093B (zh) * 2013-12-31 2018-12-04 阿里巴巴集团控股有限公司 用于获取宿主设备显示的图像识别码的方法和装置
JP6262610B2 (ja) * 2014-07-04 2018-01-17 Kddi株式会社 情報登録装置及び情報継続登録装置並びに方法及びプログラム
CN104751097B (zh) 2015-03-30 2018-05-11 深圳市道通科技股份有限公司 一种车辆识别码的检测处理方法及装置
KR101871379B1 (ko) * 2016-08-25 2018-06-26 서울과학기술대학교 산학협력단 바코드 인식 장치
CN106548110A (zh) * 2016-10-25 2017-03-29 广东欧珀移动通信有限公司 图片处理方法及装置
CN106610835A (zh) * 2016-12-23 2017-05-03 广东欧珀移动通信有限公司 识别码处理方法、装置和计算机设备
CN107067006B (zh) * 2017-04-20 2022-03-18 金电联行(北京)信息技术有限公司 一种服务于数据采集的验证码识别方法及系统
CN107194318B (zh) * 2017-04-24 2020-06-12 北京航空航天大学 目标检测辅助的场景识别方法
CN107155110A (zh) * 2017-06-14 2017-09-12 福建帝视信息科技有限公司 一种基于超分辨率技术的图片压缩方法
CN107491709A (zh) * 2017-08-29 2017-12-19 努比亚技术有限公司 一种码图识别方法、终端和计算机可读存储介质
CN109711508B (zh) * 2017-10-25 2020-06-05 北京京东尚科信息技术有限公司 图像处理方法和装置
CN107944325B (zh) * 2017-11-23 2020-01-03 维沃移动通信有限公司 一种扫码方法、扫码装置及移动终端
US20190188729A1 (en) * 2017-12-18 2019-06-20 Beijing Jingdong Shangke Information Technology Co., Ltd. System and method for detecting counterfeit product based on deep learning
CN108366253B (zh) * 2018-01-11 2020-01-31 福建联迪商用设备有限公司 摄像头功能的测试方法及智能模块
CN108268641B (zh) * 2018-01-18 2020-11-13 大象慧云信息技术有限公司 发票信息识别方法及发票信息识别装置、设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120273563A1 (en) * 2011-04-27 2012-11-01 Kyocera Document Solutions, Inc. Image Processing Apparatus
CN103530590A (zh) * 2013-10-19 2014-01-22 高韬 Dpm二维码识别系统
CN105046186A (zh) * 2015-08-27 2015-11-11 北京恒华伟业科技股份有限公司 一种二维码的识别方法及装置
CN107609525A (zh) * 2017-09-19 2018-01-19 吉林大学 基于剪枝策略构建卷积神经网络的遥感图像目标检测方法
CN109325491A (zh) * 2018-08-16 2019-02-12 腾讯科技(深圳)有限公司 识别码识别方法、装置、计算机设备和存储介质

Non-Patent Citations (1)

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

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022070512A (ja) * 2020-10-27 2022-05-13 株式会社コジマプラスチックス 作業管理システム及び教師データの生成方法
JP7217996B2 (ja) 2020-10-27 2023-02-06 株式会社コジマプラスチックス 作業管理システム及び教師データの生成方法
CN113160170A (zh) * 2021-04-19 2021-07-23 国网山东省电力公司威海供电公司 电力巡检销钉级故障识别检测方法、系统、介质及设备
WO2023011155A1 (zh) * 2021-08-02 2023-02-09 深圳思谋信息科技有限公司 条码识别方法、装置、计算机设备和存储介质
CN113608793A (zh) * 2021-08-10 2021-11-05 深圳豪杰创新电子有限公司 Bios参数修改方法、装置、工具和可读存储介质

Also Published As

Publication number Publication date
US20200394376A1 (en) 2020-12-17
CN109325491A (zh) 2019-02-12
CN109325491B (zh) 2023-01-03
JP2021516827A (ja) 2021-07-08
EP3764282A4 (en) 2021-05-26
US11494577B2 (en) 2022-11-08
EP3764282A1 (en) 2021-01-13
JP7164127B2 (ja) 2022-11-01

Similar Documents

Publication Publication Date Title
WO2020034850A1 (zh) 识别码识别方法、装置、计算机设备和存储介质
US10504202B2 (en) Method and device for identifying whether standard picture contains watermark
JP6255486B2 (ja) 情報認識のための方法及びシステム
CN109146788B (zh) 基于深度学习的超分辨率图像重建方法和装置
US10867171B1 (en) Systems and methods for machine learning based content extraction from document images
Choi et al. Deep learning-based image super-resolution considering quantitative and perceptual quality
CN110427946B (zh) 一种文档图像二值化方法、装置和计算设备
Chu et al. Stabilization and extraction of 2D barcodes for camera phones
US11704925B2 (en) Systems and methods for digitized document image data spillage recovery
CN111968064A (zh) 一种图像处理方法、装置、电子设备及存储介质
US9208551B2 (en) Method and system for providing efficient feedback regarding captured optical image quality
CN112085094B (zh) 单证图像翻拍检测方法、装置、计算机设备和存储介质
CN111914654A (zh) 一种文本版面分析方法、装置、设备和介质
Walha et al. Resolution enhancement of textual images: a survey of single image‐based methods
das Neves et al. A fast fully octave convolutional neural network for document image segmentation
CN115240203A (zh) 业务数据处理方法、装置、设备及存储介质
CN111709338B (zh) 一种用于表格检测的方法、装置及检测模型的训练方法
Nasrollahi et al. Deep artifact-free residual network for single-image super-resolution
Anvari et al. A survey on deep learning based document image enhancement
Walha et al. Handling noise in textual image resolution enhancement using online and offline learned dictionaries
WO2023150509A1 (en) Computer-based systems and/or computing devices configured for automated detection and/or reading of optical codes in images of varying quality
Pal et al. Super-resolution of textual images using autoencoders for text identification
Singh et al. Efficient binarization technique for severely degraded document images
Junior et al. A fast fully octave convolutional neural network for document image segmentation
CN115880516A (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: 19849577

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020551561

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 19849577.2

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2019849577

Country of ref document: EP

Effective date: 20201008

NENP Non-entry into the national phase

Ref country code: DE