CN116976372A - Picture identification method, device, equipment and medium based on square reference code - Google Patents

Picture identification method, device, equipment and medium based on square reference code Download PDF

Info

Publication number
CN116976372A
CN116976372A CN202310660168.4A CN202310660168A CN116976372A CN 116976372 A CN116976372 A CN 116976372A CN 202310660168 A CN202310660168 A CN 202310660168A CN 116976372 A CN116976372 A CN 116976372A
Authority
CN
China
Prior art keywords
reference code
square
picture
image
module
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202310660168.4A
Other languages
Chinese (zh)
Inventor
陈文钊
边旭
冉东来
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Youibot Robotics Technology Co ltd
Original Assignee
Shenzhen Youibot Robotics Technology Co ltd
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 Shenzhen Youibot Robotics Technology Co ltd filed Critical Shenzhen Youibot Robotics Technology Co ltd
Priority to CN202310660168.4A priority Critical patent/CN116976372A/en
Publication of CN116976372A publication Critical patent/CN116976372A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1439Methods for optical code recognition including a method step for retrieval of the optical code
    • G06K7/1452Methods for optical code recognition including a method step for retrieval of the optical code detecting bar code edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/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/146Methods for optical code recognition the method including quality enhancement steps
    • 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

Landscapes

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

Abstract

The embodiment of the application provides a picture identification method, device, equipment and medium based on square reference codes. And the perspective transformation module is used for performing perspective transformation on the square reference code to obtain a regular reference code, so that the decoding module can accurately identify and decode the square reference code, and the identification accuracy of the square reference code is improved. And arranging and integrating the reference code information of the square reference code through an integration module to obtain the picture information of the original picture. Therefore, unified image processing operation can be realized on the square reference codes in the picture, repeated operation on a plurality of square reference codes of different types in the same picture is avoided, and the information identification efficiency of the square reference codes in the picture is improved.

Description

