A fruit and vegetable powder color uniformity detection method and system based on image processing

By constructing multidimensional feature vectors and iterative clustering algorithms, and dynamically adjusting local heterogeneity, the problem of segmenting complex and abnormal clumps was solved, and the accurate detection of color uniformity of fruit and vegetable powder was achieved.

CN121190475BActive Publication Date: 2026-02-24XIAN LONGZE BIOTECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511725902.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-02-24
Estimated Expiration
2045-11-24

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately segment abnormal clumps with complex shapes and blurred boundaries, leading to inaccurate detection of color uniformity in fruit and vegetable powders.

Method used

A multidimensional feature vector containing color vector, local heterogeneity, and color deviation is constructed. During the iterative clustering process, the local heterogeneity is dynamically adjusted based on the consistency of neighborhood labels, and abnormal regions are accurately identified through the iterative clustering algorithm.

Benefits of technology

It significantly improves the accuracy of color uniformity detection for fruit and vegetable powders, effectively distinguishing between large areas of color deviation and localized areas of mixed colors, and accurately identifying different types of color defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121190475B_ABST
    Figure CN121190475B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image processing, and particularly relates to a fruit and vegetable powder color uniformity detection method and system based on image processing. The method comprises the following steps: obtaining an image of a fruit and vegetable powder to be detected; constructing a feature vector of each pixel point; iteratively clustering all feature vectors to obtain multiple clusters and clustering centers of each cluster; selecting a target cluster with an area greater than an area threshold from the multiple clusters; if the local non-homogeneity of the clustering center of the target cluster is greater than a first threshold, the target cluster belongs to an abnormal area of color deviation type; if the local non-homogeneity of the clustering center of the target cluster is less than or equal to the first threshold, and the color deviation degree is greater than a second threshold, the target cluster belongs to an abnormal area of non-homogeneity type; and if the ratio of the area of all abnormal areas to the total area of the image is greater than a set value, the color of the fruit and vegetable powder to be detected is not uniform. That is, the scheme of the present application can accurately detect the color uniformity of fruit and vegetable powder.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a method and system for detecting the color uniformity of fruit and vegetable powder based on image processing. Background Technology

[0002] In the production of fruit and vegetable powder, color uniformity is an important indicator for measuring the quality of its mixing process.

[0003] Traditional manual visual inspection methods are inefficient, subjective, and inconsistent in standards, making it difficult to meet the high-speed, online, and automated quality inspection requirements of modern production lines. Therefore, automated color uniformity inspection technology based on machine vision has become an inevitable trend in the industry. However, this technology faces significant challenges in practical applications due to complex visual scenarios. The specific influencing factors include the following:

[0004] 1. Qualified fruit and vegetable powder may have reasonable color fluctuations due to factors such as raw material batch and drying process;

[0005] 2. The sample to be tested may show large areas of color difference due to uneven mixing;

[0006] 3. The sample to be tested contains abnormally shaped and blurred color spots and clumps with complex internal textures, as well as a large number of acceptable tiny color spots or noise.

[0007] The aforementioned influencing factors make it difficult for traditional image detection algorithms to accurately and robustly evaluate color uniformity.

[0008] To address the aforementioned issues, K-Means clustering algorithms are commonly used in industry for image segmentation and region recognition. However, in the specific scenario of detecting the color uniformity of fruit and vegetable powder, the K-Means clustering algorithm relies solely on pixel color information to construct the feature space, lacking the ability to perceive spatial context. This results in its inability to effectively distinguish between two fundamentally different types of regions: one is a large area of ​​abnormal clumps with highly consistent internal color and spatial coherence, but significantly deviating from the acceptable color gamut; the other is tiny color dots or texture noise with drastic local color fluctuations and random spatial distribution.

