CN116778195A - Equipment identification method and system based on color codes - Google Patents

Equipment identification method and system based on color codes Download PDF

Info

Publication number
CN116778195A
CN116778195A CN202311031664.XA CN202311031664A CN116778195A CN 116778195 A CN116778195 A CN 116778195A CN 202311031664 A CN202311031664 A CN 202311031664A CN 116778195 A CN116778195 A CN 116778195A
Authority
CN
China
Prior art keywords
color
code
unit
digital information
codes
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.)
Granted
Application number
CN202311031664.XA
Other languages
Chinese (zh)
Other versions
CN116778195B (en
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.)
Beijing Huayuan Technology Co ltd
Original Assignee
Beijing Huayuan 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 Beijing Huayuan Technology Co ltd filed Critical Beijing Huayuan Technology Co ltd
Priority to CN202311031664.XA priority Critical patent/CN116778195B/en
Publication of CN116778195A publication Critical patent/CN116778195A/en
Application granted granted Critical
Publication of CN116778195B publication Critical patent/CN116778195B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/56Extraction of image or video features relating to colour
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • 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
    • 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/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • 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/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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

Abstract

The invention relates to the technical field of equipment identification, and discloses an equipment identification method and system based on color codes. The method comprises the steps of generating a digital information code of the required identification equipment, and storing the digital information code; generating a color code corresponding to the digital information code, and printing and pasting the color code on equipment to be identified; a camera is deployed, and a color code image pasted on required identification equipment is obtained; automatically positioning the position of the color code in the image by using an AI algorithm, and acquiring the sequence information of the color code; according to the position of the positioning color code, obtaining color block coordinate information in the color code, and obtaining a color block identification result by utilizing the color block coordinate information; recording the color block identification result, decoding the color block identification result into a digital information code, and comparing the digital information code with the digital information code in a database. The method has the advantages of strong universality, high intelligent degree, convenient implementation and high accuracy, and has great significance for improving the equipment management efficiency.

Description