Picture identification method, device, equipment and medium based on square reference code
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a medium for identifying a picture based on a square reference code.
Background
The square reference code is a graph which is distributed on a plane (in two dimensions) according to a certain rule by a certain specific geometric figure, is black-white and records data symbol information.
The square reference codes commonly used at present have schemes such as Quick Response (QR) codes, data Matrix (DM) codes, arUco, aprilTag and the like. However, the recognition schemes of different codes are different, and in the same scene, if the codes exist at the same time, the codes are recognized at the same time or integrated into a new code, which is a challenging task.
The traditional reference code identification method needs to input the same photo into different identification libraries for identification, for example, a QR code, a ZBar library, a DM code, a ZXing library, an ArUco, an AprilTag and other codes, and an ArUco library.
However, the identification processes of these libraries have some common operations, such as threshold segmentation, contour extraction, and the like. These common operations, if re-executed separately once when each code is identified, are very time-consuming, which results in problems such as low identification rate, high consumption of platform computing resources, and the like, so that the information identification efficiency of square reference codes in pictures is low.
Therefore, how to solve the problem that the recognition efficiency of the square reference code in the current picture is low is a technical problem to be solved.
Disclosure of Invention
The embodiment of the application provides a picture identification method, device and equipment based on square reference codes and a storage medium, aiming at improving the identification efficiency of the square reference codes in pictures.
In a first aspect, an embodiment of the present application provides a method for identifying a picture based on a square reference code, where the method includes:
acquiring an original picture, and extracting a reference code contour of the original picture based on a preprocessing module to obtain a first reference code set;
based on a contour filtering module, identifying square reference codes in the first reference code set to obtain a second reference code set;
performing perspective transformation on the square reference codes in the second reference code set based on a perspective transformation module to obtain a third reference code set, wherein the third reference code set comprises regular reference codes corresponding to the square reference codes;
based on a decoding module, identifying and decoding regular reference codes corresponding to the square reference codes to obtain reference code information of the square reference codes;
and based on an integration module, arranging and integrating the reference code information of the square reference code to obtain the picture information of the original picture.
In a second aspect, the present application further provides a picture identifying apparatus based on a square reference code, where the picture identifying apparatus based on the square reference code includes:
the image processing module is used for acquiring an original picture, and extracting a reference code contour of the original picture based on the preprocessing module to obtain a first reference code set;
the square reference code identification module is used for identifying square reference codes in the first reference code set based on the contour filtering module to obtain a second reference code set;
the image transformation module is used for performing perspective transformation on the square reference codes in the second reference code set based on the perspective transformation module to obtain a third reference code set, wherein the third reference code set comprises regular reference codes corresponding to the square reference codes;
the reference code decoding module is used for identifying and decoding the regular reference code corresponding to the square reference code based on the decoding module to obtain the reference code information of the square reference code;
and the reference code integration module is used for arranging and integrating the reference code information of the square reference code based on the integration module to obtain the picture information of the original picture.
In a third aspect, the present application also provides a computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program when executed by the processor implements the steps of the square reference code based picture recognition method as described above.
In a fourth aspect, the present application also provides a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the square reference code based picture recognition method as described above.
The embodiment of the application provides a picture identification method, a device, equipment and a storage medium based on square reference codes, wherein the method comprises the steps of obtaining an original picture, and extracting the reference code contour of the original picture based on a preprocessing module to obtain a first reference code set; based on a contour filtering module, identifying square reference codes in the first reference code set to obtain a second reference code set; performing perspective transformation on the square reference codes in the second reference code set based on a perspective transformation module to obtain a third reference code set, wherein the third reference code set comprises regular reference codes corresponding to the square reference codes; based on a decoding module, identifying and decoding regular reference codes corresponding to the square reference codes to obtain reference code information of the square reference codes; and based on an integration module, arranging and integrating the reference code information of the square reference code to obtain the picture information of the original picture. Through the mode, the reference code in the original picture is subjected to contour extraction through the preprocessing module, the data volume of picture processing can be reduced, the contour filtering module is convenient to identify square contours in the reference code, the square reference code in the original picture is extracted, interference of a picture area of the non-square reference code is avoided, the square reference code is convenient to quickly identify, and the identification rate of the square reference code is improved. And the perspective transformation module is used for performing perspective transformation on the square reference code to obtain a regular reference code, so that the decoding module can accurately identify and decode the square reference code, and the identification accuracy of the square reference code is improved. Through the integration module, the reference code information of the square reference code is arranged and integrated, so that information confusion of the square reference code is avoided, the picture information of the original picture is more accurately identified, and the information identification precision of the square reference code of the picture is improved. Therefore, unified image processing operation can be realized on the square reference codes in the picture, repeated operation on a plurality of square reference codes of different types in the same picture is avoided, and the information identification efficiency of the square reference codes in the picture is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a first embodiment of a picture identification method based on square reference codes according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a picture identification frame based on a square reference code according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a square frame structure of a square reference code according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a second embodiment of a picture identifying method based on square reference codes according to an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating the effect of perspective transformation of a picture according to an embodiment of the present application;
fig. 6 is a schematic flow chart of a third embodiment of a picture identifying method based on square reference codes according to an embodiment of the present application;
fig. 7 is a schematic flow chart of a fourth embodiment of a picture identifying method based on square reference codes according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a first embodiment of a picture identifying apparatus based on square reference codes according to an embodiment of the present application;
fig. 9 is a schematic block diagram of a computer device according to an embodiment of the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flowchart of a first embodiment of a picture identifying method based on square reference codes according to an embodiment of the present application.
As shown in fig. 1, the picture recognition method based on the square reference code includes steps S101 to S105.
Step S101, acquiring an original picture, and extracting a reference code contour of the original picture based on a preprocessing module to obtain a first reference code set;
in one embodiment, an original image containing at least one reference code is input into a preprocessing module, and a reference code contour in the original image is extracted through an image processing algorithm in the preprocessing module to obtain at least one reference code contour, so that a first reference code set is generated.
In one embodiment, the image processing algorithm may include an image graying algorithm, a downsampling algorithm, an image binarizing algorithm, a contour extraction algorithm, and the like.
In one embodiment, as shown in fig. 2, based on the preprocessing module, the original image is subjected to graying processing to obtain a gray scale image; performing downsampling and binarization processing on the gray level map based on a first image processing algorithm to obtain a binary image; and extracting the contour of the reference code in the binary image based on a second image processing algorithm to obtain the first reference code set.
In one embodiment, the graying and binarizing of the image are both pre-processing steps of the image. Image graying refers to an image with only one sampling color per pixel, the gray image has a plurality of levels of color depth (0-255) between black and white, and image binarization refers to a black-and-white image with only two colors (0 or 255) in the field of computer images.
In one embodiment, the conversion from a color image to a grayscale image is referred to as image graying. The image graying method mainly comprises a component method, a maximum value method, an average value method, a weighted average value method and the like. The average method is to average the three-component brightness in the color image to obtain a gray scale. The maximum value method is to use the maximum value of the three-component luminance in a color image as the gradation value of the gradation map. The component method is that the value of each component of RGB is taken as the gray value of the image, thus three gray images of the original image are obtained, and then one gray image of the three gray images is selected, namely, one component of the three components of RGB is taken as the gray value of the point. The weighted average method means that the algorithm mainly performs weighted average on three components with different weights according to a certain condition.
In an embodiment, the first image processing algorithm may be a downsampling algorithm and an image binarization algorithm.
In an embodiment, the image downsampling is to reduce the original image, generate a thumbnail of the corresponding image, make the image conform to the corresponding display area, reduce the dimension of the features and retain the effective information, avoid over fitting to a certain extent, and keep rotation, translation and expansion from deforming.
In one embodiment, the principle of image downsampling is to change a window of sxs located on the original image into a pixel. If the artwork resolution is x y, then the artwork size after downsampling is (x/s) (y/s), which means that s is preferably a common divisor of x and y.
In one embodiment, binarization is one of the simplest methods of image segmentation. Binarization may convert a gray scale image into a binary image. The pixel gradation larger than a certain critical gradation value is set as a gradation maximum value, and the pixel gradation smaller than this value is set as a gradation minimum value, thereby realizing binarization. Binary images refer to the fact that there are only two possible values or gray scale states for each pixel on the image. That is, the gray value of any pixel point in the image is 0 or 255, which represents black and white, respectively.
It will be appreciated that image binarization is the process of setting the gray value of a pixel point on an image to 0 or 255, i.e., rendering the entire image to exhibit a significant black and white effect. In digital image processing, binary images are very important, and binarization of images greatly reduces the amount of data in images, so that the contours of objects can be highlighted.
In an embodiment, the image processing algorithm further comprises an image contour extraction algorithm.
It will be appreciated that the edges of the target object are useful for image recognition and computer analysis. The edge can delineate the target object, so that the observer can see the target object at a glance; edges contain rich intrinsic information (such as directions, shapes and the like) and are important attributes for extracting image features in image recognition. The purpose of contour extraction is to obtain the external contour features of the image.
For example, the contour extraction algorithm may be a hollowed-out interior point method, and if one point in the original is black and all 8 adjacent points thereof are black, the point is deleted. The principle is as follows: when contour extraction is carried out, a one-dimensional array is used for recording information of the surrounding 8 neighborhood of the processed pixel point; if the gray values of the 8 neighborhood pixel points are the same as the gray values of the center point, the point is considered to be in the object and can be deleted; otherwise, the point is considered to be at the edge of the image and needs to be reserved; each pixel in the image is processed in turn, leaving the outline of the image.
It can be understood that there are many algorithms for extracting the contours of the binary images, the present application is not limited in particular, and other algorithms for extracting the contours of the binary images should be within the scope of the embodiments of the present application.
In an embodiment, when the reference code contour is square and the corners are less than four, adding a back-shaped contour outside the reference code contour to obtain the square reference code corresponding to the reference code contour.
In an embodiment, as shown in fig. 3, when the outline of the reference code is square, but the corner points of the square outline are missing or need to be calculated according to other adjacent points, such as QR codes, DM codes, and the like, a "back" font pattern is added on the periphery of the square outline of the reference code to surround the outline, so that the four corner points of the square outline of the reference code are more definite, and the subsequent filtering and recognition of the square reference code are facilitated.
In an embodiment, after the gray-scale image is subjected to downsampling and binarization processing based on a first image processing algorithm, the gray-scale image is subjected to downsampling processing at least once based on the downsampling algorithm, so as to obtain an image pyramid of the downsampled image.
It will be appreciated that an image pyramid is a series of images, the lowest one being the largest in image size and the highest one being the smallest in image size, resembling the shape of a pyramid from top to bottom in space.
In one embodiment, the pyramid transformation of an image is understood to be a transformation of the size of the image, which is performed under the condition that the characteristics of the image are unchanged, and the image is transformed, wherein the transformation of the size of the image is most commonly the zooming in and out in the image processing, and the transformation from top to bottom is the zooming in, the resolution is increased, the transformation from bottom to top is the zooming out, and the resolution is reduced.
In an embodiment, the image pyramid and binarization may be implemented in two threads, which may be performed simultaneously, or the image pyramid may be generated after binarization and contour extraction.
Step S102, based on a contour filtering module, identifying square reference codes in the first reference code set to obtain a second reference code set;
in an embodiment, the contour filtering module inputs the contour of the reference code in the first reference code set, and outputs a contour area (an area can be understood as an image area surrounded by the contour) of a square reference code, such as a QR code, a DM code, an ArUco, an april tag, and the like.
In an embodiment, as shown in fig. 2, the contour filtering module may search for a reference code having a concentric contour area in the first reference code set by using the return character shape as a filtering basis of the square reference code, and when the concentric contour area is the return character shape area, perform polygon fitting on the return character shape area to determine whether the return character shape area is a quadrangle, and reject the contour which is not the quadrangle or does not have the return character shape area, so as to screen out the square reference code contour in the first reference code set.
In an embodiment, the contour filtering module may include a pre-filtering sub-module, which is used to reject codes near the edge of the image, or reject codes with an area smaller than a certain threshold value, and so on.
Step S103, performing perspective transformation on the square reference codes in the second reference code set based on a perspective transformation module to obtain a third reference code set, wherein the third reference code set comprises regular reference codes corresponding to the square reference codes;
in an embodiment, the square reference codes in the second reference code set are subjected to perspective transformation through a perspective transformation algorithm, so that the regular images corresponding to the square reference codes are obtained, the deformation of the original picture is eliminated to the minimum, and the accuracy of identifying the picture information of the reference codes is improved.
In an embodiment, a downsampled image of the image pyramid meeting the decoding requirement can be extracted as a target image of perspective transformation and decoding, so that the identification of image information can be realized, and the processing amount of image data can be reduced, so that the efficiency of image identification is improved.
In one embodiment, as shown in fig. 4, the step S103 includes:
step 201, obtaining the outline size of a square reference code of each downsampled image in the image pyramid;
step S202, determining a target downsampled image based on a preset threshold value and the outline size of a square reference code of each downsampled image;
and step 203, performing perspective transformation on the square reference code in the target downsampled image based on the perspective transformation module to obtain the third reference code set.
In one embodiment, the minimum size requirement of the decoding module for square reference code images may be set to a preset threshold.
In an embodiment, the outline size of a square reference code in each downsampled image in the image pyramid is obtained, a downsampled image with the smallest image size is selected from downsampled images with outline sizes of the square reference codes meeting a preset threshold value to be used as a target downsampled image for perspective transformation operation, and perspective transformation is performed on the square reference codes to obtain regular images corresponding to the square reference codes, so that a third reference code set is formed.
In one embodiment, as shown in FIG. 5, the perspective transformation maps the current image to another plane by way of projection. The perspective transformation is used for correcting the distorted image, the coordinates of a group of 4 points of the distorted image and the coordinates of a group of 4 points of the target image are required to be obtained, the transformation matrix of the perspective transformation can be calculated through the two groups of coordinate points, and then the transformation of the transformation matrix is carried out on the whole original image, so that the image correction can be realized.
Step S104, based on a decoding module, identifying and decoding the regular reference code corresponding to the square reference code to obtain the reference code information of the square reference code;
in one embodiment, the type of the square reference code is identified through the decoding module, and the decoding of the square reference code is realized through a decoding library of the corresponding type, so that the reference code information of the square reference code is extracted.
In one embodiment, as shown in fig. 6, the step S104 includes:
step S301, based on the decoding module, identifying the standard code type of the regular standard code corresponding to the square standard code;
and step S302, decoding the regular reference code based on a decoding submodule corresponding to the reference code type to obtain the reference code information.
In an embodiment, since different decoding manners exist for different reference codes, the decoding module may simultaneously associate a plurality of different decoding libraries, such as a ZBar library for QR code decoding, a ZXing library for DM code decoding, an ArUco library for ArUco code decoding, an april tag library for april tag code decoding, and the like. When the decoding module identifies the reference code type of the regular reference code corresponding to each square reference code, the decoding of the reference code can be realized through the library corresponding to the type.
Step 105, based on the integration module, arranging and integrating the reference code information of the square reference code to obtain the picture information of the original picture.
In an embodiment, the corner information of the square reference code is recovered from the downsampled image to the original image through the integration module, so that the position information of each square reference code on the original image is obtained, and then the operations of arranging, merging and the like are performed on the square reference code according to the position information.
In an embodiment, the reference code information includes decoding information of the square reference code and a reference code ID.
In an embodiment, the decoding information refers to information contained in the square reference code, for example, the decoding information may be a binary character string, or numbers, letters, etc., and may be queried and converted according to a library corresponding to the square reference code.
In an embodiment, the reference code ID represents an ordering number of the square reference code on the original picture, and is used for positioning the position of the square reference code, so as to determine the attribution and ordering position of the square reference code.
In one embodiment, as shown in fig. 7, the step S105 specifically includes:
step S401, determining position information of the square reference code on the original picture based on the integration module and the reference code ID;
and step S402, arranging and integrating the square reference code and the reference code information of the square reference code based on the position information to obtain the picture information of the original picture.
In an embodiment, since the preprocessing module performs downsampling processing on the original image, which means that the image processing methods are all operated on the downsampled image, the corner information of the square reference code needs to be restored to the original image at the integration module.
In one embodiment, the integration module may include some integration rules when restoring the square reference code to the original image, for example, two ArUco are combined into one larger ArUco, and the decoding information of the two square reference codes may be combined.
In an embodiment, the square reference code may be a child reference code in a larger reference code in the original picture, and according to the reference code ID, a parent reference code corresponding to the square reference code and its sorting position on the parent reference code may be determined.
For example, when four square reference codes belong to the same parent reference code, the four square reference codes are respectively located at four corner positions of the parent reference code, and at this time, each square reference code can be arranged to a corresponding corner position according to the reference code ID of each square reference code, so that the four square reference codes are combined into the parent reference code, and meanwhile, the decoding information of the four square reference codes is combined to generate the decoding information of the parent reference code.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a first embodiment of a square reference code-based picture recognition device according to an embodiment of the present application, where the square reference code-based picture recognition device is used for executing the foregoing square reference code-based picture recognition method. The picture identification device based on the square reference code can be configured in a server.
As shown in fig. 8, the picture recognition apparatus 300 based on square reference code includes: an image processing module 301, a square reference code identification module 302, an image transformation module 303, a reference code decoding module 304, and a reference code integration module 305.
The image processing module 301 is configured to obtain an original picture, and perform reference code contour extraction on the original picture based on the preprocessing module to obtain a first reference code set;
the square reference code identification module 302 is configured to identify square reference codes in the first reference code set based on the contour filtering module, and obtain a second reference code set;
an image transforming module 303, configured to perform perspective transformation on the square reference code in the second reference code set based on the perspective transforming module, to obtain a third reference code set, where the third reference code set includes regular reference codes corresponding to the square reference code;
the reference code decoding module 304 is configured to identify and decode a regular reference code corresponding to the square reference code based on the decoding module, so as to obtain reference code information of the square reference code;
the reference code integrating module 305 is configured to arrange and integrate the reference code information of the square reference code based on the integrating module, so as to obtain the picture information of the original picture.
In one embodiment, the image processing module 301 includes:
and the back-font contour adding unit is used for adding a back-font contour outside the reference code contour when the reference code contour is square and the angular points are less than four, so as to obtain the square reference code corresponding to the reference code contour.
In an embodiment, the image processing module 301 further includes:
the image graying unit is used for graying the original image based on the preprocessing module to obtain a gray image;
the image binarization unit is used for carrying out downsampling and binarization on the gray level image based on a first image processing algorithm to obtain a binary image;
and the contour extraction unit is used for carrying out contour extraction on the reference codes in the binary image based on a second image processing algorithm to obtain the first reference code set.
In an embodiment, the first image processing algorithm includes a downsampling algorithm, and the image processing module 301 further includes:
and the image pyramid generation unit is used for carrying out at least one time of downsampling processing on the gray level image based on the downsampling algorithm to obtain an image pyramid of the downsampled image.
In one embodiment, the image transformation module 303 includes:
a reference code outline size obtaining unit, configured to obtain a square reference code outline size of each downsampled image in the image pyramid;
the target downsampling image determining unit is used for determining target downsampling images based on a preset threshold value and the outline size of the square reference code of each downsampling image;
and the perspective transformation unit is used for performing perspective transformation on the square reference code in the target downsampled image based on the perspective transformation module to obtain the third reference code set.
In an embodiment, the reference code information includes decoding information of the square reference code and a reference code ID; the reference code integration module 305 includes:
a position information determining unit, configured to determine position information of the square reference code on the original picture based on the integration module and the reference code ID;
and the square reference code integration unit is used for arranging and integrating the square reference code and the reference code information of the square reference code based on the position information to obtain the picture information of the original picture.
In an embodiment, the reference code decoding module 304 includes:
the reference code type identification unit is used for identifying the reference code type of the regular reference code corresponding to the square reference code based on the decoding module;
and the reference code decoding unit is used for decoding the regular reference code based on the decoding submodule corresponding to the reference code type to obtain the reference code information.
It should be noted that, for convenience and brevity of description, specific working processes of the above-described apparatus and each module may refer to corresponding processes in the foregoing embodiment of the picture identification method based on the square reference code, which are not described herein again.
The apparatus provided by the above embodiments may be implemented in the form of a computer program which may be run on a computer device as shown in fig. 9.
Referring to fig. 9, fig. 9 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a server.
With reference to FIG. 9, the computer device includes a processor, memory, and a network interface connected by a system bus, where the memory may include a non-volatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program comprises program instructions which, when executed, cause the processor to perform any of a number of picture recognition methods based on square reference codes.
The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
The internal memory provides an environment for the execution of a computer program in a non-volatile storage medium that, when executed by a processor, causes the processor to perform any of a number of picture recognition methods based on square reference codes.
The network interface is used for network communication such as transmitting assigned tasks and the like. It will be appreciated by persons skilled in the art that the architecture shown in fig. 9 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements are applicable, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
It should be appreciated that the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein in one embodiment the processor is configured to run a computer program stored in the memory to implement the steps of:
acquiring an original picture, and extracting a reference code contour of the original picture based on a preprocessing module to obtain a first reference code set;
based on a contour filtering module, identifying square reference codes in the first reference code set to obtain a second reference code set;
performing perspective transformation on the square reference codes in the second reference code set based on a perspective transformation module to obtain a third reference code set, wherein the third reference code set comprises regular reference codes corresponding to the square reference codes;
based on a decoding module, identifying and decoding regular reference codes corresponding to the square reference codes to obtain reference code information of the square reference codes;
and based on an integration module, arranging and integrating the reference code information of the square reference code to obtain the picture information of the original picture.
In an embodiment, when implementing the preprocessing module, the processor performs reference code contour extraction on the original image slice to obtain a first reference code set, the processor is configured to implement:
and when the reference code outline is square and the angular points are less than four, adding a back-shaped outline outside the reference code outline to obtain the square reference code corresponding to the reference code outline.
In an embodiment, when implementing the preprocessing module, the processor is further configured to perform reference code contour extraction on the original image slice to obtain a first reference code set, so as to implement:
based on the preprocessing module, carrying out graying processing on the original image to obtain a gray image;
performing downsampling and binarization processing on the gray level map based on a first image processing algorithm to obtain a binary image;
and extracting the contour of the reference code in the binary image based on a second image processing algorithm to obtain the first reference code set.
In an embodiment, the processor is further configured to, after implementing the first image processing algorithm, implement a downsampling algorithm that downsamples and binarizes the gray map based on the first image processing algorithm:
and based on the downsampling algorithm, performing downsampling processing on the gray level image at least once to obtain an image pyramid of the downsampled image.
In an embodiment, when implementing the perspective transformation module, the processor performs perspective transformation on the square reference code in the second reference code set to obtain a third reference code set, the processor is configured to implement:
acquiring the outline size of a square reference code of each downsampled image in the image pyramid;
determining a target downsampled image based on a preset threshold value and the outline size of a square reference code of each downsampled image;
and performing perspective transformation on the square reference code in the target downsampled image based on the perspective transformation module to obtain the third reference code set.
In an embodiment, the reference code information includes decoding information of the square reference code and a reference code ID; the processor is configured to, when implementing the integration module and arranging and integrating the reference code information of the square reference code to obtain the picture information of the original picture, implement:
determining the position information of the square reference code on the original picture based on the integration module and the reference code ID;
and arranging and integrating the square reference code and the reference code information of the square reference code based on the position information to obtain the picture information of the original picture.
In an embodiment, when implementing the decoding module, the processor is configured to identify and decode a regular reference code corresponding to the square reference code, and obtain reference code information of the square reference code, so as to implement:
based on the decoding module, identifying the reference code type of the regular reference code corresponding to the square reference code;
and decoding the regular reference code based on a decoding submodule corresponding to the reference code type to obtain the reference code information.
The embodiment of the application also provides a computer readable storage medium which stores a computer program, the computer program comprises program instructions, and the processor executes the program instructions to realize any picture identification method based on square reference codes.
The computer readable storage medium may be an internal storage unit of the computer device according to the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. A picture identification method based on square reference codes, the method comprising:
acquiring an original picture, and extracting a reference code contour of the original picture based on a preprocessing module to obtain a first reference code set;
based on a contour filtering module, identifying square reference codes in the first reference code set to obtain a second reference code set;
performing perspective transformation on the square reference codes in the second reference code set based on a perspective transformation module to obtain a third reference code set, wherein the third reference code set comprises regular reference codes corresponding to the square reference codes;
based on a decoding module, identifying and decoding regular reference codes corresponding to the square reference codes to obtain reference code information of the square reference codes;
and based on an integration module, arranging and integrating the reference code information of the square reference code to obtain the picture information of the original picture.
2. The method for identifying a square reference code-based picture according to claim 1, wherein the preprocessing module performs reference code contour extraction on the original picture to obtain a first reference code set, and the method comprises:
and when the reference code outline is square and the angular points are less than four, adding a back-shaped outline outside the reference code outline to obtain the square reference code corresponding to the reference code outline.
3. The method for recognizing a picture based on square reference codes according to claim 1, wherein the preprocessing module performs reference code contour extraction on the original picture to obtain a first reference code set, and further comprises:
based on the preprocessing module, carrying out graying processing on the original image to obtain a gray image;
performing downsampling and binarization processing on the gray level map based on a first image processing algorithm to obtain a binary image;
and extracting the contour of the reference code in the binary image based on a second image processing algorithm to obtain the first reference code set.
4. A square reference code based picture recognition method according to claim 3, wherein the first image processing algorithm includes a downsampling algorithm, and the downsampling and binarizing process is performed on the gray scale map based on the first image processing algorithm, and further comprising:
and based on the downsampling algorithm, performing downsampling processing on the gray level image at least once to obtain an image pyramid of the downsampled image.
5. The picture recognition method based on square reference codes according to claim 4, wherein the perspective transformation module performs perspective transformation on the square reference codes in the second reference code set to obtain a third reference code set, and the method comprises:
acquiring the outline size of a square reference code of each downsampled image in the image pyramid;
determining a target downsampled image based on a preset threshold value and the outline size of a square reference code of each downsampled image;
and performing perspective transformation on the square reference code in the target downsampled image based on the perspective transformation module to obtain the third reference code set.
6. The picture recognition method based on square reference code according to claim 1, wherein the reference code information includes decoding information of the square reference code and a reference code ID;
the integrating module is used for arranging and integrating the reference code information of the square reference code to obtain the picture information of the original picture, and the integrating module comprises the following steps:
determining the position information of the square reference code on the original picture based on the integration module and the reference code ID;
and arranging and integrating the square reference code and the reference code information of the square reference code based on the position information to obtain the picture information of the original picture.
7. The picture identifying method based on square reference codes according to any one of claims 1 to 6, wherein the identifying and decoding, based on the decoding module, the regular reference code corresponding to the square reference code, to obtain the reference code information of the square reference code, includes:
based on the decoding module, identifying the reference code type of the regular reference code corresponding to the square reference code;
and decoding the regular reference code based on a decoding submodule corresponding to the reference code type to obtain the reference code information.
8. A picture recognition device based on a square reference code, wherein the picture recognition device based on the square reference code comprises:
the image processing module is used for acquiring an original picture, and extracting a reference code contour of the original picture based on the preprocessing module to obtain a first reference code set;
the square reference code identification module is used for identifying square reference codes in the first reference code set based on the contour filtering module to obtain a second reference code set;
the image transformation module is used for performing perspective transformation on the square reference codes in the second reference code set based on the perspective transformation module to obtain a third reference code set, wherein the third reference code set comprises regular reference codes corresponding to the square reference codes;
the reference code decoding module is used for identifying and decoding the regular reference code corresponding to the square reference code based on the decoding module to obtain the reference code information of the square reference code;
and the reference code integration module is used for arranging and integrating the reference code information of the square reference code based on the integration module to obtain the picture information of the original picture.
9. A computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the steps of the square reference code based picture recognition method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, implements the steps of the square reference code based picture recognition method as claimed in any one of claims 1 to 7.
CN202310660168.4A 2023-06-05 2023-06-05 Picture identification method, device, equipment and medium based on square reference code Pending CN116976372A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310660168.4A CN116976372A (en) 2023-06-05 2023-06-05 Picture identification method, device, equipment and medium based on square reference code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310660168.4A CN116976372A (en) 2023-06-05 2023-06-05 Picture identification method, device, equipment and medium based on square reference code