[0009] Therefore, the evaluation metrics obtained by the K-Means algorithm (such as the maximum cluster ratio) also suffer from inaccuracies, making it difficult to accurately reflect the degree of color unevenness in fruit and vegetable powders. More importantly, existing methods often rely on inferring acceptable backgrounds from the image itself, which can easily misclassify abnormal clumps as acceptable areas in cases of large areas of defective products, leading to artificially high uniformity metrics. Consequently, it is difficult to accurately segment abnormal clumps with complex shapes and blurred boundaries, thus hindering the detection of uniformity. Summary of the Invention

[0010] The purpose of this invention is to propose a method and system for detecting the color uniformity of fruit and vegetable powder based on image processing, in order to solve the problem in the prior art that it is difficult to accurately segment abnormal clumps with complex shapes and blurred boundaries, thus making it impossible to accurately detect the uniformity of fruit and vegetable powder; to this end, this invention provides solutions in the following two aspects.

[0011] In a first aspect, the present invention provides a method for detecting the color uniformity of fruit and vegetable powder based on image processing, comprising:

[0012] An image of the fruit and vegetable powder to be tested is acquired, and the values ​​of the three channels of each pixel in the image in the CIELAB color space are obtained to form a color vector; a feature vector of each pixel is constructed, which includes the color vector of the corresponding pixel, the local heterogeneity, and the color deviation; the local heterogeneity is the mean of the Euclidean distance between the color vector of any pixel and the pixels in its neighborhood, and the color deviation characterizes the deviation between the color vector of any pixel and the standard color distribution;

[0013] Iterative clustering is performed on all feature vectors to obtain multiple clusters and the cluster center of each cluster. In the current iteration, the local heterogeneity of each pixel in the previous iteration is adjusted based on the label consistency of each pixel in the previous iteration to update the local heterogeneity in the current iteration.

[0014] Select target clusters with an area greater than the area threshold from multiple clusters. If the local heterogeneity of the cluster center of the target cluster is greater than the first threshold, it belongs to the color-biased abnormal region. If the local heterogeneity of the cluster center of the target cluster is less than or equal to the first threshold and the color deviation is greater than the second threshold, it belongs to the heterogeneous abnormal region.

[0015] If the ratio of the area of ​​all abnormal regions to the total area of ​​the image is greater than a set value, the color of the fruit and vegetable powder to be tested is uneven.

[0016] The aforementioned scheme constructs a multi-dimensional feature vector that includes color vectors, local heterogeneity, and color deviation, enabling a more comprehensive description of the color state of fruit and vegetable powders. Specifically, during iterative clustering, it dynamically adjusts local heterogeneity based on the consistency of pixel labels with their neighbors, effectively suppressing texture features in large homogeneous areas while preserving texture features from noisy points. This allows the algorithm to accurately distinguish between large-area "color cast" anomalies caused by overall color deviation from the standard and "heterogeneity" anomalies caused by color mixing. This solves the technical challenge of traditional methods, which struggle to differentiate between these two types of defects and easily misclassify large areas of defective products as acceptable backgrounds, significantly improving the accuracy of color uniformity detection.

[0017] Optionally, updating the local non-homogeneity at the current iteration includes:

[0018] ;

[0019] in, As a weighting factor, Let be the local heterogeneity of pixel p in the (t+1)th iteration. Let p be the label consistency of pixel p in the t-th iteration. The local heterogeneity of the target pixel p in the t-th iteration is defined as follows: the label consistency is the percentage of pixels in the t-th iteration whose cluster labels are the same as those of their neighboring pixels, where the neighboring pixels are pixels within eight neighborhoods.

[0020] The above scheme introduces a negative feedback adjustment mechanism based on label consistency. When a pixel belongs to the same category as its surrounding pixels, its local heterogeneity weight is dynamically reduced. This enables the algorithm to reduce the interference of local texture features when processing large areas with consistent internal color (whether qualified areas or color-biased areas), thus focusing more on global features such as color deviation. This helps to accurately segment such areas as a whole, improving the stability of clustering and the ability to identify different types of defects.

[0021] Optionally, the process of obtaining the color deviation is as follows:

[0022] Obtain the standard color vector of each qualified pixel in the qualified image of the standard qualified fruit and vegetable powder sample in the CIELAB color space, and obtain the mean vector of all standard color vectors; the standard color vector is composed of the values ​​of the three channels of the qualified pixel in the CIELAB color space.

[0023] Calculate the covariance matrix of the standard color vectors of all qualified pixels;

[0024] Based on the covariance matrix, mean vector, and color vector of any pixel, the Mahalanobis distance of any pixel is obtained, and the Mahalanobis distance is used as the color deviation of any pixel.

[0025] The Mahalanobis distance mentioned above can effectively incorporate the covariance of each channel of the standard color in the CIELAB space, thus providing a deviation measure that is not affected by dimensions and is more in line with statistical laws. This makes the judgment of color deviation from the normal range more accurate and reliable, especially when dealing with qualified products with natural color fluctuations, and can better avoid misjudgment.

[0026] Optionally, before performing iterative clustering, the following steps are also included: performing Z-score normalization on the values ​​of each channel in the color vector of each pixel.

[0027] The above solution can eliminate the effects caused by differences in dimensions and numerical ranges between different color channels.

[0028] Optionally, during iterative clustering, the process of obtaining the initial set of cluster centers is as follows:

[0029] The average feature vector of all qualified pixels in the qualified image is used as an initial cluster center. The average feature vector includes the mean vector of all qualified pixels, the mean of local heterogeneity, and the mean of color deviation.

[0030] The K-Means++ initialization strategy is adopted, and the remaining samples are selected sequentially according to the K-Means++ probability sampling rules. K is the number of initial cluster centers, which constitutes the complete initial cluster center set.

[0031] The above scheme avoids clustering bias caused by inconsistency between the initialization center and the distribution of sample data, further enhances the effectiveness of the initialization strategy, and ensures the stability and efficiency of the algorithm iteration process.

[0032] Optionally, it also includes: performing Z-score normalization on the mean of each channel in the mean vector of all qualified pixels.

[0033] Optionally, the iterative clustering employs the K-Means algorithm.

[0034] Optionally, the neighborhood range is a 7×7 window.

[0035] Optionally, the convergence condition for the iterative clustering is:

[0036] In at least two consecutive iterations, the number of pixels whose cluster labels change is 0, or the proportion of pixels whose cluster labels change to the total number of pixels is less than the set convergence threshold.

[0037] In the second aspect, a method system for detecting the color uniformity of fruit and vegetable powder based on image processing includes:

[0038] processor;

[0039] The memory stores computer instructions for a method of detecting the color uniformity of fruit and vegetable powder based on image processing. When the computer instructions are executed by the processor, the system performs the aforementioned method of detecting the color uniformity of fruit and vegetable powder based on image processing.

[0040] The beneficial effects of this invention are as follows:

[0041] The solution of this invention constructs and integrates a multi-dimensional feature vector of color vector, local heterogeneity, and color deviation, and dynamically adjusts the weight of local heterogeneity based on the consistency of neighborhood labels during iterative clustering. This effectively distinguishes large-area overall color-biased regions from local color-mixed regions, accurately identifies different types of color defects, and significantly improves the accuracy of color uniformity detection. Attached Figure Description

[0042] Figure 1 This illustration schematically shows a flowchart of the steps in a method for detecting the color uniformity of fruit and vegetable powder based on image processing in this embodiment.

[0043] Figure 2 The schematic diagram illustrates the structural block diagram of a method system for detecting the color uniformity of fruit and vegetable powder based on image processing in this embodiment. Detailed Implementation

[0044] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0045] This invention provides a method for detecting the color uniformity of fruit and vegetable powder based on image processing. It aims to solve the problem that existing technologies rely solely on color information for cluster analysis, which cannot effectively distinguish between large areas of color deviation and local texture noise, thus leading to inaccurate color uniformity assessment.

[0046] Specifically, such as Figure 1 As shown in this embodiment, a method for detecting the color uniformity of fruit and vegetable powder based on image processing includes the following steps:

[0047] Step S1: Obtain an image of the fruit and vegetable powder to be tested, and obtain the color vector of each pixel in the image in the CIELAB color space.

[0048] In this embodiment, images of the fruit and vegetable powder to be tested are first acquired using image acquisition devices such as industrial cameras.

[0049] To eliminate the influence of lighting changes on color information and make color differences more consistent with human visual perception, the acquired RGB image is converted to the CIELAB color space to obtain the values ​​of each pixel in the L, a, and b channels. The values ​​of each pixel in the L, a, and b channels are then used to construct a color vector.

[0050] Furthermore, before performing color space conversion, the original image is preprocessed with Gaussian filtering and other methods to suppress random noise.

[0051] Step S2: Construct the feature vector for each pixel.

[0052] After obtaining the values ​​of the L, a, and b channels of each pixel in the CIELAB color space, a multidimensional feature vector is constructed for each pixel.

[0053] Specifically, the feature vector includes the color vector of the corresponding pixel, the local heterogeneity, and the color deviation.

[0054] The color vector is composed of the values ​​of the three channels of a pixel.

[0055] As a preferred approach, to ensure comparability of features with different dimensions in subsequent clustering processes, the values ​​of each channel in the color vector are further processed. Standardized processing.

[0056] Specifically, the mean and standard deviation of each channel in the standard color vector of each qualified pixel in the qualified image of the standard qualified fruit and vegetable powder sample in the CIELAB color space can be used to perform Z-score normalization on the color vector of each pixel in the image of the fruit and vegetable powder to be tested.

[0057] The local heterogeneity is defined as the average Euclidean distance between the color vector of any pixel and the color vectors of its neighboring pixels. Specifically, the Euclidean distance between the color vector of any pixel and the color vectors of its neighboring pixels is calculated, and the average of all Euclidean distances is taken as the local heterogeneity of that pixel.

[0058] Since the method for calculating Euclidean distance is existing technology, it will not be elaborated here.

[0059] The aforementioned local heterogeneity is the degree of color difference between any pixel and all pixels in its surrounding neighborhood, used to characterize the local texture or noise level.

[0060] The aforementioned neighborhood is a 7×7 window; of course, it can be set according to the actual situation.

[0061] Here, the color deviation is the Mahalanobis distance between the color vector of pixel p and the standard color distribution.

[0062] Specifically, the process of obtaining the color deviation is as follows:

[0063] First, obtain the standard color vector of each qualified pixel in the qualified image of the standard qualified fruit and vegetable powder sample in the CIELAB color space, and calculate the mean vector of all standard color vectors.

[0064] Next, calculate the covariance matrix of the standard color vectors of all qualified pixels.

[0065] Then, based on the covariance matrix, the mean vector, and the color vector of any pixel, the Mahalanobis distance of any pixel is obtained, and the Mahalanobis distance is used as the color deviation of any pixel.

[0066] Color deviation for:

[0067] ;

[0068] in, Let p be the color vector. This is the mean vector of the standard color vectors of all qualified pixels in a qualified image of a standard qualified fruit and vegetable powder sample. Let T be the covariance matrix of the standard color vectors of all qualified pixels, where T represents the transpose.

[0069] The Mahalanobis distance mentioned above takes into account the correlation between color channels and measures the statistical distance between the color vector of pixel p and the standard color distribution of a standard qualified fruit and vegetable powder sample. It is used to determine the degree to which the color of pixel p deviates from the normal color gamut; that is... The larger the value, the more severely the color of pixel p deviates from the standard acceptable color.

[0070] The aforementioned feature vectors not only contain color information, but also incorporate features that reflect local spatial texture and global color deviation.

[0071] Step S3: Iteratively cluster all feature vectors to obtain multiple clusters.

[0072] In this embodiment, the specific process of iterative clustering of all feature vectors is as follows:

[0073] First, obtain the initial cluster centers.

