A method for detecting sub-pixel edges of fruit and vegetable images based on Gaussian modeling

By introducing a cubic Gaussian curve fitting factor into fruit and vegetable images, a Gaussian curve fitting value for sub-pixel edge detection is constructed, which solves the problem of poor positioning accuracy in traditional methods and achieves higher accuracy sub-pixel edge detection.

CN117237664BActive Publication Date: 2026-03-20REEMOON TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-07
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Traditional edge detection algorithms suffer from poor positioning accuracy and sensitivity to noise in fruit and vegetable images, making it difficult to achieve sub-pixel level precise positioning.

Method used

A Gaussian curve cubic fitting factor is introduced to construct Gaussian curve fitting values ​​for subpixel edge detection of fruit and vegetable images. Subpixel edge detection is performed by finding the extreme points of the gradient magnitude corresponding to gray levels.

Benefits of technology

It improves the accuracy and efficiency of subpixel edge detection in fruit and vegetable images, overcomes the left-right asymmetry in traditional methods, and achieves more accurate edge localization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117237664B_ABST
    Figure CN117237664B_ABST
Patent Text Reader

Abstract

The application discloses a fruit and vegetable image sub-pixel edge detection method based on Gaussian modeling. In view of the situation that the left and right sides of the approximate Gaussian curve are not equal in the conventional sub-pixel edge detection, the introduction of a cubic fitting factor helps to change the original Gaussian modeling curve symmetry structure and adjust the height range of the left and right wings to make it closer to the actual data curve characteristics. By constructing a fruit and vegetable image sub-pixel edge detection error function, the Gaussian curve fitting coefficient optimization value, the Gaussian curve fitting median optimization value, the Gaussian curve fitting standard deviation optimization value and the cubic fitting factor optimization value are determined. The gradient amplitude of the pixel point can give the corresponding fruit and vegetable image sub-pixel edge detection Gaussian curve fitting value to judge whether it is a sub-pixel edge point, so as to complete the fruit and vegetable image sub-pixel edge detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of image detection, and particularly relates to a method for detecting a sub-pixel edge of a fruit and vegetable image by introducing a cubic fitting factor of a Gaussian curve to construct a Gaussian curve fitting value for the sub-pixel edge detection of the fruit and vegetable image, so as to solve the situation that the left and right sides of an approximate Gaussian curve are not equal in the conventional sub-pixel edge detection, and to find a sub-pixel edge point in the fruit and vegetable image based on a point corresponding to a maximum value of the Gaussian curve, thereby realizing the sub-pixel edge detection of the fruit and vegetable image. BACKGROUND

[0002] Edge detection is the basis for analyzing an image and is a basic feature of the image. Good image edge information is the basis for understanding image segmentation, image recognition and image enhancement. The essence of edge detection is to extract edge pixels with discontinuous gray scale in an image through some algorithms. The traditional edge detection algorithm examines the change of the gray scale of each pixel in a certain region of the image, is simple in form and easy to implement, but has poor positioning accuracy and only has the accuracy of the entire pixel. In fact, the position of an edge exists at any position of a pixel, and a differential operator is very sensitive to noise, so some false edges are often generated in application. With the increasing requirement for accuracy in industrial detection, the traditional edge detection algorithm cannot meet the needs of actual measurement. The sub-pixel positioning method can break through the limitation of the resolution of a camera, so that the edge positioning of an image reaches the sub-pixel level, thereby improving the detection accuracy of an image measurement system. The principle of sub-pixel edge detection is to accurately position an edge according to the distribution of the gray scale or gradient in the edge region. The central limit theorem describes that the gradient edge in the vertical direction of an image edge is approximately Gaussian distributed, so the point corresponding to the maximum value of the Gaussian curve, i.e. the point corresponding to the maximum change of the gray scale, is the sub-pixel edge point. SUMMARY

[0003] The present application aims to introduce a cubic fitting factor of a Gaussian curve to construct a Gaussian curve fitting value for the sub-pixel edge detection of a fruit and vegetable image when the left and right sides of an approximate Gaussian curve are not equal in the conventional sub-pixel edge detection, so as to find a sub-pixel edge point in the fruit and vegetable image, and to find an extreme point of a curve formed by the gray scale corresponding gradient amplitude based on the Gaussian modeling to perform the sub-pixel edge detection of the fruit and vegetable image.

