Fruit shape evaluation method, device, equipment, medium and computer program product

By binarizing and morphologically processing the fruit image, determining the position of the fruit edge and fruit axis, and evaluating the slope of the fruit shape, the problem of machine vision being unable to evaluate the shape of irregular agricultural products is solved, and the accurate evaluation of the fruit shape is achieved and improved. increased sales of agricultural products.

CN118629032APending Publication Date: 2024-09-10TARIM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410836095.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing machine vision cannot effectively evaluate irregularly shaped agricultural products, causing agricultural product sales to be affected.

Method used

By binarizing and morphologically processing the pre-processed fruit image of the fruit to be evaluated, the fruit edge is determined, and then the fruit axis position and fruit shape slope are determined, and finally based on the comparison results of the fruit shape slope and the preset slope threshold. Fruit shape assessment.

Benefits of technology

It achieves accurate evaluation of fruit shape and provides an accurate and standardized evaluation solution to help increase sales of agricultural products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118629032A
    Figure CN118629032A
Patent Text Reader

Abstract

The invention provides a fruit shape evaluation method, device and equipment, a medium and a computer program product, and the method comprises the steps: sequentially carrying out the binarization processing and morphological processing of a preprocessed fruit image of a to-be-evaluated fruit, and determining a fruit edge in the preprocessed fruit image based on a processing result; determining a fruit axis position in the preprocessed fruit image based on a fruit edge in the preprocessed fruit image; determining a fruit shape slope of the to-be-evaluated fruit based on a fruit axis position in the preprocessed fruit image; and determining a fruit shape evaluation result of the to-be-evaluated fruit based on a comparison result of the fruit shape inclination and a preset inclination threshold value. According to the method, the fruit shape slope capable of evaluating the fruit shape is obtained by processing the fruit image, and an accurate and standard scheme for evaluating the fruit shape is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a fruit shape evaluation method, device, equipment, medium and computer program product. Background Art

[0002] The same category of fruits in different regions have large differences in shape. Due to the difference in shape, the sales of some regional fruits have decreased, affecting the income of fruit farmers in the producing areas. Machine vision has the advantages of being fast and non-destructive when used for agricultural product grading, but when grading irregular agricultural products, machine vision cannot evaluate based on the shape of the product itself, resulting in a decrease in the sales of agricultural products. Summary of the invention

[0003] The present invention provides a fruit shape evaluation method, device, equipment, medium and computer program product, which are used to solve the defect that the existing machine vision cannot evaluate the shape of agricultural products, and realize accurate evaluation of the fruit shape.

[0004] The invention provides a fruit shape evaluation method, comprising the following steps.

[0005] The pre-processed fruit image of the fruit to be evaluated is subjected to binarization processing and morphological processing in sequence, and the fruit edge in the pre-processed fruit image is determined based on the processing result; Determining a position of a fruit axis in the preprocessed fruit image based on a fruit edge in the preprocessed fruit image; Determining the fruit shape slope of the fruit to be evaluated based on the fruit axis position in the pre-processed fruit image; Based on the comparison result between the fruit shape slope and the preset slope threshold, the fruit shape evaluation result of the fruit to be evaluated is determined.

[0006] According to a fruit shape evaluation method provided by the present invention, the pre-processed fruit image of the fruit to be evaluated is subjected to binarization processing and morphological processing in sequence, and the fruit edge in the pre-processed fruit image is determined based on the processing result, which comprises: Acquire the original image of the fruit to be evaluated; The original images are sequentially screened for abnormalities and preset effects to obtain a preprocessed image set, wherein the preprocessed image set includes at least one preprocessed fruit image.

[0007] According to a fruit shape evaluation method provided by the present invention, the pre-processed fruit image of the fruit to be evaluated is subjected to binarization processing and morphological processing in sequence, and the fruit edge in the pre-processed fruit image is determined based on the processing result, comprising: determining a grayscale image corresponding to the pre-processed fruit image based on the grayscale value of each pixel in the pre-processed fruit image; Performing Gaussian filtering on the grayscale image to obtain a denoised image; Binarizing the denoised image to obtain a binary image; Perform edge extraction on the binary image, and determine the fruit edge in the preprocessed fruit image based on the edge extraction result.

