Flour quality detection method and system based on machine vision

By acquiring multi-view image data through machine vision technology, performing image standardization and feature extraction, and constructing a three-dimensional distribution map, the problem of insufficient accuracy in the detection of residues in flour storage warehouses and incomplete coverage has been solved, achieving full coverage and high-precision detection, and optimizing cleaning strategies.

CN121032931APending Publication Date: 2025-11-28GU FENGYUAN TONGLE (JIANGSU) FOOD CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202511114462.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-11
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

The detection of residues in flour storage silos suffers from insufficient accuracy and incomplete coverage, leading to either incomplete or excessive cleaning.

Method used

A machine vision-based detection method is adopted. By acquiring multi-view image data, image standardization processing is performed, gray-level gradient and color distribution differences are extracted, a gray-level distribution matrix is ​​constructed, and the texture features and boundary clarity are extracted by combining the mapping relationship between gray values ​​and physical properties of residues. Local image enhancement is performed, and a three-dimensional distribution map is constructed to achieve full-area coverage detection and accurate quantization.

Benefits of technology

It achieves full-area coverage detection inside the storage warehouse, accurately quantifies the spatial distribution and physical characteristics of residues, improves the comprehensiveness and accuracy of detection results, provides intuitive decision-making basis for storage warehouse cleaning strategies, optimizes production processes and ensures food safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121032931A_ABST
    Figure CN121032931A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of flour quality detection, and discloses a flour quality detection method and system based on machine vision, and the method comprises the steps: obtaining an original multi-view image of a flour storage bin, and obtaining an initial image data set; performing standardization processing to obtain a standard image data set; extracting features such as gray level to construct an initial spatial distribution feature map; enhancing the abnormal region to obtain local residue detail information; classifying the residue type and the pollution degree to obtain a classification result; fusing the data to construct a three-dimensional residue distribution map; analyzing the atlas to obtain detailed report data; and generating a high-risk area visual distribution map to obtain a spatialization evaluation result. According to the method, accurate detection and quantitative evaluation of the residues in the storage bin can be realized, and the flour quality control efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision inspection technology, specifically to a method and system for inspecting flour quality based on machine vision. Background Technology

[0002] Currently, in the flour production and storage sector, the quality detection of residual flour in storage silos is a crucial step in ensuring food safety, and its accuracy directly impacts the quality of subsequently processed products. With the gradual penetration of visual inspection technology into industrial production inspection scenarios, accurately analyzing the distribution, type, and degree of contamination through visual inspection has become a core requirement for optimizing storage silo cleaning strategies.

[0003] In one existing technology, a combination of manual inspection and chemical sampling is used: manual observation of the approximate morphology of residues on the inner wall and bottom of the storage tank is supplemented by laboratory analysis of a small number of samples. This method has obvious limitations: the complex geometry of the storage tank makes it difficult for manual inspection to cover corners and blind spots, and it cannot quantify the thickness, density, and spatial distribution differences of residues. For example, for residues in the recessed areas at the bottom of the storage tank, the thickness of the accumulation cannot be accurately judged by the naked eye, which can easily lead to problems of incomplete cleaning or over-cleaning.

[0004] In summary, the detection of residues in flour storage silos suffers from limitations in precise analytical capabilities, including insufficient ability to accurately quantify the spatial distribution and physical characteristics of residues, and incomplete detection coverage. Summary of the Invention

[0005] This invention provides a machine vision-based method and system for flour quality detection, which solves the problems of insufficient accuracy and comprehensive coverage in the detection of flour storage residues in existing technologies.

[0006] In a first aspect, the present invention provides a flour quality detection method based on machine vision, comprising:

[0007] Obtain the original multi-view image set of the inside of the flour storage silo to obtain the initial image dataset;

[0008] The initial image dataset is standardized to obtain a standard image dataset;

[0009] Local gray-level gradients and color distribution differences of pixels are extracted from the standard image dataset to construct a gray-level distribution matrix. Combined with the preset mapping relationship between gray-level values ​​and physical properties of residues, texture features and boundary clarity values ​​of residues are extracted to construct an initial spatial distribution feature map.

[0010] Local image enhancement is performed on the gray-scale abnormal areas in the initial spatial distribution feature map to extract the geometric parameters of the residue shape and light and shadow reflection characteristics, thereby obtaining detailed information on the local residue distribution.

[0011] Based on the detailed information on the local residue distribution, the residue types and pollution levels are classified to obtain residue characteristic classification results;

[0012] By fusing the initial image dataset with the residue characteristic classification results, and combining the residue texture features and the boundary sharpness value, a three-dimensional residue distribution map is constructed.

[0013] Based on the three-dimensional residue distribution map, analyze the spatial accumulation morphology and density distribution gradient to obtain detailed analysis report data;

[0014] Based on the detailed analysis report data, high-risk areas are marked and a visual distribution map is generated to obtain spatial assessment results.

[0015] In one optional implementation, obtaining the initial image dataset by acquiring the original multi-view image set of the flour storage silo includes:

[0016] Multiple-angle shots were taken from the top, side walls, and bottom of the flour storage silo to obtain the first set of raw images covering the inner wall corners and the bottom blind area;

[0017] The first original image set is subjected to viewpoint switching and image registration to determine the corresponding points of the overlapping area, thereby obtaining the registered second original image set.

[0018] By fusing the overlapping regions of the second original image set, a seamless third original image set is obtained;

[0019] The third original image set is subjected to light correction. If the light intensity is lower than the preset light intensity threshold, the brightness and contrast are adjusted to obtain the initial image dataset.

[0020] In one optional implementation, the standardization process of the initial image dataset to determine a standard image dataset includes:

[0021] The initial image dataset is subjected to lighting correction, and the brightness and contrast are adjusted to obtain a first initial image set;

[0022] Key feature points are extracted from the first initial image set, and the feature points are aligned through image registration to obtain the second initial image set;

[0023] If the second initial image set contains noise, noise suppression is performed to obtain a third initial image set;

[0024] The angle is normalized on the third initial image set to correct the viewing angle deviation and determine the standard image dataset.

[0025] In one optional implementation, the step of extracting local gray-level gradients and color distribution differences of pixels from the standard image dataset, constructing a gray-level distribution matrix, and combining a preset mapping relationship between gray-level values ​​and the physical properties of residues to extract residue texture features and boundary sharpness values, and constructing an initial spatial distribution feature map, includes:

[0026] The grayscale value and color value of each pixel are obtained from the standard image dataset, and the color distribution differences are processed to obtain local grayscale gradient data and color distribution difference data.

[0027] Based on the gray-level gradient data and the color distribution difference data, a gray-level distribution matrix related to the residue characteristics is constructed. If there are outliers, smoothing is performed to obtain a denoised gray-level distribution matrix.

[0028] Based on the preset mapping relationship between gray values ​​and physical properties of residues, the denoised gray distribution matrix is ​​layered, and the residue texture feature set corresponding to each gray layer is extracted.

[0029] Extract the boundary data of the residue from the gray-scale distribution matrix. If the boundary clarity is lower than the preset clarity threshold, enhance the boundary contrast to obtain an optimized boundary clarity value.

[0030] The initial spatial distribution feature map is constructed by fusing the set of residue texture features, the optimized boundary sharpness value, and the residue region information determined by image segmentation.

[0031] In one optional implementation, the step of performing local image enhancement on the gray-scale abnormal regions in the initial spatial distribution feature map, extracting the geometric parameters of the residue shape and light reflection characteristics, and obtaining detailed information on the local residue distribution includes:

[0032] The gray-scale abnormal regions in the initial spatial distribution feature map are divided to obtain the segmented abnormal region image;

[0033] By enhancing the contrast and brightness of the image of the abnormal region, the shape and geometric parameters of the residue are extracted to obtain an enhanced detailed image;