[0004] According to the design scheme provided in the present application, Figure 1 a method for detecting a sub-pixel edge of a fruit and vegetable image based on Gaussian modeling comprises the following steps:

[0005] Step 1, introducing a cubic fitting factor of a Gaussian curve to construct a Gaussian curve fitting value for the sub-pixel edge detection of a fruit and vegetable image;

[0006] Step 2, taking the natural logarithm of the fruit and vegetable image sub-pixel edge detection Gaussian curve fitting value to determine the fruit and vegetable image sub-pixel edge detection Gaussian curve fitting logarithmic value, and setting the fitting logarithmic value cubic term coefficient, fitting logarithmic value quadratic term coefficient, fitting logarithmic value linear term coefficient and fitting logarithmic value constant term;

[0007] Step 3, constructing a fruit and vegetable image sub-pixel edge detection error function by the sum of squares of the difference between the gradient amplitude density of the pixel point on the perpendicular line corresponding to the tangent of the pixel-level edge to be detected in the fruit and vegetable image and the fruit and vegetable image sub-pixel edge detection Gaussian curve fitting value given by the gradient amplitude of the pixel point, and giving the first derivative and second derivative of the fruit and vegetable image sub-pixel edge detection error function with respect to the fitting logarithmic value cubic term coefficient, fitting logarithmic value quadratic term coefficient, fitting logarithmic value linear term coefficient and fitting logarithmic value constant term;

[0008] Step 4, determining the fitting logarithmic value cubic term coefficient optimization value, fitting logarithmic value quadratic term coefficient optimization value, fitting logarithmic value linear term coefficient optimization value and fitting logarithmic value constant term optimization value when the fruit and vegetable image sub-pixel edge detection error function takes the minimum value;

[0009] Step 5, determining the Gaussian curve fitting coefficient optimization value, Gaussian curve fitting median optimization value, Gaussian curve fitting standard deviation optimization value and cubic fitting factor optimization value from the fitting logarithmic value cubic term coefficient optimization value, fitting logarithmic value quadratic term coefficient optimization value, fitting logarithmic value linear term coefficient optimization value and fitting logarithmic value constant term optimization value; the corresponding fruit and vegetable image sub-pixel edge detection Gaussian curve fitting value can be given by the gradient amplitude of the pixel point to determine whether it is a sub-pixel edge point;

[0010] Further, step 1 specifically includes:

[0011] The fruit and vegetable image sub-pixel edge detection Gaussian curve fitting value is constructed as:

[0012]

[0013] Wherein, x is the gradient amplitude of the pixel point, p is the Gaussian curve fitting coefficient, m is the Gaussian curve fitting median, s is the Gaussian curve fitting standard deviation, and t is the Gaussian curve fitting cubic fitting factor;

[0014] Further, step 2 specifically includes:

[0015] The fruit and vegetable image sub-pixel edge detection Gaussian curve fitting value is taken as the natural logarithm, and the fruit and vegetable image sub-pixel edge detection Gaussian curve fitting logarithmic value

[0016]

[0017] wherein the fitting logarithmic value cubic term coefficient fitting logarithmic value quadratic term coefficient fitting logarithmic value linear term coefficient fitting logarithmic value constant term

[0018] Further, step 3 specifically includes:

[0019] In the fruit and vegetable image to be detected, N pixel points are selected on the perpendicular line corresponding to the tangent line of the pixel-level edge fitting tangent line to establish a fruit and vegetable image detection edge pixel set Ξ, then the amplitude density z n and the gradient amplitude x n of the sub-pixel edge point are given The difference between the two is squared to construct a fruit and vegetable image sub-pixel edge detection error function G:

[0020]

[0021] wherein,

[0022] Taking the first derivative of the G with respect to the b3, b2, b1 and b0 respectively, we can get:

[0023]

[0024]

[0025]

[0026]

[0027] Taking the second derivative of the G with respect to the b3, b2, b1 and b0 respectively, we can get:

[0028]

[0029]

[0030]

[0031]

[0032] It can be seen that the and are both greater than 0;

[0033] Further, step 4 specifically includes:

[0034] When the​ and all take 0 and all are greater than 0, it can be known that the G takes the minimum value, the fitting logarithmic value three-term coefficient optimal value when the G takes the minimum value can be determined by solving the Gaussian curve fitting logarithmic value coefficient simultaneous equations of the fruit and vegetable image sub-pixel edge detection fitting logarithmic value quadratic term coefficient optimal value fitting logarithmic value linear term coefficient optimal value and fitting logarithmic value constant term optimal value

[0035]

[0036] Let and Then the updated fruit and vegetable image sub-pixel edge detection Gaussian curve fitting logarithmic value coefficient simultaneous equations can be obtained:

[0037]

[0038] Thus, the and

[0039]

[0040]

[0041]

[0042]

[0043] Further, step 5 specifically includes: giving the and corresponding Gaussian curve fitting coefficient optimal value Gaussian curve fitting median optimal value Gaussian curve fitting standard deviation optimal value and cubic fitting factor optimal value

[0044] From and b3<0, it can be obtained that and

[0045] From and it can be known that wherein From needs to be greater than 0, it can be obtained that

[0046] From can be obtained and

[0047] by available:

[0048]

[0049] wherein,

[0050] For a picture of fruit and vegetable image sub-pixel edge detection, the gradient amplitude x of the pixel point k k determine the corresponding fruit and vegetable image sub-pixel edge detection Gaussian curve fitting value

[0051]

[0052] wherein, let

[0053] by the to determine whether the k is a sub-pixel edge point. BRIEF DESCRIPTION OF DRAWINGS

[0054] Figure 1 : fruit and vegetable image sub-pixel edge detection step based on Gaussian modeling;

[0055] Figure 2 : gradient curve diagram of different functions in fruit and vegetable image sub-pixel edge detection. DETAILED DESCRIPTION

[0056] Please refer to Figure 1 and Figure 2 , in order to have a clearer understanding of the technical features, purposes and effects of the present application, the technical solutions of the present application will be further described below in conjunction with the drawings, specifically including the following steps shown in Figure 1

[0057] Step 1: fruit and vegetable image sub-pixel edge detection Gaussian curve fitting value is constructed as:

[0058]

[0059] wherein, x is the gradient amplitude of the pixel point, p is the Gaussian curve fitting coefficient, mu is the Gaussian curve fitting value, sigma is the Gaussian curve fitting standard deviation, and tau is the Gaussian curve cubic fitting factor;

[0060] Step 2: the take natural logarithm, get fruit and vegetable image sub-pixel edge detection Gaussian curve fitting logarithmic value

[0061]

[0062] wherein the cubic term coefficient of the fitted logarithmic value the quadratic term coefficient of the fitted logarithmic value the linear term coefficient of the fitted logarithmic value the constant term of the fitted logarithmic value

[0063] Step 3: Select N pixel points on the perpendicular line corresponding to the tangent line of the pixel-level edge to be detected in the fruit and vegetable image to establish a fruit and vegetable image detection edge pixel set Ξ, then the gradient amplitude density z of the nth pixel point in the set Ξ is n and the difference between the gradient amplitude x of the sub-pixel edge point and the Gaussian curve fitting value given by the sub-pixel edge detection of the fruit and vegetable image n The error function G of the fruit and vegetable image sub-pixel edge detection is constructed by the square sum of the difference between the gradient amplitude x of the sub-pixel edge point and the Gaussian curve fitting value given by the sub-pixel edge detection of the fruit and vegetable image:

[0064]

[0065] wherein,

[0066] Taking the first-order derivative of the G with respect to the b3, b2, b1 and b0 respectively, we can get:

[0067]

[0068]

[0069]

[0070]

[0071] Taking the second-order derivative of the G with respect to the b3, b2, b1 and b0 respectively, we can get:

[0072]

[0073]

[0074]

[0075]

[0076] It can be seen that the and are both greater than 0;

[0077] Step 4: When the and ​​When both a0and a1are greater than 0, it can be known that the G takes the minimum value, and the fitting logarithmic value three-term coefficient optimal value when the G takes the minimum value can be determined by solving the equation group of the fruit and vegetable image sub-pixel edge detection Gaussian curve fitting logarithmic value coefficients Fitting logarithmic value quadratic term coefficient optimal value Fitting logarithmic value linear term coefficient optimal value And fitting logarithmic value constant term optimal value

