Agricultural product supply chain information management system
By dividing the grayscale range of the image to be compressed into multiple intervals in the agricultural product supply chain information management system and setting the grayscale value of the pixel points, the problems of high compression rate and image quality loss are solved, and efficient image compression is achieved and feature reserved.
Patent Information
- Application Number
- CN202510025569.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to achieve high compression rate image compression in the agricultural product supply chain information management system while maintaining image quality.
By dividing the grayscale range of the image to be compressed into multiple grayscale intervals, setting the grayscale value of the pixel point to the median of the interval to which it belongs, obtaining the target image, and selecting the compression result according to the degree of feature retention.
Improve image compression rate while minimizing image texture features and reducing image quality loss.
Smart Images

Figure CN119450010A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video transmission technology and more specifically to an agricultural product supply chain information management system. Background Art
[0002] The agricultural product supply chain involves many links, including production, processing, packaging, transportation and sales. The operation of each link has an important impact on the quality and safety of the final product. Therefore, it is particularly important to establish an efficient information management system.
[0003] Among them, surveillance video provides an intuitive record of the production, processing and distribution of agricultural products. In the related technology, for example, the Chinese patent application document with application publication number CN114580953A discloses an agricultural product traceability system based on Hyperledger fabric alliance chain, including an Internet of Things system, a cloud storage system and a Hyperledger fabric alliance chain traceability system. The patent document is based on the fabric-node-sdk interface to chain and trace key agricultural product identification, detection, transaction and transportation data. By collecting various large-capacity data including video information from the whole process of agricultural products from growth to sales to consumers, the fingerprint of large-capacity data is chained, and the large-capacity data itself is stored in the cloud, providing a complete and secure support for consumers to trace various information of products. The blockchain + cloud storage + Internet of Things traceability system adopted by the patent document not only provides a data collection and storage mechanism, but also provides a transparent, decentralized, and tamper-proof security environment to effectively track the source of agricultural products.
[0004] In order to make the information management system more efficient, the surveillance video needs to be compressed; among them, the lossy image compression method has a high compression rate, but will lose image quality, and the lossless image compression algorithm can retain the complete image, but the compression rate is low; therefore, there is an urgent need for an image compression method with little image quality loss and high compression rate. Summary of the invention
[0005] In order to solve the technical problem of the urgent need for an image compression method with low image quality loss and high compression rate, the present invention provides an agricultural product supply chain information management system, the system comprising the following modules: a video acquisition module, which acquires monitoring videos of agricultural products during production, processing and distribution; a video compression module, which obtains the compression result of any frame of the image to be compressed in the monitoring video, including: using a division method to divide the grayscale range of the image to be compressed into multiple grayscale intervals; setting the grayscale value of each pixel in the image to be compressed to the median of the grayscale interval to which each pixel belongs, thereby obtaining a target image; determining the feature retention degree of the target image: , is the number of all edge pixels in the image to be compressed, represents the number of pixels that maintain the feature, where the pixels that maintain the feature refer to the pixels that are edge pixels in both the image to be compressed and the target image. , are the pixels that retain the features. The gradient magnitude and gradient direction in the image to be compressed, , are the pixels that retain the features. The gradient magnitude and gradient direction in the target image, is the natural exponential function, is a cosine function; the compression result of the target image with the smallest feature retention degree under different division methods is used as the compression result of the image to be compressed; the video transmission module sends the compression results of all the images to be compressed in the monitoring video to the background database, which is stored and processed by the background database.
[0006] The present invention divides the grayscale range of the image to be compressed into multiple grayscale intervals, sets the grayscale value of each pixel in the image to be compressed to the representative grayscale of the grayscale interval to which each pixel belongs, thereby reducing the number of grayscales required to be encoded in the target image obtained in this way compared to the image to be compressed, thereby reducing the information entropy of the grayscale values of all pixels in the target image, and ultimately improving the compression rate of the target image, making the information management system more efficient; The present invention divides pixel points belonging to edge pixels in an image to be compressed into pixel points with retained features and pixel points without retained features, obtains the feature retention degree of a target image based on the retention of texture features in the image, and uses the compression results of the target image with the minimum feature retention degree under different division methods as the compression results of the image to be compressed. This can maximize the retention of the image's texture features while improving the compression rate, and minimize the image quality loss in the compression result of the image to be compressed.
[0007] Preferably, for the grayscale intervals obtained by the division method, the length of each grayscale interval ranges from , , are the preset minimum length and the preset maximum length respectively, and Less than .
[0008] Preferably, the grayscale range of the image to be compressed refers to an interval consisting of a minimum grayscale value and a maximum grayscale value in the image to be compressed.
[0009] Preferably, the grayscale interval to which each pixel point belongs refers to the grayscale interval in which the grayscale value of each pixel point lies.
[0010] Preferably, the method of using the compression result of the target image with the smallest feature retention degree under different division methods as the compression result of the image to be compressed includes: using the compression result of the target image with the smallest corrected feature retention degree under different division methods as the compression result of the image to be compressed; the corrected feature retention degree is equal to the product of the correction coefficient and the feature retention degree of the target image.
[0011] The present invention obtains a corrected feature retention degree based on texture features and regional features in an image, and uses the compression result of a target image with the smallest corrected feature retention degree under different division methods as the compression result of an image to be compressed. This can retain the texture features and regional features of the image to the maximum extent, and minimize the image quality loss in the compression result of the image to be compressed.
[0012] Preferably, the correction coefficient satisfies the expression: ; In the formula, is the correction factor, is the pixel point in the target image The gray value of is the pixel point in the target image The grayscale values in the image to be compressed, is the pixel point in the target image The neighborhood grayscale distribution eigenvalue, is the pixel point in the target image The neighborhood grayscale distribution eigenvalue in the image to be compressed, To take the absolute value, the number of all pixels in the target image is equal to , , are the length and width of the target image respectively.
[0013] The present invention obtains a correction coefficient according to regional features in an image, so that the obtained corrected feature retention degree reflects the retention of texture features and regional features in the image, and the texture features and regional features represent the details and structure of the image, providing a basis for determining the degree of image quality loss in the compression result of the image to be compressed.
[0014] Preferably, the pixel points in the target image The gray value in the image to be compressed is equal to the pixel The gray value of the pixel is the pixel in the image to be compressed Pixels with the same coordinates.
[0015] Preferably, the pixel points in the target image The neighborhood grayscale distribution characteristic value refers to the pixel point The variance of the grayscale values of all other pixels in the neighborhood of the target image is The neighborhood grayscale distribution characteristic value in the image to be compressed refers to the pixel point The variance of the grayscale values of all other pixels in the neighborhood of .
[0016] Preferably, the pixel points in the target image The neighborhood grayscale distribution characteristic value refers to the pixel point The information entropy of the grayscale values of all other pixels in the neighborhood of the target image; The neighborhood grayscale distribution characteristic value in the image to be compressed refers to the pixel point The information entropy of the grayscale values of all other pixels in the neighborhood.
[0017] Whether it is the variance of the grayscale values of all other pixels in the neighborhood or the information entropy of the grayscale values of all other pixels in the neighborhood, it can reflect the distribution of the grayscale values of all other pixels in the neighborhood, and thus reflect the regional characteristics of the pixels.
[0018] Preferably, in response to the backend database receiving a video query request from a user, the surveillance video corresponding to the video query request is sent and played for display to the user, so that the user can trace the production, processing and distribution process of the agricultural products purchased or to be purchased.
[0019] The present invention helps to improve the transparency of the production and processing of agricultural products and ensure the quality and safety of agricultural products by providing users with monitoring videos of the production, processing and distribution of agricultural products.
[0020] The beneficial effects of the present invention are: The present invention divides the grayscale range of the image to be compressed into multiple grayscale intervals, sets the grayscale value of each pixel in the image to be compressed to the representative grayscale of the grayscale interval to which each pixel belongs, thereby reducing the number of grayscales required to be encoded in the target image obtained in this way compared to the image to be compressed, thereby reducing the information entropy of the grayscale values of all pixels in the target image, and ultimately improving the compression rate of the target image, making the information management system more efficient; Furthermore, the present invention divides the pixel points belonging to the edge pixel points in the image to be compressed into pixel points with retained features and pixel points without retained features, obtains the feature retention degree of the target image based on the retention of the texture features in the image, and uses the compression results of the target image with the minimum feature retention degree under different division methods as the compression result of the image to be compressed, thereby being able to maximize the retention of the image's texture features while improving the compression rate, and minimize the image quality loss in the compression result of the image to be compressed; Furthermore, the present invention helps to improve the transparency of the production and processing of agricultural products and ensure the quality and safety of agricultural products by providing users with monitoring videos of the production, processing and distribution of agricultural products. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein: Figure 1 A system block diagram of an agricultural product supply chain information management system in the present invention is schematically shown. DETAILED DESCRIPTION
[0022] 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0023] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0024] The present invention provides an agricultural product supply chain information management system. Figure 1 As shown, an agricultural product supply chain information management system includes a video acquisition module 100, a video compression module 200 and a video transmission module 300, which are described in detail below.
[0025] The video acquisition module 100 is used to collect monitoring videos of agricultural products during production, processing and distribution.
[0026] It should be noted that the agricultural product supply chain involves multiple links, and the operation of each link has an important impact on the quality and safety of the final product. Among them, surveillance video provides an intuitive record of the production, processing and distribution of agricultural products.
[0027] Specifically, cameras are installed in the production, processing and distribution environment of agricultural products, and the production, processing and distribution process of agricultural products are filmed using the cameras to obtain monitoring videos of the agricultural products in the production, processing and distribution process, wherein the monitoring videos include multiple frames of images.
[0028] It should be noted that when the image is an RGB image, each channel is regarded as a grayscale image, and the RGB image includes a red channel (R), a green channel (G), and a blue channel (B).
[0029] The video compression module 200 is used to obtain the compression result of any frame of the image to be compressed in the surveillance video.
[0030] It should be noted that in order to make the information management system more efficient, the surveillance video needs to be compressed; among them, the lossy image compression method has a high compression rate, but will lose image quality, and the lossless image compression algorithm can retain the complete image, but the compression rate is low; therefore, the present invention divides the grayscale range of the image to be compressed into multiple grayscale intervals, and sets the grayscale value of each pixel in the image to be compressed to the representative grayscale of the grayscale interval to which each pixel belongs, so as to obtain the target image, and uses the compression result of the target image with the smallest feature retention degree under different division methods as the compression result of the image to be compressed, which can maximize the retention of the image's texture features while improving the compression rate, so that the image quality loss degree in the compression result of the image to be compressed is minimized.
[0031] Specifically, the interval consisting of the minimum grayscale value and the maximum grayscale value in the image to be compressed is used as the grayscale range of the image to be compressed; the grayscale range of the image to be compressed is divided into multiple grayscale intervals by using one of the different division methods, and the median of each grayscale interval is used as the representative grayscale of each grayscale interval; the grayscale value of each pixel in the image to be compressed is set to the representative grayscale of the grayscale interval to which each pixel belongs, so as to obtain the target image; wherein, the grayscale interval to which each pixel belongs refers to the grayscale interval in which the grayscale value of each pixel is located.
[0032] Among all the grayscale intervals obtained by each division method, the length of each grayscale interval ranges from , , are the preset minimum length and the preset maximum length respectively, and Less than ; The specific values of the preset minimum length and the preset maximum length can be set according to the actual application scenario and requirements, and the value range of the preset minimum length is [5,10], and the value range of the preset maximum length is [13,18]; and the larger the preset minimum length and the preset maximum length, the higher the compression rate of the compressed image, and the greater the loss of the compressed image compared to the image before compression, that is, the clarity of the compressed image is reduced and the details become blurred; in order to retain the details of the compressed image as much as possible while achieving compression, the present invention sets the preset minimum length to 8 and the preset maximum length to 15.
[0033] For example, when the grayscale range of the image to be compressed is [100, 150], since the length of each grayscale interval ranges from Therefore, the four grayscale intervals obtained by one division method are: [100,112], [113,125], [126,138] and [139,150]; the five grayscale intervals obtained by another division method are: [100,108], [109,117], [118,127], [128,138] and [139,150]; the six grayscale intervals obtained by another division method are: [100,107], [108,116], [117,124], [125,133], [134,141] and [142,150].
[0034] In one embodiment, the compression result of the target image with the smallest feature retention degree under different division modes is used as the compression result of the image to be compressed, including: obtaining the target image with the smallest feature retention degree under different division modes , by Perform encoding compression to obtain the target image compression result; the coding compression method refers to entropy coding, including but not limited to Huffman coding and arithmetic coding; and Huffman coding and arithmetic coding are both well-known algorithms and will not be described in detail here.
[0035] It should be noted that the present invention divides the grayscale range of the image to be compressed into multiple grayscale intervals, and sets the grayscale value of each pixel in the image to be compressed to the representative grayscale of the grayscale interval to which each pixel belongs. Compared with the image to be compressed, the number of grayscale levels that need to be encoded in the target image obtained in this way is reduced, thereby reducing the information entropy of the grayscale values of all pixels in the target image, and ultimately improving the compression rate of encoding and compressing the target image through entropy coding.
[0036] It should be further explained that the present invention uses the compression result of the target image with the smallest feature retention degree under different division methods as the compression result of the image to be compressed. This can maximize the retention of the image's texture features while improving the compression rate, thereby minimizing the image quality loss in the compression result of the image to be compressed.
[0037] In another embodiment, the compression result of the target image with the minimum feature retention degree after correction under different division modes is used as the compression result of the image to be compressed, including: obtaining the target image with the minimum feature retention degree after correction under different division modes , by Perform encoding compression to obtain the target image compression result; the coding compression method refers to entropy coding, including but not limited to Huffman coding and arithmetic coding; and Huffman coding and arithmetic coding are both well-known algorithms and will not be described in detail here.
[0038] It should be noted that the degree of feature retention before correction is obtained based on the texture features in the image, and the texture features and regional features represent the details in the image. Therefore, the compression result of the target image with the smallest degree of feature retention after correction under different division methods is used as the compression result of the image to be compressed, which can maximize the retention of the texture features in the image; the degree of feature retention after correction is obtained based on the texture features and regional features in the image, and represents the details and structure of the image. The compression result of the target image with the smallest degree of feature retention after correction under different division methods is used as the compression result of the image to be compressed, which can maximize the retention of the texture features and regional features of the image, and minimize the image quality loss in the compression result of the image to be compressed.
[0039] The feature preservation degree of the target image satisfies the expression: ; In the formula, is the feature preservation degree of the target image, is the number of all edge pixels in the image to be compressed, represents the number of pixels that maintain the feature, where the pixels that maintain the feature refer to the pixels that are edge pixels in both the image to be compressed and the target image. is the number of pixels without preserved features, wherein the pixels without preserved features refer to pixels that are edge pixels in the image to be compressed and are not edge pixels in the target image. , are the pixels that retain the features. The gradient magnitude and gradient direction in the image to be compressed, , are the pixels that retain the features. The gradient magnitude and gradient direction in the target image, is the natural exponential function, is the cosine function.
[0040] The method for obtaining edge pixels and the gradient amplitude and gradient direction of edge pixels is the Canny edge detection algorithm; in other embodiments, implementers can select an edge detection algorithm according to actual application scenarios and requirements.
[0041] It should be noted that the feature retention degree of the target image is obtained based on the texture features in the image, wherein the pixel points belonging to the edge pixels in the image to be compressed are divided into pixel points with retained features and pixel points without retained features. The number of pixel points without retained features is The smaller it is, the more texture features the target image retains in the image to be compressed. Therefore, the feature retention degree of the target image The larger the pixel point is, the larger the gradient amplitude of the pixel point that retains the feature in the target image is compared with the gradient amplitude of the pixel point that is to be compressed, and the more consistent the gradient direction of the pixel point that retains the feature in the target image is with the gradient direction of the pixel point that is to be compressed, the more completely the pixel point that retains the feature retains the texture feature of the image to be compressed. Therefore, and The larger the value, the more the feature preservation of the target image The bigger.
[0042] The corrected feature retention degree is equal to the product of the correction coefficient and the feature retention degree of the target image, and the correction coefficient satisfies the expression: ; In the formula, is the correction factor, is the pixel point in the target image The gray value of is the pixel point in the target image The grayscale values in the image to be compressed, is the pixel point in the target image The neighborhood grayscale distribution eigenvalue, is the pixel point in the target image The neighborhood grayscale distribution eigenvalue in the image to be compressed, To take the absolute value, the number of all pixels in the target image is equal to , , are the length and width of the target image respectively; wherein the pixel point in the target image The gray value in the image to be compressed is equal to the pixel The gray value of the pixel is the pixel in the image to be compressed Pixels with the same coordinates.
[0043] It should be noted that the correction coefficient is obtained based on the regional features in the image, where the difference between the grayscale value of a pixel in the target image and the grayscale value of a pixel with the same coordinates as the pixel in the image to be compressed is The smaller the value, the difference between the neighborhood grayscale distribution characteristic value of the pixel point in the target image and the neighborhood grayscale distribution characteristic value of the pixel point with the same coordinates as the pixel point in the image to be compressed The smaller it is, the more completely the target image retains the regional features in the image to be compressed. Therefore, the correction coefficient The larger the correction factor The greater the degree of feature preservation after correction.
[0044] Among them, for the pixel point in the target image The neighborhood grayscale distribution eigenvalue and the pixels in the target image Neighborhood grayscale distribution eigenvalues in the image to be compressed In one embodiment, the pixel point in the target image The neighborhood grayscale distribution characteristic value refers to the pixel point The variance of the grayscale values of all other pixels in the neighborhood of the target image; The neighborhood grayscale distribution characteristic value in the image to be compressed refers to the pixel point The variance of the grayscale values of all other pixels in the neighborhood of the target image. The neighborhood grayscale distribution characteristic value refers to the pixel point The information entropy of the grayscale values of all other pixels in the neighborhood of the target image; The neighborhood grayscale distribution characteristic value in the image to be compressed refers to the pixel point The information entropy of the grayscale values of all other pixels in the neighborhood.
[0045] It should be noted that both the variance of the grayscale values of all other pixels in the neighborhood and the information entropy of the grayscale values of all other pixels in the neighborhood can reflect the distribution of the grayscale values of all other pixels in the neighborhood, and thus reflect the distribution of the grayscale values of the pixels. regional characteristics.
[0046] The neighborhood of the pixel point is centered at the pixel point and has a size of area, Equal to the preset value; the specific value of the preset value can be set according to the actual application scenario and requirements. The value of the preset value can be 3, 5 or 7. The present invention sets the preset value to 5.
[0047] The video transmission module 300 is used to send the compression results of all the images to be compressed in the surveillance video to the backend database, which will store and process them.
[0048] Specifically, the compression results of all images to be compressed in the surveillance video are sent to the background database, which stores and processes them; in response to the background database receiving a video query request from a user, the surveillance video corresponding to the video query request is sent and played for display to the user, so that the user can trace the production, processing and distribution process of the agricultural products purchased or to be purchased.
[0049] It should be noted that the present invention helps to improve the transparency of the production and processing of agricultural products and ensure the quality and safety of agricultural products by providing users with monitoring videos of the production, processing and distribution of agricultural products.
[0050] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0051] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. An agricultural product supply chain information management system, characterized in that: include: Video acquisition module, which collects surveillance videos of agricultural products during production, processing and distribution; The video compression module obtains the compression result of any frame of the image to be compressed in the surveillance video, including: using a division method to divide the grayscale range of the image to be compressed into multiple grayscale intervals; setting the grayscale value of each pixel in the image to be compressed to the median of the grayscale interval to which each pixel belongs, thereby obtaining the target image; determining the feature retention degree of the target image: , is the number of all edge pixels in the image to be compressed, represents the number of pixels that maintain the feature, where the pixels that maintain the feature refer to the pixels that are edge pixels in both the image to be compressed and the target image. , are the pixels that retain the features. The gradient magnitude and gradient direction in the image to be compressed, , are the pixels that retain the features. The gradient magnitude and gradient direction in the target image, is the natural exponential function, is a cosine function; the compression result of the target image with the minimum feature retention degree under different division modes is used as the compression result of the image to be compressed; The video transmission module sends the compression results of all the images to be compressed in the surveillance video to the backend database, which stores and processes them.
2. The agricultural product supply chain information management system according to claim 1, characterized in that: For the grayscale intervals obtained by the division method, the length of each grayscale interval ranges from , , are the preset minimum length and the preset maximum length respectively, and Less than .
3. The agricultural product supply chain information management system according to claim 1, characterized in that: The grayscale range of the image to be compressed refers to the interval consisting of the minimum grayscale value and the maximum grayscale value in the image to be compressed.
4. The agricultural product supply chain information management system according to claim 1, characterized in that: The grayscale interval to which each pixel belongs refers to the grayscale interval in which the grayscale value of each pixel belongs.
5. The agricultural product supply chain information management system according to claim 1, characterized in that: The method of using the compression result of the target image with the minimum feature retention degree under different division modes as the compression result of the image to be compressed includes: The compression result of the target image with the minimum corrected feature retention degree under different division modes is used as the compression result of the image to be compressed; the corrected feature retention degree is equal to the product of the correction coefficient and the feature retention degree of the target image.
6. The agricultural product supply chain information management system according to claim 5, characterized in that: The correction coefficient satisfies the expression: ; In the formula, is the correction factor, is the pixel point in the target image The gray value of is the pixel point in the target image The grayscale values in the image to be compressed, is the pixel point in the target image The neighborhood grayscale distribution eigenvalue, is the pixel point in the target image The neighborhood grayscale distribution eigenvalue in the image to be compressed, To take the absolute value, the number of all pixels in the target image is equal to , , are the length and width of the target image respectively.
7. The agricultural product supply chain information management system according to claim 6, characterized in that: The pixel point in the target image The gray value in the image to be compressed is equal to the pixel The gray value of the pixel is the pixel in the image to be compressed Pixels with the same coordinates.
8. The agricultural product supply chain information management system according to claim 7, characterized in that: The pixel point in the target image The neighborhood grayscale distribution characteristic value refers to the pixel point The variance of the grayscale values of all other pixels in the neighborhood of the target image is The neighborhood grayscale distribution characteristic value in the image to be compressed refers to the pixel point The variance of the grayscale values of all other pixels in the neighborhood of .
9. The agricultural product supply chain information management system according to claim 7, characterized in that: The pixel point in the target image The neighborhood grayscale distribution characteristic value refers to the pixel point The information entropy of the grayscale values of all other pixels in the neighborhood of the target image; The neighborhood grayscale distribution characteristic value in the image to be compressed refers to the pixel point The information entropy of the grayscale values of all other pixels in the neighborhood.
10. The agricultural product supply chain information management system according to claim 1, characterized in that: In response to the backend database receiving a video query request from a user, the surveillance video corresponding to the video query request is sent and played for display to the user, so that the user can trace the production, processing and distribution process of the agricultural products purchased or to be purchased.
Citation Information
Patent Citations
Agricultural product traceability system based on Hyperledger fabric alliance chain
CN114580953A
Blockchain-based agricultural product safe and credible traceability system
CN113240435A
User data compression and storage method for mobile terminal
CN115802056A
Agricultural product tracing method and system based on block chain technology
CN116485412A
Working image transmission method for photogravure press
CN119052399A
Cited By
Emergency communication method of satellite vehicle-mounted station
CN119893055A