[0034] Light and shadow reflection characteristic data are extracted and analyzed from the enhanced detail image to determine the light and shadow reflection feature set.

[0035] By fusing the set of light and shadow reflection features with the shape geometry parameters, detailed information on the distribution of local residues is generated.

[0036] In one optional implementation, the step of classifying the residue type and degree of contamination based on the detailed information of the local residue distribution to obtain a residue characteristic classification result includes:

[0037] Extract residue boundary features from the detailed information on the local residue distribution, and divide the residue distribution area accordingly;

[0038] The color distribution differences of the residue distribution area are quantified. If the difference value exceeds the preset color difference threshold, a preliminary pollution classification label is marked.

[0039] Calculate the texture density parameter of the residue distribution area, and determine the residue type by combining it with a preset texture density threshold;

[0040] The proportion of contaminated area is calculated based on the type of residue, and the degree of contamination is classified according to the preset contamination level classification rules to obtain the residue characteristic classification result.

[0041] In one optional implementation, the step of fusing the initial image dataset with the residue characteristic classification results, combining the residue texture features and the boundary sharpness value, to construct a three-dimensional residue distribution map includes:

[0042] The initial image dataset is converted to grayscale to generate a three-dimensional mapped grayscale distribution matrix, thereby determining the preliminary range of the residue area;

[0043] Combining the texture features of the residue and the boundary clarity value, the type distribution probability is analyzed from the preliminary area of ​​the residue, and the area where the type distribution probability is higher than the preset probability threshold is marked as the target residue area;

[0044] Calculate the correlation strength assessment value between each of the target residue regions, construct the spatial connection relationship, and determine the distribution structure;

[0045] By integrating the aforementioned distribution structure and performing multi-view spatial registration, a high-precision three-dimensional residue distribution map is constructed.

[0046] In one optional implementation, the step of analyzing the spatial accumulation morphology and density distribution gradient based on the three-dimensional residue distribution map to obtain detailed analysis report data includes:

[0047] Spatial point cloud data containing the three-dimensional coordinates of the residue locations are extracted from the three-dimensional residue distribution map and then divided into grids to obtain multiple point cloud regions.

[0048] Select point cloud regions whose point cloud density exceeds a preset density threshold as key regions;

[0049] Extract the thickness data and coordinate range of the key region, and divide the region into layers based on the thickness data;

[0050] Analyze the density distribution gradient of each of the aforementioned stratified intervals, and combine it with a pre-established density distribution database to determine the spatial packing morphology;

[0051] Calculate the location of the peak thickness point based on the spatial stacking morphology, and determine the density anomaly area;

[0052] By integrating the coordinate range of the key areas, the layered intervals, the spatial stacking morphology, the density distribution gradient, and the density anomaly areas, a detailed analysis report of quality inspection data is output.

[0053] In one optional implementation, the step of marking high-risk areas and generating a visual distribution map based on the detailed analysis report data to obtain spatial assessment results includes:

[0054] Based on the detailed analysis report data, the risk level of different regions is calculated and classified, and information on the distribution of high-risk areas is obtained.

[0055] The distribution information of the high-risk areas is labeled to generate a visual distribution map;

[0056] The visualized distribution map is analyzed to output a spatial assessment result that includes the coordinates of high-risk areas, risk levels, and the scope of impact.

[0057] Secondly, the present invention provides a flour quality inspection system based on machine vision, comprising:

[0058] Image acquisition module: Acquires a set of original multi-view images of the inside of the flour storage silo to obtain the initial image dataset;

[0059] Image correction module: Standardizes the initial image dataset to obtain a standard image dataset;

[0060] Feature extraction module: Extracts local gray-level gradients and color distribution differences of pixels from the standard image dataset, constructs a gray-level distribution matrix, and extracts texture features and boundary clarity values ​​of residues by combining the preset mapping relationship between gray-level values ​​and physical properties of residues, and constructs an initial spatial distribution feature map;

[0061] Detail enhancement module: Performs local image enhancement on the gray-scale abnormal areas in the initial spatial distribution feature map, extracts the geometric parameters of the residue shape and light and shadow reflection characteristics, and obtains local residue distribution detail information;

[0062] Classification and identification module: Based on the detailed information of the local residue distribution, classify the residue type and degree of pollution to obtain the residue characteristic classification result;

[0063] 3D modeling module: By integrating the initial image dataset with the residue characteristic classification results, and combining the residue texture features and the boundary sharpness value, a 3D residue distribution map is constructed.

[0064] Analysis and evaluation module: Based on the three-dimensional residue distribution map, analyze the spatial accumulation morphology and density distribution gradient, and obtain detailed analysis report data;

[0065] Visual output module: Based on the detailed analysis report data, high-risk areas are marked and a visual distribution map is generated to obtain spatial assessment results.

[0066] Thirdly, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the machine vision-based flour quality detection method described in any one of the preceding claims.

[0067] Fourthly, the present invention also provides a computer-readable storage medium comprising a stored computer program, wherein the computer program, when running, controls the device containing the computer-readable storage medium to execute the machine vision-based flour quality detection method described above.

[0068] Compared with the prior art, the present invention has the following beneficial effects:

[0069] (1) This invention integrates multi-view image data through machine vision technology, breaks through the field of view limitations of traditional manual inspection, realizes full-area coverage detection inside the storage warehouse, and especially solves the problem of identifying residues in corners and blind spots;

[0070] (2) This invention uses grayscale analysis, feature extraction and three-dimensional modeling to accurately quantify the physical properties and spatial distribution of residues, replacing the local sample analysis of chemical sampling, and improving the comprehensiveness and accuracy of the test results.

[0071] (3) This invention combines local enhancement, classification recognition and visualization output to form a closed-loop mechanism of “image acquisition-feature analysis-3D modeling-risk assessment”, providing intuitive and accurate decision-making basis for warehouse cleaning strategy formulation, optimizing production process and ensuring food safety. Attached Figure Description

[0072] Figure 1 This is a schematic diagram of a flour quality detection method based on machine vision provided in the first embodiment of the present invention;

[0073] Figure 2 This is a schematic diagram of a flour quality detection system based on machine vision provided in the second embodiment of the present invention. Detailed Implementation

[0074] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0075] Reference Figure 1 The first embodiment of the present invention provides a flour quality detection method based on machine vision, comprising the following steps:

[0076] S1, Obtain the original multi-view image set of the inside of the flour storage silo to obtain the initial image dataset;

[0077] S2, Standardize the initial image dataset to obtain a standard image dataset;

[0078] S3, extract the local gray-level gradient and color distribution difference of the pixels from the standard image dataset, construct a gray-level distribution matrix, combine the preset mapping relationship between gray-level values ​​and physical properties of residues, extract the texture features and boundary clarity values ​​of residues, and construct an initial spatial distribution feature map.

[0079] S4, perform local image enhancement on the gray-scale abnormal areas in the initial spatial distribution feature map, extract the geometric parameters of the residue shape and light and shadow reflection characteristics, and obtain detailed information on the local residue distribution;

[0080] S5. Based on the detailed information on the distribution of local residues, the types and degrees of contamination of residues are classified to obtain the residue characteristic classification results;

[0081] S6, merge the initial image dataset with the residue characteristic classification results, and combine the residue texture features and the boundary clarity value to construct a three-dimensional residue distribution map;

[0082] S7. Based on the three-dimensional residue distribution map, analyze the spatial accumulation morphology and density distribution gradient, and obtain detailed analysis report data;

[0083] Based on the detailed analysis report data, S8 marks high-risk areas and generates a visual distribution map to obtain spatial assessment results.

[0084] In step S1, a set of original multi-view images of the interior of the flour storage silo is obtained to obtain an initial image dataset, including:

