CN108805246B - Intelligent indication two-dimensional code and method for monitoring food state by using same - Google Patents
Intelligent indication two-dimensional code and method for monitoring food state by using same Download PDFInfo
- Publication number
- CN108805246B CN108805246B CN201810627082.0A CN201810627082A CN108805246B CN 108805246 B CN108805246 B CN 108805246B CN 201810627082 A CN201810627082 A CN 201810627082A CN 108805246 B CN108805246 B CN 108805246B
- Authority
- CN
- China
- Prior art keywords
- indicator
- information
- color
- dimensional code
- image
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06037—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
- G06K19/0615—Constructional details the marking being of the rewritable type, e.g. thermo-chromic barcodes
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
Description
技术领域technical field
本发明属于二维码制备技术领域,具体涉及一种智能指示二维码及利用该智能指示二维码对食品质量监测的方法。The invention belongs to the technical field of two-dimensional code preparation, and in particular relates to an intelligent indicating two-dimensional code and a method for monitoring food quality by using the intelligent indicating two-dimensional code.
背景技术Background technique
随着我国城镇化加快带动城市配送,网络零售市场的爆发式增长,制造业物流环节外包以及生鲜产业的冷链物流市场的推动作用,近年来我国物流行业迎来快速增长,据中国产业调研网发布的中国物流调研显示,2016年全国社会物流总额229.7万亿,预计到2020年物流行业市场规模接近360万亿元。生鲜食品、果蔬食品等产品在物流过程中容易变质腐败,记录这类产品的源头信息和运输贮藏后的质量信息就显得尤为重要,现在已经普及的记录产品信息的技术是条形码技术。With the acceleration of urbanization in my country to drive urban distribution, the explosive growth of the online retail market, the outsourcing of manufacturing logistics links and the promotion of the cold chain logistics market of the fresh food industry, my country's logistics industry has ushered in rapid growth in recent years. According to China Industry Research According to the China logistics survey released by the Internet, the total social logistics in the country in 2016 was 229.7 trillion yuan, and the market size of the logistics industry is expected to be close to 360 trillion yuan by 2020. Fresh food, fruit and vegetable food and other products are prone to spoilage and corruption during the logistics process. It is particularly important to record the source information of such products and the quality information after transportation and storage. The technology that has been popularized to record product information is barcode technology.
在记录产品信息中使用最频繁的有一维条形码(One-Dimensional Bar Code),一维条形码的应用可以提高信息录入的速度,减少差错率,但是一维条形码也存在一些不足之处:数据容量只能包含字母和数字条形码尺寸相对较大空间利用率较低,条形码遭到损坏后便不能阅读。One-dimensional barcode (One-Dimensional Bar Code) is the most frequently used in recording product information. The application of one-dimensional barcode can improve the speed of information entry and reduce the error rate, but one-dimensional barcode also has some shortcomings: the data capacity is only The barcodes that can contain letters and numbers are relatively large in size and have low space utilization, and the barcodes cannot be read after being damaged.
二维码(QR Code)是用某种特定的几何图形按一定规律在平面二维方向上分布的黑白相间的图形记录数据符号信息,具有对处理图形旋转变化、纠错能力高、信息量较一维码多的特点。二维码作为一种信息存储、传递和识别技术不仅应用在工业生产线的自动化管理、物流中的货物分类,库存的查询,邮政物流包裹的管理等,而且也应用在海关、税务等部门对各类报表和票据的管理,以及应用于各类证件的管理上,但是二维码在信息量记录的信息量较少,当信息量过大就无法识别读取,编译效率低。Two-dimensional code (QR Code) is a black-and-white graphic recording data symbol information that uses a specific geometric graphic to distribute in the two-dimensional direction of the plane according to a certain rule. One-dimensional codes have many features. As an information storage, transmission and identification technology, two-dimensional code is not only used in the automatic management of industrial production lines, the classification of goods in logistics, the query of inventory, the management of postal logistics and parcels, etc., but also in customs, taxation and other departments. It can be applied to the management of similar reports and bills, as well as the management of various certificates, but the QR code records a small amount of information in the amount of information. When the amount of information is too large, it cannot be recognized and read, and the compilation efficiency is low.
现有技术中这些能记录产品信息的条码,无论是一维码和二维码,都只能记录预先记载的信息,而不能实现实时反映产品在运输储存过程后具体的质量状态信息。The barcodes in the prior art that can record product information, whether it is a one-dimensional code or a two-dimensional code, can only record the pre-recorded information, but cannot reflect the specific quality status information of the product after transportation and storage in real time.
发明内容SUMMARY OF THE INVENTION
本发明的目的在于克服现有技术中存在的缺陷:目前应用的一维码和二维码,都只能记录预先写入的信息,不能实时反映产品在复杂的运输储存过程后具体的质量状态信息的缺点,本发明提供一种能监测在经历运输储藏过程中产品状态变化的指示性二维码和识别方法,实现通过终端设备扫描二维码即可获得在运输贮藏中食品的时间-温度、湿度、pH值、氧气、微生物质量指标的信息。The purpose of the present invention is to overcome the defects existing in the prior art: the currently applied one-dimensional code and two-dimensional code can only record pre-written information, and cannot reflect the specific quality state of the product in real time after the complex transportation and storage process In view of the shortcomings of information, the present invention provides an indicative two-dimensional code and an identification method that can monitor changes in product status during transportation and storage, so that the time-temperature of food during transportation and storage can be obtained by scanning the two-dimensional code through a terminal device. , humidity, pH, oxygen, information on microbial quality indicators.
本发明提供一种智能指示二维码,所述智能指示二维码的结构为两层保护层中间包裹着一层数据层。保护层为厚度在20-25微米之间的透明塑料膜,材料可以为尼龙塑料膜、聚酯塑料膜或邻苯基苯酚塑料膜。数据层材料为白色纸张或聚酯无纺布等无孔透气材料。智能指示二维码位于数据层上,包括位置探测图形、数据信息图形、指示信息图形、格式信息图形和位置探测图形分割符。其中指示信息图形所在的位置对应的上层保护层和下层保护层均匀分布有孔径在0.3-1.0毫米的透气微孔。The invention provides an intelligent indicating two-dimensional code, wherein the structure of the intelligent indicating two-dimensional code is that a data layer is wrapped in the middle of two protective layers. The protective layer is a transparent plastic film with a thickness of 20-25 microns, and the material can be nylon plastic film, polyester plastic film or o-phenylphenol plastic film. The data layer material is non-porous and breathable material such as white paper or polyester non-woven fabric. The intelligent indicating QR code is located on the data layer, including position detection graphics, data information graphics, instruction information graphics, format information graphics and position detection graphics separators. The upper protective layer and the lower protective layer corresponding to the position of the indication information graphic are evenly distributed with air-permeable micropores with a diameter of 0.3-1.0 mm.
位置探测图形包括第一位置探测图形、第二位置探测图形和第三位置探测图形,分别分布在二维码的左上角、右上角和左下角。The location detection patterns include a first location detection pattern, a second location detection pattern, and a third location detection pattern, which are distributed in the upper left corner, the upper right corner and the lower left corner of the two-dimensional code, respectively.
数据信息图形用于记录二进制数据,二进制数据中记录有产品的产地信息、生产信息和指示种类信息;The data information graphic is used to record binary data, and the binary data records the origin information, production information and indication type information of the product;
指示信息图形占2个数据块,2个数据块相邻且位于智能指示二维码的中间,其中第一数据块涂有指示剂,指示剂可以是时间-温度指示剂、湿度指示剂、pH值指示剂、氧气指示剂或微生物指示剂的一种或多种,每一种指示剂能根据对应环境条件变化显示出不同的颜色;第二数据块印刷有与相邻的第一数据块对应指示剂的标准颜色,标准颜色为指示剂在不同变化阶段颜色的组合。The indication information graphic occupies 2 data blocks, and the 2 data blocks are adjacent and located in the middle of the smart indication QR code. The first data block is coated with an indicator, and the indicator can be time-temperature indicator, humidity indicator, pH indicator One or more of the value indicator, oxygen indicator or microbial indicator, each indicator can display different colors according to the corresponding environmental conditions; the second data block is printed with corresponding to the adjacent first data block The standard color of the indicator, the standard color is the combination of the color of the indicator in different stages of change.
上述时间-温度指示剂为十八烷基氨基甲酸乙酯、丁氧羰基氨基甲酸乙酯或淀粉/淀粉酶;Above-mentioned time-temperature indicator is octadecyl urethane, butoxycarbonyl urethane or starch/amylase;
上述湿度指示剂为氯化铜或硫氰酸钴;Above-mentioned humidity indicator is copper chloride or cobalt thiocyanate;
上述pH值指示剂为花青素、甲基橙或中性红;The above-mentioned pH indicator is anthocyanin, methyl orange or neutral red;
上述氧气指示剂为邻菲罗啉-Fe(II)、N-邻苯氨基苯甲酸或二苯胺磺酸钠;Above-mentioned oxygen indicator is o-phenanthroline-Fe(II), N-o-anilino acid or sodium diphenylamine sulfonate;
上述微生物指示剂为EZTest@环氧乙烯或EZTest@过氧化氢。The above microbial indicators are EZTest@ethylene oxide or EZTest@hydrogen peroxide.
格式信息图形用于指示数据在编码时的格式信息和版本大小的信息,二维码的格式信息存储二维码的纠错级别,本发明中的二维码采用的是M级别的纠错码字。The format information graphic is used to indicate the format information and version size information of the data during encoding. The format information of the two-dimensional code stores the error correction level of the two-dimensional code. The two-dimensional code in the present invention adopts the M-level error correction code. Character.
其中,纠错码字是基于选取的纠错级别,用里德一所罗门纠错算法通过数据码字计算得到的。Among them, the error correction code word is calculated by the data code word using the Reed-Solomon error correction algorithm based on the selected error correction level.
位置探测图形分割符用于将位置探测图形与格式信息分隔,或将位置探测图形与数据信息图形分隔。The position detection graphic separator is used to separate the position detection graphic from the format information, or separate the position detection graphic from the data information graphic.
本发明提供一种指示性二维码的识别方法,所述方法包括:The present invention provides a method for identifying an indicative two-dimensional code, the method comprising:
步骤1,获取二维码的图像;Step 1, obtain the image of the two-dimensional code;
步骤2,在二维码中识别出3个位置探测图形;Step 2, identify 3 position detection patterns in the two-dimensional code;
步骤3,读取二维码格式信息图形中的格式信息和版本信息;Step 3, read the format information and version information in the two-dimensional code format information graphics;
步骤4,从数据块中解码出数据码字;Step 4, decode the data code word from the data block;
步骤5,获取指示信息图形的指示剂和标准颜色的图形位置;Step 5, obtaining the graphic position of the indicator indicating the information graphic and the standard color;
步骤6,校正指示剂图形信息;Step 6, correcting the graphic information of the indicator;
步骤7,匹配指示剂颜色等级;Step 7, match the indicator color grade;
步骤8,向服务器发送指示剂的等级信息;Step 8, sending the level information of the indicator to the server;
步骤9,服务器向终端反馈的产品状态信息。Step 9, the product status information fed back by the server to the terminal.
所述步骤4中数据码字,其记录有指示剂的种类信息、产品产地信息、产品生产信息;Data code word in described step 4, it records the kind information of indicator, product origin information, product production information;
所述步骤5中获取指示信息图形的指示剂和标准颜色的图形位置,具体为:为提高图像处理效率,先将图像转化为灰度值为32的灰度值图像。利用中值滤波的5×5模板对灰度值图像进行去除噪声,用于增强图像效果利于后期处理;再通过Sober算子检测图像的边缘,得到指示信息图像的边缘,接着借助轮廓提取算法检测出指示信息图形的指示剂和标准颜色的轮廓;最后用自适应阈值选取法分割出指示剂和标准颜色的图形位置。In the step 5, the position of the indicator indicating the information graphic and the graphic position of the standard color is obtained, specifically: in order to improve the image processing efficiency, the image is first converted into a gray value image with a gray value of 32. Use the median filtered 5×5 template to remove noise from the gray value image, which is used to enhance the image effect and facilitate post-processing; then use the Sober operator to detect the edge of the image to obtain the edge of the indication information image, and then use the contour extraction algorithm to detect The outline of the indicator and standard color indicating the information graphic is obtained; finally, the graphic position of the indicator and the standard color is segmented by the adaptive threshold selection method.
所述步骤6中校正指示剂图形信息,分别提取指示剂和标准颜色图形中各像素的R、G、B值,利用具有在线校正的多项式回归法对每个区域的颜色进行校正。In the step 6, the indicator graphic information is corrected, the R, G, and B values of each pixel in the indicator and the standard color graphic are extracted respectively, and the color of each area is corrected by the polynomial regression method with online correction.
所述步骤7中匹配指示剂颜色等级,具体为将校正的指示剂R、G、B值带入预先建立好的人工神经网络模型识别出指示剂的颜色等级;Matching the color grade of the indicator in the step 7, specifically, bringing the corrected R, G, B values of the indicator into the pre-established artificial neural network model to identify the color grade of the indicator;
上述建立的人工神经网络模型,输入层神经元个数为3个,既指示剂校正后的R、G、B值,隐含层为8个神经元,输出层为4个神经元,既4个颜色等级;隐含层传递函数为tansig(),输出层传递函数为logsig(),训练函数为trainlm()。In the artificial neural network model established above, the number of neurons in the input layer is 3, which is the R, G, and B values corrected by the indicator, the hidden layer is 8 neurons, and the output layer is 4 neurons, which is 4 neurons. The transfer function of the hidden layer is tansig(), the transfer function of the output layer is logsig(), and the training function is trainlm().
所述步骤9中服务器向终端反馈的产品状态信息,The product status information fed back by the server to the terminal in the step 9,
可选的,当指示剂是时间温度指示剂时,产品状态信息是产品贮存的时间;Optionally, when the indicator is a time temperature indicator, the product status information is the storage time of the product;
可选的,当指示剂是湿度指示剂时,产品状态信息是产品贮存环境的水分含量;Optionally, when the indicator is a humidity indicator, the product status information is the moisture content of the product storage environment;
可选的,当指示剂是pH值指示剂时,产品状态信息是产品贮存环境的pH值;Optionally, when the indicator is a pH indicator, the product status information is the pH value of the product storage environment;
可选的,当指示剂是氧气指示剂时,产品状态信息是产品贮存环境的含氧量;Optionally, when the indicator is an oxygen indicator, the product status information is the oxygen content of the product storage environment;
可选的,当指示剂是微生物指示剂时,产品状态信息是产品贮存中是否被细菌污染。Optionally, when the indicator is a microbial indicator, the product status information is whether the product is contaminated with bacteria in storage.
本发明的有益效果:Beneficial effects of the present invention:
本发明涉及一种智能指示性二维码,利用可变色指示剂印刷到二维码上,指示剂在外界环境的变化后可以发生颜色变化,根据变化的颜色能反映出产品质量状态,实现监测运输贮藏过程中产品质量状态的功能,克服了传统条码仅能记录固定信息的缺点,丰富了二维码的功能,提高了二维码的智能性。The invention relates to an intelligent indicative two-dimensional code, which is printed on the two-dimensional code by using a color-changing indicator, the indicator can change in color after the change of the external environment, and the quality state of the product can be reflected according to the changed color, so as to realize monitoring The function of product quality status in the process of transportation and storage overcomes the shortcomings of traditional barcodes that can only record fixed information, enriches the functions of two-dimensional codes, and improves the intelligence of two-dimensional codes.
附图说明Description of drawings
图1为本发明的智能指示二维码的结构分解示意图;Fig. 1 is the structural decomposition schematic diagram of the intelligent indication two-dimensional code of the present invention;
图2为本发明的智能指示二维码数据层的示意图之一;Fig. 2 is one of the schematic diagrams of the data layer of the intelligent indication two-dimensional code of the present invention;
图3为本发明的智能指示二维码数据层的示意图之二;Fig. 3 is the second schematic diagram of the data layer of the intelligent indication two-dimensional code of the present invention;
图4为本发明的智能指示二维码的指示图像示意图2;4 is a schematic diagram 2 of an indication image of an intelligent indication two-dimensional code of the present invention;
图中:101-第一保护层、102-数据层、103-第二保护层、104-透气微孔、201-位置探测图形、201a-第一位置探测图形、201b-第二位置探测图形、201c-第三位置探测图形、202-数据信息图形、203-格式信息图形、204-位置探测图形分割符、205-指示信息图形、205a-第一数据块、205b-第二数据块。In the figure: 101-first protective layer, 102-data layer, 103-second protective layer, 104-breathable micropores, 201-position detection pattern, 201a-first position detection pattern, 201b-second position detection pattern, 201c-third position detection graphic, 202-data information graphic, 203-format information graphic, 204-position detection graphic separator, 205-indication information graphic, 205a-first data block, 205b-second data block.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,以下结合具体实施例,并参照附图,对本发明进一步详细说明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings.
实施例1:Example 1:
本发明提出的一种智能指示二维码的结构如图1所示,所述智能指示二维码结构自下而上包括第一保护层101、数据层102、第二保护层103。The structure of an intelligent indication two-dimensional code proposed by the present invention is shown in FIG.
所述的第一保护层101和第二保护层103为厚度在20-25微米之间的透明塑料膜,材料可以是尼龙塑料膜、聚酯塑料膜或邻苯基苯酚塑料膜。保护层的使用温度范围很大、尺寸稳定性好、耐腐蚀、无毒,起到保护数据层102不受物理磨损或者划痕等作用;保护层为透明的,以便于终端获取数据层上的二维码图像。The first
所述数据层102为白色纸张或聚酯无纺布等无孔透气材料,二维码印刷在数据层102上面,二维码包括位置探测图形201、数据信息图形202、指示信息图形205、格式信息图形203和位置探测图形分割符204,指示信息图形205上印刷有能与外界环境发生反应的指示剂,指示信息图形205的位置对应的上层保护层和下层保护层均匀分布有孔径在0.3-1毫米的透气微孔104,便于指示剂与外界接触。The
实施例2:Example 2:
为了对指示性二维码的结构进行更详细的示意,下述实施例以具有版本1的二维码为例进行说明。In order to illustrate the structure of the indicative two-dimensional code in more detail, the following embodiments are described by taking a two-dimensional code with version 1 as an example.
本发明实施例提供的二维码数据层的结构示意图,如图2、3所示。该二维码为21×21个码元的二维码,包括位置探测图形201、数据信息图形202、指示信息图形205、格式信息图形203和位置探测图形分割符204。A schematic structural diagram of a two-dimensional code data layer provided by an embodiment of the present invention is shown in FIGS. 2 and 3 . The two-dimensional code is a two-dimensional code with 21×21 symbols, including a position detection graphic 201 , a data information graphic 202 , an instruction information graphic 205 , a format information graphic 203 and a position detection
(1)位置探测图形201包括第一位置探测图形201a、第二位置探测图形201b和第三位置探测图形201c,分别分布在二维码的左上角、右上角和左下角。(1) The location detection pattern 201 includes a first
(2)数据信息图形202占24个数据块。数据信息图形202用于携带二进制数据,二进制数据中记录有产品的产地信息、生产信息和指示种类信息;(2) The data information graphic 202 occupies 24 data blocks. The data information graphic 202 is used to carry binary data, and the binary data records the origin information, production information and indication type information of the product;
(3)指示信息图形205占2个数据块,2个数据块相邻且位于二维码中间位置,其中第一数据块205a涂有指示剂,指示剂可以是时间-温度指示剂、湿度指示剂、pH值指示剂、氧气指示剂或微生物指示剂的一种,每一种指示剂能根据对应环境条件变化显示出不同的颜色;第二数据块205b印刷有与第一数据块205a对应指示剂的标准颜色,标准颜色为指示剂在不同变化阶段颜色的组合,如图4中205b1、205b2、205b3和205b4所示,为指示剂变色范围内的中间颜色,标准颜色的功能是消除因环境光线引起的颜色误差和对指示剂变化等级进行匹配。(3) The indication information graphic 205 occupies 2 data blocks, and the 2 data blocks are adjacent and located in the middle of the two-dimensional code, wherein the
时间-温度指示剂可以为淀粉和淀粉酶混合物,随着时间推移,其颜色可由白色变为蓝色;The time-temperature indicator can be a mixture of starch and amylase that changes color from white to blue over time;
湿度指示剂可以为,用三价铁或二价铁盐浸渍的混合物,随着湿度增加,其颜色可由黄色/琥珀色变到几乎无色;The humidity indicator can be a mixture impregnated with ferric or ferrous salts, the color of which changes from yellow/amber to almost colorless with increasing humidity;
pH值指示剂可以为紫薯花青素,随着pH值从酸性转为碱性,其颜色可由红色变为蓝色;The pH indicator can be purple potato anthocyanin, and its color can change from red to blue as the pH changes from acidic to alkaline;
氧气指示剂可以为,邻菲罗啉-Fe(II),其本身为淡蓝色,接触氧气后变为红色;The oxygen indicator can be, o-phenanthroline-Fe(II), which itself is light blue and turns red after contact with oxygen;
微生物指示剂可以为,为EZTest@环氧乙烯,在无菌的时候颜色为红色,在存在微生物的时,显色为黄色;The microbial indicator can be EZTest@ethylene oxide, the color is red when sterile, and the color is yellow when microorganisms are present;
(4)格式信息图形203如图2中的斜线阴影部分所示,用于指示数据在编码时的格式信息和版本大小信息,二维码的格式信息存储二维码的纠错级别,本实施例中的二维码采用M级别的纠错码字;(4) The format information graphic 203 is shown in the shaded part of the oblique line in FIG. 2, and is used to indicate the format information and version size information of the data during encoding. The format information of the two-dimensional code stores the error correction level of the two-dimensional code. The two-dimensional code in the embodiment adopts the error correction code word of M level;
(5)位置探测图形分割符204用于将位置探测图形201与格式信息图形203分隔,或将位置探测图形201与数据信息图形202分隔。(5) The position detection
实施例3:识别方法Example 3: Identification method
该二维码的识别方法,包括:The identification method of the QR code includes:
步骤1,获取二维码的图像;Step 1, obtain the image of the two-dimensional code;
智能终端获取包含二维码的图像的具体方法包括将包含二维码的图像放入识别框内、或者从相册中选取包含二维码的图像、或者长按包含二维码的图像。The specific method for acquiring the image containing the two-dimensional code by the smart terminal includes placing the image containing the two-dimensional code in the identification frame, or selecting the image containing the two-dimensional code from the album, or long pressing the image containing the two-dimensional code.
步骤2,在二维码中识别出3个位置探测图形;Step 2, identify 3 position detection patterns in the two-dimensional code;
智能终端在图像中从上到下进行逐行扫描。The intelligent terminal scans the image progressively from top to bottom.
位置探测图形为黑白相间的“回”形图案,扫描时黑白码元的比例为1:1:1:3:1:1,在扫描二维码的过程中,先基于该固定比例搜寻二维码的定位图案,当图像中的所有行均扫描完毕后,得到n个候选的位置探测图形。The position detection pattern is a black and white "return" pattern, and the ratio of black and white code elements during scanning is 1:1:1:3:1:1. In the process of scanning the two-dimensional code, first search for two-dimensional The positioning pattern of the code, when all the lines in the image are scanned, n candidate position detection patterns are obtained.
智能终端将每三个候选的位置探测图形的中心进行连线得到对应的三角形;确定与等腰直角三角形的相似度最高且最长边最长的三角形;从与三角形对应的三个候选的位置探测图形中,确定出位于左上角的第一位置探测图形、位于右上角第二位置探测图形和位于左下角第三位置探测图形。利用3个位置探测图形能够对二维码在图像的位置进行定位。The intelligent terminal connects the centers of each of the three candidate position detection patterns to obtain the corresponding triangle; determines the triangle with the highest similarity to the isosceles right triangle and the longest side; from the three candidate positions corresponding to the triangle In the detection pattern, a first position detection pattern in the upper left corner, a second position detection pattern in the upper right corner and a third position detection pattern in the lower left corner are determined. The position of the two-dimensional code in the image can be located by using three position detection patterns.
步骤3,读取二维码格式信息图形中的格式信息和版本信息;Step 3, read the format information and version information in the two-dimensional code format information graphics;
当正方形模块阵列为21×21个码元的正方形模块阵列时,对应的编码格式信息确定数据信息图形。When the square module array is a square module array of 21×21 symbols, the corresponding coding format information determines the data information pattern.
从格式信息中获取纠错码字对应的纠错级别,纠错级别包括L纠错级别、M纠错级别、Q纠错级别和H纠错级别;Obtain the error correction level corresponding to the error correction codeword from the format information, and the error correction level includes L error correction level, M error correction level, Q error correction level and H error correction level;
步骤4,从数据信息图形的数据块中解码出数据码字,得到指示剂的种类信息、产品产地信息、产品生产信息;Step 4, decode the data code word from the data block of the data information graphic to obtain the type information of the indicator, the product origin information, and the product production information;
可选的,当二维码对应的正方形模块阵列有残缺部分、正方形模块阵列中存在干扰信息时,使用所述纠错码字对数据进行纠错。Optionally, when the square module array corresponding to the two-dimensional code has a defective part and interference information exists in the square module array, the error correction codeword is used to correct the data error.
需要说明的是,本发明纠错码字可以纠正两种类型的错误,拒读错误和替代错误。其中,拒读错误是指在错误数据的位置已知的情况下,一个没扫描到或无法译码的数据;替代错误是在错误数据的位置未知的情况下,错误译码的数据。例如,当一个缺陷使深色模块变成浅色模块、或将浅色模块变成深色模块时,即将数据错误地译码为表面上有效、但却是另一个不同的数据时,这种数据替代错误需要两个纠错码字来纠正。It should be noted that the error correction codeword of the present invention can correct two types of errors, refusal to read errors and substitution errors. The refusal to read error refers to a piece of data that is not scanned or cannot be decoded when the location of the erroneous data is known; the substitution error is the data that is erroneously decoded when the location of the erroneous data is unknown. For example, when a defect turns a dark module into a light module, or a light module into a dark module, i.e. incorrectly decodes data as apparently valid, but is another different data. Data substitution errors require two error correction codewords to correct.
步骤5,获取指示信息图形的指示剂和标准颜色的图形位置;Step 5, obtaining the graphic position of the indicator indicating the information graphic and the standard color;
为了得到二维码中指示信息图形的指示剂和标准颜色的位置,先将图像转化为灰度值为32的灰度值图像。利用中值滤波的5×5模板对灰度值图像进行去除噪声,用于增强图像效果利于后期处理;再通过Sober算子检测图像的边缘,得到指示信息图像的边缘,接着借助轮廓提取算法检测出指示信息图形的指示剂和标准颜色的轮廓;最后用自适应阈值选取法分割出指示剂和标准颜色的图形位置。In order to obtain the position of the indicator and standard color indicating the information graphic in the two-dimensional code, the image is first converted into a gray value image with a gray value of 32. Use the median filtered 5×5 template to remove noise from the gray value image, which is used to enhance the image effect and facilitate post-processing; then use the Sober operator to detect the edge of the image to obtain the edge of the indication information image, and then use the contour extraction algorithm to detect The outline of the indicator and standard color indicating the information graphic is obtained; finally, the graphic position of the indicator and the standard color is segmented by the adaptive threshold selection method.
步骤6,校正指示剂图形信息Step 6, Correction of indicator graphic information
从步骤5分割出的指示剂和标准颜色图形中分别提取各像素的R、G、B值,利用具有在线校正的多项式回归法对每个区域的颜色进行校正。本发明采用多项式回归法能够使得存储空间少、计算速度快、并且容易实现,下面介绍基于多元线性回归的颜色校正过程:The R, G, and B values of each pixel are extracted from the indicator and standard color graphs segmented in step 5, respectively, and the color of each area is corrected by the polynomial regression method with online correction. The present invention adopts the polynomial regression method to make the storage space less, the calculation speed fast, and easy to implement. The following describes the color correction process based on multiple linear regression:
标准颜色图像上共有4个色块,第i个色块的颜色R、G、B值在标准空间下为Roi、Goi、Boi,其中i=1,2,3,4,在自然光照环境下采集到标准颜色图像上颜色R、G、B值,则:There are 4 color blocks on the standard color image, and the color R, G, and B values of the ith color block are Roi , Goi , Boi in the standard space, where i=1, 2, 3, 4, in natural If the color R, G, and B values of the standard color image are collected under the lighting environment, then:
式(1)的矩阵形式为:The matrix form of formula (1) is:
X=AT*V (2)X=A T *V (2)
其中:X是维数为3×i的色标标准R、G、B值矩阵;Where: X is the color scale standard R, G, B value matrix with dimension 3×i;
A是维数为j×3的转换系数矩阵;A is a conversion coefficient matrix of dimension j × 3;
V是维数为j×i的多项式回归矩阵;V is a polynomial regression matrix of dimension j×i;
其中,vji(j=1,…,J)由多项式构成,有多种不同的多项式形式,例如,vji=[R,G,B,1],vji=[R,G,B,RG,RB,GB,1],vji=[R,G,B,RGB,1]等,vji的形式可以根据需要来组合成不同的形式。Among them, v ji (j=1,...,J) consists of polynomials, there are many different polynomial forms, for example, v ji =[R,G,B,1], v ji =[R,G,B, RG, RB, GB, 1], v ji = [R, G, B, RGB, 1], etc. The form of v ji can be combined into different forms as required.
矩阵A利用最小二乘法优化得到,A即为所求的模型参数。The matrix A is optimized by the least square method, and A is the required model parameter.
A=(V×VT)-1(V×XT) (3)A=(V×V T ) -1 (V×X T ) (3)
将A带入式(2)中,即可计算出校正后图像的各像素的R、G、B值,实现在线的彩色校正。Bringing A into formula (2), the R, G, and B values of each pixel of the corrected image can be calculated to realize online color correction.
Xout=AT×Vin (4)X out = A T ×V in (4)
其中,Xout是校正后图像的R、G、B矩阵,维数为3×M;Vin是由原始图像所有像素的R、G、B值对应的多项式的项所构成的矩阵,维数为j×M;M为原始图像的像素总数。Among them, X out is the R, G, B matrix of the corrected image, and the dimension is 3×M; V in is the matrix formed by the terms of the polynomial corresponding to the R, G, and B values of all pixels of the original image, and the dimension is is j×M; M is the total number of pixels of the original image.
步骤7:匹配指示剂颜色等级Step 7: Match Indicator Color Grades
将校正的指示剂R、G、B值带入预先建立好的人工神经网络模型识别出指示剂的颜色等级。Bring the corrected R, G, B values of the indicator into the pre-established artificial neural network model to identify the color grade of the indicator.
本实施例采用人工神经网络建模匹配出指示剂的颜色等级,具有三层结构,分别为输入层、隐含层和输出层,每层有多个神经元,每层的神经元通过激发函数关联,采用的激发函数包括阶跃函数hardlim(x)、线性转移函数purelin(x)、对数S型函数logsig(x)和正切S型函数tansig(x)。This embodiment uses artificial neural network modeling to match the color grade of the indicator, which has a three-layer structure, namely the input layer, the hidden layer and the output layer, each layer has multiple neurons, and the neurons in each layer pass the excitation function. For correlation, the excitation functions used include step function hardlim(x), linear transfer function purelin(x), logarithmic sigmoid function logsig(x) and tangent sigmoid function tansig(x).
建立人工神经网络的颜色等级识别模型,过程如下:To establish a color grade recognition model of artificial neural network, the process is as follows:
(1)输入层神经元个数为3个,对应指示剂校正后的R、G、B值,隐含层为8个神经元,输出层为4个神经元,对应4个颜色等级;(1) The number of neurons in the input layer is 3, corresponding to the R, G, and B values corrected by the indicator, the hidden layer is 8 neurons, and the output layer is 4 neurons, corresponding to 4 color levels;
(2)输入矩阵归一化处理,使数据分布在[-1,1]区间上;(2) The input matrix is normalized so that the data is distributed in the [-1,1] interval;
(3)隐含层传递函数为tansig(),输出层传递函数为logsig(),训练函数为trainlm();最大训练次数为1000,训练精度为0.01。(3) The transfer function of the hidden layer is tansig(), the transfer function of the output layer is logsig(), and the training function is trainlm(); the maximum number of training times is 1000, and the training accuracy is 0.01.
在识别二维码的过程中,把校正的指示剂R、G、B值带入人工神经网络模型,即可识别出指示剂的颜色等级。In the process of identifying the two-dimensional code, the corrected indicator R, G, and B values are brought into the artificial neural network model, and the color grade of the indicator can be identified.
步骤8,向服务器发送指示剂的颜色等级信息,由服务器确定出产品状态信息;Step 8, send the color grade information of the indicator to the server, and the server determines the product status information;
利用终端向服务器发送指示剂的等级信息,服务器中存储有每种指示剂不同等级信息和产品状态信息之间的预设对应关系,指示剂种类信息和标定颜色信息是通过对产品状态信息进行哈希算法进行计算得到的信息。The terminal is used to send the level information of the indicator to the server, and the server stores the preset correspondence between the different level information of each indicator and the product status information. information obtained by the algorithm.
步骤9,服务器向终端反馈产品状态信息。Step 9, the server feeds back product status information to the terminal.
可选的,当指示剂是时间-温度指示剂时,产品状态信息是产品贮存的时间;Optionally, when the indicator is a time-temperature indicator, the product status information is the storage time of the product;
可选的,当指示剂是湿度指示剂时,产品状态信息是产品贮存环境的水分含量;Optionally, when the indicator is a humidity indicator, the product status information is the moisture content of the product storage environment;
可选的,当指示剂是pH值指示剂时,产品状态信息是产品贮存环境的pH值;Optionally, when the indicator is a pH indicator, the product status information is the pH value of the product storage environment;
可选的,当指示剂是氧气指示剂时,产品状态信息是产品贮存环境是否含氧气;Optionally, when the indicator is an oxygen indicator, the product status information is whether the product storage environment contains oxygen;
可选的,当指示剂是微生物指示剂时,产品状态信息是产品贮存中是否被细菌污染;Optionally, when the indicator is a microbial indicator, the product status information is whether the product is contaminated with bacteria in storage;
进一步的,当二维码的指示信息图像中有多种指示剂时,产品状态信息显示多种指示剂对应的产品状态信息;Further, when there are multiple indicators in the instruction information image of the two-dimensional code, the product status information displays the product status information corresponding to the multiple indicators;
实施例4:Example 4:
智能指示二维码使用时,装在包装盒内部,包装盒顶侧有一个与智能指示二维码尺寸相同的透明窗口,智能指示二维码粘贴在包装盒透明窗口的内表面,数据层102朝外,用终端通过透明窗口扫描智能指示二维码,然后获取产品的状态信息。When the smart indicator QR code is used, it is installed inside the packaging box. There is a transparent window on the top side of the packaging box with the same size as the smart indicator QR code. The smart indicator QR code is pasted on the inner surface of the transparent window of the packaging box. The
上文所列出的一系列的详细说明仅仅是针对本发明的可行性实施方式的具体说明,它们并非用以限制本发明的保护范围,凡未脱离本发明技艺精神所作的等效实施方式或变更均应包含在本发明的保护范围之内。The series of detailed descriptions listed above are only specific descriptions for the feasible embodiments of the present invention, and they are not used to limit the protection scope of the present invention. Changes should all be included within the protection scope of the present invention.
Claims (3)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810627082.0A CN108805246B (en) | 2018-06-19 | 2018-06-19 | Intelligent indication two-dimensional code and method for monitoring food state by using same |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810627082.0A CN108805246B (en) | 2018-06-19 | 2018-06-19 | Intelligent indication two-dimensional code and method for monitoring food state by using same |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN108805246A CN108805246A (en) | 2018-11-13 |
| CN108805246B true CN108805246B (en) | 2020-08-07 |
Family
ID=64083302
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810627082.0A Active CN108805246B (en) | 2018-06-19 | 2018-06-19 | Intelligent indication two-dimensional code and method for monitoring food state by using same |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108805246B (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109948765A (en) * | 2019-02-26 | 2019-06-28 | 江苏大学 | Preparation and application of a traceable three-dimensional code for crab freshness classification |
| CN118607566A (en) * | 2019-10-09 | 2024-09-06 | 陈浩能 | Coding indicator label, accurate identification method and intelligent processing system |
| CN111046996B (en) * | 2019-11-27 | 2023-08-04 | 湖南省科腾信安智能科技有限公司 | Color QR code generation and identification method |
| US12320754B2 (en) * | 2020-03-03 | 2025-06-03 | University Of Florida Research Foundation, Inc. | Devices and methods for detecting or monitoring the quality of food products |
| JP7358284B2 (en) * | 2020-03-25 | 2023-10-10 | 株式会社日立製作所 | Code, information processing system, and information processing device |
| CN112560531A (en) * | 2020-12-14 | 2021-03-26 | 国网上海市电力公司 | Two-dimensional code intelligent analysis application method based on big data |
| CN118430731A (en) * | 2024-05-27 | 2024-08-02 | 湖南首辰健康科技有限公司 | Treatment time node quality control method, device, equipment and storage medium |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102137272A (en) * | 2011-03-21 | 2011-07-27 | 西安理工大学 | Method for calibrating colors of multiple cameras in open environment |
| CN103177251A (en) * | 2013-02-21 | 2013-06-26 | 南京金东康信息系统有限公司 | Automatic QR (quick response) code positioning and orientating method |
| CN103238161A (en) * | 2010-10-06 | 2013-08-07 | 韩国食品研究院 | Method and system for monitoring quality of food |
| CN103514459A (en) * | 2013-10-11 | 2014-01-15 | 中国科学院合肥物质科学研究院 | Method and system for identifying crop diseases and pests based on Android mobile phone platform |
| CN205230089U (en) * | 2015-10-23 | 2016-05-11 | 西安新桂系信息技术有限公司 | Temperature sensing two -dimensional code antifalsification label |
| CN105651386A (en) * | 2016-03-04 | 2016-06-08 | 温州佳易仪器有限公司 | Method for carrying out color testing on standard light source color assessment inspection box |
| CN106372699A (en) * | 2016-08-18 | 2017-02-01 | 腾讯科技(深圳)有限公司 | Object with two-dimensional code, a generation method and device of two-dimensional code and recognition method and device of two-dimensional code |
| CN106408048A (en) * | 2016-09-06 | 2017-02-15 | 上海理工大学 | Novel smart label and monitoring method applied to cold chain monitoring |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150186764A1 (en) * | 2014-01-02 | 2015-07-02 | Caterpillar Inc. | Machine-readable codes |
-
2018
- 2018-06-19 CN CN201810627082.0A patent/CN108805246B/en active Active
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103238161A (en) * | 2010-10-06 | 2013-08-07 | 韩国食品研究院 | Method and system for monitoring quality of food |
| CN102137272A (en) * | 2011-03-21 | 2011-07-27 | 西安理工大学 | Method for calibrating colors of multiple cameras in open environment |
| CN103177251A (en) * | 2013-02-21 | 2013-06-26 | 南京金东康信息系统有限公司 | Automatic QR (quick response) code positioning and orientating method |
| CN103514459A (en) * | 2013-10-11 | 2014-01-15 | 中国科学院合肥物质科学研究院 | Method and system for identifying crop diseases and pests based on Android mobile phone platform |
| CN205230089U (en) * | 2015-10-23 | 2016-05-11 | 西安新桂系信息技术有限公司 | Temperature sensing two -dimensional code antifalsification label |
| CN105651386A (en) * | 2016-03-04 | 2016-06-08 | 温州佳易仪器有限公司 | Method for carrying out color testing on standard light source color assessment inspection box |
| CN106372699A (en) * | 2016-08-18 | 2017-02-01 | 腾讯科技(深圳)有限公司 | Object with two-dimensional code, a generation method and device of two-dimensional code and recognition method and device of two-dimensional code |
| CN106408048A (en) * | 2016-09-06 | 2017-02-15 | 上海理工大学 | Novel smart label and monitoring method applied to cold chain monitoring |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108805246A (en) | 2018-11-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108805246B (en) | Intelligent indication two-dimensional code and method for monitoring food state by using same | |
| CN108615065B (en) | A method of intelligence indicates three-dimension code and its monitors to food quality | |
| CN107617573B (en) | Logistics code identification and sorting method based on multitask deep learning | |
| TW318916B (en) | ||
| US11030475B2 (en) | Photo analytics calibration | |
| CN202296071U (en) | Automatic information acquisition, identification and code-sticking system for tobacco material box | |
| CN101751591B (en) | High-capacity two-dimensional barcode and reader that can recording voice message | |
| WO2021068697A1 (en) | Coding indication label, precise recognition method, and intelligent processing system | |
| CN103617441A (en) | Generating system and pattern recognition method of seal based on two-dimension code | |
| CN110146506A (en) | A kind of polarizer automatic optical checking machine detection specification accuracy method of adjustment | |
| JP6728592B2 (en) | Colony detection system, colony detection method, and program | |
| CN109002876A (en) | A kind of two-dimension code label and two-dimension code label printing process | |
| CN116362774A (en) | A traceability system and method for aquatic products | |
| CN114996500B (en) | Trademark graph retrieval method | |
| CN114495127A (en) | Commodity information processing method, apparatus, device and medium based on RPA and AI | |
| CN204759466U (en) | Dual anti -fake two -dimension code label | |
| CN120125248A (en) | A visual tracking system and visual tracking method for agricultural products | |
| CN119443997A (en) | A digital management system for logistics services | |
| CN110222548A (en) | A kind of digital picture detection knowledge method for distinguishing | |
| CN114743082A (en) | Cigarette finished product cigarette box characteristic identification method based on machine vision | |
| CN107069126A (en) | A kind of battery quality management system | |
| EP4571573A1 (en) | A smart indicator label, a method of fabrication thereof, and a memory medium or device with a code data record for the method | |
| CN109815764A (en) | The read method and system of machine sensible information inside image | |
| CN116189173A (en) | A seawater pearl texture recognition method based on big data | |
| CN107729789A (en) | A kind of express delivery list based on Cultural Differences color makes and bar code positioning identifying method |
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 |




