Automatic red pepper quality identification method and system, terminal and storage medium

Through machine vision technology and automation equipment, the automated identification and full process traceability of red pepper quality can be achieved, solving the problem of low traditional manual sorting efficiency, high cost, and inconsistent quality. Picking homework.

CN119360365APending Publication Date: 2025-01-24INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411495146.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Traditional red pepper sorting relies on manual operations, resulting in inefficient efficiency, high cost and inconsistent quality, making it difficult to meet the needs of modern agriculture for efficient circulation and stable quality.

Method used

Adopting machine visual technology combined with automated equipment, by collecting the image and single weight of red pepper samples, identifying its surface characteristics and calculating the quality scores, generating electronic quality labels, and realizing the automated identification and full process traceability of red pepper quality.

Benefits of technology

The efficient, accurate and objective identification of red pepper quality, improved sorting efficiency and quality consistency, reduced costs, and supported the quality traceability of the entire process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119360365A_ABST
    Figure CN119360365A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine vision, and particularly provides an automatic red pepper quality recognition method and system, a terminal and a storage medium, and the method comprises the steps: collecting an image of a red pepper sample, and recognizing the surface features of the red pepper sample based on the image through a machine vision technology, the surface characteristics comprise a red area proportion, a red pepper size, a red pepper shape and a surface defect; collecting the monomer weight of the red pepper sample; calculating the quality fraction of the red pepper sample based on the preset weight, the surface feature and the monomer weight; and calculating the average quality score of the red pepper product of the batch based on the quality score of the single red pepper sample, and generating a quality label for the red pepper product of the batch based on the average quality score. According to the invention, the accuracy and objectivity of quality identification are ensured while automatic identification is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of machine vision, and in particular relates to a method, system, terminal and storage medium for automatically identifying the quality of red peppers. Background Art

[0002] The traditional red pepper sorting process has long relied on manual operations. Although this method reflects the flexibility of manpower and the ability to grasp details in some aspects, it also exposes a series of significant drawbacks. First, the efficiency of manual sorting is relatively low, especially when faced with large-scale, high-intensity sorting tasks, the limitations of manpower are particularly prominent, and it is difficult to meet the needs of efficient circulation in modern agricultural production. Secondly, from a cost perspective, the continuous increase in labor costs has made traditional sorting methods no longer economically competitive. Including worker recruitment, training, wages and benefits, and related labor security costs, all are a considerable expense, which has brought considerable economic pressure to enterprises.

[0003] More importantly, it is often difficult to ensure the consistency and stability of the quality of red peppers during manual sorting. Each worker may have different sorting standards, and even the same worker may suffer from fatigue after working for a long time, which may lead to a decline in sorting quality, resulting in misjudgment or omission. This not only affects the overall quality of red peppers, but may also lead to a decline in customer satisfaction due to uneven quality, which has an adverse impact on brand image and market competitiveness.

[0004] In summary, the traditional red pepper sorting method has obvious shortcomings in efficiency, cost and quality control due to the inherent defects of manual operation. It is urgent to seek solutions through technological innovation and intelligent upgrades to achieve more efficient, economical and stable sorting operations. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method, system, terminal and storage medium for automatically identifying the quality of red peppers to solve the above-mentioned technical problems.

[0006] In a first aspect, the present invention provides a method for automatically identifying the quality of red peppers, comprising: Collecting an image of a red pepper sample, and using machine vision technology to identify surface features of the red pepper sample based on the image, wherein the surface features include a red area ratio, a red pepper size, a red pepper shape, and surface defects; Collect the monomer weight of red pepper samples; Calculate the quality score of the red pepper sample based on the preset weights, surface characteristics, and monomer weight; The average quality score of the red pepper product batch is calculated based on the quality score of the single red pepper sample, and a quality label is generated for the red pepper product batch based on the average quality score.