[0085] S11, take multi-angle shots from the top, side walls and bottom of the flour storage silo to obtain the first set of raw images covering the inner wall corners and bottom blind areas;

[0086] S12, perform viewpoint switching and image registration on the first original image set, determine the corresponding points of the overlapping area, and obtain the registered second original image set;

[0087] S13, merge the overlapping regions of the second original image set to obtain a seamless third original image set;

[0088] S14, perform light correction on the third original image set. If the light intensity is lower than the preset light intensity threshold, adjust the brightness and contrast to obtain the initial image dataset.

[0089] In step S11, multi-angle shots are taken from the top, side walls and bottom of the flour storage silo to obtain a first set of original images covering the inner wall corners and the bottom blind area.

[0090] It should be noted that the multi-angle shooting from the top, side walls, and bottom of the storage tank involves deploying imaging equipment at different locations inside the storage tank: the entire bottom area is captured from the top center, the inner walls are captured layer by layer along the height of the side walls, and corners and recessed areas are captured from the bottom edges, ensuring that the images cover all areas inside the storage tank prone to residue buildup. Imaging parameters are adjusted according to changes in light during shooting to ensure that details of residues are clearly presented in both dark and bright areas.

[0091] For example, for a cylindrical storage silo with a height of 10 meters and a diameter of 5 meters, the top image covers a circular area with a bottom diameter of 5 meters, the side walls are imaged in three layers (2 meters, 5 meters, and 8 meters in height), each layer covering a 120° arc range, and the bottom image focuses on a recessed area with a diameter of 1 meter. Finally, 200 images are obtained to form a first raw image set, which includes visual information such as the texture of the inner wall and the bottom accumulation.

[0092] In step S12, the first original image set is subjected to viewpoint switching and image registration to determine the corresponding points of the overlapping area, thereby obtaining the registered second original image set.

[0093] It should be noted that the viewpoint switching and image registration of the first original image set includes identifying obvious features that are common to adjacent images, finding the corresponding points in the overlapping area by comparing the position and shape of these features. For example, the coordinates of a weld seam in the left image are (300, 400), and the corresponding coordinates in the right image are (500, 420). Then, by adjusting the image angle and scale, these corresponding points are aligned to eliminate the viewpoint deviation.

[0094] For example, when processing images of two adjacent layers of the sidewall, a common horizontal weld is used as a feature. By comparing the degree of curvature and the position of the endpoints of the weld, 50 corresponding points in the overlapping area are determined. The images are adjusted so that the positional deviation of these points is less than 3 pixels, and finally, a second set of 180 registered original images is obtained.

[0095] In step S13, the overlapping regions of the second original image set are merged to obtain a seamless third original image set.

[0096] It should be noted that the fusion of the overlapping area of ​​the second original image set includes transition processing of the pixel values ​​within the overlapping area: for different pixel values ​​at the same location in the two images, weights are assigned according to the distance from the location to the edges of the two images, and the weighted pixel values ​​are calculated so that the brightness and texture of the overlapping area transition naturally, avoiding splicing marks.

[0097] For example, if a point in an overlapping area has a grayscale value of 120 in the left image and a grayscale value of 140 in the right image, and this point is closer to the left edge (weight 0.7) and farther from the right edge (weight 0.3), then the fused grayscale value is 120×0.7+140×0.3=126. By processing all overlapping pixels in this way, five stitched images covering the entire storage area are finally generated, forming a third set of original images.

[0098] In step S14, the third original image set is subjected to light correction. If the light intensity is lower than the preset light intensity threshold, the brightness and contrast are adjusted to obtain the initial image dataset.

[0099] It should be noted that the light correction of the third original image set includes first analyzing the brightness distribution of the image: statistically analyzing the concentrated range of pixel gray values. If more than 60% of the pixel gray values ​​are below 50, then stretching the gray range—expanding the original gray value range of 0-50 to 0-255, so that the gray value of details in dark areas is increased to 80-150, while adjusting the contrast to increase the gray value difference between the residue and the background.

[0100] For example, for the stitched image of the bottom blind area, the grayscale range is expanded to 0-255 after correction, where the grayscale value of the residue becomes 100-120 and the background becomes 150-180, with obvious differences between the two. Finally, five corrected images are obtained to form the initial image dataset, which meets the needs of subsequent extraction of residue features.

[0101] In step S2, the initial image dataset is standardized to determine a standard image dataset, including:

[0102] S21, Perform light correction on the initial image dataset, adjust the brightness and contrast, and obtain the first initial image set;

[0103] S22, extract key feature points from the first initial image set, align the feature points through image registration processing, and obtain the second initial image set;

[0104] S23, if the second initial image set contains noise, noise suppression is performed to obtain a third initial image set;

[0105] S24, the angle is normalized on the third initial image set to correct the viewing angle deviation and determine the standard image dataset.

[0106] In step S21, the initial image dataset is subjected to light correction to adjust the brightness and contrast, thereby obtaining a first initial image set.

[0107] It should be noted that the light correction of the initial image dataset includes first statistically analyzing the grayscale value distribution of all pixels in the image: if the grayscale values ​​of most pixels are concentrated in the range of 0-80, then the grayscale values ​​in this range are stretched proportionally to 0-255, so that the grayscale values ​​of dark details are increased to 100-150; at the same time, the standard deviation of the grayscale values ​​is calculated. If the standard deviation is less than 30, then the grayscale difference is increased—the pixel values ​​with original grayscale values ​​below 128 are lowered by 10%, and the pixel values ​​with original grayscale values ​​above 128 are increased by 10%, so that the boundary between the residue and the background is clearer.

[0108] For example, for the initial image of the storage tank sidewall, the corrected grayscale range is expanded to 0-255, where the grayscale value of the residue area is 120-140, the background is 180-200, and the standard deviation is increased to 50, forming a first initial image set.

[0109] In step S22, key feature points are extracted from the first initial image set, and the feature points are aligned through image registration processing to obtain the second initial image set.

[0110] It should be noted that the extraction and alignment of key feature points includes identifying areas in the image with significant grayscale changes, such as welds and fixing bolts on the inner wall of a storage silo, and marking the endpoints or corners of these areas as feature points. Then, the same feature point in different images is compared, and the coordinate deviation of the feature point is controlled within 2 pixels by fine-tuning the position and angle of the images, thus achieving alignment between the images.

[0111] For example, when processing the connection images of the top and side walls, a common bolt is used as a feature point. The coordinates of this point in the top image are (800, 600), and the coordinates in the side wall image are corrected to (801, 599) after alignment. In the final second initial image set, the feature point positions of all images are consistent and there is no obvious misalignment.

[0112] In step S23, if the second initial image set contains noise, noise suppression is performed to obtain a third initial image set.

[0113] It should be noted that the noise suppression includes identifying isolated abnormal pixels in the image: if the gray value of a pixel differs from the average value of its eight surrounding pixels by more than 50, it is determined to be a noise point. For these noise points, their gray values ​​are replaced with the average value of the surrounding pixels, and the entire image is smoothed—the gray value of each pixel is updated to the average value of itself and its four surrounding pixels, reducing the interference of random noise points on subsequent analysis.

[0114] For example, for the white noise (grayscale value 255, surrounding values ​​120) caused by dust reflection in the bottom image, after processing, the grayscale value of the noise becomes 120, the overall image is smoother, forming a third initial image set.

[0115] In step S24, the angle of the third initial image set is normalized to correct the viewing angle deviation and the standard image dataset is determined.

[0116] It should be noted that the angle normalization includes correcting the image's tilt angle: by identifying the vertical edge of the storage bin, the angle between it and the image border is calculated. If the angle exceeds 5°, the image is rotated so that the edge is parallel to the border. Simultaneously, the image scale is adjusted so that the actual size of the storage bin is presented in the image at a fixed ratio, ensuring that images from different viewpoints are consistent in size and angle.