Equipment identification method and system based on color codes
Technical Field
The invention relates to the technical field of equipment identification, in particular to a method and a system for identifying equipment based on color codes.
Background
Along with interconnection and intercommunication of the Internet of things technology and rising of artificial intelligence computing power demands, a large number of intelligent communication devices at the side and computing power devices at the server are deployed, and related supporting facilities are continuously enriched. However, the update and expansion of the equipment lack synchronous promotion of management means, and the traditional equipment identification and supervision methods are mainly based on technologies such as bar codes, two-dimensional codes and NFC, but the methods generally have problems such as large identification difficulty, low precision, high cost and large deployment difficulty.
For example, the application document with application publication number CN114781417a discloses a two-dimensional code identification method, a two-dimensional code identification device and an electronic device, and marks the device with a two-dimensional code and identifies the device, but there are some problems in general: the storage capacity of the two-dimensional code is limited, the smaller two-dimensional code may not store enough information, and the larger two-dimensional code may occupy too much space to be used conveniently; compared with other rapid identification methods, the two-dimensional code reading speed is slower, which may require more time; in order to identify two-dimensional codes, special scanning devices or application programs with corresponding functions are generally required, which are not easy to realize for some scenes; two-dimensional code identification may present security and privacy issues in some cases, such as malicious parties may generate counterfeit two-dimensional codes for spoofing or attack.
Another example is chinese patent application publication No. CN112329495a, which discloses a method, apparatus and system for identifying a bar code, where the method includes the steps of: acquiring a plurality of acquired images; positioning at least one bar code included in the acquired image to obtain a positioning result of each bar code; based on the positioning result, intercepting each bar code in parallel from the acquired image to obtain an initial bar code image; carrying out calculation processing on the initial bar code image of each bar code in the acquired image in parallel to obtain the width of each bar code unit; based on the preset minimum width and the width of each bar code unit in the initial bar code image, performing width scaling processing on the initial bar code image of each bar code in the acquired image in parallel to obtain a target bar code image; and carrying out decoding processing on the target bar code image in parallel to obtain information carried by each bar code in the acquired image. This patent has some drawbacks: in the bar code identification process, both the bar code scanning gun and the identification distance have strict limit requirements, and the service is not easy to expand under the strict limit conditions, so that the specific occasion requirements can be met; the bar code has no readability, and the accuracy of the identification result is difficult to check when the professional equipment is identified; the bar code needs to be identified by manual short-distance scanning and does not have the capability of automatically positioning and identifying the target at a long distance, so that a great deal of manual cost is required for repeated mechanical labor; black and white information can only represent binary information, and one-dimensional bar codes can only express information in the horizontal direction, but cannot express information in the vertical direction, and the height in the vertical direction is used for assisting the alignment of a reader.
At this time, an identification method with strong universality, high intelligent degree, convenient implementation and high accuracy is needed.
Disclosure of Invention
The invention aims to provide a device identification method and a system based on color codes, which are used for solving the existing problems in the background technology.
In order to achieve the above purpose, the present invention provides the following technical solutions: the device identification method based on the color code comprises the following specific steps:
generating a digital information code of the required identification equipment, and storing the digital information code;
generating a color code corresponding to the digital information code, and printing and pasting the color code on equipment to be identified;
a camera is deployed, and a color code image pasted on required identification equipment is obtained;
automatically positioning the position of the color code in the image by using an AI algorithm, and acquiring the sequence information of the color code;
according to the position of the positioning color code, obtaining color block coordinate information in the color code, and obtaining a color block identification result by utilizing the color block coordinate information;
recording the color block identification result, decoding the color block identification result into a digital information code, and comparing the digital information code with the digital information code in a database.
The invention is further improved in that the digital information code of the required identification equipment is generated, and the digital information code is stored and realized by an information generation module, wherein the information generation module comprises an information generation unit and a database unit;
The information generation unit generates a digital information code with specific length and specific information according to the type of the bound equipment, the management scale and the application scene, and the database unit is used for realizing the function of binding and storing the digital information code and the specific information of the equipment.
The invention is further improved in that the color code corresponding to the digital information code is generated, and the color code is printed and pasted on the equipment to be identified through a color code generating module, wherein the color code generating module comprises a color code generating unit and a color code printing unit;
wherein the color code generating unit generates the digital information code of the required identification equipment by a computer
Automatically generating a color code; the color code printing unit prints the color code automatically generated by the computer on the PVC material or the frosted material.
The invention is further improved in that the color code consists of three parts, namely a black edge frame responsible for positioning, a color block carrying equipment information and a white ground color responsible for color block distinction; wherein, the color block carrying the equipment information is composed of three primary colors of red, green and blue computers.
The invention is further improved in that the camera is deployed, and the color code image pasted on the required identification equipment is acquired through the image acquisition module; the image acquisition module comprises a camera unit and an image preprocessing unit;
The camera unit shoots RGB images containing color codes; the image preprocessing unit is used for preprocessing the RGB image containing the color code shot by the camera unit, and the preprocessing process comprises the steps of adjusting brightness, contrast and saturation and filtering three channels of the RGB image containing the color code.
A further improvement of the invention is that filtering any channel of an RGB image containing color codes comprises the steps of:
(a) Order theRGB image pixel representing color code>Is>Representing an initial filter window->Representing the maximum filter window +.>Representing pixel dot +.>Pixel value of>Representing the minimum pixel value in the filter window, < >>Representing the maximum pixel value in the filter window, < >>Representing the average pixel value +.>Representing intermediate pixel values;
(b) Order the,/>If->Or->Directly executing the step (c), otherwise executing the step (d);
(c) If it isThen increase the filter window->Is not equal to or greater than the size of the output->The method comprises the steps of carrying out a first treatment on the surface of the If the filter window is increasedIs larger than the maximum filter window +.>Outputting->Otherwise, performing step (b);
(d) Order the,/>If->Or->Output->Otherwise output->
The invention further improves that the position of the color code in the image is automatically positioned by using an AI algorithm, and the sequence information of the color code is acquired and realized by an AI algorithm positioning module; the AI algorithm positioning module comprises a data unit and a Yolov5 unit;
The data unit carries out preliminary marking on the preprocessed RGB image containing the color code through the YOLOV5 unit, and after the preliminary marking is finished, the RGB image containing the color code is checked, and if the RGB image containing the color code has error marking, the RGB image is modified;
the YOLOV5 unit comprises two subunits, namely a model training subunit and a model reasoning subunit, wherein the model training subunit can periodically acquire RGB images containing color codes, which are checked in the data unit, train the model, test the model through a verification set, update the model if an evaluation index rises, and send the updated model to each side end for executing reasoning; the model reasoning subunit checks the model file, and updates the model file if the model file changes.
The invention is further improved in that according to the position of the positioning color code, the color block coordinate information in the color code is obtained, and the color block identification result is obtained by utilizing the color block coordinate information and is realized by a color block identification module; the color lump identification module comprises a position positioning unit, a color positioning unit and a color lump identification unit;
the position locating unit obtains parameters in the color card generating process, wherein the parameters comprise the length information of the whole color card taking pixels as units Left upper corner of each color block +.>And lower right corner->Position information in units of pixels; then by two sets of relative coordinates ∈ ->And->Determining the position of a color block;
the color positioning unit converts an RGB image containing a color code into a gray image, the image is divided into black frames, white bottoms and color blocks by a k-means clustering method, and each part uses a contour searching method and limits the contour size to find all contours meeting the standard; if the number of outlines conforming to the number of color blocks exists in the traversing process, the positions of the color blocks are locked by locating the positions of the outlines;
the color block identification unit adds the pixel values corresponding to each channel of the positioned color block image to obtain the sum of all the corresponding pixel values of each channel, and selects the channel corresponding to the maximum value of the sum of the corresponding pixel values as the color of the color block.
The invention further improves the method that the color block identification result is recorded and decoded into a digital information code, and the digital information code in the database is compared with the digital information code to realize the identification by a data comparison module; the data comparison module comprises a decoding unit, a comparison unit and an alarm unit;
the decoding unit acquires all color block identification results in the color codes from the color block identification unit, decodes all color block identification results in the color codes into digital information codes, and stores the digital information codes into the log file;
The comparison unit obtains the digital information code from the decoding unit and compares the digital information code with the digital information code in the database unit; if the comparison result is abnormal, the alarm unit alarms to the operation and maintenance attendant.
A device identification system based on color codes comprises the following specific modules:
the information generation module is used for generating a digital information code of the required identification equipment and storing the digital information code;
the color code generation module generates a color code corresponding to the digital information code, and prints and pastes the color code to equipment to be identified;
the image acquisition module is used for deploying a camera to acquire a color code image stuck on the required identification equipment;
the AI algorithm positioning module is used for automatically positioning the position of the color code in the image by using the AI algorithm and acquiring the sequence information of the color code;
the color block identification module is used for acquiring color block coordinate information in the color code according to the position of the positioning color code and acquiring a color block identification result by utilizing the color block coordinate information;
and the data comparison module records the color block identification result, decodes the color block identification result into a digital information code and compares the digital information code with the digital information code in the database.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a device identification method based on color codes.
An electronic device comprising a memory for storing a computer program and a processor for implementing the steps of a color code based device identification method when the computer program is executed.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a device identification method and a system based on color codes, wherein the method combines the technologies of image processing, a sensor and the computer field; the whole method has the following advantages:
(1) The universality is strong: the color code recognition technology based on the camera image gets rid of the limitation of physical distance, and can adapt to the outdoor complex environment by adjusting the external environment;
(2) The intelligent degree is high: the color code recognition technology optimizes the defects of contact scanning, adopts a mode of active shooting and recognition by a camera, can save the cost and avoids repeated mechanical labor by manpower;
(3) The implementation is convenient: compared with the traditional bar code recognition technology, the device recognition method based on the color code does not need specific scanning equipment, and can complete deployment after installation only by selecting a proper camera according to the situation.
(4) The accuracy is high: the accuracy rate can reach more than 98% after environment installation adaptation and model fine adjustment under a general stable environment; the comprehensive accuracy can reach more than 88% in unstable environments such as outdoors.
Drawings
FIG. 1 is a flow chart of a device identification method based on color codes according to the present invention;
FIG. 2 is a color code diagram of the present invention;
FIG. 3 is a block diagram of a device identification system based on color codes in accordance with the present invention;
FIG. 4 is a schematic diagram of an AI algorithm positioning module of the present invention;
fig. 5 is a schematic diagram of a color lump identification module according to the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the invention. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the present invention.
Embodiments of the invention and features of the embodiments may be combined with each other without conflict.
Example 1
The embodiment provides a device identification method based on a color code, which has great value for the identification and supervision of intelligent communication devices at the edge and computing devices at the server, as shown in fig. 1, and comprises the following specific steps:
and generating a digital information code of the required identification equipment, and storing the digital information code. It should be noted that:
the step is realized based on an information generating module, and the information generating module comprises an information generating unit and a number
A database unit;
wherein, the information generating unit generates the digital information code of the required identification equipment; digital letter of equipment
The information code refers to a device identification code expressed by numbers and is used for uniquely identifying and distinguishing different devices; it may be a string of numbers, a numeric code or a string of numbers and letters; the digital information code of a device is typically managed by a user for identifying each individual device in its product line, the digital information code of each device being unique to ensure that a particular device can be accurately identified and tracked in the system; the digital information code of the device is usually generated according to the conditions of the device registration date, model number, function, factory number and the like. After the generation is finished, the database unit stores the digital information code into the Mysql database, and if the digital information code is a digital string or a digital code, the corresponding data type is flow; if the digital information code is composed of a mixture of numbers and letters, the corresponding data type is VARCHAR.
And generating a color code corresponding to the digital information code, and printing and pasting the color code on equipment to be identified. It should be noted that:
the step is realized by a color code generating module, and the color code generating module comprises a color code generating unit and a color code printing unit;
wherein the color code generating unit calculates the digital information code of the required identification equipment
The machine automatically generates color codes according to a certain rule, and as shown in fig. 2, the color codes mainly comprise three parts, namely a black edge frame responsible for positioning, a color block carrying equipment information and a white ground color responsible for color block distinction. The color block consists of three primary colors of red, green and blue; if the color code containsThe individual color blocks can be generated by different positional arrangements and color transformations>The color codes can carry a large amount of information to distinguish various different devices, and meanwhile, the red, green and blue color blocks accord with color logic of a computer bottom layer, so that the color codes have natural advantages in the aspect of recognition accuracy. The color codes can customize styles with different sizes according to the number and physical states of the equipment to be managed, the color codes default to be rectangular, the length-to-width ratio is 1:3, the color blocks carrying the equipment information default to be rectangular, the length-to-width ratio is 1:2, and the color blocks are equally arranged; if the equipment to be identified is used in an indoor environment, the color code printing unit prints the color code automatically generated by the computer on the PVC material in a thermal transfer printing mode; if the equipment to be identified is used in an outdoor environment, in order to avoid color code reflection, the color code printing unit prints the color code automatically generated by the computer on the frosted material in a thermal transfer printing mode. After printing, the color code is stuck to the equipment to be identified, and it is worth noting that in order to improve the identification accuracy, the surface of the equipment is ensured to be clean, flat and smooth, and no dust, grease, dirt or other impurities exist; if dust, grease, dirt or other impurities are present on the surface of the device, wiping with alcohol and allowing it to dry completely; the adhesive or glue is selected to be compatible with the PVC or matte material, depending on the material and characteristics of the equipment surface, to ensure that the adhesive is selected to be compatible with the material and to provide adequate adhesion under the desired environmental conditions.
And deploying a camera to obtain a color code image stuck on the required identification equipment. It should be noted that:
the method comprises the steps that the steps are realized through an image acquisition module, wherein the image acquisition module comprises a camera unit and an image preprocessing unit;
the camera unit shoots RGB images containing color codes through the camera, and main parameters of the camera comprise pixels, whether a wide-angle camera is adopted, a wide-angle and a distortion angle of the wide-angle camera, an anti-exposure degree, a shooting distance and an anti-exposure angle. When an RGB image containing a color code is shot, a 120-degree micro-distortion 500-ten-thousand-pixel anti-exposure camera is selected for shooting, the shooting distance is 60 cm, and the shooting direction is a vertical angle. The shooting distance is in direct proportion to the size of the camera pixel and the color card by taking clear visibility as a standard; the shooting angle is optimal vertically, deviation of perspective effect can be avoided, the result is not affected within 15 degrees, and accuracy rate is reduced beyond 15 degrees.
Since the RGB image containing the color code captured by the camera generally has the problems of uneven brightness, insufficient contrast, insufficient saturation and noise, the image preprocessing unit needs to preprocess the RGB image containing the color code captured by the camera, and the preprocessing process includes adjusting brightness, contrast, saturation and respectively filtering three channels of the RGB image containing the color code, wherein filtering any channel of the RGB image containing the color code includes the following steps:
(a) Order theRGB image pixel representing color code>Is>Representing an initial filter window->Representing the maximum filter window +.>Representing pixel dot +.>Pixel value of>Representing the minimum pixel value in the filter window, < >>Representing the maximum pixel value in the filter window, < >>Representing the average pixel value +.>Representing intermediate pixel values;
(b) Order the,/>If->Or->Directly executing the step (c), otherwise executing the step (d);
(c) If it isThen increase the filter window->Is not equal to or greater than the size of the output->The method comprises the steps of carrying out a first treatment on the surface of the If the filter window is increasedIs larger than the maximum filter window +.>Outputting->Otherwise, performing step (b);
(d) Order the,/>If->Or->Output->Otherwise output->
And automatically positioning the position of the color code in the image by using an AI algorithm, and obtaining the sequence information of the color code. It should be noted that:
the step is realized based on an AI algorithm positioning module, and because the RGB image containing the color code shot by the camera usually contains a large amount of information, redundant information needs to be filtered through a semantic segmentation method, so that the accurate analysis of the color card is realized.
Three problems are mainly faced in the process of semantic segmentation:
1. the method comprises the steps of firstly obtaining data through manual operation to train out a pre-training model, then enabling a data unit to conduct preliminary marking on the preprocessed RGB image containing the color codes through a YOLOV5 unit, fine-tuning and modifying data with inaccurate marking in a manual checking mode, and storing the data after finishing the marking.
2. Model training, in the process of deep learning model training, creating a RGB image data set folder train or val containing color codes, placing marked tag data together in labels files under the same-level catalog, and dividing the data set into a training set and a verification set, wherein the ratio is 9:1; in the training process, the deep learning model repeatedly and randomly extracts RGB images containing color codes from a training set and sends the RGB images to the deep learning model, in the training process, a random gradient descent optimization algorithm is used for training the deep learning model, wherein the learning rate is 0.001, the random gradient descent optimization algorithm is widely applied to the training process of the deep learning model, after the deep learning model is trained, the performance of the deep learning model is evaluated on a verification set, and the condition that the color codes are lost is reduced by marking data in a mode of expanding 25% of edges when a label file is marked is noted.
3. The model reasoning is carried out, the model training subunit can periodically acquire the data of the data unit subjected to manual auditing, train the model, and update the model and send the model to the side end of each executing reasoning if the evaluation index rises after the verification set test. The model reasoning subunit checks the model file, and updates the model file if the model file changes.
And acquiring color block coordinate information in the color code according to the position of the positioning color code, and acquiring a color block identification result by utilizing the color block coordinate information. It should be noted that:
the step is realized by a color block identification module; the color lump identification module comprises a position locating unit, a color locating unit and a color judging unit.
The position locating unit obtains parameters in the color card generating process, wherein the parameters comprise the length information of the whole color card taking pixels as unitsLeft upper corner of each color block +.>And lower right corner->Position information in units of pixels; then by two sets of relative coordinates ∈ ->And->Determining the position of a color block;
the color locating unit mainly adopts a mode of auxiliary position locating, under the condition of wide-angle imaging distortion, the image can generate spherical three-dimensional deformation, and deformation is increased when the image is closer to the edge, so that the effect of the position locating unit is poor. The color positioning unit converts an image into a gray image, then divides the image into black frames, white bottoms and color blocks by a k-means method, uses a contour searching method for each part and limits the contour size to find out all contours meeting the standard, and if the number of the contours meeting the number of the color blocks exists in the traversing process, the positions of the color blocks can be locked by positioning the positions of the contours;
The color block identification unit adds the pixel values corresponding to each channel of the positioned color block image to obtain the sum of all the corresponding pixel values of each channel, and selects the channel corresponding to the maximum value of the sum of the corresponding pixel values as the color of the color block.
Recording the color block identification result, decoding the color block identification result into a digital information code, and comparing the digital information code with the digital information code in a database. It should be noted that:
the step is realized through a data comparison module; the data comparison module comprises a decoding unit, a comparison unit and an alarm unit;
the decoding unit acquires all color block identification results in the color codes from the color block identification unit, automatically decodes all color block identification results in the color codes into digital information codes through a computer, and stores the digital information codes into a log file so as to facilitate multi-disc inspection;
the comparison unit obtains the digital information code from the decoding unit and compares the digital information code with the digital information code in the database unit; if the comparison result is abnormal, the alarm unit alarms to the operation and maintenance attendant.
Example two
This embodiment is a second embodiment of the present invention, as shown in fig. 3, a device identification system based on color codes, which includes the following modules:
The information generation module is used for collecting digital information codes of the required identification equipment and protecting the digital information codes
Storing; the information generation module comprises an information generation unit and a database unit;
wherein, the information generating unit generates the digital information code of the required identification equipment; the digital information code of the device refers to a device identification code expressed by numbers and is used for uniquely identifying and distinguishing different devices; it may be a string of numbers, a numeric code or a string of numbers and letters; the digital information code of a device is typically managed by a user for identifying each individual device in its product line, the digital information code of each device being unique to ensure that a particular device can be accurately identified and tracked in the system; the digital information code of the device is usually generated according to the conditions of the device registration date, model number, function, factory number and the like. After the generation is finished, the database unit stores the digital information code into the Mysql database, and if the digital information code is a digital string or a digital code, the corresponding data type is flow; if the digital information code is composed of a mixture of numbers and letters, the corresponding data type is VARCHAR.
The color code generation module generates a color code corresponding to the digital information code, and prints and pastes the color code to equipment to be identified; the color code generation module comprises a color code generation unit and a color code printing unit;
Wherein the color code generating unit calculates the digital information code of the required identification equipment
The machine automatically generates color codes according to a certain rule, and as shown in fig. 2, the color codes mainly comprise three parts, namely a black edge frame responsible for positioning, a color block carrying equipment information and a white ground color responsible for color block distinction. The color block is composed of three primary colors of red, green and blue, if the color code containsThe individual color blocks can be generated by different positional arrangements and color transformations>The color codes can carry a large amount of information to distinguish various devices, and the red, green and blue color blocks conform to the color logic of the bottom layer of the computer, so that the user can recognizeOther accuracy aspects have natural advantages. The color codes can customize styles with different sizes according to the number and physical states of the equipment to be managed, the color codes default to be rectangular, the length-to-width ratio is 1:3, the color blocks carrying the equipment information default to be rectangular, the length-to-width ratio is 1:2, and the color blocks are equally arranged; if the equipment to be identified is used in an indoor environment, the color code printing unit prints the color code automatically generated by the computer on the PVC material in a thermal transfer printing mode; if the equipment to be identified is used in an outdoor environment, in order to avoid color code reflection, the color code printing unit prints the color code automatically generated by the computer on the frosted material in a thermal transfer printing mode. After printing, the color code is stuck to the equipment to be identified, and it is worth noting that in order to improve the identification accuracy, the surface of the equipment is ensured to be clean, flat and smooth, and no dust, grease, dirt or other impurities exist, if dust, grease, dirt or other impurities exist on the surface of the equipment; then wiping with alcohol and allowing it to dry completely; the adhesive or glue is selected to be compatible with the PVC or matte material, depending on the material and characteristics of the equipment surface, to ensure that the adhesive is selected to be compatible with the material and to provide adequate adhesion under the desired environmental conditions.
The image acquisition module is used for deploying a camera to acquire a color code image stuck on the required identification equipment; the image acquisition module comprises a camera unit and an image preprocessing unit;
the camera unit shoots RGB images containing color codes through the camera, and main parameters of the camera comprise pixels, whether a wide-angle camera is adopted, a wide-angle and a distortion angle of the wide-angle camera, an anti-exposure degree, a shooting distance and an anti-exposure angle. When an RGB image containing a color code is shot, a camera which is 120 degrees free of distortion, 200 ten thousand pixels and resistant to exposure is selected for shooting, the shooting distance is 70 cm, and the camera distance needs to be increased to a visible range in the shooting process of the undistorted camera, and the shooting direction is a vertical angle. The shooting distance is in direct proportion to the size of the camera pixel and the color card by taking clear visibility as a standard; the shooting angle is optimal vertically, deviation of perspective effect can be avoided, the result is not affected within 15 degrees, and accuracy rate is reduced beyond 15 degrees.
Since the RGB image containing the color code captured by the camera generally has the problems of uneven brightness, insufficient contrast, insufficient saturation and noise, the image preprocessing unit needs to preprocess the RGB image containing the color code captured by the camera, and the preprocessing process includes adjusting brightness, contrast and saturation and respectively filtering three channels of the RGB image containing the color code, wherein filtering any channel of the RGB image containing the color code includes the following steps:
(a) Order theRGB image pixel representing color code>Is>Representing an initial filter window->Representing the maximum filter window +.>Representing pixel dot +.>Pixel value of>Representing the minimum pixel value in the filter window, < >>Representing the maximum pixel value in the filter window, < >>Representing the average pixel value +.>Representing intermediate pixel values;
(b) Order the,/>If->Or->Directly executing the step (c), otherwise executing the step (d);
(c) If it isThen increase the filter window->Is not equal to or greater than the size of the output->The method comprises the steps of carrying out a first treatment on the surface of the If the filter window is increasedIs larger than the maximum filter window +.>Outputting->Otherwise, performing step (b);
(d) Order the,/>If->Or->Output->Otherwise output->
The AI algorithm positioning module is used for automatically positioning the position of the color code in the image by using the AI algorithm and acquiring the sequence information of the color code; as shown in fig. 4, the AI algorithm locating module includes a data unit and a YOLOV5 unit; since the RGB image containing the color code, which is captured by the camera, usually contains a large amount of information, redundant information needs to be filtered out by means of semantic segmentation, so that accurate analysis on the color card is realized.
Three problems are mainly faced in the process of semantic segmentation:
1. The method comprises the steps of firstly obtaining data through manual operation to train out a pre-training model, then enabling a data unit to conduct preliminary marking on the preprocessed RGB image containing the color codes through a YOLOV5 unit, fine-tuning and modifying data with inaccurate marking in a manual checking mode, and storing the data after finishing the marking.
2. Model training, in the process of deep learning model training, creating a RGB image data set folder train or val containing color codes, placing marked tag data together in labels files under the same-level catalog, and dividing the data set into a training set and a verification set with the proportion of 9:1; in the training process, the deep learning model repeatedly and randomly extracts RGB images containing color codes from a training set and sends the RGB images into the deep learning model, in the training process, a random gradient descent optimization algorithm is used for training the deep learning model, wherein the learning rate is 0.001, the random gradient descent optimization algorithm is widely applied to the training process of the deep learning model, and after the deep learning model is trained, the performance of the deep learning model is evaluated on a verification set; it should be noted that, when labeling a tag file, the data is labeled in a manner of expanding the edge by 25% to reduce the loss of color code information, 75% of the IOU can be selected as standard calculation in the evaluation process through the above operation, meanwhile, the condition that 75% of the original IOU can lose information is also reduced, the condition that 100% of the IOU is unfavorable for training is avoided, and finally, the accuracy and recall rate can be calculated through the condition.
3. The model reasoning, the model training subunit regularly obtains the data of the data unit which is subjected to manual auditing, trains the model, and updates the model and transmits the model to the side end of each executing reasoning if the evaluation index rises through verification set test. The model reasoning subunit checks the model file, and updates the model file if the model file changes.
The color block identification module is used for acquiring color block coordinate information in the color code according to the position of the positioning color code and acquiring a color block identification result by utilizing the color block coordinate information; as shown in fig. 5, the color patch identifying module includes a position locating unit, a color locating unit, and a color judging unit.
The position locating unit obtains parameters in the color card generating process, wherein the parameters comprise the length information of the whole color card taking pixels as unitsLeft upper corner of each color block +.>And lower right corner->Position information in units of pixels; then by two sets of relative coordinates ∈ ->And->Determining the position of a color block;
the color locating unit mainly adopts a mode of assisting in position locating, under the condition of wide-angle imaging distortion, the image can generate spherical three-dimensional deformation, and deformation is increased when the image is closer to the edge, so that the effect of the position locating unit is poor. The color positioning unit converts an image into a gray image, then divides the image into black frames, white bottoms and color blocks by a k-means method, uses a contour searching method for each part and limits the contour size to find out all contours meeting the standard, and if the number of the contours meeting the number of the color blocks exists in the traversing process, the positions of the color blocks can be locked by positioning the positions of the contours;
The color block identification unit adds the pixel values corresponding to each channel of the positioned color block image to obtain the sum of all the corresponding pixel values of each channel, and selects the channel corresponding to the maximum value of the sum of the corresponding pixel values as the color of the color block.
The data comparison module records the color block identification result, decodes the color block identification result into a digital information code and compares the digital information code with the digital information code in the database; the data comparison module comprises a decoding unit, a comparison unit and an alarm unit;
the decoding unit acquires all color block identification results in the color codes from the color block identification unit, automatically decodes all color block identification results in the color codes into digital information codes through a computer, and stores the digital information codes into a log file so as to facilitate multi-disc inspection;
the comparison unit obtains the digital information code from the decoding unit and compares the digital information code with the digital information code in the database unit; if the comparison result is abnormal, the alarm unit alarms to the operation and maintenance attendant.
Example III
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a device identification method based on color codes. It should be noted that:
All computer programs of the device identification method based on color codes are implemented in the c++ language,
the image acquisition module is controlled by an STM32 embedded microcontroller, the processes of adjusting brightness, contrast, saturation and filtering pretreatment on the image acquired by the camera are realized by the STM32 embedded microcontroller, and the information generation module, the color code generation module, the AI algorithm positioning module, the color block identification module and the data comparison module are controlled by a remote server; the CPU of the remote server is Intel CORE i7, and the Intel CORE i7 and STM32 embedded microcontroller jointly realize a device identification system based on color codes.
Example IV
The present embodiment provides an electronic device including: a processor and a memory, wherein the memory stores a computer program for the processor to call; the processor performs a device identification method based on color codes as described above by calling a computer program stored in the memory. The electronic device may vary greatly in configuration or performance, and can include one or more processors (Central Processing Units, CPU) and one or more memories, where the memories store at least one computer program that is loaded and executed by the processors to implement a device identification method based on color codes provided by the above-described method embodiments. The electronic device can also include other components for implementing the functions of the device, for example, the electronic device can also have wired or wireless network interfaces, input-output interfaces, and the like, for inputting and outputting data. The present embodiment is not described herein.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. The device identification method based on the color code is characterized by comprising the following steps of: the method comprises the following specific steps:
generating a digital information code of the required identification equipment, and storing the digital information code;
generating a color code corresponding to the digital information code, and printing and pasting the color code on equipment to be identified;
A camera is deployed, and a color code image pasted on required identification equipment is obtained;
automatically positioning the position of the color code in the image by using an AI algorithm, and acquiring the sequence information of the color code;
according to the position of the positioning color code, obtaining color block coordinate information in the color code, and obtaining a color block identification result by utilizing the color block coordinate information;
recording the color block identification result, decoding the color block identification result into a digital information code, and comparing the digital information code with the digital information code in a database.
2. The device identification method based on color codes as claimed in claim 1, wherein the generating of the digital information code of the required identification device is realized by an information generating module, and the information generating module comprises an information generating unit and a database unit;
the information generation unit generates a digital information code with specific length and specific information according to the type of the bound equipment, the management scale and the application scene, and the database unit is used for realizing the function of binding and storing the digital information code and the specific information of the equipment.
3. A device identification method based on color codes as claimed in claim 2, characterized in that: the color code generation corresponding to the digital information code is generated, the color code is printed and pasted on equipment to be identified through a color code generation module, and the color code generation module comprises a color code generation unit and a color code printing unit;
Wherein the color code generating unit automatically generates the digital information code of the required identification equipment by a computer
Generating a color code; the color code printing unit prints the color code automatically generated by the computer on the PVC material or the frosted material.
4. A device identification method based on color codes as claimed in claim 3, characterized in that: the color code consists of three parts, namely a black edge frame responsible for positioning, a color block carrying equipment information and a white ground color responsible for color block distinction; wherein, the color block carrying the equipment information is composed of three primary colors of red, green and blue computers.
5. The device identification method based on color codes as claimed in claim 4, wherein: the camera is deployed, and the color code image pasted on the required identification equipment is obtained through the image acquisition module; the image acquisition module comprises a camera unit and an image preprocessing unit;
the camera unit shoots RGB images containing color codes; the image preprocessing unit is used for preprocessing the RGB image containing the color code shot by the camera unit, and the preprocessing process comprises the steps of adjusting brightness, contrast and saturation and filtering three channels of the RGB image containing the color code.
6. The device identification method based on color codes according to claim 5, wherein: filtering any channel of an RGB image containing color codes comprises the steps of:
(a) Order theRGB image pixel representing color code>Is>Representing the initial filtering window(s),representing the maximum filter window +.>Representing pixel dot +.>Pixel value of>Representing the minimum pixel value in the filter window,representing the maximum pixel value in the filter window, < >>Representing the average pixel value +.>Representing intermediate pixel values;
(b) Order the,/>If->Or->Directly executing the step (c), otherwise executing the step (d);
(c) If it isThen increase the filter window->Is not equal to or greater than the size of the output->The method comprises the steps of carrying out a first treatment on the surface of the If the filter window after enlargement ∈>Is larger than the maximum filter window +.>Outputting->Otherwise, performing step (b);
(d) Order the,/>If->Or->Output->Otherwise output->
7. The device identification method based on color codes as claimed in claim 6, wherein: the position of the color code in the image is automatically positioned by using an AI algorithm, and the sequence information of the color code is acquired and realized by an AI algorithm positioning module; the AI algorithm positioning module comprises a data unit and a Yolov5 unit;
The data unit carries out preliminary marking on the preprocessed RGB image containing the color code through the YOLOV5 unit, and after the preliminary marking is finished, the RGB image containing the color code is checked, and if the RGB image containing the color code has error marking, the RGB image is modified;
the YOLOV5 unit comprises two subunits, namely a model training subunit and a model reasoning subunit, wherein the model training subunit can periodically acquire RGB images containing color codes, which are checked in the data unit, train the model, test the model through a verification set, update the model if an evaluation index rises, and send the updated model to each side end for executing reasoning; the model reasoning subunit checks the model file, and updates the model file if the model file changes.
8. The device identification method based on color codes as claimed in claim 7, wherein:
the color block identification module is used for acquiring color block coordinate information in the color code according to the position of the positioning color code, and acquiring a color block identification result by utilizing the color block coordinate information; the color lump identification module comprises a position positioning unit, a color positioning unit and a color lump identification unit;
The position locating unit obtains parameters in the color card generating process, wherein the parameters comprise the length information of the whole color card taking pixels as unitsLeft upper corner of each color block +.>And lower right corner->Position information in units of pixels; then by two sets of relative coordinates ∈ ->And->Determining the position of a color block;
the color positioning unit converts an RGB image containing a color code into a gray image, the image is divided into black frames, white bottoms and color blocks by a k-means clustering method, and each part uses a contour searching method and limits the contour size to find all contours meeting the standard; if the number of outlines conforming to the number of color blocks exists in the traversing process, the positions of the color blocks are locked by locating the positions of the outlines;
the color block identification unit adds the pixel values corresponding to each channel of the positioned color block image to obtain the sum of all the corresponding pixel values of each channel, and selects the channel corresponding to the maximum value of the sum of the corresponding pixel values as the color of the color block.
9. The device identification method based on color codes as claimed in claim 8, wherein: recording a color block identification result, decoding the color block identification result into a digital information code, and comparing the digital information code with the digital information code in a database through a data comparison module; the data comparison module comprises a decoding unit, a comparison unit and an alarm unit;
The decoding unit acquires all color block identification results in the color codes from the color block identification unit, decodes all color block identification results in the color codes into digital information codes, and stores the digital information codes into the log file;
the comparison unit obtains the digital information code from the decoding unit and compares the digital information code with the digital information code in the database unit; if the comparison result is abnormal, the alarm unit alarms to the operation and maintenance attendant.
10. A device identification system based on color codes, which is realized based on the device identification method based on color codes according to any one of claims 1 to 9, and is characterized by comprising:
the information generation module is used for generating a digital information code of the required identification equipment and storing the digital information code;
the color code generation module generates a color code corresponding to the digital information code, and prints and pastes the color code to equipment to be identified;
the image acquisition module is used for deploying a camera to acquire a color code image stuck on the required identification equipment;
the AI algorithm positioning module is used for automatically positioning the position of the color code in the image by using the AI algorithm and acquiring the sequence information of the color code;
the color block identification module is used for acquiring color block coordinate information in the color code according to the position of the positioning color code and acquiring a color block identification result by utilizing the color block coordinate information;
And the data comparison module records the color block identification result, decodes the color block identification result into a digital information code and compares the digital information code with the digital information code in the database.
11. A computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements a device identification method based on color codes as claimed in any one of claims 1-9.
12. An electronic device comprising a memory and a processor, the memory for storing a computer program,
-characterized in that the processor is adapted to implement a device identification method based on color codes according to any of claims 1-9 when executing the computer program.
CN202311031664.XA 2023-08-16 2023-08-16 Equipment identification method and system based on color codes Active CN116778195B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311031664.XA CN116778195B (en) 2023-08-16 2023-08-16 Equipment identification method and system based on color codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311031664.XA CN116778195B (en) 2023-08-16 2023-08-16 Equipment identification method and system based on color codes