[0007] In an optional embodiment, an image of a red pepper sample is collected, and surface features of the red pepper sample are identified based on the image using machine vision technology, wherein the surface features include a red area ratio, a red pepper size, a red pepper shape, and surface defects, including: Convert the image from the RGB color space to the HIS color space, use the hue H to represent red, extract the red area whose hue H meets the preset hue threshold, and calculate the ratio of the pixels in the red area to the pixels of the red pepper sample to obtain the red area ratio; Using contour recognition technology to identify the contour of the red pepper sample from the image, and extracting the number of feature points from the contour of the red pepper sample, wherein the number of feature points is used to characterize the shape of the red pepper; Extract the pixel values ​​inside the red pepper sample contour and calculate the size of the red pepper based on the image resolution and image scale; The image is gray-scaled to obtain a gray-scale image, the spot areas are screened out by calculating the gray-scale value, and the number of the spot areas is calculated. The number of the spot areas is used to characterize the surface defects.

[0008] In an optional embodiment, the method further comprises: Construct a pairwise comparison weight matrix for red area percentage, red pepper size, red pepper shape, surface defects, and monomer weight; Obtain historical transaction orders, and convert the historical transaction orders into structured data, wherein the structured data is a factor: transaction volume, wherein the factors include red area ratio, red pepper size, red pepper shape, surface defects, and monomer weight; The weight elements in the weight matrix are assigned values ​​by counting the transaction volumes associated with each factor; The eigenvalue method is used to calculate the weight value of each element based on the assigned weight matrix.

[0009] In an optional embodiment, calculating the average quality score of the batch of red pepper products based on the quality score of the single red pepper sample, and generating a quality label for the batch of red pepper products based on the average quality score, comprises: The product batch label of the red pepper sample, and the product batch code corresponding to the product batch label is written into the test log; triggering the automatic transport device to transport the red pepper sample to the testing point, and writing the quality score of the red pepper sample into the position corresponding to the product batch code in the testing log; Calculate the average of all quality scores corresponding to the product batch code to obtain the average quality score; Generate electronic quality labels containing product batch code and average quality score.

[0010] In a second aspect, the present invention provides a red pepper quality automatic identification system, comprising: A visual recognition module, used to collect images of red pepper samples, and use machine vision technology to identify surface features of the red pepper samples based on the images, wherein the surface features include red area ratio, red pepper size, red pepper shape, and surface defects; A weight collection module is used to collect the monomer weight of the red pepper sample; A score calculation module, for calculating the quality score of the red pepper sample based on pre-set weights, surface features and monomer weights; The batch evaluation module is used to calculate the average quality score of the red pepper products in this batch based on the quality scores of the individual red pepper samples, and to generate a quality label for the red pepper products in this batch based on the average quality score.

[0011] In an optional embodiment, the visual recognition module includes: A color recognition unit is used to convert the image from the RGB color space to the HIS color space, use the hue H to represent red, extract the red area whose hue H meets the preset hue threshold, and calculate the ratio of the pixels in the red area to the pixels of the red pepper sample to obtain the red area ratio; A shape recognition unit, used to recognize the contour of the red pepper sample from the image using contour recognition technology, and extract the number of feature points from the contour of the red pepper sample, wherein the number of feature points is used to characterize the shape of the red pepper; A size recognition unit is used to extract the pixel value inside the red pepper sample contour and calculate the size of the red pepper based on the image resolution and image scale; The defect recognition unit is used to perform grayscale processing on the image to obtain a grayscale image, filter out spot areas by calculating grayscale values, and calculate the number of spot areas, where the number of spot areas is used to characterize surface defects.

[0012] In an optional embodiment, the system further includes: A matrix construction module is used to construct a pairwise comparison weight matrix for red area ratio, red pepper size, red pepper shape, surface defects and monomer weight; An order analysis module, used to obtain historical transaction orders and convert the historical transaction orders into structured data, wherein the structured data is a factor: transaction volume, wherein the factors include red area ratio, red pepper size, red pepper shape, surface defects and monomer weight; The matrix assignment module is used to assign values ​​to the weight elements in the weight matrix by counting the transaction volumes associated with each factor; The weight calculation module is used to calculate the weight value of each element based on the assigned weight matrix using the eigenvalue method.