[0074] In one embodiment, the initial cluster centers during iterative clustering are not randomly selected, but are set based on qualified images of standard qualified fruit and vegetable powder samples. Specifically, the average feature vector of all pixels in the qualified images of standard qualified fruit and vegetable powder samples is calculated, and the average feature vector is used as one of the initial cluster centers. Other initial cluster centers are fine-tuned or randomly generated based on this.

[0075] The aforementioned average feature vector includes the mean vector of all qualified pixels, the mean of local heterogeneity, and the mean of color deviation.

[0076] Furthermore, a K-Means++ initialization strategy is adopted, using the average feature vector of qualified images as the first initial cluster center, and then selecting the remaining cluster centers sequentially according to the probability sampling rule of K-Means++. These initial centers eventually form a complete set of initial cluster centers.

[0077] By using the average eigenvector as the first initial cluster center, randomness can be eliminated, making the clustering results more stable.

[0078] Furthermore, since the feature vectors of the colors of the fruits and vegetables being tested have been standardized, the average feature vectors also need to be standardized at this point.

[0079] It should be noted that, since the aforementioned standardization of each feature vector used the mean and standard deviation of each channel in the standard color vector of each qualified pixel in the qualified image of the standard qualified fruit and vegetable powder sample in the CIELAB color space, the standardized average feature vector should be the following when standardizing the average feature vector: , and These are the mean values ​​of local heterogeneity and color deviation of a qualified image, respectively.

[0080] Secondly, for any pixel, calculate the Euclidean distance from that pixel to each initial cluster center, assign that pixel to the cluster containing the nearest initial cluster center, and update the cluster center of the corresponding cluster.

[0081] For example, for pixel p, calculate the Euclidean distance from the feature vector at the t-th iteration to each cluster center in the cluster center set at the t-th iteration, and assign pixel p to the cluster center with the smallest obtained Euclidean distance.

[0082] Then, repeat the above steps and continue iterating until the convergence condition is met or the maximum number of iterations is reached, at which point the iteration stops.

[0083] In each iteration, the local heterogeneity from the previous iteration needs to be updated to obtain the updated local heterogeneity.

[0084] Specifically, after each iteration (e.g., the t-th iteration) is completed, the next iteration (the t-th iteration) begins. Before each iteration, the local heterogeneity of each pixel needs to be updated.

[0085] The above update is based on the following: for spatially continuous regions with the same cluster labels, the local heterogeneity of their internal pixels should be suppressed, so that the clustering algorithm can focus more on their color deviation; while for isolated noise points, their local heterogeneity should be preserved to highlight their texture features.

[0086] Specifically, the updated formula is as follows: ;

[0087] in, For the first The local heterogeneity of pixel p in the next iteration; Let be the local heterogeneity of pixel p in the t-th iteration; This is a weighting factor used to control the adjustment magnitude. Let p be the label consistency of pixel p in the t-th iteration.

[0088] As a preferred option, The value range can be set to to ;

[0089] The above label consistency refers to the percentage of pixels whose cluster labels are the same as those of their neighboring pixels at the t-th iteration, where the neighboring pixels are pixels within eight neighborhoods.

[0090] It should be noted that during the iteration, the cluster label of the cluster to which the obtained pixel p belongs can be the cluster number.

[0091] From the above formula, it can be seen that when pixel p and most of its neighboring pixels belong to the same cluster (i.e., ... A higher value indicates that pixel p is located within a spatially continuous homogeneous region. This negative feedback adjustment mechanism reduces the local heterogeneity of large areas with uniform internal color (whether qualified or defective), thereby strengthening the determining role of color deviation in subsequent clustering and helping to divide such areas as a whole. Conversely, for randomly distributed noise points, when At lower levels, It will remain basically unchanged, and the clustering algorithm will still identify it as a texture feature.

[0092] The convergence condition for the above iterative clustering can be set as follows: in two consecutive iterations, the number of pixels whose cluster labels change is 0, or the proportion of this number to the total number of pixels is less than a preset convergence threshold (e.g., ...). ).

