Moving fruit and vegetable detection target segmentation method based on adaptive updating

By using an adaptively updated Poisson probability density function model, the problem of inaccurate segmentation of moving targets in the appearance quality inspection of fruits and vegetables is solved, thus improving the detection accuracy.

CN121459342APending Publication Date: 2026-02-03REEMOON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411047704.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing technologies for fruit and vegetable appearance quality inspection suffer from insufficient accuracy in segmenting moving targets, which affects the detection precision.

Method used

An adaptively updated Poisson probability density function model is adopted. By constructing a Poisson model to describe the features in the fruit and vegetable video sequence, the weight coefficients and typical gray values ​​of the Poisson probability density function are adaptively updated to divide the moving target and the background, thereby achieving the segmentation of the fruit and vegetable detection target.

Benefits of technology

It improves the accuracy and precision of fruit and vegetable appearance quality detection and enhances the effect of moving target segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121459342A_ABST
    Figure CN121459342A_ABST
Patent Text Reader

Abstract

The invention discloses a moving fruit and vegetable detection target segmentation method based on adaptive updating, and the method comprises the steps: carrying out the modeling of a fruit and vegetable video sequence, if a certain pixel point in a certain frame of image can be jointly represented by a plurality of Poisson probability density functions; a typical gray value of each Poisson probability density function at the initial time can be given through a fruit and vegetable reference video sequence; for adaptive updating, a typical gray value set and weight coefficients of different Poisson probability density functions in the frame can be adaptively updated according to an interval statistical expectation variance deviation ratio mean value and a fruit and vegetable video sequence from the fruit and vegetable video sequence to the frame interval; therefore, dynamic updating of the background model is realized, and moving fruit and vegetable detection target segmentation is completed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of fruit and vegetable sorting and detection, and particularly to a fruit and vegetable detection target segmentation method based on adaptive updating. BACKGROUND

[0002] Intelligent video analysis technology is an important field of computer vision, which is widely applied to the application occasions of sorting fruit and vegetable products. When the appearance quality of fruit and vegetable is detected based on image processing, the moving targets on the fruit and vegetable sorting line need to be detected and segmented first, and the accuracy of the segmentation result directly affects the precision of the quality detection. Therefore, the moving target segmentation problem is one of the research hotspots in the development of the fruit and vegetable appearance quality detection technology. SUMMARY

[0003] The purpose of the present application is to describe the characteristics of a pixel point in a frame image in a fruit and vegetable video sequence by a Poisson model constructed by a plurality of Poisson probability density functions, to give the typical gray values of the Poisson probability density functions in the initial time by a set of gray quantization values corresponding to the pixel points in a fruit and vegetable reference video sequence, and to give the set of typical gray values after adaptive updating according to the deviation proportion mean of the interval statistical expectation variance and the fruit and vegetable video sequence from the start to the frame interval, and to give the weight coefficients of different Poisson probability density functions in the frame, so as to realize the segmentation of the moving fruit and vegetable detection target in the fruit and vegetable video sequence by selecting the Poisson probability density functions from large to small according to the weight coefficients.

[0004] To achieve the above purpose, the technical scheme provided by the present application is as follows:

[0005] A fruit and vegetable detection target segmentation method based on adaptive updating, which comprises the following steps:

[0006] Step 1: If the characteristics of a pixel point in a frame image in a fruit and vegetable video sequence can be described by a Poisson model constructed by a Poisson probability density function, a set of gray quantization values corresponding to the pixel points belonging to the typical gray value of a Poisson probability density function from the start of the fruit and vegetable video sequence to the frame interval can be constructed, and the interval statistical mathematical expectation, the interval statistical standard deviation and the interval statistical expectation variance deviation proportion of a Poisson probability density function from the start of the fruit and vegetable video sequence to a frame can be obtained.

[0007] Step 2: The number of Poisson probability density functions and the typical gray values of the corresponding Poisson probability density functions in the initial time are determined by the set of gray quantization values corresponding to the pixel points in the fruit and vegetable reference video sequence.

[0008] Step 3: By adaptively updating the typical gray values ​​of the Poisson probability density function in a certain frame of the fruit and vegetable video sequence, determine the number of Poisson probability density functions and the typical gray values ​​of the corresponding Poisson probability density functions in the next frame.

[0009] Step 4: Determine the weighting coefficients of the different Poisson probability density functions described in Step 3 for this frame;

[0010] Step 5: When segmenting moving fruit and vegetable detection targets in a certain frame of an image, different Poisson probability density functions can be selected sequentially from largest to smallest weight coefficient. Then, the gray quantization value corresponding to a certain pixel belongs to the set of typical gray values ​​of a certain Poisson probability density function within the interval from the beginning of the fruit and vegetable video sequence to that frame. Therefore, the pixel can be considered to be represented by the corresponding typical gray value, and it can be divided into moving target or background with reference to the Poisson probability density function. By performing the above operation on all pixels, the moving fruit and vegetable detection targets in the image can be segmented.

[0011] Furthermore, the specific method of step 1 is as follows:

[0012] If, when modeling the video sequence of fruits and vegetables, the first... Pixels in a frame image can be A Poisson model is constructed using the nth Poisson probability density function to describe the features. Framed at pixel gray quantization values ​​observed at [location] for Estimated probability of occurrence Available To represent, where, Let be the number of the Poisson probability density function. For the first The number of Poisson probability density functions at each frame. For the first The Poisson probability density function at the nth... Frame weighting coefficients, For the first The Poisson probability density function at the nth... The frame's normalization coefficients, In the first Frame time Typical gray values ​​of a Poisson probability density function, Let be the positive integer that can be taken after grayscale measurement. is the base of the natural logarithm. The factorial symbol is used to indicate that when hour The maximum then at this time Can be set to To satisfy the normalization condition;

[0013] set up From the beginning of the fruit and vegetable video sequence to the [number]th ... The set of grayscale values ​​corresponding to pixels in a fruit and vegetable video sequence within a frame interval can then be used to construct a sequence from the beginning of the fruit and vegetable video sequence to the [frame range missing]. Within the frame interval, the first The set of gray quantization values ​​corresponding to pixels with typical gray values ​​of a Poisson probability density function. Specifically, it can be expressed as:

[0014] Ψ l , m = { S g , t | ε l , t λ l , t S g , t e − λ l , t S g , t ! ≥ γ , t ∈ [ 1 , m ], S g , t ∈ Ψ m }

[0015] in, In the first Framed at pixel The gray quantization value observed at [location] For the position located at the The frame number preceding the frame, For filtering conditions, For the first The Poisson probability density function at the nth... The frame's normalization coefficients, In the first Frame time Typical gray values ​​of a Poisson probability density function, In the first Framed at pixel Gray quantization values ​​were observed at [location]. The confidence level for attributable typical gray values;

[0016] Setting for the first Poisson probability density functions are used from the beginning of the fruit and vegetable video sequence to the [number]th [number]. Interval statistical mathematical expectation of frames It can be represented as:

[0017]

[0018] in, A function to find the number of elements in a set;

[0019] Setting for the first Poisson probability density functions are used from the beginning of the fruit and vegetable video sequence to the [number]th [number]. Interval statistical standard deviation of frames It can be represented as:

[0020] D ^ l , m = ∑ S g , t ∈ Ψ l , m S g , t 2 sum ( Ψ l , m ) − [ ∑ S g , t ∈ Ψ l , m S g , t sum ( Ψ l , m ) ] 2

[0021] Considering that the expected value and variance of the Poisson probability density function take the same values, we assume that for the th Poisson probability density functions are used from the beginning of the fruit and vegetable video sequence to the [number]th [number]. Frame interval statistical expected variance deviation ratio It can be represented as:

[0022]

[0023] Furthermore, step 2 can be further refined into the following steps:

[0024] Step 2.1: Set the above Initially set to 0, the set of grayscale quantization values ​​corresponding to pixels in the fruit and vegetable reference video sequence is input. and the confidence level of the proportion of expected variance deviation Let the above be the The gray quantification values ​​can be given in descending order of the number of identical values. Gray quantization values ​​of different values Establish an initial set of gray quantization values ,in, This represents the number of available Poisson probability density functions when performing grayscale quantization on a fruit and vegetable reference video sequence. For the first The grayscale values ​​of a Poisson probability density function in a fruit and vegetable reference video sequence are used to set a typical grayscale value set corresponding to the fruit and vegetable reference video sequence. for ,in It is an empty set;

[0025] Step 2.2: From the above The unused ones are listed in order. Give the initial position of the fruit and vegetable video sequence. The set of gray quantization values ​​corresponding to pixels with typical gray values ​​according to the Poisson probability density function. Similarly, it can be expressed as Then give the first The interval statistical expectation of the Poisson probability density function at the initial time of the fruit and vegetable video sequence Interval statistical standard deviation and the percentage deviation of expected variance in interval statistics ;

[0026] Step 2.3: If the current step 2.2 is as described... Then from Delete the steps described in step 2.2. And corresponding to [ inf Ψ l , 0 ,sup Ψ l , 0 ] The elements, among which and They are respectively the supremacy and the infimum, and the above... Add to the above In the middle; if the above Then the above from Delete;

[0027] Step 2.4: Determine the current situation Is it If the condition is met, proceed to step 2.5; otherwise, proceed to step 2.2.

[0028] Step 2.5: Initialize the time Number of Poisson probability density functions under given conditions Set as and will Each element in the initial time is used as the first element. Typical gray values ​​of a Poisson probability density function Use it.

[0029] Furthermore, step 3 can be further refined into the following steps:

[0030] Step 3.1: Set the first video sequence in the fruit and vegetable video sequence. Each frame requires adaptive updates to the typical grayscale values ​​of the Poisson probability density function, and the current interval is [number of frames]. Then give the first Frame time The proportion of deviation of the interval statistical expectation and variance of each Poisson probability density function And from the beginning of the fruit and vegetable video sequence to the end Interval statistical expected variance of frames deviating from the mean ;

[0031] Step 3.2: If ,in To determine the tolerance coefficient for deviation of the expected variance in the interval statistics, the frame interval for the next adaptive update is set to [value]. Until the maximum number of frames per interval And the Typical grayscale value set of a frame Still the first Typical grayscale value set of a frame Then proceed to step 3.9; if Constructing from the beginning of the fruit and vegetable video sequence to the [number]th [section]. The set of grayscale values ​​corresponding to pixels in a fruit and vegetable video sequence within a frame interval and the Typical grayscale value set of a frame And set the next adaptive update interval to be [number of frames]. Until the minimum number of frames between intervals is reached. Then proceed to step 3.3;

[0032] Step 3.3: In According to any number The Poisson probability density function at the nth... Frame weight coefficients The sizes are given sequentially in the first position. Frame time Typical gray values ​​of a Poisson probability density function ;

[0033] Step 3.4: Through the aforementioned Calculate the corresponding interval statistical expected variance deviation ratio ,like Then from Delete that And from Delete the video sequence starting from the fruit and vegetable video sequence up to the 1st. Within the frame interval, the first The set of gray quantization values ​​corresponding to pixels with typical gray values ​​of a Poisson probability density function. Find the elements in the list and output them. To the Typical grayscale value set of a frame If the Then, the values ​​are given in descending order of the number of identical values ​​in the gray quantified values. In China [ Figure 1 Figure 2 l , m − 1 Figure 3 Figure 4 l , m − 1 ] elements and through the The deviation ratio of the interval statistical expectation variance corresponding to the typical gray value of the Poisson probability density function is used to calculate the expected value of the interval. Until it exists Then output the condition that satisfies the condition. of To the Typical grayscale value set corresponding to the frame and from Delete that And from Delete the above [ Figure 5 Figure 6 l , m − 1 Figure 1 Ψ l , m − 1 ] Elements in;

[0034] Step 3.5: If If so, proceed to step 3.3; if Then proceed to step 3.6;

[0035] Step 3.6: From The text describes a method for assigning grayscale values ​​to elements based on the order of the number of identical values. ;

[0036] Step 3.7: As described in step 3.6 The deviation ratio of the interval statistical expectation variance corresponding to the typical gray value of the Poisson probability density function is used to calculate the expected value of the interval. ;like Then from Delete that And the The set of grayscale values ​​corresponding to a pixel with a typical grayscale value Find the elements in the list and output them. To the Typical grayscale value set of a frame ;