[0013] In an optional embodiment, the batch evaluation module includes: The label recognition unit is used for the product batch label of the red pepper sample, and the product batch code corresponding to the product batch label is written into the detection log; A log management unit, used to trigger the automatic transport device to transport the red pepper sample to the testing point, and write the quality score of the red pepper sample into the position corresponding to the product batch code in the testing log; The average calculation unit is used to calculate the average of all quality scores corresponding to the product batch code to obtain the average quality score; The label generating unit is used to generate an electronic quality label including a product batch code and an average quality score.

[0014] In a third aspect, a terminal is provided, including: A memory, used for storing a red pepper quality automatic identification program; A processor is used to implement the steps of the method for automatically identifying the quality of red peppers as provided in the first aspect when executing the automatic identification program for the quality of red peppers.

[0015] In a fourth aspect, a computer-readable storage medium is provided, on which a program for automatically identifying the quality of red peppers is stored. When the program for automatically identifying the quality of red peppers is executed by a processor, the steps of the method for automatically identifying the quality of red peppers provided in the first aspect are implemented.

[0016] The beneficial effect of the present invention is that the method, system, terminal and storage medium for automatically identifying the quality of red peppers provided by the present invention, combined with machine vision technology, comprehensively evaluate the quality of red peppers from five dimensions: the proportion of red area, the size of red peppers, the shape of red peppers, surface defects and weight, thereby achieving automatic identification while ensuring the accuracy and objectivity of quality identification. Moreover, by binding the identification result with the product batch code and generating an electronic label, the whole process traceability of the quality of red peppers is achieved.

[0017] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect. 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 will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.

[0020] Figure 2 is a schematic block diagram of a system according to an embodiment of the present invention.

[0021] Figure 3A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.

[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0024] The method for automatically identifying the quality of red peppers provided in the embodiment of the present invention is executed by a computer device, and accordingly, the system for automatically identifying the quality of red peppers runs in the computer device.

[0025] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention. Figure 1 The execution subject may be a red pepper quality automatic identification system. According to different requirements, the order of the steps in the flow chart may be changed, and some may be omitted.

[0026] like Figure 1 As shown, the method includes: Step 110, collecting an image of the red pepper sample, and using machine vision technology to identify surface features of the red pepper sample based on the image, wherein the surface features include a red area ratio, a red pepper size, a red pepper shape, and surface defects; Step 120, collecting the monomer weight of the red pepper sample; Step 130, calculating the quality score of the red pepper sample based on the preset weights, surface features and monomer weights; Step 140, calculating the average quality score of the batch of red pepper products based on the quality score of the single red pepper sample, and generating a quality label for the batch of red pepper products based on the average quality score.

[0027] To facilitate understanding of the present invention, the following is a further description of the method for automatically identifying the quality of red peppers provided by the present invention based on the principle of the method for automatically identifying the quality of red peppers of the present invention and the process of automatically identifying the quality of red peppers in the embodiments.

[0028] Specifically, the method for automatically identifying the quality of red pepper includes: S1. Collect images of red pepper samples and collect monomer weights of the red pepper samples.

[0029] On the advanced automated production line, a set of sophisticated automatic conveying devices is specially designed, which cleverly integrates a number of intelligent detection technologies to ensure product quality and production efficiency. On this device, multiple key detection points are carefully set up, and each detection point is not only equipped with a highly sensitive pressure sensor, but also installed with a high-resolution camera to achieve multi-dimensional detection functions.

[0030] The pressure sensor is precisely embedded in a specific position on the conveying path. It is designed to instantly and accurately capture the pressure changes exerted on the sensor by the red pepper sample when the red pepper sample arrives at the detection area as the conveyor belt moves. This link is crucial because it is directly related to the precise measurement of the subsequent weight of the red pepper sample. Whenever the red pepper sample contacts and slightly presses the sensor, the sensor will quickly collect detailed pressure data and record this data in real time, providing a basis for subsequent data analysis.