[0117] For example, due to the tilted shooting angle, the vertical edge of a side wall image has an angle of 10° with the border. After rotation correction, the angle becomes 0°, and the number of pixels corresponding to the diameter of the storage tank in the image is adjusted from 800 to 1000. The resulting standard image dataset has all images with uniform angles and consistent proportions, which can be directly used for subsequent feature extraction.

[0118] In step S3, local gray-level gradients and color distribution differences of pixels are extracted from the standard image dataset to construct a gray-level distribution matrix. Combined with a preset mapping relationship between gray-level values ​​and the physical properties of the residue, texture features and boundary sharpness values ​​of the residue are extracted to construct an initial spatial distribution feature map, including:

[0119] S31, obtain the grayscale value and color value of each pixel from the standard image dataset, and process the color distribution difference to obtain local grayscale gradient data and color distribution difference data;

[0120] S32, Based on the gray-level gradient data and the color distribution difference data, construct a gray-level distribution matrix related to the residue characteristics. If there are outliers, perform smoothing processing to obtain a denoised gray-level distribution matrix.

[0121] S33, according to the preset mapping relationship between gray values ​​and physical properties of residues, the denoised gray distribution matrix is ​​layered, and the residue texture feature set corresponding to each gray layer is extracted.

[0122] S34, extract the boundary data of the residue from the gray-scale distribution matrix. If the boundary clarity is lower than the preset clarity threshold, enhance the boundary contrast to obtain an optimized boundary clarity value.

[0123] S35, the initial spatial distribution feature map is constructed by fusing the set of residue texture features, the optimized boundary sharpness value, and the residue region information determined by image segmentation.

[0124] In step S31, the grayscale value and color value of each pixel are obtained from the standard image dataset, and the color distribution difference is processed to obtain local grayscale gradient data and color distribution difference data.

[0125] It should be noted that the acquisition of grayscale and color values ​​and the processing of differences include recording the grayscale value (range 0-255) and RGB three-color values ​​(each 0-255) of each pixel: the grayscale value reflects the brightness of the residue; color difference is achieved by calculating the standard deviation of RGB values ​​within the same area. If the standard deviation exceeds 20, it indicates that there is color unevenness. Local grayscale gradient is calculated by comparing the grayscale value changes of adjacent pixels. If the grayscale difference between a pixel and the pixel to its right exceeds 50, it is determined to be a significant gradient.

[0126] For example, for a certain area at the bottom of the storage warehouse, the extracted pixel gray values ​​are mostly 40-50, the RGB value standard deviation is 25, and the local gray-level gradient reaches 60 at the edge. These data together constitute the basic features for subsequent analysis.

[0127] In step S32, based on the grayscale gradient data and the color distribution difference data, a grayscale distribution matrix related to the residue characteristics is constructed. If there are outliers, smoothing is performed to obtain a denoised grayscale distribution matrix.

[0128] It should be noted that the construction of the grayscale distribution matrix involves using image pixel coordinates as row and column indices, with the matrix values ​​being the grayscale values ​​of the corresponding pixels. Color difference and gradient data are also embedded as additional matrix attributes. If the grayscale value of a pixel differs from the average of its eight surrounding pixels by more than 80%, it is considered an outlier, replaced with the average grayscale value of the surrounding pixels, and then a second verification is performed on the entire row and column to ensure the continuity of the matrix data.

[0129] For example, in the constructed 1000×1000 pixel matrix, after smoothing, the proportion of outliers decreased from 3% to 0.5%, and the matrix as a whole can accurately reflect the grayscale distribution trend of the residue.

[0130] In step S33, the denoised grayscale distribution matrix is ​​layered according to the preset mapping relationship between grayscale values ​​and physical properties of residues, and the residue texture feature set corresponding to each grayscale layer is extracted.

[0131] It should be noted that the preset mapping relationship is based on flour quality data: grayscale values ​​of 30-60 correspond to "high-density lumps" (impurity content ≥5%, fineness ≥80 mesh); 60-100 correspond to "medium-density residues" (impurity content 2%-5%, fineness 60-80 mesh); and 100-200 correspond to "loose residues" (impurity content <2%, fineness <60 mesh). During layered processing, the matrix regions are divided according to the above intervals, and then the grayscale change frequency (texture roughness) and distribution uniformity of pixels within each layer are statistically analyzed to form a texture feature set.

[0132] For example, texture features are extracted from grayscale layers of 30-60: 90% of the pixel grayscale values ​​are concentrated in the range of 40-50 with a standard deviation of 8, which is determined to be a typical blocky texture and included in the feature set.

[0133] In step S34, residue boundary data is extracted from the grayscale distribution matrix. If the boundary clarity is lower than a preset clarity threshold, the boundary contrast is enhanced to obtain an optimized boundary clarity value.

[0134] It should be noted that the extraction of residual boundary data includes identifying pixel lines with abrupt changes in grayscale values ​​and calculating boundary sharpness: the grayscale difference at the abrupt change is divided by the pixel spacing. If the result is <30, the contrast is enhanced by adjusting the grayscale values ​​of the pixels on both sides of the boundary—lowering the inner side (low grayscale area) by 5-10 and raising the outer side (high grayscale area) by 5-10, so that the grayscale difference is expanded to more than 80 and the sharpness is improved to more than 40.

[0135] For example, the original grayscale difference of a certain block's residual boundary was 60, and the spacing was 3 pixels (clarity 20). After enhancement, the grayscale difference was 120, and the spacing was 3 pixels (clarity 40), making the boundary outline clearer.

[0136] In step S35, the initial spatial distribution feature map is constructed by fusing the residue texture feature set, the optimized boundary sharpness value, and the residue region information determined by image segmentation.

[0137] It should be noted that the image segmentation divides the residue areas according to grayscale levels and boundary data, and then labels the texture features and boundary sharpness values ​​(such as 40, 60) on the corresponding areas. The feature map uses the storage tank's planar coordinates as the base map to intuitively present the residue types, distribution ranges, and boundary sharpness in different areas.

[0138] For example, in the initial spatial distribution feature map, the bottom central area is marked "high-density clumps - boundary clarity 40", with an area of ​​about 2㎡, which is consistent with the detection result of "bottom clumps and impurities exceeding the standard" in the flour quality data, providing a clear target for subsequent local enhancement.

[0139] In step S4, local image enhancement is performed on the gray-scale abnormal areas in the initial spatial distribution feature map to extract the geometric parameters of the residue shape and light reflection characteristics, thereby obtaining detailed information on the local residue distribution, including:

[0140] S41, the gray-scale abnormal regions in the initial spatial distribution feature map are divided to obtain the segmented abnormal region image;

[0141] S42, by enhancing the contrast and brightness of the abnormal area image, the shape and geometric parameters of the residue are extracted to obtain an enhanced detail image;

[0142] S43, extract and analyze the light and shadow reflection characteristic data from the enhanced detail image to determine the light and shadow reflection feature set;

[0143] S44, the light and shadow reflection feature set and the shape geometry parameters are fused to generate the detailed information of the local residue distribution.

[0144] In step S41, the gray-scale abnormal regions in the initial spatial distribution feature map are divided to obtain the segmented abnormal region image.

[0145] It should be noted that the process of defining grayscale abnormal regions includes setting a grayscale abnormality threshold: if the average grayscale value of a certain region differs from the average grayscale value of the surrounding normal regions by more than 80, it is determined to be an abnormal region. Through continuous pixel clustering, these abnormal pixels are connected into independent regions, separated by boundary lines and cropped to obtain one or more sub-images of abnormal regions. Each sub-image contains only one complete abnormal region, facilitating subsequent targeted processing.