[0008] According to a fruit shape evaluation method provided by the present invention, determining the position of the fruit axis in the preprocessed fruit image based on the fruit edge in the preprocessed fruit image comprises: Based on the fruit edge in the pre-processed fruit image, determining the minimum circumscribed rectangle and center coordinates of the fruit to be evaluated in the pre-processed fruit image; Based on the minimum circumscribed rectangle and the center coordinates, the position of the fruit axis in the pre-processed fruit image is determined.

[0009] According to a fruit shape evaluation method provided by the present invention, the step of determining the fruit shape slope of the fruit to be evaluated based on the fruit axis position in the preprocessed fruit image comprises: Based on the position of the fruit axis in the preprocessed fruit image, determining the coordinates of a plurality of target points on both sides of the fruit axis position; The fruit shape slope of the fruit to be evaluated is determined based on the slope of the straight line tangent from the central coordinate to the plurality of target points.

[0010] According to a fruit shape evaluation method provided by the present invention, the step of determining the fruit shape evaluation result of the fruit to be evaluated based on the comparison result between the fruit shape slope and a preset slope threshold comprises: Determine the absolute value of the difference between the fruit shape slope and a preset slope threshold; The fruit shape evaluation result of the fruit to be evaluated is determined based on the absolute value.

[0011] The present invention also provides a fruit shape evaluation device, comprising the following modules: An image edge determination module is used to sequentially perform binarization processing and morphological processing on a pre-processed fruit image of the fruit to be evaluated, and determine the fruit edge in the pre-processed fruit image based on the processing result; A fruit axis position determination module, used to determine the fruit axis position in the pre-processed fruit image based on the fruit edge in the pre-processed fruit image; A fruit shape slope determination module, used to determine the fruit shape slope of the fruit to be evaluated based on the fruit axis position in the pre-processed fruit image; The fruit shape evaluation module is used to determine the fruit shape evaluation result of the fruit to be evaluated based on the comparison result between the fruit shape slope and the preset slope threshold.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned fruit shape evaluation methods is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the fruit shape evaluation method as described in any one of the above is implemented.

[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the fruit shape evaluation method as described above is implemented.

[0015] The fruit shape evaluation method, device, equipment, medium and computer program product provided by the present invention sequentially perform binarization processing and morphological processing on the pre-processed fruit image of the fruit to be evaluated, and determine the fruit edge in the pre-processed fruit image based on the processing result. Then, based on the fruit edge in the pre-processed fruit image, determine the fruit axis position in the pre-processed fruit image, and then based on the fruit axis position in the pre-processed fruit image, determine the fruit shape slope that can evaluate the fruit shape of the fruit to be evaluated, and finally determine the fruit shape evaluation result of the fruit to be evaluated based on the comparison result between the fruit shape slope and the preset slope threshold. By performing a series of operation processing on the pre-processed fruit image, the fruit shape slope that can evaluate the fruit shape is obtained, and an accurate and standardized solution for evaluating the fruit shape is provided. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 It is one of the flow charts of the fruit shape evaluation method provided by the present invention.

[0018] Figure 2 This is the second flow chart of the fruit shape evaluation method provided by the present invention.

[0019] Figure 3 It is a structural schematic diagram of the fruit shape evaluation device provided by the present invention.

[0020] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] Combine the following Figure 1-Figure 4 The fruit shape evaluation method, device, equipment, medium and computer program product of the present invention are described.