[0031] At the same time, whenever the pressure sensor is activated, a signal linked to it will immediately trigger a camera installed nearby. The camera will then start to quickly take clear photos of the red pepper samples from multiple angles using its excellent image capture capabilities. These photos are not only used to visually inspect the appearance integrity of the red peppers, such as color uniformity, skin damage, etc., but also provide visual evidence for possible defect identification and quality traceability.

[0032] In order to further improve the level of automation, an intelligent divider is cleverly installed on the automatic conveying device. The function of this divider is that it can accurately separate the red pepper samples one by one during the continuous conveying of the red pepper samples, ensuring that each red pepper sample can maintain a preset safe distance from the previous and next samples when it is transported to the detection point. This design effectively avoids mutual interference between samples and ensures the accuracy of the data collected by the pressure sensor and the clarity of the images taken by the camera.

[0033] A conversion function between pressure value and weight is established in advance by using a calibration test, and the collected pressure value is converted into a gravity value based on the conversion function.

[0034] S2. Using machine vision technology to identify surface features of the red pepper sample based on the image, the surface features include red area ratio, red pepper size, red pepper shape and surface defects.

[0035] S201. Convert the image from RGB color space to HIS color space, use hue H to represent red, extract the red area whose hue H meets the preset hue threshold, and calculate the ratio of the pixels in the red area to the pixels of the red pepper sample to obtain the red area ratio.

[0036] In one example, the following steps are included: Read the image: Use an image processing library such as OpenCV or PIL to read the image of the red pepper sample.

[0037] Preprocessing: If the image contains noise or has a complex background, preprocessing can be performed, such as denoising, cropping, or grayscale (although this step is not necessary before converting to HIS space, it helps simplify subsequent processing).

[0038] Conversion formula: Hue (H): Calculates the hue angle from the RGB values, usually using a specific formula or lookup table.

[0039] Saturation (S): Indicates the purity or intensity of a color.

[0040] Brightness (I): Indicates the lightness or darkness of a color.

[0041] Apply conversion: Use the functions provided by the image processing library or your own conversion formula to convert each pixel of the image from RGB color space to HIS color space.

[0042] Set hue thresholds: Based on the red characteristics of red peppers, set one or more hue thresholds. These thresholds should be able to cover the range of red that red peppers may appear.

[0043] Binarization: Compare the hue channel in the converted HIS image with the set threshold to generate a binary image. In this binary image, the pixel value of the red area is 1 (or white), and the pixel value of the non-red area is 0 (or black).

[0044] Count the pixels in the red area: traverse the binary image and count the number of pixels with a value of 1 (or white).

[0045] Count the total pixels: Also traverse the image and count the number of all pixels in the red pepper sample area.

[0046] Calculate the proportion: Divide the number of pixels in the red area by the total number of pixels to get the proportion of the red area.

[0047] S202, using contour recognition technology to identify the contour of the red pepper sample from the image, and extracting the number of feature points from the contour of the red pepper sample, wherein the number of feature points is used to characterize the shape of the red pepper.

[0048] In one example, the following steps are included: Reading images: Use an image processing library such as OpenCV to read the image of the red pepper sample.

[0049] Grayscale: Convert the image to grayscale to simplify subsequent processing.

[0050] Binarization: Apply threshold segmentation technique to convert the grayscale image into a binary image, where the red pepper area is white (or 1) and the background is black (or 0).