[0078]

[0079] Let And The updated fruit and vegetable image sub-pixel edge detection Gaussian curve fitting logarithmic value coefficient equation group can be obtained:

[0080]

[0081] Thus, the G can be obtained And

[0082]

[0083]

[0084]

[0085]

[0086] Let N=20 pixel points given from the fruit and vegetable image data set Ξ, the corresponding And The values of a0, a1, a2and a3are-1.0204E-7, -6.6327E-4, -0.0319 and -152.3683 respectively;

[0087] Step 5: from And b3<0, then And

[0088] From And It can be known that Wherein From Need to be greater than 0, then

[0089] From It can be obtained that And

[0090] From It can be obtained that

[0091]

[0092] wherein,

[0093] Please refer to Figure 1 and Figure 2 , according to the corresponding and at this time and the values are 0.5, 250, 70 and 9.8E+6 respectively;

[0094] For the region in the fruit and vegetable image that needs to be sub-pixel edge, the gradient amplitude x of the pixel point k on the vertical line corresponding to the tangent of the edge fitting can be used to determine the corresponding fruit and vegetable image sub-pixel edge detection Gaussian curve fitting value k

[0095]

[0096] According to the principle of sub-pixel edge detection, if the gradient amplitude in the gradient direction of the edge is approximately Gaussian distribution, the position of the extreme point of the Gaussian curve corresponds to the position when the density function value of the Gaussian curve distribution is 0.5. The midpoint of the line segment where the gradient amplitude density is 0.5 can be searched as the final sub-pixel edge point. Therefore, if the is closer to 0.5 than the adjacent pixel points and is the midpoint of the line segment where the gradient amplitude density is 0.5, then the pixel point can be used as the sub-pixel edge point.

[0097] In Figure 2 , the gradient curves of different functions are given; wherein, the function 1 can reflect the Gaussian curve condition, specifically The function 2 can reflect the influence of the cubic fitting factor on the normalization condition, specifically The function 3 can reflect the Gaussian curve condition after the introduction of the superimposed cubic fitting factor, specifically It can be seen that considering that the standard Gaussian curve on both sides is a standard symmetric shape which may not adapt to some conditions of sub-pixel edge detection in reality, the introduction of the cubic fitting factor helps to change the original curve symmetry structure of the Gaussian modeling, and at the same time helps to adjust the height range of the left and right wings, so that it is closer to the curve characteristics of the actual data, thereby helping to process the actual condition of uneven distribution of data points on the left and right in fruit and vegetable image sub-pixel edge detection to improve the precision and efficiency of sub-pixel edge detection.

[0098] The parts not explicitly described in this embodiment can be implemented by existing technologies.

[0099] ​Changes, modifications, substitutions, and variations to the embodiments disclosed herein can be made by those of ordinary skill in the art without departing from the spirit and scope of the application, which is defined by the following claims.

Claims

1. A sub-pixel edge detection method for fruit and vegetable images based on Gaussian modeling, characterized in that, The method includes the following steps: Step 1: Introduce the cubic fitting factor of the Gaussian curve to construct the Gaussian curve fitting value for sub-pixel edge detection of fruit and vegetable images; Step 2: After taking the natural logarithm of the Gaussian curve fitting value for subpixel edge detection of fruit and vegetable images, determine the fitting logarithm value of the Gaussian curve for subpixel edge detection of fruit and vegetable images, and set the coefficients of the cubic term, quadratic term, linear term, and constant term of the fitting logarithm value. Step 3: Construct the subpixel edge detection error function for fruit and vegetable images by summing the squares of the differences between the gradient magnitude density of pixels on the vertical line corresponding to the tangent of the pixel-level edge to be detected in the fruit and vegetable image and the Gaussian curve fitting value of the subpixel edge detection of the fruit and vegetable image given by the gradient magnitude of the pixels. The first and second derivatives of the subpixel edge detection error function for the coefficients of the cubic, quadratic, linear, and constant terms of the logarithmic terms are given respectively. Step 4: Determine the optimized values ​​of the cubic, quadratic, linear, and constant terms of the fitted logarithmic terms when the subpixel edge detection error function of the fruit and vegetable image reaches its minimum value. Step 5: Determine the optimized values ​​of Gaussian curve fitting coefficients, Gaussian curve fitting median, Gaussian curve fitting standard deviation, and cubic fitting factor from the optimized values ​​of the cubic, quadratic, linear, and constant terms of the fitted logarithmic terms. The gradient magnitude of each pixel can be used to obtain the corresponding Gaussian curve fitting value for sub-pixel edge detection in the fruit and vegetable image, thus determining whether it is a sub-pixel edge point.