[0146] For example, a certain area at the bottom of the storage silo has an average grayscale value of 60 due to residual clumps, while the surrounding normal area has an average grayscale value of 150, resulting in a difference of 90. This area is classified as an abnormal area and cropped to obtain a sub-image of 200×200 pixels.

[0147] In step S42, by enhancing the contrast and brightness of the abnormal region image, the shape and geometric parameters of the residue are extracted to obtain an enhanced detailed image.

[0148] It should be noted that the enhancement of contrast and brightness includes: if the grayscale values ​​of the abnormal area image are concentrated in the 50-100 range (low contrast), then the grayscale range is stretched to 30-220, increasing the grayscale values ​​of dark details to 80-120 and bright areas (edges) to 180-220; at the same time, the overall brightness is increased by 10%-20% to ensure that blurred edges are clearly visible. When extracting shape geometric parameters, the aspect ratio, perimeter-to-area ratio, and maximum diameter of the bounding rectangle of the statistical region are used to quantify the morphological characteristics of the residue.

[0149] For example, after enhancement, the gray value of the block edge is increased from 100 to 200, and the gray value of the internal texture is increased from 60 to 100. An aspect ratio of 2.5:1 and a perimeter / area ratio of 0.8 are extracted to form an enhanced detail image and the corresponding parameter set.

[0150] In step S43, light and shadow reflection characteristic data are extracted from the enhanced detail image and analyzed to determine the light and shadow reflection feature set.

[0151] It should be noted that the extraction of light and shadow reflection characteristics includes identifying bright areas in the image formed by light reflection: statistically analyzing the proportion of areas with pixel grayscale values ​​exceeding 200, and calculating the standard deviation of grayscale values ​​in the reflective areas. During analysis, the location of the light source within the storage area is considered to determine whether the reflection direction is consistent with the angle of illumination from the light source, eliminating abnormal reflections, and ultimately forming a feature set.

[0152] For example, in a certain blocky enhanced image, the bright area accounts for 25%, the grayscale standard deviation is 8, and the reflection direction matches the angle of the top light source, which is determined to be a typical smooth surface reflection feature.

[0153] In step S44, the light and shadow reflection feature set and the shape geometry parameters are fused to generate the detailed information of the local residue distribution.

[0154] It should be noted that the fusion process associates shape parameters and lighting features with specific regions: geometric parameters and lighting features are labeled on the sub-images of abnormal regions, and combined with the actual coordinates of the regions in the storage warehouse, structured data is formed. This information directly reflects the physical state of the residue.

[0155] For example, the generated detailed information on the distribution of local residues is as follows: "3m to the left of the center at the bottom of the storage tank, there is a residue with an aspect ratio of 2.5:1 and a maximum diameter of 15cm. The surface has a high gloss ratio of 25% and uniform reflection, which is determined to be a high-density wet agglomerate." This provides a precise basis for subsequent classification and a clear target for local enhancement.

[0156] In step S5, based on the detailed information on the local residue distribution, the residue type and degree of contamination are classified to obtain the residue characteristic classification result, including:

[0157] S51, extract residue boundary features from the detailed information of the local residue distribution, and divide them to obtain the residue distribution area;

[0158] S52, quantify the color distribution difference of the residue distribution area; if the difference value exceeds the preset color difference threshold, mark the preliminary pollution classification label.

[0159] S53, calculate the texture density parameter of the residue distribution area, and determine the residue type by combining it with a preset texture density threshold;

[0160] S54. Calculate the proportion of contaminated area based on the type of residue, and combine it with the preset pollution degree classification rules to classify the pollution degree level of the residue distribution area, thereby obtaining the residue characteristic classification result.

[0161] In step S51, residue boundary features are extracted from the detailed information of the local residue distribution, and the residue distribution area is divided.

[0162] It should be noted that the extraction of boundary features includes identifying continuous pixel lines with abrupt changes in grayscale values ​​in local detail information, connecting these pixel lines to form a closed contour, which serves as the boundary of the residue. When dividing the region, all pixels within the closed contour are grouped into the same residue distribution area, ensuring that each region is independent and complete, and that the grayscale difference between the region boundary and the surrounding background remains above 80 to avoid confusion with other regions.

[0163] For example, three closed boundaries were extracted from the local details at the bottom of the storage tank, dividing it into three independent residue distribution areas with areas of 0.5㎡, 0.3㎡, and 0.2㎡, respectively.

[0164] In step S52, the color distribution difference of the residue distribution area is quantified. If the difference value exceeds the preset color difference threshold, a preliminary pollution classification label is marked.

[0165] It should be noted that the quantified color distribution difference includes calculating the standard deviation of the RGB values ​​of all pixels within the region: if the standard deviation of the red channel > 15, the standard deviation of the green channel > 10, and the standard deviation of the blue channel > 5, it indicates that the color is uneven within the region. The preset color difference threshold is "the sum of the three standard deviations > 30". If the sum of the three standard deviations in a certain region is 35, it is determined that there are significant pollution characteristics and a preliminary label of "suspected pollution" is marked.

[0166] For example, if the sum of the three standard deviations of a certain residue area is 32, which exceeds the threshold, it is marked as a "suspected contamination area".

[0167] In step S53, the texture density parameter of the residue distribution area is calculated, and the residue type is determined by combining it with a preset texture density threshold.

[0168] It should be noted that the texture density parameter is calculated by the frequency of grayscale value changes within a statistical area: a grayscale value change of more than 5 times per square centimeter is considered high-density texture, and less than 3 times is considered low-density texture. The preset texture density threshold is "5 times / square centimeter"; if it exceeds this threshold, it is judged as solid accumulation, and if it falls below this threshold, it is judged as liquid residue.

[0169] For example, if the grayscale of a 0.5㎡ residue area changes 7 times per square centimeter, exceeding the threshold, it is judged as solid accumulation; if the grayscale of a 0.3㎡ area changes 2 times, it is judged as liquid residue.

[0170] In step S54, the proportion of contaminated area is calculated according to the type of residue, and the pollution level of the residue distribution area is divided into levels according to the preset pollution level classification rules to obtain the residue characteristic classification result.

[0171] It should be noted that the contaminated area ratio is the ratio of the area of ​​a single residue area to the total area of ​​the storage compartment. The preset grading rules are: <5% is light contamination, 5%-15% is moderate contamination, and >15% is heavy contamination. The classification result is formed by combining the type and grade.

[0172] For example, the 0.5㎡ solid area accounted for 5% (slight pollution), the 0.3㎡ liquid area accounted for 3% (slight pollution), and the 0.2㎡ area accounted for 2% due to significant color difference. These were collectively labeled as "solid accumulation - slight pollution", and finally integrated into the residue characteristic classification result.

[0173] In step S6, the initial image dataset and the residue characteristic classification results are fused together, and the residue texture features and boundary sharpness values ​​are combined to construct a three-dimensional residue distribution map, including:

[0174] S61, perform grayscale conversion on the initial image dataset to generate a three-dimensional mapped grayscale distribution matrix and determine the preliminary area range of the residue;

[0175] S62, Combining the texture features of the residue and the boundary clarity value, analyze the type distribution probability from the preliminary area of ​​the residue, and mark the area where the type distribution probability is higher than a preset probability threshold as the target residue area;

[0176] S63, calculate the correlation strength assessment value between each target residue region, construct spatial connection relationship, and determine distribution structure;

[0177] S64, by integrating the aforementioned distribution structure and constructing a high-precision three-dimensional residue distribution map through multi-view spatial registration.

[0178] In step S61, the initial image dataset is converted to grayscale to generate a three-dimensional mapped grayscale distribution matrix, thereby determining the preliminary range of the residue area.