[0051] Find contours: Use contour finding functions in the image processing library (such as OpenCV's findContours function) to find the contours of the red pepper in the binary image.

[0052] Filter contours: Filter the contour that best matches the shape of the red pepper based on its area, perimeter and other attributes.

[0053] Feature point extraction: Use a corner detection algorithm (such as Harris corner detection or Shi-Tomasi corner detection) to extract corner points on the contour as feature points.

[0054] Count feature points: Count the number of extracted feature points as a parameter to characterize the shape of the red pepper. The fewer feature points, the more regular the shape of the red pepper, and the more feature points, the more irregular the shape of the red pepper.

[0055] S203, extracting pixel values ​​inside the red pepper sample contour, and calculating the size of the red pepper based on the image resolution and image scale.

[0056] Reading images: Use an image processing library such as OpenCV to read the image of the red pepper sample.

[0057] Grayscale and Binarization: Convert the image to grayscale and apply threshold segmentation technique to convert the grayscale image into a binary image where the red pepper area is white (or 1) and the background is black (or 0).

[0058] Find contours: Find the contours of the red pepper in the binary image. You can use the findContours function of OpenCV to do this.

[0059] Create a mask: Create a mask image of the same size as the original image based on the extracted red pepper outline. Set the area inside the red pepper outline in the mask image to white (or 1) and the rest to black (or 0).

[0060] Apply mask: Apply the mask image to the original image to extract the pixel values ​​inside the red pepper outline. This can be done with a bitwise AND operation.

[0061] Determine the image resolution: Get the resolution information of the image, that is, the number of dots per inch PPI or dots per inch DPI. This can usually be found in the metadata of the image file, or obtained through the functions provided by the image processing library.

[0062] Determine scale: Extract scale information from the image. This may require manually measuring the scale in the image and converting it to real-world units (such as centimeters or meters).

[0063] Calculate the pixel-to-real-world mapping: Based on the image resolution and scale, calculate the size that each pixel represents in the real world. For example, if the image resolution is 300 DPI and 1 cm in the image represents 1 cm in the real world, then the size that each pixel represents in the real world is 1 / 300 inch or approximately 0.0333 mm.

[0064] Calculate the actual size of the red pepper: Iterate over the pixel values ​​inside the extracted red pepper outline and calculate the total area occupied by these pixels in the real world. This can be achieved by counting the pixels inside the red pepper outline and multiplying the count result by the size represented by each pixel in the real world.

[0065] S204, grayscale processing is performed on the image to obtain a grayscale image, spot areas are screened out by calculating grayscale values, and the number of spot areas is calculated, and the number of spot areas is used to characterize surface defects.

[0066] Reading images: Use an image processing library such as OpenCV to read images of metal surfaces.

[0067] Grayscale conversion: Convert a color image to a grayscale image. Each pixel in a grayscale image has only one brightness value, which helps simplify subsequent processing steps.

[0068] Image smoothing: Smooth the grayscale image to reduce the impact of noise on spot detection. You can use filtering methods such as Gaussian blur.

[0069] Threshold segmentation: Apply the threshold segmentation technique to convert the grayscale image into a binary image. Choose a suitable threshold so that the pixel value of the spot area is white (or 1) and the pixel value of other areas is black (or 0).

[0070] Morphological operations: Morphological operations such as erosion and dilation are performed on binary images to further remove noise and separate adjacent spot regions.

[0071] Find contours: Find the contours of all spots in a binary image. This can be done using the findContours function of OpenCV.

[0072] Count blob regions: Iterate over all found contours and count the number of blobs. Each contour represents a blob region.

[0073] S3. Calculate the quality score of the red pepper sample based on the preset weights, surface features and monomer weights.

[0074] The method for setting weights includes: constructing a pairwise comparison weight matrix for the red area ratio, red pepper size, red pepper shape, surface defects and monomer weight; obtaining historical transaction orders, and converting the historical transaction orders into structured data, wherein the structured data is a factor: transaction volume, wherein the factors include the red area ratio, red pepper size, red pepper shape, surface defects and monomer weight; assigning weight elements in the weight matrix by counting the transaction volume associated with each factor; and calculating the weight value of each element based on the assigned weight matrix using the eigenvalue method.

[0075] In one example, the specific method includes: Construct a judgment matrix:

[0076] Extract all trading orders from the historical database and convert the order information into structured data. The structured data is composed of factors as columns, including five dimensions: red area ratio, red pepper size, red pepper shape, surface defects, and single weight, while the rows represent each trading order. In order to construct this structured data set, we may need to clean, organize, and format the unstructured or semi-structured historical trading data.

[0077] By counting the performance of each factor under different trading volumes, we can assign values ​​to the elements in the weight matrix. Specifically, we can use the following method: Correlation analysis: Analyze the correlation between each factor and trading volume, and assign higher weights to factors with stronger correlations.

[0078] Conditional screening: For a specific trading volume range, calculate the conditional probability or influence coefficient of each factor and use it as the basis for weight assignment.

[0079] Machine learning model: Build a machine learning model and train it using historical transaction data to obtain the weight coefficient of each factor.

[0080] In this example, we use a simplified approach: we assign a value to the correlation between two factors based on the change in trading volume. If two factors co-occur more frequently when trading volume is large, the weight element between them will be assigned a higher value.

[0081] After the assignment is completed, the eigenvector corresponding to the maximum eigenvalue of the weight matrix is ​​calculated, and the eigenvector is normalized to obtain the weight value corresponding to each factor.

[0082] S4. Calculate the average quality score of the batch of red pepper products based on the quality score of the single red pepper sample, and generate a quality label for the batch of red pepper products based on the average quality score.

[0083] A product batch label for a red pepper sample, and writing the product batch code corresponding to the product batch label into the inspection log; triggering an automatic transport device to transport the red pepper sample to a detection point, and writing the quality score of the red pepper sample into the position corresponding to the product batch code in the inspection log; calculating the average of all quality scores corresponding to the product batch code to obtain an average quality score; and generating an electronic quality label including the product batch code and the average quality score.

[0084] By affixing the final electronic quality label to the outer packaging of the corresponding batch of products, effective control of product quality can be achieved.

[0085] In some embodiments, the red pepper quality automatic identification system may include multiple functional modules composed of computer program segments. The computer program of each program segment in the red pepper quality automatic identification system may be stored in the memory of a computer device and executed by at least one processor to perform (see Figure 1 Description) Function of automatic identification of red pepper quality.

[0086] In this embodiment, the red pepper quality automatic identification system can be divided into multiple functional modules according to the functions it performs, such as Figure 2 As shown. The functional modules of the system 200 may include: a visual recognition module 210, a weight collection module 220, a score calculation module 230, and a batch evaluation module 240. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

[0087] A visual recognition module, used to collect images of red pepper samples, and use machine vision technology to identify surface features of the red pepper samples based on the images, wherein the surface features include red area ratio, red pepper size, red pepper shape, and surface defects; A weight collection module is used to collect the monomer weight of the red pepper sample; A score calculation module, for calculating the quality score of the red pepper sample based on pre-set weights, surface features and monomer weights; The batch evaluation module is used to calculate the average quality score of the red pepper products in this batch based on the quality scores of the individual red pepper samples, and to generate a quality label for the red pepper products in this batch based on the average quality score.

[0088] Optionally, as an embodiment of the present invention, the visual recognition module includes: A color recognition unit is used to convert the image from the RGB color space to the HIS color space, use the hue H to represent red, extract the red area whose hue H meets the preset hue threshold, and calculate the ratio of the pixels in the red area to the pixels of the red pepper sample to obtain the red area ratio; A shape recognition unit, used to recognize the contour of the red pepper sample from the image using contour recognition technology, and extract the number of feature points from the contour of the red pepper sample, wherein the number of feature points is used to characterize the shape of the red pepper; A size recognition unit is used to extract the pixel value inside the red pepper sample contour and calculate the size of the red pepper based on the image resolution and image scale; The defect recognition unit is used to perform grayscale processing on the image to obtain a grayscale image, filter out spot areas by calculating grayscale values, and calculate the number of spot areas, where the number of spot areas is used to characterize surface defects.

[0089] Optionally, as an embodiment of the present invention, the system further includes: A matrix construction module is used to construct a pairwise comparison weight matrix for red area ratio, red pepper size, red pepper shape, surface defects and monomer weight; An order analysis module, used to obtain historical transaction orders and convert the historical transaction orders into structured data, wherein the structured data is a factor: transaction volume, wherein the factors include red area ratio, red pepper size, red pepper shape, surface defects and monomer weight; The matrix assignment module is used to assign values ​​to the weight elements in the weight matrix by counting the transaction volumes associated with each factor; The weight calculation module is used to calculate the weight value of each element based on the assigned weight matrix using the eigenvalue method.

[0090] Optionally, as an embodiment of the present invention, the batch evaluation module includes: The label recognition unit is used for the product batch label of the red pepper sample, and the product batch code corresponding to the product batch label is written into the detection log; A log management unit, used to trigger the automatic transport device to transport the red pepper sample to the testing point, and write the quality score of the red pepper sample into the position corresponding to the product batch code in the testing log; The average calculation unit is used to calculate the average of all quality scores corresponding to the product batch code to obtain the average quality score; The label generating unit is used to generate an electronic quality label including a product batch code and an average quality score.

[0091] Figure 3 The present invention is a schematic diagram of the structure of a terminal 300 provided in an embodiment of the present invention. The terminal 300 can be used to execute the method for automatically identifying the quality of red peppers provided in an embodiment of the present invention.

[0092] The terminal 300 may include: a processor 310, a memory 320 and a communication unit 330. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention, and it may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0093] The memory 320 can be used to store the execution instructions of the processor 310, and the memory 320 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 can perform some or all of the steps in the following method embodiments.

