Food nondestructive testing model construction method based on machine vision
Through the non-destructive food detection model based on machine vision, multi-view image and infrared spectral imaging technology, the problems of strong subjectivity and low efficiency in traditional methods are solved, and the multi-dimensional detection and quality evaluation of food are realized, which improves the detection efficiency and accuracy.
Patent Information
- Application Number
- CN202411241050.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional food non-destructive testing methods are highly subjective and low-efficiency, difficult to detect internal food defects, and cannot conduct a comprehensive analysis of food deformation.
The non-destructive food detection model based on machine vision is adopted, and multi-view image shooting and three-dimensional model construction is constructed, combining image texture recognition and infrared spectral imaging to realize multi-dimensional detection and analysis of food.
It realizes comprehensive external and internal feature detection of food, provides more comprehensive quality assessment and safety control, and improves detection efficiency and accuracy.
Smart Images

Figure CN119131260A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image detection, and in particular to a method for constructing a food non-destructive detection model based on machine vision. Background Art
[0002] Food safety is an issue related to the national economy and people's livelihood, and non-destructive testing technology, as one of the key technologies to ensure food safety, has developed rapidly in recent years. Traditional food non-destructive testing methods have insurmountable shortcomings and strong subjectivity. Traditional methods rely on manual evaluation, such as visual observation of the color and shape of food for judgment, which is greatly affected by subjective factors, inefficient, limited detection speed, destructive detection, and difficulty in detecting internal defects. However, the food non-destructive testing model based on machine vision has many advantages: non-contact, non-destructive testing, and machine vision-based detection technology can obtain food images or videos through cameras or scanning devices without direct contact with food, avoiding contamination or damage to food. Automation and high efficiency, machine vision systems can automatically detect and analyze food to improve detection efficiency. However, the lack of comprehensive analysis of multi-dimensional indicators for the deformation of the food itself through the detection of deformation dimensions makes it impossible to conduct a more comprehensive evaluation of food. Summary of the invention
[0003] Based on this, it is necessary for the present invention to provide a method for constructing a food non-destructive detection model based on machine vision to solve at least one of the above technical problems.
[0004] To achieve the above purpose, a method for constructing a food non-destructive detection model based on machine vision includes the following steps:
[0005] Step S1: photographing and processing the food from multiple perspectives to obtain a multi-perspective image of the food; constructing a three-dimensional model of the food based on the multi-perspective image of the food to obtain a three-dimensional model of the food;
[0006] Step S2: performing image texture recognition on the multi-view images of the food to obtain the image texture of the food; performing surface texture mapping on the three-dimensional model of the food based on the image texture of the food to obtain the surface texture of the three-dimensional model; performing surface deformation area positioning on the surface texture of the three-dimensional model based on the three-dimensional model of the food to obtain the deformation area of the three-dimensional model;
[0007] Step S3: acquiring an internal image of the food region based on the deformation region of the three-dimensional model to obtain an internal image of the deformation region; performing internal deformation three-dimensional modeling on the internal image of the deformation region to obtain an internal deformation three-dimensional model; fitting the three-dimensional model of the food based on the internal deformation three-dimensional model to obtain a deformation three-dimensional model of the food;
[0008] Step S4: performing infrared spectral imaging processing on the food to obtain an infrared spectral imaging image of the food; performing non-destructive food marking on the infrared spectral imaging image of the food based on the three-dimensional deformation model of the food to obtain marked non-destructive food.
[0009] The present invention can completely and accurately record the appearance characteristics of food and establish a digital three-dimensional model of food through multi-view image shooting and three-dimensional model construction technology. This provides a basis for subsequent texture analysis, deformation area positioning and final non-destructive marking; using image texture recognition technology, visual information such as color and texture on the surface of food can be identified and extracted, and mapped to the three-dimensional model to make the model more realistic. More importantly, by analyzing the changes in texture, the area where the food is deformed can be accurately located, providing a target area for the next step of internal deformation analysis; for the deformation area, its internal image is obtained and three-dimensional modeling is performed, which can deeply analyze the deformation inside the food, such as cracks, holes, etc., which is impossible for traditional surface analysis. The internal deformation model is fitted with the original three-dimensional model, and finally a complete deformation three-dimensional model containing internal and external information is obtained, providing more comprehensive data support for food quality assessment; infrared spectral imaging technology can reflect the internal composition and quality information of food. By using the deformation three-dimensional model to mark the infrared spectral image, the external deformation information and internal quality information of the food can be associated, realizing non-destructive detection and precise analysis of the food. The external and internal characteristics of the food can be comprehensively analyzed, providing comprehensive data support for food safety and quality control. By comprehensively analyzing multi-dimensional indicators, a more comprehensive evaluation of the food can be made.
[0010] Preferably, step S1 comprises the following steps:
[0011] Step S11: performing multi-view image shooting processing on the food to obtain a multi-view image of the food;
[0012] Step S12: Analyze the food image feature points on the food multi-view images to obtain the food image feature points;
[0013] Step S13: performing feature point matching on the food multi-view images based on the feature points of the food images to obtain multi-angle image matching data;
[0014] Step S14: performing three-dimensional point cloud data positioning on the multi-angle image matching data and the multi-view images of the food to obtain three-dimensional point cloud data of the food;
[0015] Step S15: constructing a three-dimensional model of the food based on the three-dimensional point cloud data of the food to obtain a three-dimensional model of the food.
[0016] The present invention can comprehensively capture the external geometric shape and surface texture information of food through multi-view image shooting, and provide a rich data basis for subsequent 3D reconstruction. Multi-view shooting can overcome the limitations of a single view and obtain more complete 3D information of food; feature point analysis is performed on multi-view images to extract representative points in the images, such as corner points, edge points, etc. These feature points have strong stability and distinguishability and can be effectively used for matching between images of different viewpoints. Feature points are a reference for subsequent image matching and recognition, thereby improving the accuracy and efficiency of matching and recognition; matching between multi-view images is performed based on the extracted feature points. Finding the correspondence between the same spatial point under different perspectives is a key step in 3D reconstruction. Accurate feature point matching can ensure the accuracy and integrity of the final 3D model. Using the matched feature points and the geometric relationship of the camera, the coordinates of the feature points in 3D space can be calculated to obtain the 3D point cloud data of the food surface. These point cloud data are densely distributed on the food surface, forming the skeleton of the 3D model. Based on the acquired 3D point cloud data, a complete 3D model of the food is constructed through a surface reconstruction algorithm. The model can accurately reflect the geometric shape, size and surface detail features of the food, providing a basis for the digital and automated analysis of the food.
[0017] Preferably, step S12 comprises the following steps:
[0018] Step S121: acquiring an image pixel point set from the food multi-view image to obtain an image pixel point set;
[0019] Step S122: performing pixel brightness gradient analysis on the image pixel set to obtain image pixel gradient data;
[0020] Step S123: constructing a pixel autocorrelation matrix for the image pixel point set based on the image pixel gradient data to obtain a pixel autocorrelation matrix;
[0021] Step S124: Calculating pixel eigenvalues of the image pixel set based on the pixel autocorrelation matrix to obtain pixel eigenvalues;
[0022] Step S125: identifying food image feature points of the image pixel set based on the pixel feature values to obtain food image feature points.
[0023] The present invention obtains the pixel point set of multi-view images of food and converts the image information into a digital matrix, laying the foundation for subsequent pixel-level analysis. Each pixel point contains information such as color and brightness, which contains the characteristics of the image. The pixel point set is also the prerequisite for identifying image feature points. Only by obtaining the complete pixel point set information can the feature points be accurately identified and extracted; the image pixel point set is subjected to brightness gradient analysis to extract areas with drastic brightness changes in the image, such as edges, corners, etc. These areas usually correspond to important structural information in the image and are the key to identifying feature points. A pixel autocorrelation matrix is constructed based on the image pixel gradient data. This matrix describes the correlation between pixels in the local area of the image. By analyzing the autocorrelation matrix, local features of the image, such as texture and directionality, can be further extracted. The eigenvalues of the pixel autocorrelation matrix are calculated. These eigenvalues can quantitatively describe the characteristics of the local area of the image. For example, larger eigenvalues usually correspond to more significant corners or edges in the image, thereby providing an important reference for subsequent feature point identification and matching. According to the calculated pixel point eigenvalues, thresholds are set or other screening strategies are adopted to identify feature points in the image. These feature points can stably represent the shape and surface texture information of the food and can be used for subsequent 3D modeling, target recognition and other applications, so as to better understand and analyze the apparent characteristics of the food.
[0024] Preferably, step S2 comprises the following steps:
[0025] Step S21: performing image texture recognition on the food multi-view images to obtain food image texture;
[0026] Step S22: performing surface texture mapping on the food three-dimensional model based on the food image texture to obtain the surface texture of the three-dimensional model;
[0027] Step S23: constructing a texture coordinate system for the surface texture of the three-dimensional model to obtain a three-dimensional texture coordinate system;
[0028] Step S24: performing food deformation texture feature analysis on the surface texture of the three-dimensional model based on the food three-dimensional model to obtain food deformation texture features;
[0029] Step S25: locating the surface deformation area of the food deformation texture feature based on the three-dimensional texture coordinate system to obtain the three-dimensional model deformation area.
[0030] The present invention can extract visual information such as color, texture, pattern, etc. of the food surface through image texture recognition technology, and provide richer features for subsequent deformation analysis. Compared with simple geometric shapes, texture information can more sensitively reflect the deformation of food; the extracted food image texture is mapped to the surface of the three-dimensional model to make the three-dimensional model more realistic, and at the same time, the two-dimensional texture information is associated with the three-dimensional space information to provide a spatial reference for the subsequent deformation analysis. At the same time, the surface texture can also provide an important visual reference for the deformation analysis, and a texture coordinate system is constructed on the surface of the three-dimensional model, and corresponding three-dimensional coordinates are assigned to each texture pixel point, and a mapping relationship between the two-dimensional texture space and the three-dimensional model space is established, which provides a basis for the subsequent analysis of the corresponding relationship between texture changes and model deformation; the surface texture of the three-dimensional model is analyzed to extract texture features that can characterize food deformation, such as changes in texture direction, changes in texture density, texture fractures, etc. These features can sensitively reflect the deformation of the food surface, and based on the extracted deformation texture features and the three-dimensional texture coordinate system, the three-dimensional model area where deformation occurs can be accurately located, such as identifying cracks, depressions, deformations, etc. on the food surface. This provides an important reference for food quality assessment, defect detection, etc.
[0031] Preferably, step S24 comprises the following steps:
[0032] Step S241: cutting the model surface mesh of the food three-dimensional model to obtain the food three-dimensional model surface mesh;
[0033] Step S242: Calculating the model surface curvature of the food three-dimensional model surface mesh to obtain model surface curvature data;
[0034] Step S243: performing abnormal deformation identification on the model surface curvature data to obtain the abnormal deformation area of the model;
[0035] Step S244: acquiring abnormal deformation texture of the three-dimensional food model based on the abnormal deformation area of the model and the surface mesh of the three-dimensional food model to obtain the abnormal deformation texture;
[0036] Step S245: performing food deformation texture feature analysis on the surface texture of the three-dimensional model based on the abnormal deformation texture to obtain food deformation texture features.
[0037] The present invention discretizes the complex model surface into small triangular or quadrilateral patches by cutting the three-dimensional food model into surface meshes, which is convenient for subsequent curvature calculation and analysis. The fineness of the surface mesh directly affects the accuracy of subsequent analysis. The surface curvature calculation is performed on each surface mesh to obtain the curvature data of the model surface. The curvature is a quantity that describes the degree of bending of the model surface and can reflect the concave-convex changes of the model surface. It is an important indicator for identifying abnormal deformation. The surface curvature calculation can help identify and analyze the deformation and defects of the food surface and provide important information for abnormal deformation identification. By analyzing the surface curvature data of the model, the area with abnormal curvature, such as sudden change of curvature, excessive curvature, etc., is identified. Large or small areas, which usually correspond to abnormal deformations such as cracks, dents, and deformations on the food surface; based on the identified abnormal deformation area of the model, the three-dimensional model surface mesh and texture information corresponding to the area are extracted to obtain the abnormal deformation texture, which is equivalent to separating the abnormal deformation area from the three-dimensional model for more detailed analysis. The abnormal deformation texture can help understand and analyze the causes and effects of food deformation; feature analysis is performed on the extracted abnormal deformation texture, such as analyzing the shape characteristics, direction characteristics, spatial distribution characteristics, etc. of the texture. These features can more comprehensively describe the deformation of the food and provide richer information for food quality assessment, defect detection, etc.
[0038] Preferably, step S3 comprises the following steps:
[0039] Step S31: acquiring an internal image of the food region based on the deformation region of the three-dimensional model to obtain an internal image of the deformation region;
[0040] Step S32: performing deformation edge texture feature analysis on the internal image of the deformation area to obtain deformation edge texture features;
[0041] Step S33: performing deformation edge analysis on the internal image of the deformation area based on the deformation edge texture feature to obtain deformation edge data;
[0042] Step S34: performing internal deformation three-dimensional modeling on the deformed edge data to obtain an internal deformation three-dimensional model;
[0043] Step S35: fitting the food three-dimensional model based on the internal deformation three-dimensional model to obtain the food deformation three-dimensional model.
[0044] The present invention obtains the internal image information of the area based on the located deformation area. This can be achieved in many ways, such as cutting the deformation area, using X-ray or CT scanning technology, etc., to obtain internal image information that can more intuitively reflect the deformation inside the food and provide a data basis for subsequent internal deformation modeling; analyzing the internal image of the deformation area and extracting the texture features of the deformation edge. These features can reflect the shape, direction, texture change and other information of the deformation edge, providing a basis for subsequent deformation edge analysis. These features can provide important references for subsequent deformation edge analysis and internal deformation three-dimensional modeling; based on the extracted deformation edge texture features, the internal image of the deformation area is analyzed to identify and extract deformation edge data, such as the position, direction, and texture change of the edge. length, etc., which can accurately describe the geometric shape of the deformation edge; use the extracted deformation edge data to perform internal deformation 3D modeling, and construct a 3D model that can reflect the internal deformation of the food. This model can more intuitively display the cracks, voids, deformations, etc. inside the food. The internal deformation 3D model can intuitively present the impact of food deformation on the internal structure, and provide a basic model for subsequent fitting and analysis; fit the constructed internal deformation 3D model with the original food 3D model to obtain a complete food deformation 3D model containing internal deformation information. This model can more comprehensively and accurately reflect the deformation of the food, and provide a more reliable basis for food quality assessment and defect detection.
[0045] Preferably, step S32 includes the following steps:
[0046] Step S321: performing deformation edge detection on the internal image of the deformation area to obtain deformation edge image data;
[0047] Step S322: extracting single pixels from the deformed edge image data to obtain edge single pixel data;
[0048] Step S323: performing edge single pixel direction analysis on the edge single pixel data to obtain edge single pixel direction data;
[0049] Step S324: performing deformation edge segment clustering processing on the deformation edge image data based on the edge single pixel direction data and the edge single pixel data to obtain deformation edge segment data;
[0050] Step S325: extracting texture features from the deformed edge segment data to obtain deformed edge texture features.
[0051] The present invention can help obtain the boundary information of the deformation area through deformation edge detection, and can identify the edge features caused by deformation by detecting changes in brightness, color, texture, etc. in the internal image. Deformation edge detection can provide basic data for subsequent edge analysis and processing, and can also help evaluate the degree and scope of deformation; single-pixel extraction aims to obtain key information of edge images. By extracting single-pixel data, the edge can be analyzed and processed in detail, including subsequent directional analysis and clustering processing. Single-pixel extraction can improve the recognition accuracy of edge features and reduce the influence of noise and interference, thereby improving the accuracy and efficiency of subsequent processing; edge direction analysis can describe the directional characteristics of edge pixels. By analyzing The direction of the brightness change of a single pixel can identify the direction information of the edge, including horizontal, vertical, oblique, etc. Edge direction analysis can provide an important reference for the subsequent edge segment clustering processing, and can also help understand the mechanism and characteristics of deformation; edge segment clustering processing can aggregate scattered edge single pixels into continuous edge segments. By analyzing and processing the single pixel direction data, single pixels with similar directions and positions can be aggregated together to form continuous edge segments. Edge segment clustering processing can improve the accuracy and efficiency of subsequent texture feature extraction, and can also help simplify the calculation and processing process; texture feature extraction is performed on each deformed edge segment, such as calculating the length, curvature, direction change, etc. of the edge segment. These features can effectively describe the geometric morphology and texture information of the deformed edge, and provide a more refined and accurate basis for subsequent deformation analysis, defect detection, etc.
[0052] Preferably, step S4 comprises the following steps:
[0053] Step S41: performing infrared spectrum imaging processing on the food to obtain an infrared spectrum imaging image of the food;
[0054] Step S42: acquiring a damage image of the food infrared spectrum imaging image based on the food deformation three-dimensional model to obtain a food damage infrared image;
[0055] Step S43: performing food non-destructive assessment on the food based on the food infrared spectrum imaging image and the food damage infrared image to obtain food non-destructive assessment data;
[0056] Step S44: marking the food as intact food based on the food integrity assessment data to obtain marked intact food.
[0057] The present invention can obtain information on the internal structure and components of food through infrared spectral imaging processing. By scanning and imaging food through infrared spectroscopy technology, the spectral characteristics of food in the infrared band can be obtained, reflecting the absorption and reflection of different components in food, providing basic data for subsequent damage image acquisition and non-destructive evaluation, and can also help identify foreign substances and pollutants in food; damage image acquisition is based on the assistance of food deformation three-dimensional model, by using the three-dimensional model to locate and identify the damage area, it is possible to obtain images of specific areas of food damage, including damage features such as cracks, depressions, discoloration, etc. The damage image can provide important visual information for food non-destructive evaluation, and can also help analyze the cause and mechanism of damage; combining the complete food infrared spectral imaging image and the damage infrared image, the food is non-destructively evaluated. By comparing and analyzing the spectral differences between the deformation area and other areas, the degree of influence of the deformation on the quality of the food can be determined, for example, whether the deformation causes the internal components of the food to deteriorate; non-destructive food marking is based on the results of food non-destructive evaluation. By marking the food that meets the standards, it can provide consumers with intuitive quality and safety information, and can also prevent the loss and deterioration of food during transportation and storage, thereby improving the safety of food.
[0058] Preferably, step S43 includes the following steps:
[0059] Step S431: performing damage spectrum analysis on the food damage infrared image to obtain damage spectrum data;
[0060] Step S432: performing image damage pixel grayscale threshold acquisition on the damage spectrum data based on the food infrared spectrum imaging image to obtain the image damage pixel grayscale threshold;
[0061] Step S433: dividing the damaged pixel grayscale intervals according to the damaged pixel grayscale thresholds of the image to obtain damaged pixel grayscale intervals;
[0062] Step S434: Perform food integrity assessment on the food based on the grayscale interval of the damaged pixels to obtain food integrity assessment data.
[0063] The present invention can obtain specific spectral features of food damage through damage spectrum analysis. By processing and analyzing the damaged infrared image, spectral peaks and bands related to damage can be identified, including moisture content, protein changes, fat oxidation, etc. Damage spectrum analysis can provide important reference information for non-destructive evaluation of food and help evaluate the quality and safety of food. Image damage pixel grayscale threshold acquisition is intended to distinguish normal pixels from damaged pixels. By analyzing the grayscale distribution of the damaged infrared image, the grayscale threshold of the damaged pixel can be obtained, that is, the grayscale value that can effectively distinguish the damage characteristics. Grayscale threshold acquisition can help the subsequent grayscale interval division and non-destructive evaluation of damaged pixels. Improve the accuracy and reliability of assessment; the grayscale interval division of damaged pixels can classify and divide damaged pixels in detail. By further processing the grayscale threshold of damaged pixels in the image, damaged pixels can be divided into different grayscale intervals, reflecting the degree and type of damage, including mild, moderate, severe, etc. The grayscale interval division can provide a fine reference standard for non-destructive assessment of food and improve the resolution and accuracy of assessment; according to the grayscale value of each pixel, the grayscale interval of the damaged pixel to which it belongs is determined, thereby realizing non-destructive assessment of food. For example, the degree of damage and quality grade of the entire food can be evaluated based on the proportion of the number of pixels falling in each damage interval.
[0064] Preferably, step S431 includes the following steps:
[0065] Step S4311: preprocessing the spectral data of the food damage infrared image to obtain preprocessed spectral data;
[0066] Step S4312: performing new absorption peak identification on the pre-processed spectrum data to obtain new absorption peak data;
[0067] Step S4313: performing absorption peak intensity enhancement analysis on the pre-processed spectrum data to obtain enhanced absorption peak data;
[0068] Step S4314: fitting the damage-sensitive absorption band characteristics of the new absorption peak data and the enhanced absorption peak data to obtain the damage-sensitive absorption band characteristics;
[0069] Step S4315: Perform damage spectrum analysis on the damage infrared image based on the damage sensitive absorption band characteristics to obtain damage spectrum data.
[0070] The present invention can effectively remove noise and interference in the original spectral data through spectral data preprocessing, and can improve the quality and accuracy of spectral data through operations such as smoothing, filtering, and correction, which is conducive to the subsequent accurate identification and analysis of damage-related characteristic peaks and bands, and can also reduce errors and uncertainties in subsequent calculations and analysis processes; new absorption peak identification can obtain specific spectral features related to food damage, and by analyzing the preprocessed spectral data, new absorption peaks that appear after damage can be identified, and these absorption peaks are related to changes or products of certain components in food. The identification of new absorption peaks can provide an important reference for determining damage-sensitive absorption bands; the identified new absorption peak data and enhanced absorption peak data are integrated and analyzed to fit the absorption band characteristics that are sensitive to damage, and these characteristic bands can more sensitively reflect the degree of damage and quality changes of food; based on the damage-sensitive absorption band characteristics obtained by fitting, damage spectral analysis is performed on the damage infrared image to extract spectral information of these characteristic bands, such as absorbance, reflectivity, etc. The damage spectral analysis can provide an important reference basis for non-destructive evaluation of food, help evaluate the quality and safety of food, and also provide a basis for controlling and preventing food loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments thereof made with reference to the following drawings:
[0072] Figure 1 It is a schematic diagram of the steps of the method for constructing a food non-destructive detection model based on machine vision of the present invention;
[0073] Figure 2 for Figure 1 Detailed step flow diagram of step S3;
[0074] Figure 3 for Figure 1 Detailed step flow chart of step S4 in FIG. DETAILED DESCRIPTION
[0075] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.
[0076] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.
[0077] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.
[0078] To achieve this, please refer to Figures 1 to 3 The present invention provides a method for constructing a food non-destructive detection model based on machine vision, the method comprising the following steps:
[0079] Step S1: photographing and processing the food from multiple perspectives to obtain a multi-perspective image of the food; constructing a three-dimensional model of the food based on the multi-perspective image of the food to obtain a three-dimensional model of the food;
[0080] Step S2: performing image texture recognition on the multi-view images of the food to obtain the image texture of the food; performing surface texture mapping on the three-dimensional model of the food based on the image texture of the food to obtain the surface texture of the three-dimensional model; performing surface deformation area positioning on the surface texture of the three-dimensional model based on the three-dimensional model of the food to obtain the deformation area of the three-dimensional model;
[0081] Step S3: acquiring an internal image of the food region based on the deformation region of the three-dimensional model to obtain an internal image of the deformation region; performing internal deformation three-dimensional modeling on the internal image of the deformation region to obtain an internal deformation three-dimensional model; fitting the three-dimensional model of the food based on the internal deformation three-dimensional model to obtain a deformation three-dimensional model of the food;
[0082] Step S4: performing infrared spectral imaging processing on the food to obtain an infrared spectral imaging image of the food; performing non-destructive food marking on the infrared spectral imaging image of the food based on the three-dimensional deformation model of the food to obtain marked non-destructive food.
[0083] In the embodiment of the present invention, please refer to Figure 1FIG. 1 is a schematic diagram of the steps of the method for constructing a food non-destructive detection model based on machine vision of the present invention. In this example, the method for constructing a food non-destructive detection model based on machine vision includes the following steps:
[0084] Step S1: photographing and processing the food from multiple perspectives to obtain a multi-perspective image of the food; constructing a three-dimensional model of the food based on the multi-perspective image of the food to obtain a three-dimensional model of the food;
[0085] In an embodiment of the present invention, by placing the food to be tested on a rotating table, setting the camera parameters, starting the rotating table to rotate at a constant speed and synchronously controlling the camera to shoot, during the rotation process, the camera shoots multiple food images of different viewing angles at fixed angle intervals to obtain an image sequence covering all angles. The image is preprocessed, including noise removal and correction. Feature point detection algorithms, such as SIFT and SURF, are applied to extract representative corner points or feature points in the image. Feature point descriptors are used to match feature points between images, and the similarity of feature point descriptors in the two images is calculated. A robust matching algorithm, such as RANSAC, is used to improve the matching accuracy. According to the camera parameters and matching point pairs, the three-dimensional coordinates of the feature points are calculated using triangulation to obtain the three-dimensional point cloud data of the food surface. Finally, a three-dimensional reconstruction algorithm, such as Poisson surface reconstruction, is used to construct a complete three-dimensional model of the food.
[0086] Step S2: performing image texture recognition on the multi-view images of the food to obtain the image texture of the food; performing surface texture mapping on the three-dimensional model of the food based on the image texture of the food to obtain the surface texture of the three-dimensional model; performing surface deformation area positioning on the surface texture of the three-dimensional model based on the three-dimensional model of the food to obtain the deformation area of the three-dimensional model;
[0087] In an embodiment of the present invention, texture features of multi-view images of food, including roughness and directionality, are extracted through image texture analysis algorithms, such as grayscale co-occurrence matrix and local binary pattern. The texture is mapped to the surface of the three-dimensional model using camera parameters and geometric information of the three-dimensional model, and texture color is assigned to each vertex according to vertex coordinates and camera projection. The texture changes on the surface of the three-dimensional model are analyzed by the texture coordinate system established when the three-dimensional model is unfolded into a two-dimensional plane. By calculating texture feature parameters and using machine learning algorithms, deformation texture features are extracted, and areas with drastic changes or belonging to deformation categories are marked. Finally, based on texture features and texture coordinate system, the deformation area on the surface of the three-dimensional model is located to provide accurate information for subsequent processing.
[0088] Step S3: acquiring an internal image of the food region based on the deformation region of the three-dimensional model to obtain an internal image of the deformation region; performing internal deformation three-dimensional modeling on the internal image of the deformation region to obtain an internal deformation three-dimensional model; fitting the three-dimensional model of the food based on the internal deformation three-dimensional model to obtain a deformation three-dimensional model of the food;
[0089] In an embodiment of the present invention, an appropriate imaging technique is used to obtain an internal image of the located deformation area of the three-dimensional model, and the texture features of the deformation edge are analyzed and extracted, such as edge direction, gradient change, etc. Then, these features are used to perform a more refined deformation edge analysis, such as connecting edge pixels into line segments and calculating their geometric features. Finally, based on the deformation edge data obtained by the analysis, a three-dimensional reconstruction algorithm is used to construct an internal deformation three-dimensional model, and it is fitted with the original food three-dimensional model to obtain a complete model containing internal deformation information.
[0090] Step S4: performing infrared spectral imaging processing on the food to obtain an infrared spectral imaging image of the food; performing non-destructive food marking on the infrared spectral imaging image of the food based on the three-dimensional deformation model of the food to obtain marked non-destructive food.
[0091] In an embodiment of the present invention, a three-dimensional spectral image of food is obtained by an infrared spectral imaging device, and the spectral information of the deformation area is extracted based on the previously constructed three-dimensional model of food deformation to generate a damaged infrared image. By analyzing and comparing the complete spectral image and the damaged infrared image, and combining the quality index model established by data analysis methods such as principal component analysis and partial least squares method, the degree of influence of deformation on food quality can be determined. Finally, based on the non-destructive assessment data, such as the predicted value of the quality index, the degree of damage classification, etc., the food is non-destructively marked, for example, using labels of different colors to distinguish the degree of damage, to facilitate subsequent classification processing.
[0092] The present invention can completely and accurately record the appearance characteristics of food and establish a digital three-dimensional model of food through multi-view image shooting and three-dimensional model construction technology. This provides a basis for subsequent texture analysis, deformation area positioning and final non-destructive marking; using image texture recognition technology, visual information such as color and texture on the surface of food can be identified and extracted, and mapped to the three-dimensional model to make the model more realistic. More importantly, by analyzing the changes in texture, the area where the food is deformed can be accurately located, providing a target area for the next step of internal deformation analysis; for the deformation area, its internal image is obtained and three-dimensional modeling is performed, which can deeply analyze the deformation inside the food, such as cracks, holes, etc., which is impossible for traditional surface analysis. The internal deformation model is fitted with the original three-dimensional model, and finally a complete deformation three-dimensional model containing internal and external information is obtained, providing more comprehensive data support for food quality assessment; infrared spectral imaging technology can reflect the internal composition and quality information of food. By using the deformation three-dimensional model to mark the infrared spectral image, the external deformation information and internal quality information of the food can be associated, realizing non-destructive detection and precise analysis of the food. The external and internal characteristics of the food can be comprehensively analyzed, providing comprehensive data support for food safety and quality control. By comprehensively analyzing multi-dimensional indicators, a more comprehensive evaluation of the food can be made.
[0093] Preferably, step S1 comprises the following steps:
[0094] Step S11: performing multi-view image shooting processing on the food to obtain a multi-view image of the food;
[0095] In an embodiment of the present invention, the food to be measured is placed on a rotating table, and camera parameters such as focal length, aperture, and shutter speed are set. The rotating table is started to rotate at a constant speed, and the camera is synchronously controlled to shoot. During the rotation process, the camera shoots multiple food images of different perspectives at fixed angle intervals, for example, one image is taken every 10 degrees, and finally a series of image sequences covering all angles of the food are obtained. After shooting, the image is preprocessed, including removing noise, correcting lighting, adjusting contrast, etc., to improve the accuracy of subsequent feature extraction and matching.
[0096] Step S12: Analyze the food image feature points on the food multi-view images to obtain the food image feature points;
[0097] In an embodiment of the present invention, by applying a feature point detection algorithm, such as SIFT, SURF, ORB, etc., to each preprocessed multi-view image, representative feature points in the image are extracted. These feature points are usually points where the gradient changes dramatically in the image, such as corner points, etc. The feature point detection algorithm calculates the descriptor of each feature point for subsequent feature point matching. The descriptor is usually a high-dimensional vector that contains image information of the area around the feature point, such as gradient direction, texture features, etc.
[0098] Step S13: performing feature point matching on the food multi-view images based on the feature points of the food images to obtain multi-angle image matching data;
[0099] In an embodiment of the present invention, feature point matching is performed between images of different perspectives by utilizing the extracted feature points and their descriptors. The matching algorithm calculates the similarity between all feature point descriptors in the two images, such as Euclidean distance, cosine similarity, etc., and matches the feature point pairs with the highest similarity. In order to improve the matching accuracy, some more robust matching algorithms, such as the RANSAC algorithm, can be used to eliminate mismatched feature point pairs.
[0100] Step S14: performing three-dimensional point cloud data positioning on the multi-angle image matching data and the multi-view images of the food to obtain three-dimensional point cloud data of the food;
[0101] In an embodiment of the present invention, the coordinates of the feature points in the three-dimensional space are calculated by using the principle of triangulation based on the camera parameters and the matching feature point pairs. Specifically, for a pair of matching feature points, their projection points on the two images and the optical center of the camera can determine two rays, and the intersection of the two rays is the coordinates of the feature point in the three-dimensional space. By calculating the three-dimensional coordinates of all matching feature points, the three-dimensional point cloud data of the food surface can be obtained.
[0102] Step S15: constructing a three-dimensional model of the food based on the three-dimensional point cloud data of the food to obtain a three-dimensional model of the food.
[0103] In an embodiment of the present invention, a complete three-dimensional model of food is constructed by utilizing the acquired three-dimensional point cloud data. Commonly used three-dimensional reconstruction algorithms include Poisson surface reconstruction, Delaunay triangulation, Alpha Shapes algorithm, etc. These algorithms will construct a three-dimensional grid model that approximates the food surface based on the spatial distribution of the point cloud data.
[0104] The present invention can comprehensively capture the external geometric shape and surface texture information of food through multi-view image shooting, and provide a rich data basis for subsequent 3D reconstruction. Multi-view shooting can overcome the limitations of a single view and obtain more complete 3D information of food; feature point analysis is performed on multi-view images to extract representative points in the images, such as corner points, edge points, etc. These feature points have strong stability and distinguishability and can be effectively used for matching between images of different viewpoints. Feature points are a reference for subsequent image matching and recognition, thereby improving the accuracy and efficiency of matching and recognition; matching between multi-view images is performed based on the extracted feature points. Finding the correspondence between the same spatial point under different perspectives is a key step in 3D reconstruction. Accurate feature point matching can ensure the accuracy and integrity of the final 3D model. Using the matched feature points and the geometric relationship of the camera, the coordinates of the feature points in 3D space can be calculated to obtain the 3D point cloud data of the food surface. These point cloud data are densely distributed on the food surface, forming the skeleton of the 3D model. Based on the acquired 3D point cloud data, a complete 3D model of the food is constructed through a surface reconstruction algorithm. The model can accurately reflect the geometric shape, size and surface detail features of the food, providing a basis for the digital and automated analysis of the food.
[0105] Preferably, step S12 comprises the following steps:
[0106] Step S121: acquiring an image pixel point set from the food multi-view image to obtain an image pixel point set;
[0107] In an embodiment of the present invention, the acquired multi-view images of food are loaded into a memory, and the image information is converted into a digital pixel point set, each pixel point contains its coordinate position and color information in the image, usually represented by the values of the three RGB channels. For example, for a color image with a resolution of 1024x768, its pixel point set contains 786,432 pixels, and each pixel point can be represented by a six-dimensional vector containing coordinate (x, y) and color (R, G, B) information.
[0108] Step S122: performing pixel brightness gradient analysis on the image pixel set to obtain image pixel gradient data;
[0109] In an embodiment of the present invention, a brightness gradient analysis is performed on a set of image pixels in order to find areas in the image where the brightness changes dramatically. A commonly used method is to use a Sobel operator to perform a convolution operation on the image. The Sobel operator includes convolution kernels in two directions, which are used to calculate the gradients in the horizontal and vertical directions, respectively. After applying the Sobel operator to each pixel point, the gradient values of the pixel point in the horizontal and vertical directions can be obtained, and then the gradient amplitude and gradient direction of the pixel point can be calculated.
[0110] Step S123: constructing a pixel autocorrelation matrix for the image pixel point set based on the image pixel gradient data to obtain a pixel autocorrelation matrix;
[0111] In an embodiment of the present invention, for each pixel point, a pixel autocorrelation matrix is constructed using the gradient information of its neighborhood pixel points. Specifically, a neighborhood window of appropriate size is selected with the pixel point as the center, such as a 5x5 or 7x7 window, and the outer products of the gradient vectors of all pixels in the window in the horizontal and vertical directions are calculated. All outer product matrices are summed to obtain the autocorrelation matrix of the pixel point. The autocorrelation matrix is a 2x2 matrix whose elements reflect the correlation between the gradient vectors of the neighborhood pixel points.
[0112] Step S124: Calculating pixel eigenvalues of the image pixel set based on the pixel autocorrelation matrix to obtain pixel eigenvalues;
[0113] In an embodiment of the present invention, two eigenvalues are obtained by performing eigenvalue decomposition on the autocorrelation matrix of each pixel point. The size of the eigenvalue reflects the gradient change of the neighborhood area of the pixel point. For example, if the pixel point is located in a flat area, the gradient vectors of its neighborhood pixels are relatively similar, and the eigenvalue of the autocorrelation matrix will be relatively small; conversely, if the pixel point is located in an area with drastic gradient changes such as an edge or corner point, the eigenvalue of its autocorrelation matrix will be relatively large.
[0114] Step S125: identifying food image feature points of the image pixel set based on the pixel feature values to obtain food image feature points.
[0115] In an embodiment of the present invention, whether a pixel is a feature point is determined based on the size of the feature value of each pixel. For example, a threshold can be set to determine pixels whose feature values are greater than the threshold as feature points. In addition, the accuracy of feature point recognition can be improved based on information such as the proportional relationship between two feature values, the comparison results between the feature value and the feature values of surrounding pixels, etc.
[0116] The present invention obtains the pixel point set of multi-view images of food and converts the image information into a digital matrix, laying the foundation for subsequent pixel-level analysis. Each pixel point contains information such as color and brightness, which contains the characteristics of the image. The pixel point set is also the prerequisite for identifying image feature points. Only by obtaining the complete pixel point set information can the feature points be accurately identified and extracted; the image pixel point set is subjected to brightness gradient analysis to extract areas with drastic brightness changes in the image, such as edges, corners, etc. These areas usually correspond to important structural information in the image and are the key to identifying feature points. A pixel autocorrelation matrix is constructed based on the image pixel gradient data. This matrix describes the correlation between pixels in the local area of the image. By analyzing the autocorrelation matrix, local features of the image, such as texture and directionality, can be further extracted. The eigenvalues of the pixel autocorrelation matrix are calculated. These eigenvalues can quantitatively describe the characteristics of the local area of the image. For example, larger eigenvalues usually correspond to more significant corners or edges in the image, thereby providing an important reference for subsequent feature point identification and matching. According to the calculated pixel point eigenvalues, thresholds are set or other screening strategies are adopted to identify feature points in the image. These feature points can stably represent the shape and surface texture information of the food and can be used for subsequent 3D modeling, target recognition and other applications, so as to better understand and analyze the apparent characteristics of the food.
[0117] Preferably, step S2 comprises the following steps:
[0118] Step S21: performing image texture recognition on the food multi-view images to obtain food image texture;
[0119] In an embodiment of the present invention, the food multi-view image is processed by using an image texture analysis algorithm to extract texture information in the image. Commonly used texture analysis algorithms include grayscale co-occurrence matrix and local binary pattern, which can extract texture features of different scales and directions in the image, such as roughness, directionality, contrast, etc. For example, the grayscale co-occurrence matrix algorithm can be used to calculate the co-occurrence probability between different pixel gray values in the image, and the texture feature parameters such as energy, contrast, correlation, etc. can be calculated based on the co-occurrence probability matrix.
[0120] Step S22: performing surface texture mapping on the food three-dimensional model based on the food image texture to obtain the surface texture of the three-dimensional model;
[0121] In an embodiment of the present invention, the extracted food image texture is mapped to the surface of the three-dimensional model by utilizing the camera parameters and the geometric information of the three-dimensional model obtained during the three-dimensional reconstruction process. Specifically, for each vertex on the three-dimensional model, the projection coordinates of the vertex on the corresponding perspective image are calculated using the camera projection matrix according to its coordinates in the three-dimensional space. Then, the texture pixel corresponding to the vertex is found according to the projection coordinates, and the color information of the pixel is assigned to the vertex.
[0122] Step S23: constructing a texture coordinate system for the surface texture of the three-dimensional model to obtain a three-dimensional texture coordinate system;
[0123] In an embodiment of the present invention, a texture coordinate system is constructed for the surface of a three-dimensional model. A common method is to unfold the three-dimensional model into a two-dimensional plane and establish a texture coordinate system on the two-dimensional plane. For example, the three-dimensional model can be unfolded into a two-dimensional plane using a cylindrical unfolding method or a spherical unfolding method. Each point on the unfolded two-dimensional plane corresponds to a point on the surface of the three-dimensional model. Therefore, the coordinates of the two-dimensional plane can be used as the texture coordinates of the surface points of the three-dimensional model.
[0124] Step S24: performing food deformation texture feature analysis on the surface texture of the three-dimensional model based on the food three-dimensional model to obtain food deformation texture features;
[0125] In an embodiment of the present invention, by analyzing the changes in the surface texture of the three-dimensional model, texture features that can characterize the deformation of the food are extracted. For example, texture feature parameters, such as GLCM feature parameters, gradient, curvature, mutation and other information on the surface of the three-dimensional model can be calculated. The deformation area usually corresponds to the area where the texture features change dramatically. In addition, machine learning algorithms, such as support vector machines and random forests, can be used to classify texture features and identify deformation areas.
[0126] Step S25: locating the surface deformation area of the food deformation texture feature based on the three-dimensional texture coordinate system to obtain the three-dimensional model deformation area.
[0127] In an embodiment of the present invention, the deformation area on the surface of the three-dimensional model is located through the food deformation texture characteristics and the constructed three-dimensional texture coordinate system. For example, the area where the texture characteristics change dramatically can be marked as the deformation area. In addition, according to the classification results of the machine learning algorithm, the area belonging to the deformation category can be marked as the deformation area. The final deformation area can be represented by geometric elements such as points, lines, and surfaces on the three-dimensional model.
[0128] The present invention can extract visual information such as color, texture, pattern, etc. of the food surface through image texture recognition technology, and provide richer features for subsequent deformation analysis. Compared with simple geometric shapes, texture information can more sensitively reflect the deformation of food; the extracted food image texture is mapped to the surface of the three-dimensional model to make the three-dimensional model more realistic, and at the same time, the two-dimensional texture information is associated with the three-dimensional space information to provide a spatial reference for the subsequent deformation analysis. At the same time, the surface texture can also provide an important visual reference for the deformation analysis, and a texture coordinate system is constructed on the surface of the three-dimensional model, and corresponding three-dimensional coordinates are assigned to each texture pixel point, and a mapping relationship between the two-dimensional texture space and the three-dimensional model space is established, which provides a basis for the subsequent analysis of the corresponding relationship between texture changes and model deformation; the surface texture of the three-dimensional model is analyzed to extract texture features that can characterize food deformation, such as changes in texture direction, changes in texture density, texture fractures, etc. These features can sensitively reflect the deformation of the food surface, and based on the extracted deformation texture features and the three-dimensional texture coordinate system, the three-dimensional model area where deformation occurs can be accurately located, such as identifying cracks, depressions, deformations, etc. on the food surface. This provides an important reference for food quality assessment, defect detection, etc.
[0129] Preferably, step S24 comprises the following steps:
[0130] Step S241: cutting the model surface mesh of the food three-dimensional model to obtain the food three-dimensional model surface mesh;
[0131] In the embodiment of the present invention, by performing face mesh cutting on the constructed three-dimensional food model, its surface is discretized into finer triangular face patches, and the existing mesh processing software, such as MeshLab, CGAL, etc., can be used to implement the mesh cutting function. When performing mesh cutting, it is necessary to set appropriate cutting parameters, such as the maximum triangle side length, the maximum triangle angle, etc., according to the complexity of the model and the accuracy requirements of the subsequent analysis. After the cutting is completed, each triangular face patch represents a small area on the surface of the model.
[0132] Step S242: Calculating the model surface curvature of the food three-dimensional model surface mesh to obtain model surface curvature data;
[0133] In an embodiment of the present invention, the surface curvature of each triangular face is calculated. Commonly used methods include discrete curvature estimation method, curvature calculation method based on fitting, etc. The discrete curvature estimation method uses the vertex coordinates and neighborhood information of the triangular face to directly calculate the curvature value of each vertex. The curvature calculation method based on fitting is to first fit the triangular face and its neighborhood with a smooth surface, and then calculate the curvature value of each point on the triangular face of the fitting surface.
[0134] Step S243: performing abnormal deformation identification on the model surface curvature data to obtain the abnormal deformation area of the model;
[0135] In an embodiment of the present invention, areas with abnormal curvature are identified based on the calculated model surface curvature data. These areas usually correspond to deformation areas of the food. A common method is to set a curvature threshold and mark the area where the curvature value exceeds the threshold as an abnormal deformation area. The setting of the threshold can be determined based on empirical values or statistical analysis results. Some outlier detection algorithms, such as density-based clustering algorithms and isolation forest algorithms, can also be used to analyze the curvature data and identify abnormal deformation areas.
[0136] Step S244: acquiring abnormal deformation texture of the three-dimensional food model based on the abnormal deformation area of the model and the surface mesh of the three-dimensional food model to obtain the abnormal deformation texture;
[0137] In an embodiment of the present invention, by identifying the abnormal deformation area of the model, the three-dimensional model surface mesh and texture information corresponding to the area are extracted. For each triangular facet falling within the abnormal deformation area, the three-dimensional coordinates of its vertices and the corresponding texture coordinates, as well as the color information of the corresponding pixel points in the texture image are extracted. By integrating this information together, the texture information of the abnormal deformation area can be obtained.
[0138] Step S245: performing food deformation texture feature analysis on the surface texture of the three-dimensional model based on the abnormal deformation texture to obtain food deformation texture features.
[0139] In an embodiment of the present invention, by performing feature analysis on the extracted abnormal deformation texture, commonly used methods include statistical analysis, texture analysis, shape analysis, etc. The statistical analysis method can calculate the color histogram of the abnormal deformation texture, the statistical values of texture feature parameters, etc. The texture analysis method can use GLCM, LBP and other algorithms to extract the texture features of the abnormal deformation texture. The shape analysis method can calculate the area, perimeter, shape complexity and other features of the abnormal deformation area.
[0140] The present invention discretizes the complex model surface into small triangular or quadrilateral patches by cutting the three-dimensional food model into surface meshes, which is convenient for subsequent curvature calculation and analysis. The fineness of the surface mesh directly affects the accuracy of subsequent analysis. The surface curvature calculation is performed on each surface mesh to obtain the curvature data of the model surface. The curvature is a quantity that describes the degree of bending of the model surface and can reflect the concave-convex changes of the model surface. It is an important indicator for identifying abnormal deformation. The surface curvature calculation can help identify and analyze the deformation and defects of the food surface and provide important information for abnormal deformation identification. By analyzing the surface curvature data of the model, the area with abnormal curvature, such as sudden change of curvature, excessive curvature, etc., is identified. Large or small areas, which usually correspond to abnormal deformations such as cracks, dents, and deformations on the food surface; based on the identified abnormal deformation area of the model, the three-dimensional model surface mesh and texture information corresponding to the area are extracted to obtain the abnormal deformation texture, which is equivalent to separating the abnormal deformation area from the three-dimensional model for more detailed analysis. The abnormal deformation texture can help understand and analyze the causes and effects of food deformation; feature analysis is performed on the extracted abnormal deformation texture, such as analyzing the shape characteristics, direction characteristics, spatial distribution characteristics, etc. of the texture. These features can more comprehensively describe the deformation of the food and provide richer information for food quality assessment, defect detection, etc.
[0141] Preferably, step S3 comprises the following steps:
[0142] Step S31: acquiring an internal image of the food region based on the deformation region of the three-dimensional model to obtain an internal image of the deformation region;
[0143] Step S32: performing deformation edge texture feature analysis on the internal image of the deformation area to obtain deformation edge texture features;
[0144] Step S33: performing deformation edge analysis on the internal image of the deformation area based on the deformation edge texture feature to obtain deformation edge data;
[0145] Step S34: performing internal deformation three-dimensional modeling on the deformed edge data to obtain an internal deformation three-dimensional model;
[0146] Step S35: fitting the food three-dimensional model based on the internal deformation three-dimensional model to obtain the food deformation three-dimensional model.
[0147] As an embodiment of the present invention, refer to Figure 2 As shown, Figure 1 Detailed step flow diagram of step S3 in the embodiment, step S3 includes the following steps:
[0148] Step S31: acquiring an internal image of the food region based on the deformation region of the three-dimensional model to obtain an internal image of the deformation region;
[0149] In the embodiment of the present invention, an appropriate imaging technology is used to obtain an internal image of the located deformation area of the three-dimensional model. The specific method depends on the type of food and the type of deformation. For example, for fruits with cracks on the surface, a high-resolution camera can be used to capture images of the inside of the cracks; for cakes with cavities inside, X-ray or CT scanning technology can be used to obtain its tomographic image.
[0150] Step S32: performing deformation edge texture feature analysis on the internal image of the deformation area to obtain deformation edge texture features;
[0151] In an embodiment of the present invention, the texture features of the deformed edge are extracted by analyzing the acquired internal image of the deformed area. First, an edge detection algorithm, such as the Canny operator, is used to identify edge information in the image, and the texture features of the deformed edge, such as edge direction, gradient change, texture primitive distribution, etc., are extracted. A suitable texture analysis method, such as gray level co-occurrence matrix, local binary pattern, etc., can be selected to extract multi-scale and multi-directional texture information to fully describe the characteristics of the deformed edge.
[0152] Step S33: performing deformation edge analysis on the internal image of the deformation area based on the deformation edge texture feature to obtain deformation edge data;
[0153] In an embodiment of the present invention, by utilizing the extracted deformation edge texture features, a more refined deformation edge analysis is performed on the internal image of the deformation area. For example, the edge pixel points can be connected into continuous edge segments based on the edge direction information, and the length, curvature and other geometric features of each segment can be calculated. Alternatively, the edge segments can be grouped based on the similarity of the texture features, and the edge segments belonging to the same deformation structure can be classified together for subsequent three-dimensional modeling.
[0154] Step S34: performing internal deformation three-dimensional modeling on the deformed edge data to obtain an internal deformation three-dimensional model;
[0155] In an embodiment of the present invention, three-dimensional modeling of internal deformation is performed based on the deformation edge data obtained based on the analysis, such as the position, direction, length and other information of the edge segments. A three-dimensional reconstruction algorithm, such as Poisson surface reconstruction, Delaunay triangulation, etc., can be used to construct a three-dimensional model representing the internal structure of the deformation area based on the edge data. If a more sophisticated model is required, a more complex modeling method can be used, such as a modeling method based on spline curves or implicit surfaces.
[0156] Step S35: fitting the food three-dimensional model based on the internal deformation three-dimensional model to obtain the food deformation three-dimensional model.
[0157] In an embodiment of the present invention, a complete food deformation three-dimensional model containing internal deformation information is obtained by fitting the constructed internal deformation three-dimensional model with the original food three-dimensional model. During the fitting process, it is necessary to place the internal deformation model to the correct position according to the position information of the deformation area on the original model, and perform necessary scaling, rotation, deformation and other operations.
[0158] The present invention obtains the internal image information of the area based on the located deformation area. This can be achieved in many ways, such as cutting the deformation area, using X-ray or CT scanning technology, etc., to obtain internal image information that can more intuitively reflect the deformation inside the food and provide a data basis for subsequent internal deformation modeling; analyzing the internal image of the deformation area and extracting the texture features of the deformation edge. These features can reflect the shape, direction, texture change and other information of the deformation edge, providing a basis for subsequent deformation edge analysis. These features can provide important references for subsequent deformation edge analysis and internal deformation three-dimensional modeling; based on the extracted deformation edge texture features, the internal image of the deformation area is analyzed to identify and extract deformation edge data, such as the position, direction, and texture change of the edge. length, etc., which can accurately describe the geometric shape of the deformation edge; use the extracted deformation edge data to perform internal deformation 3D modeling, and construct a 3D model that can reflect the internal deformation of the food. This model can more intuitively display the cracks, voids, deformations, etc. inside the food. The internal deformation 3D model can intuitively present the impact of food deformation on the internal structure, and provide a basic model for subsequent fitting and analysis; fit the constructed internal deformation 3D model with the original food 3D model to obtain a complete food deformation 3D model containing internal deformation information. This model can more comprehensively and accurately reflect the deformation of the food, and provide a more reliable basis for food quality assessment and defect detection.
[0159] Preferably, step S32 includes the following steps:
[0160] Step S321: performing deformation edge detection on the internal image of the deformation area to obtain deformation edge image data;
[0161] In an embodiment of the present invention, an edge detection algorithm is used to process the internal image of the deformation area to identify and extract areas in the image where the brightness changes dramatically. These areas usually correspond to the deformation edges. Commonly used edge detection algorithms include the Sobel operator, the Canny operator, the Prewitt operator, etc. For example, the Canny operator can be used to perform a convolution operation on the image, and edge image data of a single pixel width can be obtained by calculating the image gradient amplitude and direction, and using non-maximum suppression and hysteresis threshold processing.
[0162] Step S322: extracting single pixels from the deformed edge image data to obtain edge single pixel data;
[0163] In an embodiment of the present invention, single-pixel extraction is performed on the deformed edge image data to refine the edge area into edge lines containing only a single pixel width. The specific operation is to traverse the edge image data, mark the pixel points with pixel values greater than zero as single edge pixel points, and record their coordinate positions. This can eliminate the influence of the edge area width on subsequent analysis and improve the accuracy of feature extraction.
[0164] Step S323: performing edge single pixel direction analysis on the edge single pixel data to obtain edge single pixel direction data;
[0165] In an embodiment of the present invention, by performing directional analysis on each single edge pixel, its direction on the edge line is determined. A commonly used method is to calculate the gradient direction of the pixel on the edge image. For example, the Sobel operator can be used to calculate the gradient values in the horizontal and vertical directions, and then the gradient direction angle is calculated according to the inverse tangent function. The range of the gradient direction angle is usually 0 to 360 degrees and can be represented by a floating point number.
[0166] Step S324: performing deformation edge segment clustering processing on the deformation edge image data based on the edge single pixel direction data and the edge single pixel data to obtain deformation edge segment data;
[0167] In an embodiment of the present invention, edge segment clustering processing is performed on the deformed edge image data based on the direction information and position information of the single edge pixel, and single pixel points with similar directions and adjacent positions are connected into continuous edge segments. Some clustering algorithms, such as the K-means algorithm, the DBSCAN algorithm, etc., can be used to cluster single pixel points with similar directions together. The clustering results can also be optimized according to the distance information between the pixel points, and the pixel points with a closer distance can be connected into edge segments.
[0168] Step S325: extracting texture features from the deformed edge segment data to obtain deformed edge texture features.
[0169] In an embodiment of the present invention, texture features are extracted for each deformed edge segment to describe its geometric shape and texture information. Commonly used texture features include edge segment length, curvature, direction change, gradient intensity change, etc. For example, the number of pixels contained in each edge segment can be calculated as its length feature; the change in the direction angle between adjacent pixels on the edge segment can be calculated as its curvature feature; the mean and variance of the gradient intensity values of the pixels on the edge segment can be statistically calculated as its gradient intensity change feature.
[0170] The present invention can help obtain the boundary information of the deformation area through deformation edge detection, and can identify the edge features caused by deformation by detecting changes in brightness, color, texture, etc. in the internal image. Deformation edge detection can provide basic data for subsequent edge analysis and processing, and can also help evaluate the degree and scope of deformation; single-pixel extraction aims to obtain key information of edge images. By extracting single-pixel data, the edge can be analyzed and processed in detail, including subsequent directional analysis and clustering processing. Single-pixel extraction can improve the recognition accuracy of edge features and reduce the influence of noise and interference, thereby improving the accuracy and efficiency of subsequent processing; edge direction analysis can describe the directional characteristics of edge pixels. By analyzing The direction of the brightness change of a single pixel can identify the direction information of the edge, including horizontal, vertical, oblique, etc. Edge direction analysis can provide an important reference for the subsequent edge segment clustering processing, and can also help understand the mechanism and characteristics of deformation; edge segment clustering processing can aggregate scattered edge single pixels into continuous edge segments. By analyzing and processing the single pixel direction data, single pixels with similar directions and positions can be aggregated together to form continuous edge segments. Edge segment clustering processing can improve the accuracy and efficiency of subsequent texture feature extraction, and can also help simplify the calculation and processing process; texture feature extraction is performed on each deformed edge segment, such as calculating the length, curvature, direction change, etc. of the edge segment. These features can effectively describe the geometric morphology and texture information of the deformed edge, and provide a more refined and accurate basis for subsequent deformation analysis, defect detection, etc.
[0171] Preferably, step S4 comprises the following steps:
[0172] Step S41: performing infrared spectrum imaging processing on the food to obtain an infrared spectrum imaging image of the food;
[0173] Step S42: acquiring a damage image of the food infrared spectrum imaging image based on the food deformation three-dimensional model to obtain a food damage infrared image;
[0174] Step S43: performing food non-destructive assessment on the food based on the food infrared spectrum imaging image and the food damage infrared image to obtain food non-destructive assessment data;
[0175] Step S44: marking the food as intact food based on the food integrity assessment data to obtain marked intact food.
[0176] As an embodiment of the present invention, refer to Figure 3 As shown, Figure 1 Detailed step flow diagram of step S4 in FIG. 1 , in this embodiment, step S4 includes the following steps:
[0177] Step S41: performing infrared spectrum imaging processing on the food to obtain an infrared spectrum imaging image of the food;
[0178] In an embodiment of the present invention, an infrared spectral imaging device is used to scan food to obtain its infrared spectral information at different wavelengths, and combine it into a three-dimensional data cube, i.e., an infrared spectral imaging image. Each pixel corresponds to the spectral information of a tiny area on the surface of the food, including the absorbance or reflectance value of the area at different wavelengths. In the process of acquiring the image, it is necessary to select a suitable wavelength range and resolution according to the type of food and the detection requirements.
[0179] Step S42: acquiring a damage image of the food infrared spectrum imaging image based on the food deformation three-dimensional model to obtain a food damage infrared image;
[0180] In an embodiment of the present invention, by utilizing a previously constructed three-dimensional model of food deformation, infrared spectral information corresponding to the deformation area is extracted from the infrared spectral imaging image to generate an infrared image of food damage. The three-dimensional model is projected onto the two-dimensional plane where the infrared spectral imaging image is located, the pixel coordinates corresponding to the deformation area in the image are obtained, and the spectral information of these pixel points is extracted to form a damaged infrared image that only contains the spectral information of the deformation area.
[0181] Step S43: performing food non-destructive assessment on the food based on the food infrared spectrum imaging image and the food damage infrared image to obtain food non-destructive assessment data;
[0182] In an embodiment of the present invention, by performing non-destructive assessment of food based on complete food infrared spectral imaging images and damage infrared images, a variety of data analysis methods, such as principal component analysis and partial least squares method, can be used to establish a relationship model between food quality indicators and spectral data. By comparing the spectral differences between the deformed area and other areas, and comparing with the established quality indicator model, the degree of influence of the deformation on the food quality can be determined, such as whether it causes ingredient deterioration or tissue damage.
[0183] Step S44: marking the food as intact food based on the food integrity assessment data to obtain marked intact food.
[0184] In an embodiment of the present invention, by non-destructively marking the food based on the food non-destructive assessment data, such as the predicted value of the quality index, the damage degree classification, etc., the food can be classified into different grades according to the degree of damage and distinguished by labels of different colors to facilitate subsequent classification processing.
[0185] The present invention can obtain information on the internal structure and components of food through infrared spectral imaging processing. By scanning and imaging food through infrared spectroscopy technology, the spectral characteristics of food in the infrared band can be obtained, reflecting the absorption and reflection of different components in food, providing basic data for subsequent damage image acquisition and non-destructive evaluation, and can also help identify foreign substances and pollutants in food; damage image acquisition is based on the assistance of food deformation three-dimensional model, by using the three-dimensional model to locate and identify the damage area, it is possible to obtain images of specific areas of food damage, including damage features such as cracks, depressions, discoloration, etc. The damage image can provide important visual information for food non-destructive evaluation, and can also help analyze the cause and mechanism of damage; combining the complete food infrared spectral imaging image and the damage infrared image, the food is non-destructively evaluated. By comparing and analyzing the spectral differences between the deformation area and other areas, the degree of influence of the deformation on the quality of the food can be determined, for example, whether the deformation causes the internal components of the food to deteriorate; non-destructive food marking is based on the results of food non-destructive evaluation. By marking the food that meets the standards, it can provide consumers with intuitive quality and safety information, and can also prevent the loss and deterioration of food during transportation and storage, thereby improving the safety of food.
[0186] Preferably, step S43 includes the following steps:
[0187] Step S431: performing damage spectrum analysis on the food damage infrared image to obtain damage spectrum data;
[0188] In an embodiment of the present invention, spectral characteristic information that can reflect changes in food quality is extracted by performing spectral analysis on the extracted infrared image of food damage. Common methods include characteristic band selection, spectral derivative processing, principal component analysis, etc. For example, bands with a high correlation with food indicators can be selected as characteristic bands, and spectral data of these bands can be extracted for analysis; principal component analysis can also be used to extract the main components of the spectral data, and use them as damage spectral data for subsequent analysis.
[0189] Step S432: performing image damage pixel grayscale threshold acquisition on the damage spectrum data based on the food infrared spectrum imaging image to obtain the image damage pixel grayscale threshold;
[0190] In an embodiment of the present invention, a grayscale threshold of image damage pixels is determined based on damage spectrum data to distinguish normal tissue from damaged tissue. A commonly used method is to select the average grayscale value of the damaged tissue in a specific characteristic band as the threshold. For example, a characteristic band that can effectively distinguish normal tissue from damaged tissue can be selected based on experience or literature, and then the grayscale values of all pixels in the damage infrared image in this band are calculated, and the average value is used as the grayscale threshold.
[0191] Step S433: dividing the damaged pixel grayscale intervals according to the damaged pixel grayscale thresholds of the image to obtain damaged pixel grayscale intervals;
[0192] In an embodiment of the present invention, the entire grayscale range is divided into multiple damaged pixel grayscale intervals, such as a mild damage interval, a moderate damage interval, and a severe damage interval, by taking a determined image damaged pixel grayscale threshold as the boundary. Each interval corresponds to a different degree of damage and quality change. The interval division can be performed based on experience, statistical analysis or machine learning methods. For example, an interval with a grayscale value lower than the threshold can be defined as a normal tissue interval, and an interval with a grayscale value higher than the threshold but lower than a certain upper limit can be defined as a mild damage interval, and so on.
[0193] Step S434: Perform food integrity assessment on the food based on the grayscale interval of the damaged pixels to obtain food integrity assessment data.
[0194] In an embodiment of the present invention, by determining the damaged pixel grayscale interval to which each pixel belongs based on its grayscale value, non-destructive assessment of food can be achieved. For example, the ratio of the number of pixels in each damaged pixel grayscale interval to the number of all pixels can be calculated, and these ratios can be used as indicators for non-destructive assessment of food. Alternatively, a comprehensive damage index of food can be calculated based on the weights of different damage intervals to more comprehensively evaluate the quality of food.
[0195] The present invention can obtain specific spectral features of food damage through damage spectrum analysis. By processing and analyzing the damaged infrared image, spectral peaks and bands related to damage can be identified, including moisture content, protein changes, fat oxidation, etc. Damage spectrum analysis can provide important reference information for non-destructive evaluation of food and help evaluate the quality and safety of food. Image damage pixel grayscale threshold acquisition is intended to distinguish normal pixels from damaged pixels. By analyzing the grayscale distribution of the damaged infrared image, the grayscale threshold of the damaged pixel can be obtained, that is, the grayscale value that can effectively distinguish the damage characteristics. Grayscale threshold acquisition can help the subsequent grayscale interval division and non-destructive evaluation of damaged pixels. Improve the accuracy and reliability of assessment; the grayscale interval division of damaged pixels can classify and divide damaged pixels in detail. By further processing the grayscale threshold of damaged pixels in the image, damaged pixels can be divided into different grayscale intervals, reflecting the degree and type of damage, including mild, moderate, severe, etc. The grayscale interval division can provide a fine reference standard for non-destructive assessment of food and improve the resolution and accuracy of assessment; according to the grayscale value of each pixel, the grayscale interval of the damaged pixel to which it belongs is determined, thereby realizing non-destructive assessment of food. For example, the degree of damage and quality grade of the entire food can be evaluated based on the proportion of the number of pixels falling in each damage interval.
[0196] Preferably, step S431 includes the following steps:
[0197] Step S4311: preprocessing the spectral data of the food damage infrared image to obtain preprocessed spectral data;
[0198] In the embodiment of the present invention, the spectral data corresponding to each pixel of the damaged infrared image is preprocessed to eliminate the interference of noise and irrelevant information, thereby improving the accuracy of spectral analysis. Common preprocessing methods include multivariate scatter correction and standard normal variable transformation. For example, the MSC method can be used to correct the scattering effect in the spectral data, or the SNV method can be used to eliminate the scattering effect caused by the change of optical path and particle size difference in the spectral data.
[0199] Step S4312: performing new absorption peak identification on the pre-processed spectrum data to obtain new absorption peak data;
[0200] In an embodiment of the present invention, by analyzing the preprocessed spectral data, a new absorption peak appearing in the damaged area is identified. The newly appearing absorption peak can be identified by comparing the spectral curves of the damaged area and the normal area, or by comparing with a standard spectral database. For example, the spectral difference between the damaged area and the normal area can be calculated, and the existence of the new absorption peak can be judged based on the peak shape, peak position and other information of the difference spectrum line.
[0201] Step S4313: performing absorption peak intensity enhancement analysis on the pre-processed spectrum data to obtain enhanced absorption peak data;
[0202] In an embodiment of the present invention, by analyzing the pre-processed spectral data, the phenomenon of enhanced absorption peak intensity in the damaged area is identified. By comparing the spectral curves of the damaged area and the normal area, the absorption peak whose peak intensity in the damaged area is significantly higher than that in the normal area can be found. For example, the spectral ratio of the damaged area and the normal area can be calculated, and the presence of enhanced absorption peak intensity can be judged based on information such as the peak shape, peak position, and peak intensity of the ratio spectrum line.
[0203] Step S4314: fitting the damage-sensitive absorption band characteristics of the new absorption peak data and the enhanced absorption peak data to obtain the damage-sensitive absorption band characteristics;
[0204] In an embodiment of the present invention, the identified new absorption peak data and enhanced absorption peak data are integrated and analyzed, and the absorption band characteristics sensitive to damage are fitted using statistical or machine learning methods. For example, partial least squares method, support vector machine and other methods can be used to establish a relationship model between the degree of damage and spectral data, and the absorption band range sensitive to damage is determined based on the variable importance or weight coefficient of the model.
[0205] Step S4315: Perform damage spectrum analysis on the damage infrared image based on the damage sensitive absorption band characteristics to obtain damage spectrum data.
[0206] In an embodiment of the present invention, damage spectral analysis is performed on the damaged infrared image based on the damage sensitive absorption band characteristics obtained by fitting, and the spectral information of these characteristic bands is extracted. For example, parameters such as the absorbance, reflectivity, peak area, etc. of these bands can be calculated and used as damage spectral data for subsequent food quality assessment.
[0207] The present invention can effectively remove noise and interference in the original spectral data through spectral data preprocessing, and can improve the quality and accuracy of spectral data through operations such as smoothing, filtering, and correction, which is conducive to the subsequent accurate identification and analysis of damage-related characteristic peaks and bands, and can also reduce errors and uncertainties in subsequent calculations and analysis processes; new absorption peak identification can obtain specific spectral features related to food damage, and by analyzing the preprocessed spectral data, new absorption peaks that appear after damage can be identified, and these absorption peaks are related to changes or products of certain components in food. The identification of new absorption peaks can provide an important reference for determining damage-sensitive absorption bands; the identified new absorption peak data and enhanced absorption peak data are integrated and analyzed to fit the absorption band characteristics that are sensitive to damage, and these characteristic bands can more sensitively reflect the degree of damage and quality changes of food; based on the damage-sensitive absorption band characteristics obtained by fitting, damage spectral analysis is performed on the damage infrared image to extract spectral information of these characteristic bands, such as absorbance, reflectivity, etc. The damage spectral analysis can provide an important reference basis for non-destructive evaluation of food, help evaluate the quality and safety of food, and also provide a basis for controlling and preventing food loss.
[0208] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. A method for constructing a food non-destructive detection model based on machine vision, characterized in that: The following steps are involved: Step S1: photographing and processing the food from multiple perspectives to obtain a multi-perspective image of the food; constructing a three-dimensional model of the food based on the multi-perspective image of the food to obtain a three-dimensional model of the food; Step S2: performing image texture recognition on the multi-view images of the food to obtain the image texture of the food; performing surface texture mapping on the three-dimensional model of the food based on the image texture of the food to obtain the surface texture of the three-dimensional model; performing surface deformation area positioning on the surface texture of the three-dimensional model based on the three-dimensional model of the food to obtain the deformation area of the three-dimensional model; Step S3: acquiring an internal image of the food region based on the deformation region of the three-dimensional model to obtain an internal image of the deformation region; performing internal deformation three-dimensional modeling on the internal image of the deformation region to obtain an internal deformation three-dimensional model; Fitting the food three-dimensional model based on the internal deformation three-dimensional model to obtain the food deformation three-dimensional model; Step S4: performing infrared spectral imaging processing on the food to obtain an infrared spectral imaging image of the food; performing non-destructive food marking on the infrared spectral imaging image of the food based on the three-dimensional deformation model of the food to obtain marked non-destructive food.
2. The method for constructing a food nondestructive detection model based on machine vision according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: performing multi-view image shooting processing on the food to obtain a multi-view image of the food; Step S12: Analyze the food image feature points on the food multi-view images to obtain the food image feature points; Step S13: performing feature point matching on the food multi-view images based on the feature points of the food images to obtain multi-angle image matching data; Step S14: performing three-dimensional point cloud data positioning on the multi-angle image matching data and the multi-view images of the food to obtain three-dimensional point cloud data of the food; Step S15: constructing a three-dimensional model of the food based on the three-dimensional point cloud data of the food to obtain a three-dimensional model of the food.
3. The method for constructing a food nondestructive detection model based on machine vision according to claim 2, characterized in that: Step S12 includes the following steps: Step S121: acquiring an image pixel point set from the food multi-view image to obtain an image pixel point set; Step S122: performing pixel brightness gradient analysis on the image pixel set to obtain image pixel gradient data; Step S123: constructing a pixel autocorrelation matrix for the image pixel point set based on the image pixel gradient data to obtain a pixel autocorrelation matrix; Step S124: Calculating pixel eigenvalues of the image pixel set based on the pixel autocorrelation matrix to obtain pixel eigenvalues; Step S125: identifying food image feature points of the image pixel set based on the pixel feature values to obtain food image feature points.
4. The method for constructing a food nondestructive detection model based on machine vision according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: performing image texture recognition on the food multi-view images to obtain food image texture; Step S22: performing surface texture mapping on the food three-dimensional model based on the food image texture to obtain the surface texture of the three-dimensional model; Step S23: constructing a texture coordinate system for the surface texture of the three-dimensional model to obtain a three-dimensional texture coordinate system; Step S24: performing food deformation texture feature analysis on the surface texture of the three-dimensional model based on the food three-dimensional model to obtain food deformation texture features; Step S25: locating the surface deformation area of the food deformation texture feature based on the three-dimensional texture coordinate system to obtain the three-dimensional model deformation area.
5. The method for constructing a food nondestructive detection model based on machine vision according to claim 4, characterized in that: Step S24 includes the following steps: Step S241: cutting the model surface mesh of the food three-dimensional model to obtain the food three-dimensional model surface mesh; Step S242: Calculating the model surface curvature of the food three-dimensional model surface mesh to obtain model surface curvature data; Step S243: performing abnormal deformation identification on the model surface curvature data to obtain the abnormal deformation area of the model; Step S244: acquiring abnormal deformation texture of the three-dimensional food model based on the abnormal deformation area of the model and the surface mesh of the three-dimensional food model to obtain the abnormal deformation texture; Step S245: performing food deformation texture feature analysis on the surface texture of the three-dimensional model based on the abnormal deformation texture to obtain food deformation texture features.
6. The method for constructing a food nondestructive detection model based on machine vision according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: acquiring an internal image of the food region based on the deformation region of the three-dimensional model to obtain an internal image of the deformation region; Step S32: performing deformation edge texture feature analysis on the internal image of the deformation area to obtain deformation edge texture features; Step S33: performing deformation edge analysis on the internal image of the deformation area based on the deformation edge texture feature to obtain deformation edge data; Step S34: performing internal deformation three-dimensional modeling on the deformed edge data to obtain an internal deformation three-dimensional model; Step S35: fitting the food three-dimensional model based on the internal deformation three-dimensional model to obtain the food deformation three-dimensional model.
7. The method for constructing a food nondestructive detection model based on machine vision according to claim 6, characterized in that: Step S32 includes the following steps: Step S321: performing deformation edge detection on the internal image of the deformation area to obtain deformation edge image data; Step S322: extracting single pixels from the deformed edge image data to obtain edge single pixel data; Step S323: performing edge single pixel direction analysis on the edge single pixel data to obtain edge single pixel direction data; Step S324: performing deformation edge segment clustering processing on the deformation edge image data based on the edge single pixel direction data and the edge single pixel data to obtain deformation edge segment data; Step S325: extracting texture features from the deformed edge segment data to obtain deformed edge texture features.
8. The method for constructing a food nondestructive detection model based on machine vision according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: performing infrared spectrum imaging processing on the food to obtain an infrared spectrum imaging image of the food; Step S42: acquiring a damage image of the food infrared spectrum imaging image based on the food deformation three-dimensional model to obtain a food damage infrared image; Step S43: performing food non-destructive assessment on the food based on the food infrared spectrum imaging image and the food damage infrared image to obtain food non-destructive assessment data; Step S44: marking the food as intact food based on the food integrity assessment data to obtain marked intact food.
9. The method for constructing a food nondestructive detection model based on machine vision according to claim 8, characterized in that: Step S43 includes the following steps: Step S431: performing damage spectrum analysis on the food damage infrared image to obtain damage spectrum data; Step S432: performing image damage pixel grayscale threshold acquisition on the damage spectrum data based on the food infrared spectrum imaging image to obtain the image damage pixel grayscale threshold; Step S433: dividing the damaged pixel grayscale intervals according to the damaged pixel grayscale thresholds of the image to obtain damaged pixel grayscale intervals; Step S434: Perform food integrity assessment on the food based on the grayscale interval of the damaged pixels to obtain food integrity assessment data.
10. The method for constructing a food non-destructive detection model based on machine vision according to claim 9, characterized in that: Step S431 includes the following steps: Step S4311: preprocessing the spectral data of the food damage infrared image to obtain preprocessed spectral data; Step S4312: performing new absorption peak identification on the pre-processed spectrum data to obtain new absorption peak data; Step S4313: performing absorption peak intensity enhancement analysis on the pre-processed spectrum data to obtain enhanced absorption peak data; Step S4314: fitting the damage-sensitive absorption band characteristics of the new absorption peak data and the enhanced absorption peak data to obtain the damage-sensitive absorption band characteristics; Step S4315: Perform damage spectrum analysis on the damage infrared image based on the damage sensitive absorption band characteristics to obtain damage spectrum data.
Citation Information
Cited By
Traditional Chinese medicine abnormal state recognition method, system and equipment and storage medium
CN119622603A
Material detection method based on fusion of laser radar and millimeter wave radar
CN120121139A
Magnetic stripe appearance defect automatic detection method and system based on image recognition
CN120471904A
Shaft part forging forming monitoring method and system
CN120656006A
A method and system for monitoring the forging of a shaft part
CN120656006B