[0093] In this embodiment, after the iterative clustering converges, multiple clusters and the cluster center of each cluster are obtained.

[0094] Step S4: Select the target cluster from multiple clusters and identify whether the target cluster is an abnormal region; if the ratio of the area of ​​all abnormal regions to the total area of ​​the image is greater than a set value, the color of the fruit and vegetable powder to be tested is uneven.

[0095] The selection criterion for choosing the target cluster from multiple clusters is that its area is greater than an area threshold, in order to eliminate acceptable tiny color points or noise. Here, the area refers to the number of pixels within the cluster.

[0096] In this embodiment, the specific process for identifying whether a target cluster is an abnormal region is as follows:

[0097] If the local heterogeneity of the cluster center of the target cluster is greater than the first threshold, it belongs to the color-biased abnormal region. If the local heterogeneity of the cluster center of the target cluster is less than or equal to the first threshold, and the color deviation is greater than the second threshold, it belongs to the heterogeneous abnormal region.

[0098] Among them, the abnormal areas of color deviation correspond to large areas of clumps in the fruit and vegetable powder to be tested, with uniform internal color but overall color significantly deviating from the standard color. That is, the high local heterogeneity indicates that there is a significant color abrupt change between the boundary of the cluster and the surrounding area.

[0099] The heterogeneous abnormal area corresponds to the area in the fruit and vegetable powder where the color is mixed and uneven. Although the internal texture is not strong (the local heterogeneity is low), the overall color gamut has deviated from the qualified range (the color deviation is high).

[0100] In this embodiment, the first threshold and the second threshold are empirical values ​​obtained from statistical analysis of a large number of qualified and unqualified samples, and are used to distinguish different defect patterns.

[0101] In this embodiment, the areas of all abnormal regions identified as color cast or heterogeneous are summed to obtain the total area of ​​all abnormal regions. The ratio of the area to the total area of ​​the image is calculated and compared with a set value. If the ratio is greater than the set value, the fruit and vegetable powder to be tested is determined to have uneven color and is of substandard quality; otherwise, it is determined to be qualified.

[0102] The above setting value can be 0.4, or it can be determined according to the accuracy requirements in production.

[0103] The solution of this invention can comprehensively utilize color, local texture and global color deviation information, and accurately identify and distinguish different types of color defect regions through an adaptive feature adjustment clustering process, thereby achieving objective and accurate detection of the color uniformity of fruit and vegetable powder.

[0104] This invention also provides a method and system for detecting the color uniformity of fruit and vegetable powder based on image processing. For example... Figure 2 As shown, the system includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the image processing-based method for detecting the color uniformity of fruit and vegetable powder according to the present invention.

[0105] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and therefore will not be described in detail here.

[0106] In this invention, the aforementioned memory can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc., or any other medium that can be used to store desired information and can be accessed by an application, module, or both. Any such computer storage medium can be part of a device or accessible to or connected to a device. Any application or module described in this invention can be implemented by computer-readable / executable instructions stored or otherwise maintained on such a computer-readable medium.

[0107] In the description of this specification, "multiple" means at least two, such as two, three or more, etc., unless otherwise expressly and specifically defined.

[0108] While various embodiments of the invention have been shown and described in this specification, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention.

Claims

1. A method for detecting the color uniformity of fruit and vegetable powder based on image processing, characterized in that, include: An image of the fruit and vegetable powder to be tested is acquired, and the values ​​of the three channels of each pixel in the image in the CIELAB color space are obtained to form a color vector; a feature vector of each pixel is constructed, which includes the color vector of the corresponding pixel, the local heterogeneity, and the color deviation; the local heterogeneity is the mean of the Euclidean distance between the color vector of any pixel and the pixels in its neighborhood, and the color deviation characterizes the deviation between the color vector of any pixel and the standard color distribution; Iterative clustering is performed on all feature vectors to obtain multiple clusters and the cluster center of each cluster. In the current iteration, the local heterogeneity of each pixel in the previous iteration is adjusted based on the label consistency of each pixel in the previous iteration to update the local heterogeneity in the current iteration. Select target clusters with an area greater than the area threshold from multiple clusters. If the local heterogeneity of the cluster center of the target cluster is greater than the first threshold, it belongs to the color-biased abnormal region. If the local heterogeneity of the cluster center of the target cluster is less than or equal to the first threshold and the color deviation is greater than the second threshold, it belongs to the heterogeneous abnormal region. If the ratio of the area of ​​all abnormal regions to the total area of ​​the image is greater than a set value, the color of the fruit and vegetable powder to be tested is uneven.