[0094] The processor 310 is the control center of the storage terminal, and uses various interfaces and lines to connect various parts of the entire electronic terminal. It runs or executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 310 can only include a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.

[0095] The communication unit 330 is used to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals or send user data to other terminals.

[0096] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0097] Therefore, the present invention combines machine vision technology to comprehensively evaluate the quality of red peppers from five dimensions: red area ratio, red pepper size, red pepper shape, surface defects, and weight, achieving automatic identification while ensuring the accuracy and objectivity of quality identification. And by binding the identification results with the product batch code and generating an electronic label, the full process traceability of the red pepper quality is achieved. The technical effects that can be achieved by this embodiment can be found in the above description and will not be repeated here.

[0098] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes, including several instructions for enabling a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.

[0099] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.

[0100] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or modules, which can be electrical, mechanical or other forms.

[0101] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0102] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0103] Although the present invention has been described in detail with reference to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention.

Claims

1. A method for automatically identifying the quality of red peppers, characterized in that: include: Collecting an image of a red pepper sample, and using machine vision technology to identify surface features of the red pepper sample based on the image, wherein the surface features include a red area ratio, a red pepper size, a red pepper shape, and surface defects; Collect the monomer weight of red pepper samples; Calculate the quality score of the red pepper sample based on the preset weights, surface characteristics, and monomer weight; The average quality score of the red pepper product batch is calculated based on the quality score of the single red pepper sample, and a quality label is generated for the red pepper product batch based on the average quality score.