[0179] It should be noted that the grayscale conversion includes converting the color images in the initial image dataset to grayscale images. The grayscale value of each pixel is calculated according to the formula "0.299×R+0.587×G+0.114×B", where R, G, and B are the values ​​of the red, green, and blue color channels of the color image, respectively. The preset residue baseline value is determined based on the statistical characteristics of normal flour images in the clean storage warehouse: the grayscale value of the normal flour area is concentrated at 180±20. Using this as a baseline, areas with grayscale values ​​below 160 are marked as potential residue areas to initially distinguish between normal areas and residue areas. The three-dimensional mapped grayscale distribution matrix uses the actual three-dimensional coordinates of the storage warehouse as an index, and the matrix value records the grayscale value at the corresponding position. By comparing the grayscale value with the preset residue baseline value, the preliminary range of the residue area is determined.

[0180] For example, after conversion, the gray values ​​at the bottom of the storage silo with coordinates X:2-3m, Y:1-2m, Z:0m are concentrated in the range of 140-150, and are designated as the initial area of ​​residue.

[0181] In step S62, the type distribution probability is obtained from the preliminary area of ​​the residue by combining the texture features of the residue and the boundary clarity value, and the area where the type distribution probability is higher than the preset probability threshold is marked as the target residue area.

[0182] It should be noted that the type distribution probability is calculated by comparing the matching degree of the texture features of the preliminary area with a known residue feature library. The residue feature library is a structured set obtained by pre-collecting images of common residue samples from flour storage silos, extracting texture, grayscale, and other features, and classifying and labeling them. The boundary sharpness value is used to correct the probability; the corrected probability is calculated by multiplying the boundary sharpness value by 0.002 times and then by the initial type distribution probability. The preset probability threshold is 70%; areas exceeding this value are marked as target residue areas.

[0183] For example, if the initial solid distribution probability of a certain area is 82% and the boundary clarity is 45, the corrected probability is 89.38% by calculating 82% × (1 + 45 × 0.002), and it is marked as a solid target residue area.

[0184] In step S63, the correlation strength assessment value between each target residue region is calculated to construct spatial connection relationships and determine the distribution structure.

[0185] It should be noted that the correlation strength assessment value is calculated based on the similarity of grayscale values ​​and spatial distance between the two regions: when the grayscale value difference is <20 and the spatial distance is <1m, the strength value is 80-100 (strong correlation); when the grayscale value difference is 20-50 and the spatial distance is 1-3m, the strength value is 40-70 (moderate correlation); when the difference is >50 or the distance is >3m, the strength value is <40 (weak correlation). Connection relationships are constructed based on the strength values, forming a distribution structure that includes the region's location, type, and connection relationships.

[0186] For example, two solid target regions with a grayscale difference of 15, a distance of 0.8m, and a correlation strength of 90 are connected by a solid line and incorporated into the distribution structure.

[0187] In step S64, the distribution structure is fused, and a high-precision three-dimensional residue distribution map is constructed through multi-view spatial registration.

[0188] It should be noted that the multi-view spatial registration includes selecting fixed marker points within the storage warehouse as coordinate references, unifying the coordinates of target areas in images from different perspectives to the reference coordinate system, and calculating the actual position of each area in three-dimensional space. When fusing the distribution structure, the area type and its relationship are superimposed onto the three-dimensional coordinates to generate a three-dimensional map containing color codes, area boundaries, and connectivity relationships, intuitively presenting the three-dimensional distribution of residues within the storage warehouse.

[0189] For example, the three-dimensional map clearly shows that X:2-3m, Y:1-2m, and Z:0-0.3m are red solid regions, which are connected to the blue liquid regions X:3-4m, Y:1-2m, and Z:0.5-1m by dashed lines, thus presenting the complete spatial distribution.

[0190] In step S7, based on the three-dimensional residue distribution map, the spatial accumulation morphology and density distribution gradient are analyzed to obtain detailed analysis report data, including:

[0191] S71, extract spatial point cloud data containing the three-dimensional coordinates of the residue locations from the three-dimensional residue distribution map, and perform grid division to obtain multiple point cloud regions;

[0192] S72, select point cloud regions whose point cloud density exceeds the preset density threshold as key regions;

[0193] S73, extract the thickness data and coordinate range of the key area, and divide the layered intervals according to the thickness data;

[0194] S74, Analyze the density distribution gradient of each layered interval, and determine the spatial packing morphology by combining it with the pre-established density distribution database;

[0195] S75, calculate and locate the peak thickness point based on the spatial stacking morphology, and determine the density anomaly area;

[0196] S76 integrates the coordinate range of the key area, the layered interval, the spatial stacking pattern, the density distribution gradient, and the density anomaly area, and outputs a detailed analysis report of quality inspection data.

[0197] In step S71, spatial point cloud data containing the three-dimensional coordinates of the residue locations is extracted from the three-dimensional residue distribution map, and then gridded to obtain multiple point cloud regions.

[0198] It should be noted that the spatial point cloud data consists of the X, Y, and Z coordinates of all residue points in the 3D map, with each point corresponding to a sampling point on the residue surface. Grid division involves dividing the 3D space of the storage warehouse into fixed dimensions, counting the number of point clouds within each grid, and forming independent point cloud regions.

[0199] For example, the bottom of the storage silo is divided into 200 grids within a height range of 0-1m, with point cloud distribution in 30 of the grids, forming 30 point cloud regions.

[0200] In step S72, point cloud regions with point cloud density exceeding a preset density threshold are selected as key regions.

[0201] It should be noted that the point cloud density is the ratio of the number of points in each grid cell to the grid volume. The preset density threshold is set based on the typical distribution of flour residue; areas exceeding this value indicate a dense distribution of residue and are identified as critical areas.

[0202] For example, among the 30 point cloud regions, 12 regions have a point cloud density of 2500-5000 points / m².3 All exceeded the threshold and were selected as key areas.

[0203] In step S73, the thickness data and coordinate range of the key area are extracted, and the layered intervals are divided according to the thickness data.

[0204] It should be noted that the thickness data refers to the difference between the maximum and minimum Z-coordinates of points within the key area; the coordinate range is the maximum and minimum coordinates of the area in the X and Y directions. The layered intervals are uniformly divided according to thickness, with each layer corresponding to a different height of residue distribution.

[0205] For example, a key area with a thickness of 0.3m and coordinate range of X: 1.0-2.0m, Y: 0.5-1.5m is divided into three layered intervals: 0-0.1m, 0.1-0.2m, and 0.2-0.3m.

[0206] In step S74, the density distribution gradient of each of the layered intervals is analyzed, and the spatial packing morphology is determined by combining it with a pre-established density distribution database.

[0207] It should be noted that the density distribution gradient is the ratio of the point cloud density difference between adjacent layer intervals to the layer height. The density distribution database stores density gradient features of different stacking patterns. By comparing the actual gradient with the database features, the spatial stacking pattern is determined.

[0208] For example, the density gradient of a certain key region is 8000 points / (m²). 3 ·m), which matches the “conical stacking” feature in the database, is determined to be a conical stacking morphology.

[0209] In step S75, the location of the peak thickness point is calculated based on the spatial stacking morphology, and the density anomaly area is determined.

[0210] It should be noted that the peak thickness point is the point with the largest Z-coordinate within the critical area. Anomaly zones refer to areas where the density exceeds the normal range for the same type of packing morphology in the database.

[0211] For example, the peak thickness points in a certain key area are (1.5, 1.0, 0.3), where the density of the 0.2-0.3m layer is 5500 points / m. 3 It was identified as a density anomaly region.

[0212] In step S76, the coordinate range of the key area, the layered interval, the spatial stacking pattern, the density distribution gradient, and the density anomaly area are integrated to output a detailed analysis report of quality inspection data.

[0213] It should be noted that the integration involves linking various parameters to specific key areas to form structured data. The report data is directly linked to flour quality indicators, providing a quantitative basis for subsequent risk assessment.