[0023] Figure 1 FIG. 1 is one of the flow diagrams of the fruit shape evaluation method provided by the present invention, such as Figure 1 As shown, the method comprises the following steps: Step 100, performing binarization processing and morphological processing on the pre-processed fruit image of the fruit to be evaluated in sequence, and determining the fruit edge in the pre-processed fruit image based on the processing result; In the fruit shape evaluation scheme provided by the present application, it is first necessary to obtain the image of the fruit to be evaluated (the present application embodiment takes fruit as an example, but is not limited to other agricultural product types), the pre-processed fruit image is not limited to a specific shooting angle, it can be an image obtained by side shooting, it can also be an image obtained by shooting from a top-down angle, and the image obtained by shooting at an angle that can reflect the fruit shape is the best. After obtaining the pre-processed fruit image of the fruit to be evaluated, the gray value calculation is performed on the pixels in the pre-processed fruit image to obtain the gray value corresponding to each pixel in the pre-processed fruit image. Then the gray image is Gaussian filtered to remove abnormal pixels and play a noise reduction effect, and then the gray image after filtering is binarized to obtain a binarized image. Then the binarized image is edge extracted (i.e., morphological processing in the present embodiment), and the result of edge extraction is the fruit edge in the pre-processed fruit image.

[0024] Step 200, determining the position of the fruit axis in the preprocessed fruit image based on the fruit edge in the preprocessed fruit image; After determining the fruit edge of the preprocessed fruit image, the minimum bounding rectangle and center point coordinates of the fruit to be evaluated in the preprocessed fruit image are calculated and determined based on the fruit edge in the preprocessed fruit image. The minimum bounding rectangle and center point coordinates can be used to determine the fruit axis position in the preprocessed fruit image. The specific method will be described in detail below.

[0025] Step 300, based on the position of the fruit axis in the preprocessed fruit image, determine the fruit shape slope of the fruit to be evaluated; after determining the fruit axis position of the preprocessed fruit image, select multiple coordinate points on the fruit shape edges on both sides of the fruit axis position, calculate the slopes of the tangents of these straight lines through the connecting straight lines between the coordinates of the center point of the preprocessed fruit image and the selected coordinate points on the edges on both sides of the fruit axis, and calculate the absolute value of the difference between the slopes of the tangents of the straight lines on both sides. The absolute value of the difference between the slopes of the tangents of the straight lines on both sides of the fruit axis is the fruit shape slope that can be used to evaluate the fruit shape.

[0026] Step 400: Determine a fruit shape evaluation result of the fruit to be evaluated based on a comparison result between the fruit shape slope and a preset slope threshold.

[0027] After determining the fruit shape slope, the fruit shape evaluation result of the fruit to be evaluated is determined by comparing the fruit shape slope with the preset fruit shape slope threshold. It can be seen that the preset slope threshold is related to external factors such as the category and origin of the fruit to be evaluated. The preset slope thresholds corresponding to the fruits to be evaluated of different categories or origins are different. The larger the difference between the above-obtained fruit shape slope and the preset slope threshold, the worse the evaluation of the fruit shape; the smaller the difference between the fruit shape slope and the preset slope threshold, the better the evaluation of the fruit shape. Before comparing the fruit shape slope with the preset slope threshold, it is necessary to predetermine whether the fruit to be evaluated corresponding to the obtained fruit shape slope has a corresponding relationship with the preset slope threshold, that is, whether the preset slope threshold is the slope threshold corresponding to the category and origin of the fruit to be evaluated.

[0028] This embodiment sequentially performs binarization processing and morphological processing on the pre-processed fruit image of the fruit to be evaluated, and determines the fruit edge in the pre-processed fruit image based on the processing result. Based on the fruit edge in the pre-processed fruit image, the position of the fruit axis in the pre-processed fruit image is determined, and then based on the position of the fruit axis in the pre-processed fruit image, the fruit shape slope that can evaluate the fruit shape of the fruit to be evaluated is determined, and finally based on the comparison result between the fruit shape slope and the preset slope threshold, the fruit shape evaluation result of the fruit to be evaluated is determined. By performing a series of operations on the pre-processed fruit image, the fruit shape slope that can evaluate the fruit shape is obtained, and an accurate and standardized solution for evaluating the fruit shape is provided.

[0029] In one embodiment, the fruit shape evaluation method provided in the embodiment of the present application may further include: Step 10, obtaining the original image of the fruit to be evaluated; Step 20: Perform abnormality screening and preset effect screening on the original image in turn to obtain a pre-processed image set, wherein the pre-processed image set includes at least one pre-processed fruit image.

[0030] Before the pre-processed fruit image is binarized and morphologically processed, a series of pre-processing operations need to be performed on the original image of the fruit to be evaluated acquired by the image acquisition system. Among them, the process of the pre-processing operation includes abnormal screening, that is, removing abnormal images in the original image, and abnormal images include images that do not contain the whole fruit to be evaluated, images that are not taken at a specific angle, and images with abnormal scaling, etc. The pre-processing process also includes screening the original image of the fruit to be evaluated according to the preset effect to obtain the pre-processed fruit image that meets the preset effect, and adding the original image that meets the preset effect to the pre-processed image set. It can be seen that the pre-processed image set contains at least one pre-processed fruit image to facilitate the execution of the binarization process and the morphological process.

[0031] This embodiment performs a series of preprocessing operations on the acquired original image of the fruit to be evaluated, thereby obtaining a preprocessed fruit image that meets the requirements and can be subjected to binarization processing and morphological processing.

[0032] Figure 2 FIG. 2 is a flow chart of the fruit shape evaluation method provided by the present invention. Figure 2 As shown, the method may also include: Step 110, determining a grayscale image corresponding to the preprocessed fruit image based on the grayscale value of each pixel in the preprocessed fruit image; Step 120, performing Gaussian filtering on the grayscale image to obtain a denoised image; Step 130, binarizing the denoised image to obtain a binary image; Step 140: Perform edge extraction on the binary image, and determine the fruit edge in the preprocessed fruit image based on the edge extraction result.

[0033] Specifically, after obtaining a pre-processed fruit image that meets the requirements, the pre-processed fruit image is converted into a grayscale image, and the grayscale value of each pixel in the pre-processed fruit image is calculated. The grayscale image obtained by converting the pre-processed fruit image is subjected to Gaussian noise reduction filtering. The entire process of Gaussian filtering is to perform weighted averaging on the pixels in the pre-processed fruit image. The value of each pixel is obtained by weighted averaging the values ​​of itself and other pixels in its neighborhood. The purpose of Gaussian filtering is to eliminate Gaussian noise and perform noise reduction processing on the pre-processed fruit image. The specific operation of Gaussian filtering is: use a template (or convolution and mask) to scan each pixel in the image, and use the weighted average grayscale value of the pixels in the neighborhood determined by the template to replace the value of the pixel in the center of the template. When all pixels are processed, a Gaussian noise reduction image is obtained.

[0034] The image after Gaussian filtering needs to be binarized. Binarization is to convert each pixel on the image after Gaussian filtering into a pixel with only two values, namely black pixel (pixel with a pixel value of 0) and white pixel (pixel with a pixel value of 255). Binarization can reduce the complexity of the Gaussian denoised image, remove some unimportant parts of the image, and thus highlight important image features. The image after binarization is convenient for image segmentation, that is, the process of determining the edge of the pre-processed fruit image. The edge of the pre-processed fruit image also needs to be expanded, hole filled, eroded, and contour area filled.

[0035] This embodiment determines the fruit edge in the pre-processed fruit image through Gaussian noise reduction filtering, binarization processing, edge extraction and other operations, providing a data basis for further determining the slope of the fruit shape.

[0036] In one embodiment, the fruit shape evaluation method provided in the embodiment of the present application may further include: Step 210: determining the minimum circumscribed rectangle and center coordinates of the fruit to be evaluated in the preprocessed fruit image based on the fruit edge in the preprocessed fruit image; Step 220: Determine the position of the fruit axis in the pre-processed fruit image based on the minimum circumscribed rectangle and the center coordinates.

[0037] Specifically, after determining the fruit shape edge in the pre-processed fruit image, further determine the minimum bounding rectangle of the fruit to be evaluated in the pre-processed fruit image, wherein the minimum bounding rectangle is the minimum rectangle that can just surround all image edges of the fruit to be evaluated. The center coordinates of the pre-processed fruit image can be the center of the minimum bounding rectangle, and the center coordinates can be considered as the center of the fruit to be evaluated. After determining the minimum bounding rectangle and the center coordinates of the pre-processed fruit image, further determine the fruit axis position of the pre-processed fruit image. It can be known that the fruit axis of the pre-processed fruit image can pass through the center coordinates and divide the minimum bounding rectangle into two rectangles of the same area. For fruits to be evaluated with certain rules, such as apples, the fruit axis can divide the fruit to be evaluated into two relatively symmetrical parts. The minimum bounding rectangle and the center coordinates determined in this embodiment can be used to calculate and determine the fruit shape slope of the fruit to be evaluated, and the fruit shape slope can be directly used to evaluate the fruit to be evaluated.

[0038] This embodiment further determines the fruit axis position of the pre-processed fruit image by determining the minimum circumscribed rectangle and the center coordinates of the pre-processed fruit image, thereby providing a data basis for further determining the slope of the fruit shape.

[0039] In one embodiment, the fruit shape evaluation method provided in the embodiment of the present application may further include: Step 310: based on the position of the fruit axis in the preprocessed fruit image, determine the coordinates of a plurality of target points on both sides of the fruit axis position; Step 320: Determine the fruit shape slope of the fruit to be evaluated based on the slope of the straight line tangent from the center coordinate to the plurality of target points.

[0040] Specifically, according to the above content, the obtained fruit axis position can divide the preprocessed fruit image into two parts, namely, the two sides of the fruit axis position. The coordinates of each point on the edge of the fruit on the left and right sides of the fruit axis position are found, and the points on the edge of the image on the left and right sides of the fruit axis position can be found. The absolute value of the slope of the tangent line from the center coordinate to the points on the left and right sides of the fruit axis position is calculated, and then the difference between the absolute values ​​(average values) of the slopes obtained on the left and right sides is calculated, and the difference obtained is the fruit shape slope.

[0041] This embodiment obtains the fruit shape slope of the fruit to be evaluated by calculating the edge points on the left and right sides of the fruit axis position and the center coordinates of the pre-processed fruit image, and provides an accurate and standardized solution for evaluating the fruit shape.

[0042] In one embodiment, the fruit shape evaluation method provided in the embodiment of the present application may further include: Step 410, determining the absolute value of the difference between the fruit shape slope and a preset slope threshold; Step 420: Determine a fruit shape evaluation result of the fruit to be evaluated based on the absolute value.

[0043] Specifically, after obtaining the fruit shape inclination of the fruit to be evaluated by the fruit shape evaluation method provided by the present application, determine the inclination threshold value related to the category or origin of the fruit to be evaluated, that is, the preset inclination threshold value in this embodiment. Perform a difference operation on the fruit shape inclination and the preset inclination threshold value to obtain the difference between the fruit shape inclination and the preset inclination threshold value, and further determine the absolute value of the difference between the fruit shape inclination and the preset inclination threshold value. The basic idea of ​​fruit shape evaluation is: the larger the absolute value of the difference between the fruit shape inclination and the preset inclination threshold value, the worse the evaluation of the fruit shape; the smaller the absolute value of the difference between the fruit shape inclination and the preset inclination threshold value, the better the evaluation of the fruit shape. Based on this basic idea of ​​fruit shape evaluation, determine the fruit shape evaluation result of the fruit to be evaluated.

[0044] This embodiment determines the fruit shape evaluation result of the fruit to be evaluated by performing a difference operation on the fruit shape slope and a preset slope threshold, thereby providing an accurate and standardized solution for evaluating the fruit shape.

[0045] The fruit shape evaluation device provided by the present invention is described below. The fruit shape evaluation device described below and the fruit shape evaluation method described above can be referenced to each other.

[0046] Please refer to Figure 3 The present invention also provides a fruit shape evaluation device, comprising: An image edge determination module 301 is used to sequentially perform binarization processing and morphological processing on a pre-processed fruit image of a fruit to be evaluated, and determine a fruit edge in the pre-processed fruit image based on the processing result; A fruit axis position determination module 302, configured to determine the fruit axis position in the pre-processed fruit image based on the fruit edge in the pre-processed fruit image; A fruit shape slope determination module 303 is used to determine the fruit shape slope of the fruit to be evaluated based on the fruit axis position in the pre-processed fruit image; The fruit shape evaluation module 304 is used to determine the fruit shape evaluation result of the fruit to be evaluated based on the comparison result between the fruit shape slope and a preset slope threshold.

[0047] Optionally, the fruit shape evaluation device further comprises: The module for acquiring the original image of the fruit to be evaluated is used to acquire the original image of the fruit to be evaluated; The original image preprocessing module is used to perform abnormality screening and preset effect screening on the original image in sequence to obtain a preprocessed image set, and the preprocessed image set at least includes one preprocessed fruit image.

[0048] Optionally, the image edge determination module includes: A grayscale image determining unit, used for determining a grayscale image corresponding to the preprocessed fruit image based on the grayscale value of each pixel in the preprocessed fruit image; A Gaussian filtering unit, used for performing Gaussian filtering on the grayscale image to obtain a denoised image; A binarization processing unit, used for binarizing the denoised image to obtain a binary image; The edge extraction unit is used to perform edge extraction on the binary image and determine the fruit edge in the pre-processed fruit image based on the edge extraction result.

[0049] Optionally, the fruit axis position determination module includes: A minimum circumscribed rectangle and center coordinate determining unit, used to determine the minimum circumscribed rectangle and center coordinates of the fruit to be evaluated in the preprocessed fruit image based on the fruit edge in the preprocessed fruit image; A fruit axis position determination unit is used to determine the fruit axis position in the pre-processed fruit image based on the minimum circumscribed rectangle and the center coordinates.

[0050] Optionally, the fruit shape slope determination module includes: A point coordinate determination unit, used for determining the coordinates of a plurality of target points on both sides of the fruit axis position based on the fruit axis position in the preprocessed fruit image; The fruit shape slope determination unit is used to determine the fruit shape slope of the fruit to be evaluated based on the slope of the straight line tangent from the center coordinate to the multiple target points.

[0051] Optionally, the fruit shape assessment module includes: A calculation unit, used to determine the absolute value of the difference between the fruit shape slope and a preset slope threshold; The fruit shape evaluation unit is used to determine the fruit shape evaluation result of the fruit to be evaluated based on the absolute value.

[0052] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the fruit shape evaluation method, which includes: performing binarization processing and morphological processing on the pre-processed fruit image of the fruit to be evaluated in sequence, and determining the fruit edge in the pre-processed fruit image based on the processing result; determining the fruit axis position in the pre-processed fruit image based on the fruit edge in the pre-processed fruit image; determining the fruit shape slope of the fruit to be evaluated based on the fruit axis position in the pre-processed fruit image; and determining the fruit shape evaluation result of the fruit to be evaluated based on the comparison result between the fruit shape slope and a preset slope threshold.

[0053] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0054] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the fruit shape evaluation method provided by the above-mentioned methods, which includes: performing binarization processing and morphological processing on a preprocessed fruit image of the fruit to be evaluated in sequence, and determining the fruit edge in the preprocessed fruit image based on the processing result; determining the fruit axis position in the preprocessed fruit image based on the fruit edge in the preprocessed fruit image; determining the fruit shape slope of the fruit to be evaluated based on the fruit axis position in the preprocessed fruit image; and determining the fruit shape evaluation result of the fruit to be evaluated based on the comparison result of the fruit shape slope and a preset slope threshold.

[0055] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the fruit shape evaluation method provided by the above-mentioned methods, the method comprising: sequentially performing binarization processing and morphological processing on a preprocessed fruit image of the fruit to be evaluated, and determining the fruit edge in the preprocessed fruit image based on the processing result; determining the fruit axis position in the preprocessed fruit image based on the fruit edge in the preprocessed fruit image; determining the fruit shape slope of the fruit to be evaluated based on the fruit axis position in the preprocessed fruit image; and determining the fruit shape evaluation result of the fruit to be evaluated based on a comparison result of the fruit shape slope with a preset slope threshold.

[0056] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0057] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0058] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fruit shape evaluation method, characterized in that: include: The pre-processed fruit image of the fruit to be evaluated is subjected to binarization processing and morphological processing in sequence, and the fruit edge in the pre-processed fruit image is determined based on the processing result; Determining a position of a fruit axis in the preprocessed fruit image based on a fruit edge in the preprocessed fruit image; Determining the fruit shape slope of the fruit to be evaluated based on the fruit axis position in the pre-processed fruit image; Based on the comparison result between the fruit shape slope and the preset slope threshold, the fruit shape evaluation result of the fruit to be evaluated is determined.

2. The fruit shape evaluation method according to claim 1, characterized in that: The pre-processed fruit image of the fruit to be evaluated is subjected to binarization processing and morphological processing in sequence, and the fruit edge in the pre-processed fruit image is determined based on the processing result, which includes: Acquire the original image of the fruit to be evaluated; The original images are sequentially screened for abnormalities and preset effects to obtain a preprocessed image set, wherein the preprocessed image set includes at least one preprocessed fruit image.

3. The fruit shape evaluation method according to claim 1, characterized in that: The pre-processed fruit image of the fruit to be evaluated is subjected to binarization processing and morphological processing in sequence, and the fruit edge in the pre-processed fruit image is determined based on the processing result, comprising: Determine a grayscale image corresponding to the preprocessed fruit image based on the grayscale value of each pixel in the preprocessed fruit image; Performing Gaussian filtering on the grayscale image to obtain a denoised image; Binarizing the denoised image to obtain a binary image; Perform edge extraction on the binary image, and determine the fruit edge in the preprocessed fruit image based on the edge extraction result.

4. The fruit shape evaluation method according to claim 1, characterized in that: The determining the position of the fruit axis in the preprocessed fruit image based on the fruit edge in the preprocessed fruit image comprises: Based on the fruit edge in the pre-processed fruit image, determining the minimum circumscribed rectangle and center coordinates of the fruit to be evaluated in the pre-processed fruit image; Based on the minimum circumscribed rectangle and the center coordinates, the position of the fruit axis in the pre-processed fruit image is determined.

5. The fruit shape evaluation method according to claim 1, characterized in that: The step of determining the fruit shape slope of the fruit to be evaluated based on the fruit axis position in the pre-processed fruit image comprises: Based on the position of the fruit axis in the preprocessed fruit image, determining the coordinates of a plurality of target points on both sides of the fruit axis position; The fruit shape slope of the fruit to be evaluated is determined based on the slope of the straight line tangent from the central coordinate to the plurality of target points.

6. The fruit shape evaluation method according to claim 1, characterized in that: The step of determining the fruit shape evaluation result of the fruit to be evaluated based on the comparison result between the fruit shape slope and the preset slope threshold comprises: Determine the absolute value of the difference between the fruit shape slope and a preset slope threshold; The fruit shape evaluation result of the fruit to be evaluated is determined based on the absolute value.

7. A fruit shape evaluation device, characterized in that: include: An image edge determination module is used to sequentially perform binarization processing and morphological processing on a pre-processed fruit image of the fruit to be evaluated, and determine the fruit edge in the pre-processed fruit image based on the processing result; A fruit axis position determination module, used to determine the fruit axis position in the pre-processed fruit image based on the fruit edge in the pre-processed fruit image; A fruit shape slope determination module, used to determine the fruit shape slope of the fruit to be evaluated based on the fruit axis position in the pre-processed fruit image; The fruit shape evaluation module is used to determine the fruit shape evaluation result of the fruit to be evaluated based on the comparison result between the fruit shape slope and the preset slope threshold.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the fruit shape evaluation method as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the fruit shape evaluation method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the fruit shape evaluation method according to any one of claims 1 to 6 is implemented.