2. The method according to claim 1, characterized in that: Collect images of red pepper samples, and use machine vision technology to identify surface features of the red pepper samples based on the images, wherein the surface features include red area ratio, red pepper size, red pepper shape, and surface defects, including: Convert the image from the RGB color space to the HIS color space, use the hue H to represent red, extract the red area whose hue H meets the preset hue threshold, and calculate the ratio of the pixels in the red area to the pixels of the red pepper sample to obtain the red area ratio; Using contour recognition technology to identify the contour of the red pepper sample from the image, and extracting the number of feature points from the contour of the red pepper sample, wherein the number of feature points is used to characterize the shape of the red pepper; Extract the pixel values ​​inside the red pepper sample contour and calculate the size of the red pepper based on the image resolution and image scale; The image is gray-scaled to obtain a gray-scale image, the spot areas are screened out by calculating the gray-scale value, and the number of the spot areas is calculated. The number of the spot areas is used to characterize the surface defects.

3. The method according to claim 1, characterized in that The method further comprises: Construct a pairwise comparison weight matrix for red area percentage, red pepper size, red pepper shape, surface defects, and monomer weight; Obtain historical transaction orders, and convert the historical transaction orders into structured data, wherein the structured data is a factor: transaction volume, wherein the factors include red area ratio, red pepper size, red pepper shape, surface defects, and monomer weight; The weight elements in the weight matrix are assigned values ​​by counting the transaction volumes associated with each factor; The eigenvalue method is used to calculate the weight value of each element based on the assigned weight matrix.