Publications (2)

Publication Number Publication Date
CN116778195A true CN116778195A (en) 2023-09-19
CN116778195B CN116778195B (en) 2023-11-24

Family

ID=88013686

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311031664.XA Active CN116778195B (en) 2023-08-16 2023-08-16 Equipment identification method and system based on color codes

Country Status (1)

Country Link
CN (1) CN116778195B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1578969A (en) * 2001-11-03 2005-02-09 卡勒兹普麦迪亚公司 Apparatus and method for recognizing code
CN1912537A (en) * 2005-08-01 2007-02-14 株式会社拓普康 Three-dimensional measurement system and method of the same, and color-coded mark
CN101189641A (en) * 2005-05-12 2008-05-28 布雷克成像有限公司 Method for coding pixels or voxels of a digital image and a method for processing digital images
US20080191035A1 (en) * 2005-01-18 2008-08-14 Ji-Deak Cheon Bar Code Generation Method Using Color Code, Data Compression Method, And Internet Service Method Thereof
CN102646187A (en) * 2011-02-20 2012-08-22 深圳市心艺来文化有限公司 Color graphics coding and identifying method
CN102982468A (en) * 2012-10-31 2013-03-20 郁敏 Advertisement system based on color code recognition technology and method thereof
CN106683593A (en) * 2015-11-06 2017-05-17 沈维 Billboard containing coding information
CN106919966A (en) * 2016-12-28 2017-07-04 上海交通大学 Taking care of books method and colored rectangles code label based on colored rectangles code
CN111477289A (en) * 2019-01-24 2020-07-31 明码(上海)生物科技有限公司 Method and device for storing and reading detection report
CN114781417A (en) * 2022-04-12 2022-07-22 普联技术有限公司 Two-dimensional code identification method, two-dimensional code identification device and electronic equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1578969A (en) * 2001-11-03 2005-02-09 卡勒兹普麦迪亚公司 Apparatus and method for recognizing code
US20080191035A1 (en) * 2005-01-18 2008-08-14 Ji-Deak Cheon Bar Code Generation Method Using Color Code, Data Compression Method, And Internet Service Method Thereof
CN101189641A (en) * 2005-05-12 2008-05-28 布雷克成像有限公司 Method for coding pixels or voxels of a digital image and a method for processing digital images
CN1912537A (en) * 2005-08-01 2007-02-14 株式会社拓普康 Three-dimensional measurement system and method of the same, and color-coded mark
CN102646187A (en) * 2011-02-20 2012-08-22 深圳市心艺来文化有限公司 Color graphics coding and identifying method
CN102982468A (en) * 2012-10-31 2013-03-20 郁敏 Advertisement system based on color code recognition technology and method thereof
CN106683593A (en) * 2015-11-06 2017-05-17 沈维 Billboard containing coding information
CN106919966A (en) * 2016-12-28 2017-07-04 上海交通大学 Taking care of books method and colored rectangles code label based on colored rectangles code
CN111477289A (en) * 2019-01-24 2020-07-31 明码(上海)生物科技有限公司 Method and device for storing and reading detection report
CN114781417A (en) * 2022-04-12 2022-07-22 普联技术有限公司 Two-dimensional code identification method, two-dimensional code identification device and electronic equipment