2. The method for sub-pixel edge detection of fruit and vegetable images based on Gaussian modeling according to claim 1, characterized in that, Step 1 specifically includes: fitting the subpixel edge detection Gaussian curve values ​​of the fruit and vegetable image. Build as: in, The gradient magnitude of a pixel. These are the Gaussian curve fitting coefficients. The median of the Gaussian curve fitting. The standard deviation of the Gaussian curve fitting. is the cubic fitting factor for the Gaussian curve.

3. The method for sub-pixel edge detection of fruit and vegetable images based on Gaussian modeling according to claim 1, characterized in that, Step 2 specifically includes: [the following is a description of the process] Taking the natural logarithm yields the logarithmic value of the Gaussian curve fitting for subpixel edge detection in fruit and vegetable images. : Among them, the coefficients of the cubic term of the fitted logarithmic value Fitting the coefficients of the logarithmic quadratic term Fitting the coefficients of the first-order logarithmic term Fitting the logarithmic constant term .

4. The method for sub-pixel edge detection of fruit and vegetable images based on Gaussian modeling according to claim 1, characterized in that, Step 3 specifically includes: selecting on the vertical line corresponding to the tangent line of the pixel-level edge fitting line to be detected in the fruit and vegetable image. A set of edge pixels for fruit and vegetable image detection is established based on the n pixels. Then, the nth pixel in the set of edge pixels for fruit and vegetable image detection is used to construct the edge pixel set. Gradient magnitude density of each pixel and the gradient magnitude through the sub-pixel edge point The given Gaussian curve fitting values ​​for subpixel edge detection in fruit and vegetable images The sum of squared differences between them is used to construct the subpixel edge detection error function for fruit and vegetable images. : in, for ; The For the above , , and Taking the first derivative, we can obtain: The For the above , , and Taking the second derivative, we can obtain: It can be seen that the above , , and All are greater than 0.

5. The method for sub-pixel edge detection of fruit and vegetable images based on Gaussian modeling according to claim 1, characterized in that, Step 4 specifically includes: when the , , and When all values ​​are 0 and all are greater than 0, it can be known that the above... The minimum value is determined by fitting a Gaussian curve to the logarithmic coefficients of the subpixel edge detection in the fruit and vegetable image and solving a system of simultaneous equations. Optimized value of the coefficient of the cubic term of the fitted logarithm when taking the minimum value Optimized values ​​of the coefficients of the quadratic term of the fitted logarithmic value Optimized values ​​of the coefficients of the first-order term of the fitted logarithmic value And the optimized value of the fitting logarithmic constant term : set up , , , , , , , , , and Then, we can obtain the updated system of equations for the logarithmic coefficients of the Gaussian curve fitting for subpixel edge detection in the fruit and vegetable image: Therefore, the above can be concluded. , , and : 。 6. The method for sub-pixel edge detection of fruit and vegetable images based on Gaussian modeling according to claim 1, characterized in that, Step 5 specifically includes: providing the... , , and The corresponding optimized values ​​of Gaussian curve fitting coefficients Optimized value of Gaussian curve fitting median Optimization value of standard deviation for Gaussian curve fitting and cubic fitting factor optimization value : Depend on and Then we can obtain and ; Depend on and It can be known ,in , ,Depend on It needs to be greater than 0 to obtain ; Depend on achievable and ; Depend on We can obtain: in, ; For a specific image requiring subpixel edge detection of fruits and vegetables, it can be determined by pixel points. gradient magnitude Determine the Gaussian curve fitting values ​​for subpixel edge detection in the corresponding fruit and vegetable images. : Among them, let ; From the above To determine the Is it a subpixel edge point?

Citation Information

Patent Citations

  • Circular target circular center positioning method

    CN101334263A

  • Detecting and error-correcting method capable of rapidly and accurately obtaining element center and deflection angle

    CN104981105A