4. The method according to claim 1, characterized in that: Calculating the average quality score of the batch of red pepper products based on the quality score of the individual red pepper samples, and generating a quality label for the batch of red pepper products based on the average quality score, including: The product batch label of the red pepper sample, and the product batch code corresponding to the product batch label is written into the test log; triggering the automatic transport device to transport the red pepper sample to the testing point, and writing the quality score of the red pepper sample into the position corresponding to the product batch code in the testing log; Calculate the average of all quality scores corresponding to the product batch code to obtain the average quality score; Generate electronic quality labels containing product batch code and average quality score.

5. A red pepper quality automatic identification system, characterized in that: include: A visual recognition module, used to collect images of red pepper samples, and use machine vision technology to identify surface features of the red pepper samples based on the images, wherein the surface features include red area ratio, red pepper size, red pepper shape, and surface defects; A weight collection module is used to collect the monomer weight of the red pepper sample; A score calculation module, for calculating the quality score of the red pepper sample based on pre-set weights, surface features and monomer weights; The batch evaluation module is used to calculate the average quality score of the red pepper products in this batch based on the quality scores of the individual red pepper samples, and to generate a quality label for the red pepper products in this batch based on the average quality score.

6. The system according to claim 5, characterized in that The visual recognition module comprises: A color recognition unit is used to convert the image from the RGB color space to the HIS color space, use the hue H to represent red, extract the red area whose hue H meets the preset hue threshold, and calculate the ratio of the pixels in the red area to the pixels of the red pepper sample to obtain the red area ratio; a shape recognition unit, used to recognize the contour of the red pepper sample from the image using contour recognition technology, and extract the number of feature points from the contour of the red pepper sample, wherein the number of feature points is used to characterize the shape of the red pepper; A size recognition unit is used to extract the pixel value inside the red pepper sample contour and calculate the size of the red pepper based on the image resolution and image scale; The defect recognition unit is used to perform grayscale processing on the image to obtain a grayscale image, filter out spot areas by calculating grayscale values, and calculate the number of spot areas, where the number of spot areas is used to characterize surface defects.

7. The system according to claim 5, characterized in that The system further comprises: A matrix construction module is used to construct a pairwise comparison weight matrix for red area ratio, red pepper size, red pepper shape, surface defects and monomer weight; An order analysis module, used to obtain historical transaction orders and convert the historical transaction orders into structured data, wherein the structured data is a factor: transaction volume, wherein the factors include red area ratio, red pepper size, red pepper shape, surface defects and monomer weight; The matrix assignment module is used to assign values ​​to the weight elements in the weight matrix by counting the transaction volumes associated with each factor; The weight calculation module is used to calculate the weight value of each element based on the assigned weight matrix using the eigenvalue method.

8. The system according to claim 5, characterized in that The batch evaluation module includes: The label recognition unit is used for the product batch label of the red pepper sample, and the product batch code corresponding to the product batch label is written into the detection log; A log management unit, used to trigger the automatic transport device to transport the red pepper sample to the testing point, and write the quality score of the red pepper sample into the position corresponding to the product batch code in the testing log; The average calculation unit is used to calculate the average of all quality scores corresponding to the product batch code to obtain the average quality score; The label generating unit is used to generate an electronic quality label including a product batch code and an average quality score.

9. A terminal, characterized in that: include: A memory, used for storing a red pepper quality automatic identification program; A processor, configured to implement the steps of the method for automatically identifying the quality of red peppers as described in any one of claims 1 to 4 when executing the program for automatically identifying the quality of red peppers.

10. A computer-readable storage medium storing a computer program, characterized in that: The readable storage medium stores a red pepper quality automatic identification program, which, when executed by a processor, implements the steps of the red pepper quality automatic identification method according to any one of claims 1 to 4.