Also Published As

Publication number Publication date
CN116778195B (en) 2023-11-24

Similar Documents

Publication Publication Date Title
CN108416403B (en) Method, system, equipment and storage medium for automatically associating commodity with label
CN107680294A (en) House property information querying method, system, terminal device and storage medium
CN107145929B (en) A kind of predistortion two-dimensional code generation method for cylindrical surface two dimensional code patch
CN107808157B (en) Detonator code positioning and identifying method and device
WO2019061658A1 (en) Method and device for positioning eyeglass, and storage medium
WO2022156178A1 (en) Image target comparison method and apparatus, computer device and readable storage medium
CN109687382B (en) Relay protection pressing plate switching state identification method based on color template matching
CN110287787B (en) Image recognition method, image recognition device and computer-readable storage medium
CN106156684A (en) A kind of two-dimensional code identification method and device
CN112699775A (en) Certificate identification method, device and equipment based on deep learning and storage medium
CN109034694B (en) Production raw material intelligent storage method and system based on intelligent manufacturing
CN111339811B (en) Image processing method, device, equipment and storage medium
CN110114781B (en) Method for detecting and identifying remote high density visual indicia
CN113111880B (en) Certificate image correction method, device, electronic equipment and storage medium
CN110020643A (en) A kind of pressing plate recognition methods and equipment
CN107122775A (en) A kind of Android mobile phone identity card character identifying method of feature based matching
CN110443181A (en) Face identification method and device
CN109741273A (en) A kind of mobile phone photograph low-quality images automatically process and methods of marking
CN115147939A (en) Data distribution management system and method in large-scale scene
CN112541432A (en) Video livestock identity authentication system and method based on deep learning
CN104346596A (en) Identification method and identification device for QR (Quick Response) code
CN116778195B (en) Equipment identification method and system based on color codes
CN115908774B (en) Quality detection method and device for deformed materials based on machine vision
CN106056029B (en) Street lamp mobile management system and its method based on street lamp label intelligent identification technology
CN109214243A (en) Method for tracking target, device and unmanned plane

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
GR01 Patent grant
GR01 Patent grant