A method and system for tracing agricultural product quality based on the Internet of Things
By pasting QR code tags on agricultural products, collecting and comparing the image characteristics of agricultural products, the problem of low quality inspection efficiency in the existing technology is solved, and fast and accurate quality inspection is achieved.
Patent Information
- Application Number
- CN202010633796.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-02
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2040-07-02
AI Technical Summary
It is difficult for the existing technology to efficiently detect the quality of agricultural products, especially during transportation, which is prone to deformity and deterioration. The existing methods mainly rely on human eye recognition and are inefficient.
Using the Internet of Things-based agricultural product quality traceability method and system, by pasting QR code tags on agricultural products, collecting global static images of agricultural products, extracting outline features and 3D change characteristics, comparing them with the original images stored in the database, and judging agricultural products quality.
It realizes the quality of agricultural products quickly and accurately, improves detection efficiency and accuracy, avoids the subjectivity of human eye recognition, and can effectively identify the authenticity and quality of agricultural products.
Smart Images

Figure CN111861158B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to agricultural product quality detection technology, in particular to an agricultural product quality tracing method and system based on the Internet of Things. Background Art
[0002] During the transportation process from the production area to the sales end, agricultural products are often easily deformed and spoiled due to squeezing, improper storage, etc. The existing technology uses human eyes to identify whether agricultural products have spoiled, which is inefficient. Summary of the invention
[0003] The main purpose of the present invention is to overcome the deficiencies of the prior art and disclose a method and system for tracing the quality of agricultural products based on the Internet of Things;
[0004] To achieve the above purpose, the agricultural product quality traceability method based on the Internet of Things of the present invention is characterized by comprising the following steps:
[0005] Image acquisition and recognition of QR code labels on agricultural products;
[0006] Query the agricultural product information associated with the QR code;
[0007] Focusing on the QR code labels on agricultural products, global static images of agricultural products with QR code labels are collected;
[0008] Extract the contour features of agricultural products and the 3D change features of the transition from the QR code label to the contour of the agricultural products;
[0009] Comparing the outline features and the 3D change features with the original global static image stored in the database;
[0010] Determine the authenticity or quality of agricultural products based on the comparison results;
[0011] Furthermore, the method further comprises preprocessing the global static image of the agricultural product to form a line drawing having an external contour and a plurality of three-dimensional lines indicating the 3D shape of the agricultural product; extracting the 3D change feature of the transition from the two-dimensional code label to the contour of the agricultural product by extracting the line feature indicating the 3D shape of the agricultural product extending from the two-dimensional code label to the external contour;
[0012] Furthermore, the method further includes comparing the contour features extracted from the global static image of the agricultural product with the contour features of the original global static image stored in the database to obtain a first similarity; comparing the 3D change features extracted from the global static image of the agricultural product with the 3D change features of the original global static image stored in the database to obtain a second similarity; and determining whether the first similarity and the second similarity exceed preset thresholds respectively;
[0013] Furthermore, the method further includes comparing the contour features extracted from the global static image of the agricultural product with the contour features of the original global static image stored in the database to obtain a first similarity; comparing the 3D change features extracted from the global static image of the agricultural product with the 3D change features of the original global static image stored in the database to obtain a second similarity; calculating a comprehensive similarity based on the first similarity and the second similarity, and determining whether the comprehensive similarity exceeds a preset threshold;
[0014] The present invention also provides an agricultural product quality traceability system based on the Internet of Things, which is characterized by:
[0015] The information recognition module is used to scan the QR code attached to the agricultural products to obtain the ID of the QR code, focus on the QR code label on the agricultural products, and collect the global static image of the agricultural products containing the QR code label;
[0016] The quality detection module is used to extract the contour features of the agricultural products and the 3D change features of the transition from the QR code label to the contour of the agricultural products based on the global static image of the agricultural products; compare the contour features and the 3D change features with the original global static image stored in the database; and judge the authenticity or quality of the agricultural products based on the comparison results;
[0017] Furthermore, it also includes an assembly line module, which is used to transfer the agricultural products one by one to the workstation corresponding to the information identification module. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the structures shown in these drawings without creative work.
[0019] Figure 1 One of the main flow charts for agricultural product information collection in a preferred implementation scheme;
[0020] Figure 2 This is the second main flow chart of agricultural product information collection in a preferred implementation scheme;
[0021] Figure 3 It is a schematic diagram of the contour characteristics of agricultural products;
[0022] Figure 4 It is a schematic diagram of a global static image of agricultural products containing a QR code label;
[0023] Figure 5 This is the structural diagram of the agricultural product information collection system based on the Internet of Things;
[0024] Figure 6 It is a basic structural block diagram of an agricultural product quality traceability system based on the Internet of Things in a preferred implementation scheme;
[0025] Figure 7 It is a main flow chart of a method for tracing the quality of agricultural products based on the Internet of Things in a preferred implementation scheme;
[0026] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention;
[0028] In addition, when only necessary solutions to solve technical problems are described in the present invention, although the well-known technical means are not described below, it does not mean that they do not exist in the technical solution, and it should not be a reason for insufficient disclosure. The first and second descriptions such as the first user and the second user below do not refer to the order or sequence, but are only for the convenience of describing the technical solution and facilitating understanding;
[0029] refer to Figures 1 to 5 , which is a scheme of agricultural product information collection method and system based on Internet of Things invented in another case;
[0030] refer to Figure 5 , is a block diagram of the agricultural product information collection system based on the Internet of Things in a preferred embodiment. The agricultural product information collection system based on the Internet of Things has:
[0031] The labeling module is used to attach a QR code to agricultural products or to put a QR code label on agricultural products. ;
[0032] An assembly line module, used for assembly line transmission of agricultural products, in particular, for sequentially transmitting agricultural products from the labeling module, the image recognition module, the weighing module and the preset information adding module;
[0033] An image recognition module, which collects images of agricultural products passing through an image collection station;
[0034] Specifically, the image recognition module identifies the QR code label and obtains the information of the QR code label. If there is no QR code label or the QR code information cannot be identified, it is transmitted to the manual processing area through the pipeline module;
[0035] If the QR code label is identified and the information of the QR code label is obtained successfully, the second image acquisition and image recognition of the agricultural product are performed, and the recognition content includes shape recognition and color. Preferably, the second image acquisition and recognition is based on the QR code label as the reference focus, and automatic focusing and static image acquisition are performed; during the recognition process, the contour features of the agricultural product and the 3D change features of the transition from the QR code label to the contour of the agricultural product are extracted according to the collected static image, and then the contour features and 3D change features are searched and matched with the feature templates stored in the database. When the similarity exceeds the preset threshold, the matching result is output. According to the image recognition results of the agricultural product and in combination with the database, the type of agricultural product with the highest similarity is matched from the database according to the image recognition results, and the type of the agricultural product is judged and determined. Such as apples, potatoes, lettuce, etc. Preferably, the type of agricultural product can include color descriptions, such as red apples, green apples, etc. The static image collected in this way can not only record a clear QR code label image, focus quickly, and improve the efficiency and accuracy of contour feature extraction, but also use the 3D change feature of the transition from the QR code label to the contour of the agricultural product as the basis for search and matching, so that the recognition process adds the QR code label as the focus, which can improve the accuracy and efficiency of image acquisition and recognition of agricultural products. Preferably, the static image collected by the second image of the agricultural product is preprocessed to form a line drawing with an external contour and a number of three-dimensional lines indicating the 3D shape of the agricultural product. When extracting features, the 3D change feature of the transition from the QR code label to the contour of the agricultural product refers to extracting the line features extending from the QR code label to the external contour to indicate the 3D shape of the agricultural product;
[0036] The information on the QR code label is associated with the type of agricultural product identified and confirmed, as well as the image of the agricultural product acquired in the second image acquisition. Later, by reading the QR code information of the agricultural product, the type of agricultural product and the original image can be automatically queried, providing basic data for information query and quality image comparison detection;
[0037] The weighing module is used to automatically measure the weight of the agricultural products passing through. Preferably, the weighing module is located at the subsequent station of the image recognition module. After the weighing module determines the weight information of the agricultural products, it associates the weight information of the agricultural products with the QR code label information collected by the image recognition module, so that the weight can be known by reading the QR code label information later. Preferably, in addition to the weight information, information such as date and time can also be added, which is also associated with the QR code label information;
[0038] The preset information adding module is used to generate new information according to preset information or preset rules, and associate them with the QR code label information collected by the image recognition module. For example: based on the preset unit price information and pricing rules of the agricultural product, combined with the weight of the agricultural product obtained by the weighing module, the price of the agricultural product is generated, and associated with the QR code label information collected by the image recognition module, so that all related information including the price of the agricultural product can be queried by scanning the code later. Or according to the shelf life calculation rules, the expiration date of the agricultural product is generated, and it is also associated with the QR code label information collected by the image recognition module. In addition, information such as place of origin and manufacturer can be automatically added and associated, so that the complete information collection and entry of agricultural products is finally completed;
[0039] The manual processing module is used to collect manual information of agricultural and sideline products that are transferred to the manual processing area through the assembly line module. It includes the manual processing area. The objects to be processed include: unsuccessful labeling, the image recognition module cannot recognize the QR code information, the second image collection of agricultural products or unsuccessful image recognition, and the manual collection of information of agricultural products weighed and recognized by the weighing module and manual input in the background;
[0040] refer to Figures 1 to 4 ,The agricultural product information collection methods based on the Internet of Things include:
[0041] S01, labeling the agricultural products. This includes affixing a QR code or putting a QR code label on the agricultural products. Preferably, the labeling station is set at the front end or the first station of the assembly line;
[0042] S02, image acquisition and recognition of the QR code label on the agricultural product. Identify the QR code label and obtain the information of the QR code label, such as ID. If there is no QR code label or the QR code information cannot be recognized, it is transmitted to the manual processing area corresponding to the manual processing module through the pipeline module;
[0043] If the QR code label is identified and the information of the QR code label is obtained successfully, the second image acquisition is performed and the image of the agricultural product is recognized;
[0044] S03, focusing on the QR code labels on agricultural products, collects global static images of products with QR code labels. Figure 3 ,The second image acquisition and recognition is based on the QR code label as the ,reference focus, for automatic focusing and static image acquisition;
[0045] S031, extract the contour features of agricultural products, and the 3D change features of the transition from the QR code label to the contour of the agricultural products. Figure 3 and Figure 4,The static image acquired by the second image acquisition of the agricultural product is preprocessed to form a line drawing with an external contour and a number of three-dimensional lines indicating the 3D shape of the agricultural product. When extracting features, the 3D change feature of the transition from the QR code label to the contour of the agricultural product refers to the line feature extending from the QR code label to the external contour to indicate the 3D shape of the agricultural product;
[0046] S032, searching and matching the feature templates stored in the database according to the outline features and 3D change features to determine the agricultural product information. Searching and matching the feature templates stored in the database according to the outline features and 3D change features. When the similarity exceeds a preset threshold, the matching result is output. According to the image recognition results of the agricultural products and in combination with the database, the type of agricultural products with the highest similarity is matched from the database according to the image recognition results, and the type of the agricultural products is judged and determined. Such as apples, potatoes, lettuce, etc. Preferably, the type of agricultural products can include color descriptions, such as red apples, green apples, etc.;
[0047] S033, the determined agricultural product information is associated with the ID of the QR code label. The information of the QR code label is associated with the type of agricultural product identified and confirmed, and the image of the agricultural product acquired by the second image acquisition. Later, by reading the QR code information of the agricultural product, the type of agricultural product and the original image can be automatically queried, providing basic data for information query and quality image comparison detection;
[0048] In this way, the static image collected in this way can not only record a clear QR code label image, quickly focus, and improve the efficiency and accuracy of contour feature extraction, but also use the 3D change feature of the transition from the QR code label to the contour of the agricultural product as the basis for search and matching, so that the recognition process adds the QR code label as the focus, which can improve the accuracy and efficiency of image acquisition and recognition of agricultural products. In agricultural products, adding the QR code as a positioning focus makes the image recognition of agricultural products have a universal image composition and features, further solving the problems of low recognition rate and low efficiency in image recognition of agricultural products due to the large variety and diverse shapes of agricultural products;
[0049] refer to Figure 2 In a preferred embodiment, the method for collecting agricultural product information based on the Internet of Things includes:
[0050] S04, automatically weigh and associate the weight information with the ID of the QR code tag. The weighing module is located at the subsequent station of the image recognition module. After the weighing module determines the weight information of the agricultural product, it associates the weight information of the agricultural product with the QR code tag information collected by the image recognition module, so that the weight can be known by reading the QR code tag information later. Preferably, in addition to the weight information, information such as date and time can also be added, which is also associated with the QR code tag information;
[0051] S05, add preset information and associate it with the ID of the QR code label, generate new information according to the preset information or according to preset rules, and associate them with the QR code label information collected by the image recognition module. For example: based on the preset unit price information and pricing rules of the agricultural product, combined with the weight of the agricultural product obtained by the weighing module, generate the price of the agricultural product and associate it with the QR code label information collected by the image recognition module, so that all related information including the price of the agricultural product can be queried by scanning the code later. Or according to the shelf life calculation rules, generate the expiration date of the agricultural product, and also associate it with the QR code label information collected by the image recognition module. In addition, information such as place of origin and manufacturer can be automatically added and associated, so that the complete information collection and entry of agricultural products can be completed;
[0052] In addition, it can also include manual processing steps, that is, the agricultural and sideline products transmitted to the manual processing area through the assembly line module are manually collected for information. The objects to be processed include: unsuccessful labeling, the image recognition module cannot recognize the QR code information, the second image collection of agricultural products or unsuccessful image recognition, and the manual collection of information of agricultural products identified by the weighing module and manual input in the background, thus forming a complete agricultural product automation information collection solution based on the Internet of Things;
[0053] refer to Figures 6 to 7 , which is a preferred implementation of the agricultural product quality tracing method and system based on the Internet of Things corresponding to the agricultural product information collection method and system based on the Internet of Things;
[0054] refer to Figure 6 ,The agricultural product quality traceability system based on the Internet of Things has an ,information recognition module for scanning the QR code attached to the agricultural products to obtain the ID of the QR code, and focusing on the QR code label on the agricultural products to ,collect the global static image of the agricultural products containing the QR code label; ,Specifically, in terms of hardware, the information recognition module integrates a QR code scanning gun and ,a camera for global static image acquisition of the agricultural products;
[0055] The quality detection module is used to extract the contour features of the agricultural products and the 3D change features of the transition from the QR code label to the contour of the agricultural products based on the global static image of the agricultural products; compare the contour features and the 3D change features with the original global static image stored in the database; and judge the authenticity or quality of the agricultural products based on the comparison results;
[0056] and an assembly line module, used to transfer the agricultural products one by one to the workstation corresponding to the information identification module;
[0057] refer to Figure 7 ,The agricultural product quality traceability method based on the Internet of Things includes the following core steps:
[0058] K01, scan and identify the QR code. Obtain the QR code ID of agricultural products. This can be achieved through the QR code scanner of the information identification module;
[0059] K02, query the agricultural product information associated with the QR code. According to the QR code ID, query the associated agricultural product information from the database, including weight, origin, type, etc., especially the original global static image of the agricultural product;
[0060] K03, focusing on the QR code labels on agricultural products, collects global static images of products with QR code labels. This can be achieved through the camera of the information recognition module;
[0061] K031, extracts the contour features of agricultural products and the 3D change features of the transition from the QR code label to the contour of the agricultural product;
[0062] K032, compare the contour features and 3D change features with the original global static image stored in the database. Specifically including: preprocessing the global static image of the agricultural product to form a line drawing with an external contour and a plurality of three-dimensional lines indicating the 3D shape of the agricultural product; extracting the line features extending from the QR code label to the external contour indicating the 3D shape of the agricultural product when extracting the 3D change features of the transition from the QR code label to the contour of the agricultural product. Compare the contour features extracted from the global static image of the agricultural product with the contour features of the original global static image stored in the database to obtain a first similarity; compare the 3D change features extracted from the global static image of the agricultural product with the 3D change features of the original global static image stored in the database to obtain a second similarity; determine whether the first similarity and the second similarity exceed preset thresholds respectively, or calculate a comprehensive similarity based on the first similarity and the second similarity, and determine whether the comprehensive similarity exceeds a preset threshold;
[0063] K033, judge the authenticity or quality of agricultural products based on the comparison results. If it exceeds the preset threshold, it means that the similarity is high and the agricultural products are authentic. And the agricultural products are not deformed and the quality is qualified. Otherwise, the agricultural products are deformed and the quality is unqualified;
[0064] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. All equivalent structural changes made using the contents of the present invention's specification and drawings, or directly / indirectly applied in other related technical fields, are included in the patent protection scope of the present invention.
Claims
1. A method for tracing the quality of agricultural products based on the Internet of Things, characterized by: The following steps are involved: Image acquisition and recognition of QR code labels on agricultural products; Query the agricultural product information associated with the QR code; Focusing on the QR code labels on agricultural products, global static images of agricultural products with QR code labels are collected; Extract the contour features of agricultural products and the 3D change features of the transition from the QR code label to the contour of the agricultural products; Comparing the contour features and the 3D change features with the original global static image stored in the database; comparing the contour features extracted from the global static image of the agricultural product with the contour features of the original global static image stored in the database to obtain a first similarity; comparing the 3D change features extracted from the global static image of the agricultural product with the 3D change features of the original global static image stored in the database to obtain a second similarity; judging whether the first similarity and the second similarity exceed preset thresholds respectively; Determine the authenticity or quality of agricultural products based on the comparison results.
2. The agricultural product quality tracing method based on the Internet of Things according to claim 1, characterized in that: The method also includes preprocessing the global static image of the agricultural product to form a line drawing with an external contour and a plurality of three-dimensional lines indicating the 3D shape of the agricultural product; when extracting the 3D change features of the transition from the two-dimensional code label to the contour of the agricultural product, the line features indicating the 3D shape of the agricultural product extending from the two-dimensional code label to the external contour are extracted.
3. The agricultural product quality tracing method based on the Internet of Things according to claim 2, characterized in that: The method also includes comparing contour features extracted from the global static image of the agricultural product with contour features of an original global static image stored in a database to obtain a first similarity; comparing 3D change features extracted from the global static image of the agricultural product with 3D change features of the original global static image stored in a database to obtain a second similarity; calculating a comprehensive similarity based on the first similarity and the second similarity, and determining whether the comprehensive similarity exceeds a preset threshold.
4. An agricultural product quality traceability system based on the Internet of Things, characterized by: include The information recognition module is used to scan the QR code attached to the agricultural products to obtain the ID of the QR code, focus on the QR code label on the agricultural products, and collect the global static image of the agricultural products containing the QR code label; The quality detection module is used to extract the contour features of the agricultural product and the 3D change features of the transition from the QR code label to the contour of the agricultural product based on the global static image of the agricultural product; compare the contour features and the 3D change features with the original global static image stored in the database; compare the contour features extracted from the global static image of the agricultural product with the contour features of the original global static image stored in the database to obtain a first similarity; compare the 3D change features extracted from the global static image of the agricultural product with the 3D change features of the original global static image stored in the database to obtain a second similarity; judge whether the first similarity and the second similarity exceed preset thresholds respectively; and judge the authenticity or quality of the agricultural product based on the comparison results.
5. The agricultural product quality traceability system based on the Internet of Things as claimed in claim 4, characterized in that: It also includes an assembly line module, which is used to transfer the agricultural products one by one to the workstation corresponding to the information identification module.
Citation Information
Patent Citations
Traceability system and traceability method for agricultural product based on cloud platform
CN104933584A
Self-service product fidelity and traceability device based on block chain technology
CN108269100A
Commodity traceability code generation and query method and device
CN110163629A
Product traceability system based on block chain
CN110874746A