[0037] Step 3.8: If Then proceed to step 3.7; if Then proceed to step 3.9;

[0038] Step 3.9: Output the above. , will the Number of Poisson probability density functions per frame Set as and will The elements in are used as the first Each frame corresponding to Use it.

[0039] Furthermore, step 4 can be further refined into the following steps:

[0040] Step 4.1: Let for Any number in the middle Framed at pixel Gray quantization value observed at [location] The measured probability and the estimated probability are respectively and ,in Then in above Establish the independent variable for different pixels at the th... Measured probability before frame With Estimated Probability Sum of squared errors function It can be represented as:

[0041] H ( ε l , m ) = ∑ S g , t ∈ λ m [ Y g , t − ∑ l = 1 L m λ l , m γ l , m Ψ l , m S g , t e − Ψ l , m S g , t ! ]

[0042] Step 4.2: From the above Regarding the Taking the first and second derivatives, we get:

[0043] ∂ H ∂ sum l , m = ∑ S g , t ∈ Ψ m − 2 Ψ l , m sum l , m S g , t e − Ψ l , m S g , t ! [ Y g , t − ∑ l = 1 L m Figure 2 l , m inf l , m Ψ l , m S g , t e − ,sup l , m S g , t ! ]

[0044] ∂ 2 H ∂ Ψ 2 l , m = ∑ S g , t ∈ Figure 3 m 2 [ Figure 3 l , m inf l , m S g , t e − Ψ l , m S g , t ! ] 2

[0045] Step 4.3: From step 4.2 It can be known that it is greater than 0, then when hour Existence for The minimum value, at which point by We can obtain:

[0046] ∑ S g , t ∈ ,sup m Ψ l , m inf l , m S g , t e − Ψ l , m S g , t ! [ ∑ l = 1 L m ,sup l , m Ψ l , m Figure 3 l , m S g , t e − Figure 4 l , m S g , t ! ] = ∑ S g , t ∈ Figure 4 m Y g , t Figure 3 l , m ω l , m S g , t e − Ψ l , m S g , t !

[0047] Setting intermediate variables We can obtain:

[0048] ∑ S g , t ∈ ω m ε l , m ( S g , t ) [ ∑ l = 1 L m λ l , m λ l , m ( S g , t ) ] = ∑ S g , t ∈ ω m Y g , t Ψ l , m ( S g , t )

[0049] exist Time corresponds to different This can be rewritten as the following system of normal equations 1:

[0050] { ∑ S g , t ∈ ε m λ 1 , m ( S g , t ) [ ∑ l = 1 L m λ l , m ω l , m ( S g , t ) ] = ∑ S g , t ∈ ε m Y g , t λ 1 , m ( S g , t ) ∑ S g , t ∈ λ m ω 2 , m ( S g , t ) [ ∑ l = 1 L m Ψ l , m ε l , m ( S g , t ) ] = ∑ S g , t ∈ λ m Y g , t λ 2 , m ( S g , t ) ⋮ ∑ S g , t ∈ Ψ m ε l , L m ( S g , t ) [ ∑ l = 1 L m λ l , m λ l , m ( S g , t ) ] = ∑ S g , t ∈ ω m Y g , t ε l , L m ( S g , t )

[0051] The normal equation system 1 can be rearranged into the following normal equation system 2:

[0052]

[0053] Step 4.4: The normal equation system 2 described in step 4.3 can be represented in the following matrix form 1:

[0054]

[0055] Considering matrix form 1 If the corresponding determinant value is non-zero, then we know The matrix representation can be expressed as:

[0056]

[0057] Therefore, this can be achieved through step 4.4 above. The matrix representation of the first The Poisson probability density function at the nth... The weight coefficients of the frames are updated to obtain different... corresponding value.

[0058] Further, the specific method of step 5 is:

[0059] When the moving fruit and vegetable detection target in the first frame of the fruit and vegetable video sequence is segmented, each element in the is used as each corresponding to the first frame, wherein , for any first Poisson probability density function, its corresponding value is given by step 4.4, and the gray quantization value set corresponding to the pixel point belonging to the first Poisson probability density function in the interval from the start of the fruit and vegetable video sequence to the first frame is obtained , and its corresponding value is given;

[0060] Let , , and be the fruit and vegetable video background weight coefficient typical value, the fruit and vegetable video background standard deviation typical value, the fruit and vegetable video moving target weight coefficient typical value, and the fruit and vegetable video moving target standard deviation typical value, respectively, to define the left half trapezoidal distribution function of the weight coefficient of the first Poisson probability density function at the first frame and the right half trapezoidal fuzzy distribution function of the interval statistical standard deviation of the first Poisson probability density function from the start of the fruit and vegetable video sequence to the first frame, which are specifically represented as:

[0061]

[0062]

[0063] Considering that when the object exists fixedly in the image, a Poisson probability distribution with gradually accumulated weight coefficient but gradually reduced interval statistical standard deviation is generated, it is set that if there is corresponding and can make , then the distribution of the above first Poisson probability density function can be attributed to the background model, otherwise to the moving target model;

[0064] In the first frame image, the pixel point may be calculated according to corresponding The value is selected in descending order to calculate the corresponding Poisson probability density function, and if the first The pixel point in the frame image corresponding belongs to a certain corresponding [ λ λ l , m Ψ ε l , m ] The pixel point in the frame image may be considered as the first The pixel point in the frame image may be represented by the typical gray value is divided into a moving target or background; by completing the above operation on all pixel points in the first frame image, the segmentation of the moving fruit and vegetable detection target is realized. BRIEF DESCRIPTION OF DRAWINGS

[0065] λ is a schematic diagram of a moving fruit and vegetable detection target segmentation method based on adaptive update;

[0066] λ is a flowchart for further refinement in step 2;

[0067] Ψ is the Poisson probability density function condition in the initial fruit and vegetable video sequence in the specific embodiment;

[0068] θ is the Poisson probability density function condition after adaptive update in the specific embodiment;

[0069] ω is the weight coefficient corresponding to different Poisson probability density functions in the specific embodiment;

[0070] θ is the standard deviation corresponding to different Poisson probability density functions in the specific embodiment. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described by specific embodiments combined with the drawings.

[0072] Referring to Ψ , a moving fruit and vegetable detection target segmentation method based on adaptive update, the steps include the following specific contents:

[0073] Step 1: If, when modeling a fruit and vegetable video sequence, any pixel in a frame can be described by a Poisson model constructed using a Poisson probability density function, then a set of gray quantified values ​​corresponding to pixels belonging to a typical gray value of a certain Poisson probability density function within the interval from the start of the fruit and vegetable video sequence to that frame can be constructed. Furthermore, the interval statistical expectation, interval statistical standard deviation, and deviation ratio of the interval statistical expectation variance from the start of the fruit and vegetable video sequence to that frame can be obtained for a certain Poisson probability density function. The specific method is as follows:

[0074] If, when modeling the video sequence of fruits and vegetables, the first... Pixels in a frame image can be A Poisson model is constructed using the nth Poisson probability density function to describe the features. Framed at pixel gray quantization values ​​observed at [location] for Estimated probability of occurrence Available To represent, where, Let be the number of the Poisson probability density function. For the first The number of Poisson probability density functions at each frame. For the first The Poisson probability density function at the nth... Frame weighting coefficients, For the first The Poisson probability density function at the nth... The frame's normalization coefficients, In the first Frame time Typical gray values ​​of a Poisson probability density function, Let be the positive integer that can be taken after grayscale measurement. is the base of the natural logarithm. The factorial symbol is used to indicate that when hour The maximum then at this time Can be set to To satisfy the normalization condition;

[0075] set up From the beginning of the fruit and vegetable video sequence to the [number]th ... The set of grayscale values ​​corresponding to pixels in a fruit and vegetable video sequence within a frame interval can then be used to construct a sequence from the beginning of the fruit and vegetable video sequence to the [frame range missing]. Within the frame interval, the first The set of gray quantization values ​​corresponding to pixels with typical gray values ​​of a Poisson probability density function. Specifically, it can be expressed as:

[0076] θ l , m = { S g , t | Ψ l , t θ l , t S g , t e − ω l , t S g , t ! ≥ θ , t ∈ [ 1 , m ], S g , t ∈ Ψ m }

[0077] wherein, is the quantized gray level observed at pixel point in frame , is the frame number before frame , is the filter condition symbol, is the normalized coefficient of the th Poisson probability density function in frame , is the typical gray level of the th Poisson probability density function in frame , is the quantized gray level observed at pixel point in frame , is the confidence level of the typical gray level;

[0078] The statistical mean of the interval from the beginning of the fruit and vegetable video sequence to frame for the th Poisson probability density function can be expressed as:

[0079]

[0080] wherein, is the function for counting the number of elements in the set;

[0081] The statistical standard deviation of the interval from the beginning of the fruit and vegetable video sequence to frame for the th Poisson probability density function can be expressed as:

[0082] D ^ l , m = ∑ S g , t ∈ θ l , m S g , t 2 Ψ ( θ l , m ) − [ ∑ S g , t ∈ ω l , m S g , t θ ( Ψ l , m ) ] 2

[0083] Considering that the mean and variance of the Poisson probability density function are consistent, the statistical expected variance deviation ratio of the interval from the beginning of the fruit and vegetable video sequence to frame for the th Poisson probability density function can be expressed as:

[0084]

[0085] Step 2: Determine the number of Poisson probability density functions and the typical gray level of the corresponding Poisson probability density function at the initial time through the set of gray level quantization values corresponding to the pixel points in the fruit and vegetable reference video sequence, including​​​θ The following five steps are shown as follows:

[0086] Step 2.1: Set the initially as 0, input the set of gray quantization values corresponding to the pixel points in the fruit and vegetable reference video sequence and the expected variance deviation proportion confidence level , set the gray quantization value in the fruit and vegetable reference video sequence according to the number of the same values in the fruit and vegetable reference video sequence , and give the gray quantization value of the different values in turn establish the initial gray quantization value set , wherein is the number of available Poisson probability density functions when the fruit and vegetable reference video sequence is gray quantized, is the gray quantization value of the th Poisson probability density function in the fruit and vegetable reference video sequence, and set the set of typical gray values corresponding to the fruit and vegetable reference video sequence is , wherein

[0087] Step 2.2: give the unused in the fruit and vegetable reference video sequence in turn, give the set of gray quantization values corresponding to the pixel points belonging to the typical gray value of the th Poisson probability density function at the initial stage of the fruit and vegetable video sequence , which can be expressed as , and then give the interval statistical mathematical expectation , interval statistical standard deviation and interval statistical expected variance deviation proportion of the th Poisson probability density function at the initial stage of the fruit and vegetable video sequence ;

[0088] Step 2.3: if the in the current step 2.2 is not empty, delete the in the current step 2.2 from the and the corresponding element in the [ Ψ θ l , 0 ω θ l , 0 ] , wherein and are the supremum and infimum respectively, and add the above to the ; if the above is empty, delete the above from the ;

[0089] Step 2.4: judge whether the current is If yes, go to step 2.5, if no, go to step 2.2;

[0090] Step 2.5: Set the initial time The number of Poisson probability density functions under the condition Set And each element in As the initial time Poisson probability density function of the typical gray value Use.

[0091] Let Ψ In the initial time The normalized Poisson probability density function under the condition, where Can be set to 0.02, Can be set to 0.5, from the figure, according to the maximum value, the typical gray value set corresponding to the fruit and vegetable reference video sequence The number of elements in the set is 5, which are 21, 53, 82, 145 and 221, corresponding to θ The number of Poisson probability density functions in is 1, 2, 3, 4, 5, so the initial time of the fruit and vegetable video sequence can give the gray quantization value set corresponding to the pixel points belonging to the typical gray value of the five different Poisson probability density functions.

[0092] Step 3: By adaptively updating the Poisson probability density function typical gray value in a certain frame of the fruit and vegetable video sequence, determine the number of Poisson probability density functions and the corresponding Poisson probability density function typical gray value in the next frame, including the following nine steps:

[0093] Step 3.1: Set the fruit and vegetable video sequence in the initial time The adaptive update of the Poisson probability density function typical gray value is needed, and the current interval frame number is , then give the interval statistical expectation variance deviation ratio of the The Poisson probability density function in the initial time And the interval statistical expectation variance deviation ratio mean From the beginning of the fruit and vegetable video sequence to the initial time Frame;

[0094] Step 3.2: If , where Is the interval statistical expectation variance deviation tolerance coefficient, then set the interval frame number of the next adaptive update as Until the maximum interval frame number And the typical gray value set of the initial time Frame​ Still the first Typical grayscale value set of a frame Then proceed to step 3.9; if Constructing a video sequence from the beginning of the fruit and vegetable video sequence to the end of the sequence. The set of grayscale values ​​corresponding to pixels in a fruit and vegetable video sequence within a frame interval and the Typical grayscale value set of a frame And set the next adaptive update interval to be [number of frames]. Until the minimum number of frames between intervals is reached. Then proceed to step 3.3;

[0095] Step 3.3: In According to any number The Poisson probability density function at the nth... Frame weight coefficients The sizes are given sequentially in the first position. Frame time Typical gray values ​​of a Poisson probability density function ;

[0096] Step 3.4: Through the aforementioned Calculate the corresponding interval statistical expected variance deviation ratio ,like Then from Delete that And from Delete the video sequence starting from the fruit and vegetable video sequence up to the 1st. Within the frame interval, the first The set of gray quantization values ​​corresponding to pixels with typical gray values ​​of a Poisson probability density function. Find the elements in the list and output them. To the Typical grayscale value set of a frame If the Then, the values ​​are given in descending order of the number of identical values ​​in the gray quantified values. In China [ Figure 4 Figure 5 l , m − 1 Figure 6 Figure 5 l , m − 1 ] elements and through the The deviation ratio of the interval statistical expectation variance corresponding to the typical gray value of the Poisson probability density function is used to calculate the expected value of the interval. Until it exists Then output the condition that satisfies the condition. of To the Typical grayscale value set corresponding to the frame and from Delete that And from Delete the above [ inf Ψ l , m − 1 ,sup Ψ l , m − 1 ] Elements in;

[0097] Step 3.5: If If so, proceed to step 3.3; if Then proceed to step 3.6;

[0098] Step 3.6: From The text describes a method for assigning grayscale values ​​to elements based on the order of the number of identical values. ;

[0099] Step 3.7: As described in step 3.6 The deviation ratio of the interval statistical expectation variance corresponding to the typical gray value of the Poisson probability density function is used to calculate the expected value of the interval. ;like Then from Delete that And the The set of grayscale values ​​corresponding to a pixel with a typical grayscale value Find the elements in the list and output them. To the Typical grayscale value set of a frame ;

[0100] Step 3.8: If Then proceed to step 3.7; if Then proceed to step 3.9;

[0101] Step 3.9: Output the above. , will the Number of Poisson probability density functions per frame Set as and will The elements in the first part are used as the second part. Each frame corresponding to Use it.

[0102] Set the first video sequence of fruits and vegetables The Poisson probability density function after frame-time normalization is also as follows ​ As shown, where Set to 200, set ​ The middle part describes the normalized Poisson probability density function obtained from the fruit and vegetable video sequence through step 3. ​ It can be seen from the above that... ​ Compared to the original typical grayscale values, the grayscale values ​​have been slightly adjusted. Furthermore, since the fruit and vegetable video sequence may exhibit more surface color variations compared to the fruit and vegetable reference video sequence, a third grayscale value has been added here. Frame time The typical gray value of the Poisson probability density function is 115, so the corresponding new Poisson probability density function is used to represent the changed gray value cluster area of the fruit and vegetable video sequence compared with the fruit and vegetable reference video sequence.

[0103] Step 4: Determine the weight coefficient of the different Poisson probability density functions in step 3 in the frame, including the following four steps:

[0104] Step 4.1: Set for any i-th frame , the observed gray quantization value is , and the measured probability and estimated probability of the pixel point are and respectively, where , then the error sum of squares function of the measured probability and the estimated probability of the different pixel points before the i-th frame is established with as the independent variable on . The error sum of squares function can be expressed as:

[0105] H ( ​ l , m ) = ∑ S g , t ∈ ​ m [ Y g , t − ∑ l = 1 L m ​ l , m ​ l , m ​ l , m S g , t e − ​ l , m S g , t ! ]

[0106] Step 4.2: The first derivative and second derivative of the error sum of squares function with respect to the weight coefficient can be obtained:

[0107] ∂ H ∂ ​ l , m = ∑ S g , t ∈ ​ m − 2 ​ l , m ​ l , m S g , t e − ​ l , m S g , t ! [ Y g , t − ∑ l = 1 L m ​ l , m ​ l , m ​ l , m S g , t e − ​ l , m S g , t ! ]

[0108] ∂ 2 H ∂ ​ 2 l , m = ∑ S g , t ∈ ​ m 2 [ ​ l , m ​ l , m S g , t e − ​ l , m S g , t ! ] 2

[0109] Step 4.3: According to step 4.2 , it is greater than 0, so when , there is a minimum value for , and at this time, it can be obtained from :

[0110] ∑ S g , t ∈ ​ m ​ l , m ​ l , m S g , t e − ​ l , m S g , t ! [ ∑ l = 1 L m ​ l , m ​ l , m ​ l , m S g , t e − ​ l , m S g , t ! ] = ∑ S g , t ∈ ​ m Y g , t ​ l , m ​ l , m S g , t e − ​ l , m S g , t !

[0111] Set the intermediate variable , and it can be obtained:

[0112] ∑ S g , t ∈ ​ m ​ l , m ( S g , t ) [ ∑ l = 1 L m ​ l , m ​ l , m ( S g , t ) ] = ∑ S g , t ∈ ​ m Y g , t ​ l , m ( S g , t )

[0113] When , the corresponding different​​​​ This can be rewritten as the following system of normal equations 1:

[0114] { ∑ S g , t ∈ ​ m ​ 1 , m ( S g , t ) [ ∑ l = 1 L m ​ l , m ​ l , m ( S g , t ) ] = ∑ S g , t ∈ ​ m Y g , t ​ 1 , m ( S g , t ) ∑ S g , t ∈ ​ m ​ 2 , m ( S g , t ) [ ∑ l = 1 L m ​ l , m ​ l , m ( S g , t ) ] = ∑ S g , t ∈ ​ m Y g , t ​ 2 , m ( S g , t ) ⋮ ∑ S g , t ∈ ​ m ​ l , L m ( S g , t ) [ ∑ l = 1 L m ​ l , m ​ l , m ( S g , t ) ] = ∑ S g , t ∈ ​ m Y g , t ​ l , L m ( S g , t )

[0115] The normal equation system 1 can be rearranged into the following normal equation system 2:

[0116]

[0117] Step 4.4: The normal equation system 2 described in step 4.3 can be represented in the following matrix form 1:

[0118]

[0119] Considering matrix form 1 If the corresponding determinant value is non-zero, then we know The matrix representation can be expressed as:

[0120]

[0121] Therefore, this can be achieved through step 4.4 above. The matrix representation of the first The Poisson probability density function at the nth... The weight coefficients of the frames are updated to obtain different... corresponding value.

[0122] Step 5: When segmenting moving fruit and vegetable detection targets in a certain frame of an image, different Poisson probability density functions can be selected sequentially from largest to smallest weight coefficient. The gray quantization value corresponding to a pixel belongs to the set of typical gray values ​​of a certain Poisson probability density function within the interval from the beginning of the fruit and vegetable video sequence to that frame. Therefore, this pixel can be considered to be represented by the corresponding typical gray value. Referring to this Poisson probability density function, it can be divided into moving targets or background. By performing the above operation on all pixels, the segmentation of moving fruit and vegetable detection targets in the image is achieved. The specific method is as follows:

[0123] When the video sequence of fruits and vegetables is in its first... When segmenting moving fruit and vegetable targets within a frame, The elements in are used as the first Each frame corresponding to Use it, among which Then for any of them, the first... Each Poisson probability density function is given in step 4.4. Value, retrieve the video sequence of fruits and vegetables from the beginning to the [value]. Within the frame interval, the first a set of quantized gray scale values corresponding to the pixels of the typical gray scale value of the Poisson probability density function , the corresponding value is given

[0124] Set , , and are the typical values of the fruit and vegetable video background weight coefficient, the fruit and vegetable video background standard deviation typical value, the fruit and vegetable video moving target weight coefficient and the fruit and vegetable video moving target standard deviation typical value, respectively, to define the left half trapezoidal distribution function of the weight coefficient of the Poisson probability density function at the frame based on the th Poisson probability density function and define the right half trapezoidal fuzzy distribution function of the interval statistical standard deviation of the fruit and vegetable video sequence from the start to the frame based on the th Poisson probability density function , which are specifically represented as:

[0125]

[0126]

[0127] Considering that when the object is fixed in the image, a Poisson probability distribution with gradually accumulated weight coefficient but gradually reduced interval statistical standard deviation will be generated, and thus if there are corresponding and can make , the distribution of the above th Poisson probability density function can be classified as a background model, otherwise as a moving target model;

[0128] Set the Poisson probability density function condition of the current fruit and vegetable video sequence ​ , the weight coefficient and the standard deviation of the corresponding Poisson probability density function are shown in ​ and ​ , respectively, and and are set to 0.16 and 0.05, respectively, and and The values ​​are 5 and 15 respectively. Therefore, the distributions of the 1st, 2nd, and 5th Poisson probability density functions can be attributed to the background model, while the distributions of the 3rd, 4th, and 6th Poisson probability density functions can be attributed to the moving target model. Considering that there are adjustments in lighting and moving target speeds in fruit and vegetable sorting scenarios, a hybrid model can better describe the various changes in scene targets over time, thus enabling more successful detection of moving targets and meeting the needs of complex and variable scenarios that may exist in fruit and vegetable sorting.

[0129] Depend on ​ It can be seen that in the first Pixels in a frame image According to corresponding The values ​​are calculated by selecting the Poisson probability density function corresponding to the above numbers in the order 2-1-5-4-3-6. If the... Pixels in a frame image Corresponding gray quantization value Belongs to a certain corresponding [ ​ ​ l , m ​ ​ l , m ] Then it can be considered that the first Pixels in a frame image Typical grayscale values To express, refer to the above. Divide into moving targets or background; by analyzing the first... All pixels in the frame image complete the above operations, thereby achieving segmentation of moving fruit and vegetable detection targets in the fruit and vegetable video sequence.

[0130] Any parts not explicitly stated in this embodiment can be implemented using existing technologies. For those skilled in the art, any changes, modifications, substitutions, and variations made to the implementation methods without departing from the principles and spirit of this invention, based on the teachings of this invention, still fall within the protection scope of this invention.

Claims

1. A motion fruit and vegetable detection target segmentation method based on adaptive update, characterized in that, The method comprises the following steps: Step 1: If any pixel point in a frame image can be described by a Poisson model constructed by a Poisson probability density function when modeling a fruit and vegetable video sequence, a set of gray scale quantization values corresponding to pixel points belonging to a typical gray scale value of a certain Poisson probability density function in an interval from the beginning of the fruit and vegetable video sequence to the frame can be constructed, and a statistical mathematical expectation, a statistical standard deviation and a statistical expectation deviation proportion in the interval from the beginning of the fruit and vegetable video sequence to the frame for the certain Poisson probability density function are obtained; Step 2: The number of initial Poisson probability density functions and the typical gray scale values of the corresponding Poisson probability density functions are determined through the set of gray scale quantization values corresponding to pixel points in a fruit and vegetable reference video sequence; Step 3: The number of Poisson probability density functions and the typical gray scale values of the corresponding Poisson probability density functions in the next frame are determined through adaptive updating of the typical gray scale values of the Poisson probability density functions at a certain frame in the fruit and vegetable video sequence; Step 4: The weight coefficients of the different Poisson probability density functions at the frame are determined; Step 5: When a moving fruit and vegetable detection target in a frame image is segmented, different Poisson probability density functions are selected in turn from large to small according to the weight coefficients, and if the gray scale quantization value corresponding to a certain pixel point belongs to the set of gray scale quantization values corresponding to pixel points belonging to a typical gray scale value of a certain Poisson probability density function in an interval from the beginning of the fruit and vegetable video sequence to the frame, it is considered that the pixel point can be represented by the corresponding typical gray scale value, and the pixel point is divided into a moving target or a background according to the Poisson probability density function; the above operation is completed for all pixel points, so that the moving fruit and vegetable detection target is segmented.

2. The motion-based adaptive update target segmentation method for fruit and vegetable detection according to claim 1, wherein, The specific method of step 1 is: If the fruit and vegetable video sequence is modeled, the first frame image pixel point The feature can be described by a Poisson model constructed by Poisson probability density function, and the estimated probability of the gray quantization value observed at the pixel point in the first frame can be represented as The estimated probability of occurrence can be represented as , wherein is the number of Poisson probability density functions, is the number of Poisson probability density functions at the first frame, is the weight coefficient of the first Poisson probability density function at the first frame, is the normalization coefficient of the first Poisson probability density function at the first frame, is the typical gray value of the first Poisson probability density function at the first frame, is a positive integer after gray quantization, is the base of natural logarithm, is the factorial symbol, and it can be known that when The maximum can be set to to satisfy the normalization condition;​​ Setting The set of gray quantization values corresponding to the pixel points in the fruit and vegetable video sequence from the start to the frame interval, the set of gray quantization values corresponding to the pixel points in the fruit and vegetable video sequence from the start to the frame interval belonging to the typical gray value of the Poisson probability density function can be constructed, which can be specifically represented as: ​ Ψ l , m = { S g , t | ε l , t λ l , t S g , t e − λ l , t S g , t ! ≥ γ , t ∈ [ 1 , m ], S g , t ∈ Ψ m } wherein, is a frame number of a frame preceding the frame, is a quantized value of a gray level observed at a pixel point in the frame, is a frame number of a frame preceding the frame, is a filter condition symbol, is a normalized coefficient of the th Poisson probability density function in the frame, is a typical gray level value of the th Poisson probability density function at the frame, is a quantized value of a gray level observed at a pixel point in the frame, is a quantized value of a gray level observed at a pixel point in the frame, is a confidence level attributable to the typical gray level value; Set the first Poisson probability density function from the fruit and vegetable video sequence to the interval statistics mathematical expectation of the first frame can be represented as: wherein is a function of the number of elements in the set; Setting for the first Poisson probability density functions are used from the beginning of the fruit and vegetable video sequence to the [number]th [number]. Interval statistical standard deviation of frames It can be represented as: D ^ l , m = ∑ S g , t ∈ Ψ l , m S g , t 2 sum ( Ψ l , m ) − [ ∑ S g , t ∈ Ψ l , m S g , t sum ( Ψ l , m ) ] 2 Considering the fact that the mean and variance of the Poisson probability density function are equal, the deviation ratio of the mean and variance of the Poisson probability density function from the fruit and vegetable video sequence starting from the first frame to the interval of the frame can be expressed as: ​​ 3. The motion fruit and vegetable detection target segmentation method based on adaptive update according to claim 1, characterized in that, The specific method of step 2 comprises the following steps: Step 2.1: set the initially 0, input fruit and vegetable reference video sequence pixel point corresponding to the gray quantization value set and the expected variance deviation proportion confidence level , set by the gray quantization value according to the number of the same value level can be given different numerical gray quantization value establish the initial gray quantization value set , wherein is the number of Poisson probability density function available when the fruit and vegetable reference video sequence is gray quantized, is the gray quantization value of the first Poisson probability density function in the fruit and vegetable reference video sequence, set the typical gray value set corresponding to the fruit and vegetable reference video sequence is , wherein is an empty set; Step 2.2: the unused are sequentially given in the fruit and vegetable video sequence initial time , the pixel points corresponding to the gray quantization value set of the typical gray value of the first Poisson probability density function , can be expressed as , and the interval statistical mathematical expectation of the first Poisson probability density function at the initial time of the fruit and vegetable video sequence is given , the interval statistical standard deviation , and the interval statistical expected variance deviation ratio ; Step 2.3: If the current step 2.2 described , then delete the current step 2.2 described from the and add the element [ inf Ψ l , 0 ,sup Ψ l , 0 ] to the and are the supremum and infimum, respectively, and add the above to the ; if the above , then delete the above from the ; Step 2.4: Determine if the current is , if so, go to Step 2.5, if not, go to Step 2.2; Step 2.5: Set the initial time the number of Poisson probability density functions under the condition to and use each element in as the typical gray value of the initial time Poisson probability density function is performed.

4. The motion-based adaptive update target segmentation method for fruit and vegetable detection according to claim 1, wherein, The specific method of step 3 comprises the following steps: Step 3.1: Set the first frame number of the fruit and vegetable video sequence as the adaptive update of the typical gray value of the Poisson probability density function at the frame time, and the current interval frame number is , the interval statistical expectation variance deviation ratio of the Poisson probability density function at the frame time is given , the interval statistical expectation variance deviation ratio of the Poisson probability density function at the frame time is given , and the interval statistical expectation variance deviation ratio of the Poisson probability density function at the frame time is given , and the interval statistical expectation variance deviation ratio of the Poisson probability density function at the frame time is given , and the interval statistical expectation variance deviation ratio of the Poisson probability density function at the frame time is given ; Step 3.2: if wherein is the interval statistical expectation variance deviation tolerance coefficient, the interval frame number of the next adaptive update is set as until the interval frame number reaches the maximum value and the typical gray value set of the frame is still the typical gray value set of the frame then go to Step 3.9; if , the gray quantization value set of the pixel points in the fruit and vegetable video sequence from the beginning of the fruit and vegetable video sequence to the frame is constructed and the typical gray value set of the frame is obtained, and the interval frame number of the next adaptive update is set as until the interval frame number reaches the minimum value and then go to Step 3.

3. Step 3.3: In , the size of the weight coefficient of the i-th frame is sequentially corresponding to the typical gray value of the i-th Poisson probability density function at the i-th frame. ;​​​​​ Step 3.4: Through the aforementioned Calculate the corresponding interval statistical expected variance deviation ratio ,like Then from Delete that And from Delete the video sequence starting from the fruit and vegetable video sequence up to the 1st. Within the frame interval, the first The set of gray quantization values ​​corresponding to pixels with typical gray values ​​of a Poisson probability density function. Find the elements in the list and output them. To the Typical grayscale value set of a frame If the Then, the values ​​are given in descending order of the number of identical values ​​in the gray quantified values. In China [ inf Ψ l , m − 1 ,sup Ψ l , m − 1 ] elements and through the The deviation ratio of the interval statistical expectation variance corresponding to the typical gray value of the Poisson probability density function is used to calculate the expected value of the interval. Until it exists Then output the condition that satisfies the condition. of To the Typical grayscale value set corresponding to the frame and from Delete that And from Delete the above [ inf Ψ l , m − 1 ,sup Ψ l , m − 1 ] Elements in; Step 3.5: If then go to Step 3.3; if then go to Step 3.6; Step 3.6: from a gray scale value according to the high or low of the same number of elements in the value of a number of different values ; Step 3.7: the step 3.6 is described The interval statistical expectation variance deviation proportion corresponding to the typical gray value calculated as the Poisson probability density function ; if , the pixel point is deleted from ; and the and the The gray quantization value set corresponding to the pixel point as the typical gray value is an element in , and the is output to the typical gray value set of the first frame ; Step 3.8: If then go to Step 3.7; if then go to Step 3.9; Step 3.9: output the , and set the , and set the , and set the , and set the , and set the , and set the , and set the 5. The motion-based adaptive update target segmentation method for fruit and vegetable detection according to claim 1, wherein, The specific method of step 4 comprises the following steps: Step 4.1: Let for Any of the following Framed at pixel Gray quantization value observed at [location] The measured probability and the estimated probability are respectively and ,in Then in above Establish the independent variable for different pixels at the th... Measured probability before frame With Estimated Probability Sum of squared errors function It can be represented as: H ( ω l , m ) = ∑ S g , t ∈ Ψ m [ Y g , t − ∑ l = 1 L m ω l , m ε l , m λ l , m S g , t e − λ l , m S g , t ! ] Step 4.2: from said The first derivative and the second derivative of said The first derivative and the second derivative of said ∂ H ∂ ω l , m = ∑ S g , t ∈ Ψ m − 2 ε l , m λ l , m S g , t e − λ l , m S g , t ! [ Y g , t − ∑ l = 1 L m ω l , m ε l , m λ l , m S g , t e − λ l , m S g , t ! ] ∂ 2 H ∂ ω 2 l , m = ∑ S g , t ∈ Ψ m 2 [ ε l , m λ l , m S g , t e − λ l , m S g , t ! ] 2 Step 4.3: From step 4.2 it is known that it is greater than 0, then when there exists a minimum for from which it follows that ​​ ∑ S g , t ∈ Ψ m ε l , m λ l , m S g , t e − λ l , m S g , t ! [ ∑ l = 1 L m ω l , m ε l , m λ l , m S g , t e − λ l , m S g , t ! ] = ∑ S g , t ∈ Ψ m Y g , t ε l , m λ l , m S g , t e − λ l , m S g , t ! Setting intermediate variables It follows that: ∑ S g , t ∈ Ψ m θ l , m ( S g , t ) [ ∑ l = 1 L m ω l , m θ l , m ( S g , t ) ] = ∑ S g , t ∈ Ψ m Y g , t θ l , m ( S g , t ) In corresponding to different can be rewritten as the following normal equations 1: { ∑ S g , t ∈ Ψ m θ 1 , m ( S g , t ) [ ∑ l = 1 L m ω l , m θ l , m ( S g , t ) ] = ∑ S g , t ∈ Ψ m Y g , t θ 1 , m ( S g , t ) ∑ S g , t ∈ Ψ m θ 2 , m ( S g , t ) [ ∑ l = 1 L m ω l , m θ l , m ( S g , t ) ] = ∑ S g , t ∈ Ψ m Y g , t θ 2 , m ( S g , t ) ⋮ ∑ S g , t ∈ Ψ m θ l , L m ( S g , t ) [ ∑ l = 1 L m ω l , m θ l , m ( S g , t ) ] = ∑ S g , t ∈ Ψ m Y g , t θ l , L m ( S g , t ) The normal equation group 1 can be arranged into the following normal equation group 2: Step 4.4: The normal equation group 2 in step 4.3 can be expressed in the following matrix form 1: Considering the matrix form 1 The corresponding determinant value is non-zero, and it is known that The matrix expression of the matrix expression of the matrix expression of the matrix expression of the matrix expression of the matrix expression of the matrix expression of the matrix expression of the matrix expression of the matrix expression of the matrix expression of the matrix expression of the matrix expression of the matrix expression Therefore, this can be achieved through step 4.4 above. The matrix representation of the first The Poisson probability density function at the nth... The weight coefficients of the frames are updated to obtain different... corresponding value.

6. The motion-based adaptive update target segmentation method for fruit and vegetable detection according to claim 1, wherein, The specific method of step 5 is: When the video sequence of fruits and vegetables is in its first... When segmenting moving fruit and vegetable targets within a frame, The elements in the first part are used as the second part. Each frame corresponding to Use it, among which Then for any of them, the first... Each Poisson probability density function is given in step 4.

4. Value, retrieve the video sequence of fruits and vegetables from the beginning to the [value]. Within the frame interval, the first The set of gray quantization values ​​corresponding to pixels with typical gray values ​​of a Poisson probability density function. Give its corresponding value; set up , , and These are, respectively, the typical values ​​of the background weight coefficients, the typical values ​​of the standard deviation of the background in the fruit and vegetable video, the typical values ​​of the moving target weight coefficients, and the typical values ​​of the standard deviation of the moving target in the fruit and vegetable video, to define the values ​​based on the first... The Poisson probability density function at the nth... Frame weight coefficients Left half trapezoidal distribution function and the definition is based on the first Poisson probability density functions are used from the beginning of the fruit and vegetable video sequence to the [number]th [number]. Interval statistical standard deviation of frames Right half trapezoidal fuzzy distributed function Specifically, they are expressed as follows: Set if there is Corresponding And Can make Then the above first The distribution of the Poisson probability density function can be attributed to the background model, otherwise to the moving target model; In the first Pixel points in the frame image According to Corresponding The value is selected in turn from large to small to calculate the corresponding Poisson probability density function, if the first Pixel points in the frame image Corresponding gray quantization value Belong to a certain Corresponding [ inf Ψ l , m ,sup Ψ l , m ] It can be considered that the pixel points in the first Frame image Can be represented by the typical gray value , refer to the above Divided into moving targets or backgrounds; through the above operation on all pixel points in the first Frame image, so as to realize the segmentation of the moving fruit and vegetable detection target.