2. The method for detecting the color uniformity of fruit and vegetable powder based on image processing according to claim 1, characterized in that, The update of the local non-homogeneity at the current iteration includes: ; in, As a weighting factor, Let be the local heterogeneity of pixel p in the (t+1)th iteration. Let p be the label consistency of pixel p in the t-th iteration. The local heterogeneity of the target pixel p in the t-th iteration is defined as follows: the label consistency is the percentage of pixels in the t-th iteration whose cluster labels are the same as those of their neighboring pixels, where the neighboring pixels are pixels within eight neighborhoods.

3. The method for detecting the color uniformity of fruit and vegetable powder based on image processing according to claim 1, characterized in that, The process of obtaining the color deviation is as follows: Obtain the standard color vector of each qualified pixel in the qualified image of the standard qualified fruit and vegetable powder sample in the CIELAB color space, and obtain the mean vector of all standard color vectors; the standard color vector is composed of the values ​​of the three channels of the qualified pixel in the CIELAB color space. Calculate the covariance matrix of the standard color vectors of all qualified pixels; Based on the covariance matrix, mean vector, and color vector of any pixel, the Mahalanobis distance of any pixel is obtained, and the Mahalanobis distance is used as the color deviation of any pixel.

4. The method for detecting the color uniformity of fruit and vegetable powder based on image processing according to claim 1, characterized in that, Before performing iterative clustering, the following steps are also included: Z-score normalization of the values ​​of each channel in the color vector of each pixel.

5. The method for detecting the color uniformity of fruit and vegetable powder based on image processing according to claim 1, characterized in that, The process of obtaining the initial set of cluster centers during iterative clustering is as follows: The average feature vector of all qualified pixels in the qualified image is used as an initial cluster center. The average feature vector includes the mean vector of all qualified pixels, the mean of local heterogeneity, and the mean of color deviation. The K-Means++ initialization strategy is adopted, and the remaining samples are selected sequentially according to the K-Means++ probability sampling rules. K is the number of initial cluster centers, which constitutes the complete initial cluster center set.

6. The method for detecting the color uniformity of fruit and vegetable powder based on image processing according to claim 5, characterized in that, Also includes: Z-score normalization is performed on the mean values ​​of each channel in the mean vector of all qualified pixels.

7. The method for detecting the color uniformity of fruit and vegetable powder based on image processing according to claim 1, characterized in that, The iterative clustering uses the K-Means algorithm.

8. The method for detecting the color uniformity of fruit and vegetable powder based on image processing according to claim 1, characterized in that, The neighborhood is a 7×7 window.

9. The method for detecting the color uniformity of fruit and vegetable powder based on image processing according to claim 1, characterized in that, The convergence condition for the iterative clustering is: In at least two consecutive iterations, the number of pixels whose cluster labels change is 0, or the proportion of pixels whose cluster labels change to the total number of pixels is less than the set convergence threshold.

10. A method and system for detecting the color uniformity of fruit and vegetable powder based on image processing, characterized in that, include: processor; A memory storing computer instructions for detecting the color uniformity of fruit and vegetable powder based on image processing, wherein when the computer instructions are executed by the processor, the system performs a method for detecting the color uniformity of fruit and vegetable powder based on image processing according to any one of claims 1-9.

Citation Information

Patent Citations

  • Textile quality detection method and system based on image identification

    CN113706528A

  • Method of and system for detecting uniform color segments

    US20040090453A1