Publications (1)

Publication Number Publication Date
CN116976372A true CN116976372A (en) 2023-10-31

Family

ID=88483965

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310660168.4A Pending CN116976372A (en) 2023-06-05 2023-06-05 Picture identification method, device, equipment and medium based on square reference code

Country Status (1)

Country Link
CN (1) CN116976372A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117197422A (en) * 2023-11-07 2023-12-08 深圳优艾智合机器人科技有限公司 Identification code positioning method, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117197422A (en) * 2023-11-07 2023-12-08 深圳优艾智合机器人科技有限公司 Identification code positioning method, electronic equipment and storage medium
CN117197422B (en) * 2023-11-07 2024-03-26 深圳优艾智合机器人科技有限公司 Identification code positioning method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
TWI726422B (en) Two-dimensional code recognition method, device and equipment
CN102243704B (en) Positioning system for two-dimension bar code and two-dimension bar code identification method and equipment
EP2974261A2 (en) Systems and methods for classifying objects in digital images captured using mobile devices
US7873215B2 (en) Precise identification of text pixels from scanned document images
CN111259846B (en) Text positioning method and system and text positioning model training method and system
CN110738203A (en) Method and device for outputting field structuralization and computer readable storage medium
US20180232888A1 (en) Removal of background information from digital images
CN110009615B (en) Image corner detection method and detection device
WO2015002719A1 (en) Method of improving contrast for text extraction and recognition applications
CN112163443A (en) Code scanning method, code scanning device and mobile terminal
CN112597940B (en) Certificate image recognition method and device and storage medium
CN116976372A (en) Picture identification method, device, equipment and medium based on square reference code
CN113228105A (en) Image processing method and device and electronic equipment
CN114758145A (en) Image desensitization method and device, electronic equipment and storage medium
CN111914846B (en) Layout data synthesis method, equipment and storage medium
US10872257B2 (en) Barcode detection method and barcode detection system for increasing detection efficiency
CN114519788A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111753573B (en) Two-dimensional code image recognition method and device, electronic equipment and readable storage medium
CN115272143A (en) Visual enhancement method, device and equipment for bar code and storage medium
CN113850208A (en) Picture information structuring method, device, equipment and medium
CN114926829A (en) Certificate detection method and device, electronic equipment and storage medium
CN113840135A (en) Color cast detection method, device, equipment and storage medium
CN117351495B (en) Text image correction method, device, chip and terminal
CN112733567B (en) Method and device for identifying two-dimension code of motor vehicle and computer readable storage medium
CN112118478B (en) Text processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination