A fruit and vegetable color recognition and detection method based on grayscale image and hybrid modeling

By establishing a grayscale image mixture model and using hyperbolic functions and fuzzy subset technology, the problem of feature information loss caused by grayscale conversion of color images in post-harvest fruit and vegetable sorting is solved, and efficient detection of fruit and vegetable color recognition is achieved.

CN117173695BActive Publication Date: 2025-09-23REEMOON TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311150575.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-07
Publication Date
2025-09-23
Estimated Expiration
2043-09-07

AI Technical Summary

Technical Problem

During the post-harvest sorting of fruits and vegetables, the grayscale conversion of color images leads to the loss or weakening of chromaticity, contrast and structural feature information, affecting the accuracy of fruit and vegetable color recognition and detection.

Method used

A method based on grayscale image and hybrid modeling is adopted. A grayscale image hybrid model is established through the inverse of several hyperbolic functions. Combining fuzzy subsets and membership functions, a grayscale value label recommendation set is constructed to retain the color information of fruit and vegetable images and realize fruit and vegetable color recognition and detection.

Benefits of technology

The global feature information of fruit and vegetable images is effectively retained, and the accuracy and efficiency of fruit and vegetable color recognition and detection are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117173695B_ABST
    Figure CN117173695B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for identifying and detecting the color of fruits and vegetables based on grayscale images and hybrid modeling. Color recognition is performed by establishing a grayscale hybrid model. A cyclic mode is used to select appropriate grayscales in combination with a grayscale selection variance condition to construct a grayscale image. In an iterative process, the proportion widths corresponding to different grayscale values ​​in a domain are given. Thus, color recognition is performed on pixel points in a fruit and vegetable image that needs to be color-recognized by using the grayscale hybrid model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of post-harvest sorting of fruits and vegetables, and specifically relates to establishing a grayscale image mixing model through the inverses of several hyperbolic functions to perform color recognition, re-sorting the values ​​from large to small according to the proportion of grayscale values, and outputting them as a recommended set of grayscale value labels, and giving the corresponding proportion widths of different grayscale values, thereby realizing fruit and vegetable color recognition and detection. Background Art

[0002] During the dimensionality reduction process of grayscale color images, the loss or weakening of characteristic features such as chromaticity, contrast, and structure is inevitable. Research on grayscale methods aims to preserve other information, such as contrast and structure, while maintaining the brightness characteristics of the color image. With the deepening of research on grayscale color image conversion methods, scholars have proposed many targeted methods to better preserve the characteristic information of interest in color images. Based on the correlation between pixel grayscale value and position and the effective range of the mapping function, these methods can be divided into local mapping methods and global mapping methods. Local mapping methods are position-dependent and primarily consider the color contrast between a pixel and its surrounding pixels and groups. Global mapping methods are position-independent and consider preserving the color contrast of the entire image. For example, methods based on nonlinear parametric models can treat the grayscale conversion process as an optimization of the discriminability of matching features. They also construct a bimodal objective function for contrast preservation by mapping the grayscale image into the second-order RGB color space to maximize the preservation of color contrast. The global mapping method uses a linear or nonlinear mapping function to ensure that the mapping of the same color from three dimensions to one dimension is unique, resulting in only identical grayscale values. This maintains the global features of the color image, such as contrast and structure. Designing an appropriate mapping function is crucial for preserving the global features of color images and can effectively implement color recognition and detection in post-harvest fruit and vegetable sorting. Summary of the Invention

[0003] The appropriate grayscale value and the corresponding membership status of the grayscale value close to the color hue are taken to give the proportion width corresponding to different grayscale values, so as to meet the design goal of using the grayscale image mixture model to identify and detect the color of fruits and vegetables in the pixel points of fruit and vegetable pictures.

[0004] According to the design scheme provided by the present invention, a method for identifying and detecting the color of fruits and vegetables based on grayscale images and hybrid modeling includes the following steps:

[0005] Step 1: If each pixel in the fruit and vegetable image can be used to establish a grayscale image mixture model for color recognition by using the inverse of several hyperbolic functions, a domain as a finite set can be set as a set constructed from several typical grayscale values. At the same time, the grayscale image mixture model can be set as a fuzzy subset on the domain, and its membership function is the inverse of the hyperbolic function after the difference between the grayscale value of a pixel and the typical value of a specified grayscale is divided by the proportion width of the specified grayscale. Then, the grayscale image mixture model can be represented by the Zadeh notation using multiple typical grayscale values ​​and the corresponding membership functions;

[0006] Step 2: Count the proportions of grayscale values ​​corresponding to different grayscale values ​​from the image sample set of fruits and vegetables, sort the proportions of grayscale values ​​in descending order, and establish a grayscale value label sorting set. Select the labels of the previous several grayscale values ​​to establish a grayscale value label usage set when the number of cycles is zero, and calculate the grayscale selection variance when the number of cycles is zero. In the loop process, add the grayscale value label corresponding to the maximum value of the proportion of the grayscale value label usage set that has not been used in the current loop number, and calculate the grayscale selection variance of the current loop number. If the grayscale selection variance of the current loop number is the same as that of the previous loop number, If the absolute value of the difference in the grayscale selection variance conditions of the numbers is greater than the grayscale selection variance change threshold, two elements with the closest corresponding grayscale values ​​are selected from the current grayscale value label usage set, the label with a higher grayscale value ratio is retained, and the grayscale value ratio conditions of the two are merged as the grayscale value ratio conditions corresponding to the label, otherwise the newly added label is removed, and the loop process can be ended; when the loop process is completed, the grayscale value label usage set of the current loop number is re-sorted according to the grayscale value ratio conditions from large to small according to the numerical value, and then output as the grayscale value label recommendation set, and the domain in step 1 is set in sequence according to the corresponding grayscale value;

[0007] Step 3: Use the grayscale value label recommendation set given in step 2 when initializing the iterative process; before each iterative process starts, check whether there is an element in the current grayscale value label recommendation set. If not, the iterative process can be ended. If so, the label of the grayscale value corresponding to the maximum value of the grayscale value proportion in the current grayscale value label recommendation set and the corresponding grayscale value are given to continue the iterative process; in each iterative process, determine whether the grayscale value has a left adjacent grayscale value or a right adjacent grayscale value in the current grayscale value label recommendation set. By selecting a grayscale value with a color close to the grayscale value within the range of the grayscale value and the left adjacent grayscale value or the right adjacent grayscale value and substituting it into the membership condition set to 0.5, the left proportion width or the right proportion width of the grayscale value can be obtained; at the end of the iterative process, the proportion width corresponding to different grayscale values ​​in the domain is given;

[0008] Step 4: For the pixels in the fruit and vegetable images that need to be color-recognized, the grayscale image mixture model can be used to perform color recognition;

[0009] Furthermore, step 1 specifically includes:

[0010] If each pixel on the fruit and vegetable image can be constructed by the inverse of K hyperbolic functions, a grayscale image mixing model To perform color recognition, set k to be In the grayscale image, the grayscale label is used and k∈[1,2,...,K] and μ k is the typical value of the kth grayscale, then the universe Ω can be expressed as a finite set Ω={μ1,...,μ k ,...,μ K}, and set the grayscale image mixed model is a fuzzy subset on Ω, and its membership function is Where x is the grayscale of the pixel, ω k is the width of the k-th grayscale, which can be expressed using Zadeh notation. Expressed as:

[0011]

[0012] Furthermore, the specific steps of step 2 are:

[0013] Step 2-1: Create an image sample set Θ of a certain fruit and vegetable from M images of the fruit and vegetable GS , after selecting N pixels from each image, the corresponding grayscale values ​​are counted. If there are H different grayscale values, the proportion of the h-th grayscale value HDBL(h) is given:

[0014]

[0015] Among them, x m,n is the grayscale value of the nth pixel in the mth image, true is the function to determine whether it is true, 1 if it is true, 0 if it is not true, HD h is the hth grayscale value, δ HD is the grayscale deviation tolerance range;

[0016] Step 2-2: Set the number of cycles c to 0, sort the grayscale value ratios from large to small, and then create a grayscale value number sorting set Ξ BH and from Ξ BH Select the labels of the first K grayscale values ​​to establish the grayscale value label usage set Ψ(c=0) when the number of cycles c is 0, and calculate the grayscale selection variance state FCZK(c) when the number of cycles c is 0:

[0017]

[0018] Step 2-3: Increase the current number of cycles c by 1, and set BH - The grayscale value index d corresponding to the maximum value of the grayscale value ratio in Ψ(c) is added to Ψ(c+1), and the grayscale selection variance FCZK(c+1) when the current cycle number is c+1 is calculated:

[0019]

[0020] Step 2-4: If in To select the variance change threshold for grayscale, remove the newly added label d from Ψ(c+1), and then go to step 2-6;

[0021] Step 2-5: If Then, two elements with the closest grayscale values ​​are selected from Ψ(c+1), the one with the higher grayscale value ratio is retained, and the grayscale value ratios of the two are combined as the grayscale value ratio corresponding to the element, and then the process goes to step 2-3;

[0022] Step 2-6: Re-sort the grayscale values ​​in Ψ(c+1) from large to small according to their proportions and output them as a recommended grayscale value label set Ψ′, and set the Ω in step 1 in sequence according to the corresponding grayscale values ​​in the Ψ′;

[0023] Furthermore, the specific steps of step 3 are:

[0024] Step 3-1: Initialize the iterative process using the recommended set of grayscale value labels Ψ′ given in step 2;

[0025] Step 3-2: Check whether there is an element in the current Ψ′. If not, go to step 3-7. Otherwise, give the grayscale value i and the corresponding grayscale value μ corresponding to the maximum value of the grayscale value ratio in the current Ψ′. i ;

[0026] Step 3-3: Determine whether there is a corresponding μ in the current Ψ′ i Gray value adjacent to the left Gray value adjacent to the right If exists Then go to step 3-4, if it exists Then proceed to step 3-5;

[0027] Step 3-4: In the μ i To the above Select the range with μ i Grayscale values ​​close to the color hue Can be set in grayscale image mixing model superior For μ i The affiliation status is:

[0028]

[0029] Depend on It can be seen that:

[0030]

[0031] After finishing, we can get:

[0032]

[0033] From this we can get the width of the left side of the i-th grayscale image

[0034] Step 3-5: In the μ i To the above Select the range with μ i Grayscale values ​​close to the color hue And set It can be seen that Then we can get:

[0035]

[0036] From this we can get the width of the right side of the i-th grayscale image

[0037] Step 3-6: If for the μ i Only the Then set If for the μ i Only the Then set If for the μ i There is also the and stated Then set The μ i Delete from the Ψ′ and go to step 3-2;

[0038] Step 3-7: Output the different grayscale values ​​μ in Ω given in step 2 i The corresponding ω i value;

[0039] Furthermore, step 4 specifically includes:

[0040] For fruit and vegetable images that need to be detected for color recognition, the grayscale image hybrid model can be used for pixel point j in the fruit and vegetable image. To perform color recognition:

[0041]

[0042] Among them, x j is the grayscale value of pixel j; BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0044] Figure 1 This is a step diagram of a method for identifying and detecting fruit and vegetable colors based on grayscale images and hybrid modeling in an embodiment of the present invention;

[0045] Figure 2 1 is a cyclic flow chart for providing a suitable grayscale in a grayscale image mixing model according to an embodiment of the present invention;

[0046] Figure 3 This is an iterative flow chart for providing the proportion width corresponding to different grayscale values ​​in an embodiment of the present invention;

[0047] Figure 4 A grapefruit image sample set is established for the grapefruit image converted from a color image to grayscale in an embodiment of the present invention;

[0048] Figure 5 A diagram showing the relationship between grayscale value labels and grayscale values ​​provided in an embodiment of the present invention;

[0049] Figure 6 A schematic diagram of different grayscale value labels and proportion widths is provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to have a more thorough understanding of the technical features, objectives and effects of the present invention, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0051] An embodiment of the present invention provides a method for identifying and detecting the color of fruits and vegetables based on grayscale images and hybrid modeling.

[0052] Please refer to Figure 1 , Figure 1 This is a step diagram of a method for fruit and vegetable color recognition and detection based on grayscale images and hybrid modeling in an embodiment of the present invention, comprising the following steps:

[0053] Step 1: If each pixel in the fruit and vegetable image can be used to establish a grayscale image mixture model for color recognition by using the inverse of several hyperbolic functions, a domain as a finite set can be set as a set constructed from several typical grayscale values. At the same time, the grayscale image mixture model can be set as a fuzzy subset on the domain, and its membership function is the inverse of the hyperbolic function after the difference between the grayscale value of a pixel and the typical value of a specified grayscale is divided by the proportion width of the specified grayscale. Then, the grayscale image mixture model can be represented by the Zadeh notation using multiple typical grayscale values ​​and the corresponding membership functions;

[0054] Reference Figure 2 ,Step 2: Count the proportion of gray values ​​corresponding to different gray values ​​from the image sample set of fruits and vegetables, sort the proportion of gray values ​​from large to small according to the value, and then establish a gray value label sorting set, and select the labels of the previous several gray values ​​to establish the gray value label usage set when the number of cycles is zero, and calculate the gray selection variance when the number of cycles is zero; in the loop process, add the gray value label corresponding to the maximum value of the proportion of the gray value label usage set that has not been used in the current loop number, and calculate the gray selection variance of the current loop number. If the gray selection variance of the current loop number is the same as that of the previous loop number, If the absolute value of the difference in the grayscale selection variance conditions of the numbers is greater than the grayscale selection variance change threshold, two elements with the closest corresponding grayscale values ​​are selected from the current grayscale value label usage set, the label with a higher grayscale value ratio is retained, and the grayscale value ratio conditions of the two are merged as the grayscale value ratio conditions corresponding to the label, otherwise the newly added label is removed, and the loop process can be ended; when the loop process is completed, the grayscale value label usage set of the current loop number is re-sorted according to the grayscale value ratio conditions from large to small according to the numerical value, and then output as the grayscale value label recommendation set, and the domain in step 1 is set in sequence according to the corresponding grayscale value;

[0055] Reference Figure 3 , Step 3: Use the grayscale value label recommendation set given in step 2 when initializing the iterative process; before each iterative process starts, check whether there is an element in the current grayscale value label recommendation set. If not, the iterative process can be ended. If so, the grayscale value label corresponding to the maximum value of the grayscale value proportion in the current grayscale value label recommendation set and the corresponding grayscale value are given to continue the iterative process; in each iterative process, determine whether the grayscale value has a left adjacent grayscale value or a right adjacent grayscale value in the current grayscale value label recommendation set. By selecting a grayscale value with a color close to the grayscale value within the range of the grayscale value and the left adjacent grayscale value or the right adjacent grayscale value and substituting it into the membership condition set to 0.5, the left proportion width or the right proportion width of the grayscale value can be obtained; at the end of the iterative process, the proportion width corresponding to different grayscale values ​​in the domain is given;

[0056] Step 4: For the pixels in the fruit and vegetable images that need to be color-recognized, the grayscale image mixture model can be used to perform color recognition;

[0057] Furthermore, step 1 specifically includes:

[0058] Assume that grapefruit is the object of color recognition detection in the embodiment of the present invention. If each pixel on the grapefruit image can be constructed by the inverse of K=8 hyperbolic functions, a grayscale image mixing model is established. To perform color recognition, set k to be Grayscale images are labeled with grayscale and k∈[1,2,...,K] and is the typical value of the kth grayscale, then the universe Ω can be expressed as a finite set Ω={μ1,...,μ k ,...,μ K}, and set the grayscale image mixed model is a fuzzy subset on Ω, and its membership function is Where x is the grayscale of the pixel, ω k is the width of the k-th grayscale, which can be expressed using Zadeh notation. Expressed as:

[0059]

[0060] Furthermore, the specific steps of step 2 are:

[0061] Step 2-1: From M = 200 sheets Figure 4 The grapefruit image sample set Θ is established by converting the color image into grayscale. GS , where the resolution of each grapefruit image is 512×512. N=128×128 pixels are selected from each image and their corresponding grayscale values ​​are counted. If there are H different grayscale values, the proportion of the h-th grayscale value HDBL(h) is given:

[0062]

[0063] Among them, x m,n is the grayscale value of the nth pixel in the mth image, true is the function to determine whether it is true, 1 if it is true, 0 if it is not true, HD h is the hth grayscale value, δ HD is the grayscale deviation tolerance range;

[0064] Step 2-2: Set the number of cycles c to 0, sort the grayscale value ratios from large to small, and then create a grayscale value number sorting set Ξ BH and from Ξ BHSelect the labels of the first K grayscale values ​​to establish the grayscale value label usage set Ψ(c=0) when the number of cycles c is 0, and calculate the grayscale selection variance state FCZK(c) when the number of cycles c is 0:

[0065]

[0066] Step 2-3: Increase the current number of cycles c by 1, and set BH - The grayscale value index d corresponding to the maximum value of the grayscale value ratio in Ψ(c) is added to Ψ(c+1), and the grayscale selection variance FCZK(c+1) when the current cycle number is c+1 is calculated:

[0067]

[0068] Step 2-4: If in To select the variance change threshold for grayscale, remove the newly added label d from Ψ(c+1), and then go to step 2-6;

[0069] Step 2-5: If Then, two elements with the closest grayscale values ​​are selected from Ψ(c+1), the one with the higher grayscale value ratio is retained, and the grayscale value ratios of the two are combined as the grayscale value ratio corresponding to the element, and then the process goes to step 2-3;

[0070] Step 2-6: Rearrange the grayscale values ​​in Ψ(c+1) from large to small according to the grayscale value ratio and output it as the grayscale value label recommendation set Ψ′. Set the grayscale value label and grayscale value as follows: Figure 5 As shown in , thereby giving the corresponding grayscale value in Ψ′, and then setting the Ω in step 1 in sequence;

[0071] Furthermore, the specific steps of step 3 are:

[0072] Step 3-1: Initialize the iterative process using the recommended set of grayscale value labels Ψ′ given in step 2;

[0073] Step 3-2: Check whether there is an element in the current Ψ′. If not, go to step 3-7. Otherwise, give the grayscale value i and the corresponding grayscale value μ corresponding to the maximum value of the grayscale value ratio in the current Ψ′. i ;

[0074] Step 3-3: Determine whether there is a corresponding μ in the current Ψ′ i Gray value adjacent to the left Gray value adjacent to the right If exists Then go to step 3-4, if it exists Then proceed to step 3-5;

[0075] Step 3-4: In the μ i To the above Select the range with μ i Grayscale values ​​close to the color hue Can be set in grayscale image mixing model superior For μ i The affiliation status is From this we can get the width of the left side of the i-th grayscale image

[0076] Step 3-5: In the μ i To the above Select the range with μ i Grayscale values ​​close to the color hue And set From this we can get the width of the right side of the i-th grayscale image

[0077] Step 3-6: If for the μ i Only the Then set If for the μ i Only the Then set If for the μ i There is also the and stated Then set The μ i Delete from the Ψ′ and go to step 3-2;

[0078] Step 3-7: Set the output as Figure 6 As shown in step 2, for the different grayscale values ​​μ in Ω i The corresponding ω i value;

[0079] Furthermore, step 4 specifically includes:

[0080] For a grapefruit image that needs to be tested for fruit and vegetable color recognition, for pixel point j in the grapefruit image, when x is set j When the gray value of pixel j is the gray value, the grayscale mixed model can be used To perform color recognition:

[0081]

[0082] It can be seen that for pixel j, we can choose The corresponding μ kUsed as grayscale value.

[0083] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention. Any portion not specified in this embodiment may be implemented using existing technology.

Claims

1. A method for fruit and vegetable color recognition and detection based on grayscale image and hybrid modeling, characterized in that: The following steps are involved: Step 1: If each pixel in the fruit and vegetable image can be used to establish a grayscale image mixture model for color recognition by using the inverse of several hyperbolic functions, a domain as a finite set can be set as a set constructed from several typical grayscale values. At the same time, the grayscale image mixture model can be set as a fuzzy subset on the domain, and its membership function is the inverse of the hyperbolic function after the difference between the grayscale value of a pixel and the typical value of a specified grayscale is divided by the proportion width of the specified grayscale. Then, the grayscale image mixture model can be represented by the Zadeh notation using multiple typical grayscale values ​​and the corresponding membership functions; Step 2: Count the grayscale value ratios corresponding to different grayscale values ​​from the fruit and vegetable image sample set, sort the grayscale value ratios in descending order, and establish a grayscale value label sorting set. Select the labels of the first several grayscale values ​​to establish a grayscale value label usage set when the number of cycles is zero, and calculate the grayscale selection variance when the number of cycles is zero. During the loop process, the grayscale value label corresponding to the maximum value of the proportion condition of the grayscale value label usage set that has not been used in the current loop number is added thereto, and the grayscale selection variance condition of the current loop number is calculated. If the absolute value of the difference between the grayscale selection variance condition of the current loop number and the grayscale selection variance condition of the previous loop number is greater than the grayscale selection variance change threshold, two elements with the closest corresponding grayscale values ​​are selected from the current grayscale value label usage set, the label with the higher grayscale value proportion condition is retained, and the grayscale value proportion conditions of the two are merged as the grayscale value proportion condition corresponding to the label, otherwise the newly added label is eliminated, and the loop process can be ended; when the loop process is completed, the grayscale value label usage set of the current loop number is re-sorted according to the grayscale value proportion condition from large to small according to the numerical value, and output as the grayscale value label recommendation set, and the domain in step 1 is set in sequence according to the corresponding grayscale value; Step 3: Use the grayscale value label recommendation set given in step 2 when initializing the iterative process; before each iterative process starts, check whether there is an element in the current grayscale value label recommendation set. If not, the iterative process can be ended. If so, the label of the grayscale value corresponding to the maximum value of the grayscale value proportion in the current grayscale value label recommendation set and the corresponding grayscale value are given to continue the iterative process; in each iterative process, determine whether the grayscale value has a left adjacent grayscale value or a right adjacent grayscale value in the current grayscale value label recommendation set. By selecting a grayscale value with a color close to the grayscale value within the range of the grayscale value and the left adjacent grayscale value or the right adjacent grayscale value and substituting it into the membership condition set to 0.5, the left proportion width or the right proportion width of the grayscale value can be obtained; at the end of the iterative process, the proportion width corresponding to different grayscale values ​​in the domain is given; Step 4: For the pixels in the fruit and vegetable images that need to be detected for color recognition, color recognition can be performed by using a grayscale image mixture model.

2. The method for fruit and vegetable color recognition and detection based on grayscale image and hybrid modeling according to claim 1, characterized in that: The step 1 specifically includes: If each pixel on the fruit and vegetable image can be The inverse of a hyperbolic function is used to establish a grayscale image mixing model To perform color recognition, set For the Grayscale images are labeled using grayscale and as well as For the Typical values ​​of grayscale, then let the domain As a finite set it can be represented as , and set the grayscale image mixed model for The fuzzy subset on , its membership function is ,in is the grayscale of the pixel, For the The proportion of the width of the grayscale can be expressed in Zadeh form. Expressed as: 。 3. The method for fruit and vegetable color recognition and detection based on grayscale image and hybrid modeling according to claim 2, characterized in that: The specific steps of step 2 are: Step 2-1: By Create an image sample set of a certain type of fruit and vegetable , from each image After selecting pixels, count the corresponding grayscale values. If there is different grayscale values, then the The ratio of gray values : in, For the In the image The gray value of a pixel, For the Grayscale value, is the grayscale deviation tolerance range; Step 2-2: Set the number of cycles If the grayscale value ratio is 0, the grayscale value ratio is sorted from large to small according to the value, and then a grayscale value label sorting set is established. and from Before the selection The grayscale value is used to establish the number of cycles Grayscale value label when it is 0 uses set , and calculate the number of cycles Grayscale selection variance when it is 0 : Step 2-3: Set the current number of loops Add 1 and The grayscale value number corresponding to the maximum value of the grayscale value ratio join in , and calculate the current number of cycles as Grayscale selection variance : Step 2-4: If ,in To select the variance change threshold for grayscale, the newly added label from Eliminate it and then go to step 2-6; Step 2-5: If , then from Select the two elements with the closest grayscale values, retain the label with the higher grayscale value ratio, and combine the grayscale value ratios of the two as the grayscale value ratio corresponding to the label, and then go to step 2-3; Step 2-6: According to the ratio of gray values, the values ​​are sorted from large to small and then used as the recommended set of gray value labels. Output, and gives the The corresponding grayscale values ​​in step 1 are set in turn .

4. The method for fruit and vegetable color recognition and detection based on grayscale image and hybrid modeling according to claim 3, characterized in that: The specific steps of step 3 are: Step 3-1: Initialize the iterative process using the recommended set of grayscale value labels given in step 2 ; Step 3-2: Check the current Is there an element in the , if not, go to step 3-7, otherwise give the current The grayscale value number corresponding to the maximum value of the grayscale value ratio And the corresponding grayscale value ; Step 3-3: Determine the current Is there any Gray value adjacent to the left Gray value adjacent to the right , if exists Then go to step 3-4, if it exists Then proceed to step 3-5; Step 3-4: In the To the above Select from the range Grayscale values ​​close to the color hue , can be set in the grayscale image mixing model superior for The affiliation status is , from this we can get The left side of the grayscale image accounts for the width ; Steps 3-5: To the above Select from the range Grayscale values ​​close to the color hue , and set , from this we can get The right side of the grayscale image accounts for the width ; Step 3-6: If Only the , then set ; If for the Only the , then set ; If for the said There is also the and stated , then set ; From the said Delete it and go to step 3-2; Step 3-7: Output given in step 2 Different gray values Corresponding value.

5. The method for fruit and vegetable color recognition and detection based on grayscale image and hybrid modeling according to claim 1, characterized in that: The step 4 specifically includes: For the fruit and vegetable pictures that need to be detected for color recognition, for the pixel points in the fruit and vegetable pictures , we can use the grayscale image mixture model To perform color recognition: in, Pixel Gray value.

Citation Information

Patent Citations

  • Color image graying method

    CN106447603A

  • High-tension transmission line insulator picture enhancing method based on improved fuzzy set theory

    CN108154490A