[0214] In step S8, based on the detailed analysis report data, high-risk areas are marked and a visual distribution map is generated to obtain spatial assessment results, including:

[0215] S81, Calculate the risk level of different regions and classify them according to the detailed analysis report data to obtain the distribution information of high-risk areas;

[0216] S82, The distribution information of the high-risk areas is labeled and processed to generate a visual distribution map;

[0217] S83, Analyze the visualized distribution map and output a spatial assessment result that includes the coordinates of high-risk areas, risk level, and scope of impact.

[0218] In step S81, the risk level of different regions is calculated and classified according to the detailed analysis report data to obtain the distribution information of high-risk regions.

[0219] It should be noted that the calculated risk level includes key parameters from the integrated detailed analysis report: using peak thickness, density anomalies, and contaminated area percentage as core indicators, combined with pre-assigned weights to calculate the comprehensive risk value.

[0220] It is worth noting that the comprehensive risk value is calculated using the formula R = T*w1 + D*w2 + S*w3, where R is the comprehensive risk value, representing the quantitative result of the quality risk caused by regional residues; T is the peak thickness, i.e., the maximum measured value of the residue accumulation thickness; D is the density anomaly value, obtained by standardizing the difference between the residue density and the normal flour density; S is the proportion of contaminated area, referring to the ratio of the area of ​​the residue area to the total area detected; w1, w2, and w3 are the corresponding indicator weights, determined through historical risk incident retrospective analysis. Cases of flour storage warehouses experiencing quality deterioration due to residues were statistically analyzed, and the correlation between each indicator and the incident was extracted. Excessive thickness leading to clumping accounted for 40%, density anomalies leading to mold accounted for 35%, and contaminated area percentages causing quality deterioration accounted for 25%. Based on this, the weights assigned to the peak thickness w1 are 0.4, density anomalies w2 are 0.35, and contaminated area percentages w3 are 0.25.

[0221] Optionally, the risk level is divided into three levels: a comprehensive risk value R < 30 indicates mild risk, 30 ≤ R ≤ 60 indicates moderate risk, and R > 60 indicates high risk. By comparing the comprehensive risk values ​​of each key area, high-risk areas are selected, and their coordinate ranges are recorded to form high-risk area distribution information.

[0222] For example, a critical area with a peak thickness of 0.4m (risk score 40), an abnormal density of 25% (risk score 30), and a contaminated area ratio of 12% (risk score 30) has a comprehensive risk score of 100 and is therefore classified as a high-risk area.

[0223] In step S82, the distribution information of the high-risk areas is labeled to generate a visual distribution map.

[0224] It should be noted that the annotation process includes using the 3D model of the storage warehouse as a base map and color-coding areas according to risk level: high-risk areas are filled with red, medium-risk areas with yellow, and low-risk areas with blue; a comprehensive risk value (e.g., "100") is marked at the center of each area, and the boundary lines are thickened for emphasis. The visualized distribution map is also overlaid with the actual size scale of the storage warehouse to ensure that the location of the areas is consistent with the actual storage warehouse structure.

[0225] For example, in the generated visualization distribution map, the area at the bottom of the storage silo, X: 1.0-2.0m and Y: 0.5-1.5m, is filled in red, with "100" marked in the center, clearly showing the location and range of the high-risk area.

[0226] In step S83, the visualized distribution map is analyzed, and a spatial assessment result containing the coordinates of high-risk areas, risk levels, and impact range is output.

[0227] It should be noted that the analysis includes determining the specific boundary coordinates, risk level, and impact range of high-risk areas. The spatial assessment results are output in the form of a combination of tables and 3D annotated maps. The tables record the coordinates, risk level, and impact range, while the 3D maps visually display the spatial location of the areas within the storage warehouse, providing clear targets for storage warehouse cleaning strategies.

[0228] For example, in the output spatial assessment results, the coordinates of the high-risk area are "X:1.2-1.8m, Y:0.7-1.3m, Z:0-0.3m", the level is "high risk", and the influence range is "2m", which directly matches the assessment requirements of "residual pollution diffusion risk" in flour quality testing.

[0229] In summary, this invention, through a machine vision-driven full-domain detection and quantitative evaluation mechanism, achieves precise analysis of flour storage residues from image acquisition to spatial evaluation result output throughout the entire process. This effectively improves the comprehensiveness of detection coverage and the quantitative accuracy of physical characteristics, providing strong support for the quality control and cleaning strategy formulation of flour storage silos.

[0230] Reference Figure 2 The second embodiment of the present invention provides a flour quality inspection system based on machine vision, comprising:

[0231] The image acquisition module is used to acquire a set of original multi-view images of the inside of the flour storage silo to obtain the initial image dataset;

[0232] The image correction module is used to standardize the initial image dataset to obtain a standard image dataset;

[0233] The feature extraction module is used to extract the local gray-level gradient and color distribution differences of pixels from the standard image dataset, construct a gray-level distribution matrix, and extract the texture features and boundary clarity values ​​of the residue by combining the preset mapping relationship between gray-level values ​​and physical properties of the residue, and construct an initial spatial distribution feature map.

[0234] The detail enhancement module is used to perform local image enhancement on the gray-scale abnormal areas in the initial spatial distribution feature map, extract the geometric parameters of the residue shape and light and shadow reflection characteristics, and obtain local residue distribution detail information;

[0235] The classification and identification module is used to classify the type and degree of pollution of the residues based on the detailed information of the local residue distribution, and to obtain the residue characteristic classification result;

[0236] A 3D modeling module is used to fuse the initial image dataset with the residue characteristic classification results, and combine the residue texture features and the boundary sharpness value to construct a 3D residue distribution map;

[0237] The analysis and evaluation module is used to analyze the spatial accumulation morphology and density distribution gradient based on the three-dimensional residue distribution map and obtain detailed analysis report data.

[0238] The visual output module is used to mark high-risk areas and generate a visual distribution map based on the detailed analysis report data, thereby obtaining spatial assessment results.

[0239] The various modules of the system work together in sequence to realize the intelligent processing of the entire process of flour storage residue detection. Its working principle corresponds one-to-one with the above-mentioned method embodiments, and will not be repeated here.

[0240] This invention also provides an electronic device. The electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a machine vision-based flour quality detection program. When the processor executes the computer program, it implements the steps described in the various machine vision-based flour quality detection method embodiments above, for example... Figure 1 The step S11 shown. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above-described device embodiments, such as the image acquisition module.

[0241] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.

[0242] The electronic device may be a desktop computer, laptop, handheld computer, or smart tablet, etc. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. It may include more or fewer components than described above, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.

[0243] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device, connecting various parts of the electronic device through various interfaces and lines.

[0244] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0245] Wherein, if the modules / units integrated in the electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0246] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0247] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A machine vision-based method for flour quality inspection, characterized in that, include: Obtain the original multi-view image set of the inside of the flour storage silo to obtain the initial image dataset; The initial image dataset is standardized to obtain a standard image dataset; Local gray-level gradients and color distribution differences of pixels are extracted from the standard image dataset to construct a gray-level distribution matrix. Combined with the preset mapping relationship between gray-level values ​​and physical properties of residues, texture features and boundary clarity values ​​of residues are extracted to construct an initial spatial distribution feature map. Local image enhancement is performed on the gray-scale abnormal areas in the initial spatial distribution feature map to extract the geometric parameters of the residue shape and light and shadow reflection characteristics, thereby obtaining detailed information on the local residue distribution. Based on the detailed information on the local residue distribution, the residue types and pollution levels are classified to obtain residue characteristic classification results; By fusing the initial image dataset with the residue characteristic classification results, and combining the residue texture features and the boundary sharpness value, a three-dimensional residue distribution map is constructed. Based on the three-dimensional residue distribution map, analyze the spatial accumulation morphology and density distribution gradient to obtain detailed analysis report data; Based on the detailed analysis report data, high-risk areas are marked and a visual distribution map is generated to obtain spatial assessment results.

2. The method according to claim 1, characterized in that, The process of obtaining the initial image dataset by acquiring the original multi-view image set of the flour storage silo includes: Multiple-angle shots were taken from the top, side walls, and bottom of the flour storage silo to obtain the first set of raw images covering the inner wall corners and the bottom blind area; The first original image set is subjected to viewpoint switching and image registration to determine the corresponding points of the overlapping area, thereby obtaining the registered second original image set. By fusing the overlapping regions of the second original image set, a seamless third original image set is obtained; The third original image set is subjected to light correction. If the light intensity is lower than the preset light intensity threshold, the brightness and contrast are adjusted to obtain the initial image dataset.

3. The method according to claim 1, characterized in that, The standardization process for the initial image dataset to determine the standard image dataset includes: The initial image dataset is subjected to lighting correction, and the brightness and contrast are adjusted to obtain a first initial image set; Key feature points are extracted from the first initial image set, and the feature points are aligned through image registration to obtain the second initial image set; If the second initial image set contains noise, noise suppression is performed to obtain a third initial image set; The angle is normalized on the third initial image set to correct the viewing angle deviation and determine the standard image dataset.

4. The method according to claim 1, characterized in that, The step of extracting local gray-level gradients and color distribution differences of pixels from the standard image dataset, constructing a gray-level distribution matrix, and combining the preset mapping relationship between gray-level values ​​and the physical properties of residues to extract residue texture features and boundary sharpness values, and constructing an initial spatial distribution feature map includes: The grayscale value and color value of each pixel are obtained from the standard image dataset, and the color distribution differences are processed to obtain local grayscale gradient data and color distribution difference data. Based on the gray-level gradient data and the color distribution difference data, a gray-level distribution matrix related to the residue characteristics is constructed. If there are outliers, smoothing is performed to obtain a denoised gray-level distribution matrix. Based on the preset mapping relationship between gray values ​​and physical properties of residues, the denoised gray distribution matrix is ​​layered, and the residue texture feature set corresponding to each gray layer is extracted. Extract the boundary data of the residue from the gray-scale distribution matrix. If the boundary clarity is lower than the preset clarity threshold, enhance the boundary contrast to obtain an optimized boundary clarity value. The initial spatial distribution feature map is constructed by fusing the set of residue texture features, the optimized boundary sharpness value, and the residue region information determined by image segmentation.

5. The method according to claim 1, characterized in that, The step involves performing local image enhancement on the grayscale abnormal regions in the initial spatial distribution feature map, extracting the geometric parameters of the residue shape and light reflection characteristics, and obtaining detailed information on the local residue distribution, including: The gray-scale abnormal regions in the initial spatial distribution feature map are divided to obtain the segmented abnormal region image; By enhancing the contrast and brightness of the image of the abnormal region, the shape and geometric parameters of the residue are extracted to obtain an enhanced detailed image; Light and shadow reflection characteristic data are extracted and analyzed from the enhanced detail image to determine the light and shadow reflection feature set. By fusing the set of light and shadow reflection features with the shape geometry parameters, detailed information on the distribution of local residues is generated.

6. The method according to claim 1, characterized in that, The process of classifying residue types and contamination levels based on the detailed information of local residue distribution to obtain residue characteristic classification results includes: Extract residue boundary features from the detailed information on the local residue distribution, and divide the residue distribution area accordingly; The color distribution differences of the residue distribution area are quantified. If the difference value exceeds the preset color difference threshold, a preliminary pollution classification label is marked. Calculate the texture density parameter of the residue distribution area, and determine the residue type by combining it with a preset texture density threshold; The proportion of contaminated area is calculated based on the type of residue, and the degree of contamination is classified according to the preset contamination level classification rules to obtain the residue characteristic classification result.

7. The method according to claim 1, characterized in that, The process of fusing the initial image dataset with the residue characteristic classification results, combining the residue texture features and the boundary sharpness value, and constructing a three-dimensional residue distribution map includes: The initial image dataset is converted to grayscale to generate a three-dimensional mapped grayscale distribution matrix, thereby determining the preliminary range of the residue area; Combining the texture features of the residue and the boundary clarity value, the type distribution probability is analyzed from the preliminary area of ​​the residue, and the area where the type distribution probability is higher than the preset probability threshold is marked as the target residue area; Calculate the correlation strength assessment value between each of the target residue regions, construct the spatial connection relationship, and determine the distribution structure; By integrating the aforementioned distribution structure and performing multi-view spatial registration, a high-precision three-dimensional residue distribution map is constructed.

8. The method according to claim 1, characterized in that, The process involves analyzing the spatial accumulation morphology and density distribution gradient based on the three-dimensional residue distribution map, and obtaining detailed analysis report data, including: Spatial point cloud data containing the three-dimensional coordinates of the residue locations are extracted from the three-dimensional residue distribution map and then divided into grids to obtain multiple point cloud regions. Select point cloud regions whose point cloud density exceeds a preset density threshold as key regions; Extract the thickness data and coordinate range of the key region, and divide the region into layers based on the thickness data; Analyze the density distribution gradient of each of the aforementioned stratified intervals, and combine it with a pre-established density distribution database to determine the spatial packing morphology; Calculate the location of the peak thickness point based on the spatial stacking morphology, and determine the density anomaly area; By integrating the coordinate range of the key areas, the layered intervals, the spatial stacking morphology, the density distribution gradient, and the density anomaly areas, a detailed analysis report of quality inspection data is output.

9. The method according to claim 1, characterized in that, Based on the detailed analysis report data, high-risk areas are marked and a visual distribution map is generated to obtain spatial assessment results, including: Based on the detailed analysis report data, the risk level of different regions is calculated and classified, and information on the distribution of high-risk areas is obtained. The distribution information of the high-risk areas is labeled to generate a visual distribution map; The visualized distribution map is analyzed to output a spatial assessment result that includes the coordinates of high-risk areas, risk levels, and the scope of impact.

10. A flour quality inspection system based on machine vision, characterized in that, include: Image acquisition module: Acquires a set of original multi-view images of the inside of the flour storage silo to obtain the initial image dataset; Image correction module: Standardizes the initial image dataset to obtain a standard image dataset; Feature extraction module: Extracts local gray-level gradients and color distribution differences of pixels from the standard image dataset, constructs a gray-level distribution matrix, and extracts texture features and boundary clarity values ​​of residues by combining the preset mapping relationship between gray-level values ​​and physical properties of residues, and constructs an initial spatial distribution feature map; Detail enhancement module: Performs local image enhancement on the gray-scale abnormal areas in the initial spatial distribution feature map, extracts the geometric parameters of the residue shape and light and shadow reflection characteristics, and obtains local residue distribution detail information; Classification and identification module: Based on the detailed information of the local residue distribution, classify the residue type and degree of pollution to obtain the residue characteristic classification result; 3D modeling module: By integrating the initial image dataset with the residue characteristic classification results, and combining the residue texture features and the boundary sharpness value, a 3D residue distribution map is constructed. Analysis and evaluation module: Based on the three-dimensional residue distribution map, analyze the spatial accumulation morphology and density distribution gradient, and obtain detailed analysis report data; Visual output module: Based on the detailed analysis report data, high-risk areas are marked and a visual distribution map is generated to obtain spatial assessment results.

Citation Information

Cited By

  • Method for classifying waste for animal husbandry and veterinary medicine based on image processing

    CN121616898A

  • A livestock veterinarian waste classification method based on image processing

    CN121616898B

  • Chemical detection system for scraped edge residues of printing tape

    CN122084769A