CN117952857B - Spectral image intelligent analysis method of natural food additive - Google Patents

Spectral image intelligent analysis method of natural food additive Download PDF

Info

Publication number
CN117952857B
CN117952857B CN202410331404.2A CN202410331404A CN117952857B CN 117952857 B CN117952857 B CN 117952857B CN 202410331404 A CN202410331404 A CN 202410331404A CN 117952857 B CN117952857 B CN 117952857B
Authority
CN
China
Prior art keywords
image
pixel point
gray
spectrum
noise
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410331404.2A
Other languages
Chinese (zh)
Other versions
CN117952857A (en
Inventor
舒青列
刘子豪
张琳涵
张胜
周悦
陈子生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hanzhong Shendeng Biotechnology Co ltd
Original Assignee
Hanzhong Shendeng Biotechnology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hanzhong Shendeng Biotechnology Co ltd filed Critical Hanzhong Shendeng Biotechnology Co ltd
Priority to CN202410331404.2A priority Critical patent/CN117952857B/en
Publication of CN117952857A publication Critical patent/CN117952857A/en
Application granted granted Critical
Publication of CN117952857B publication Critical patent/CN117952857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Image Processing (AREA)

Abstract

The invention relates to the technical field of multi-image analysis, in particular to an intelligent analysis method for spectral images of natural food additives. The method comprises the steps of filtering an image of each layer of an image pyramid of a spectrum gray level image to obtain a corresponding initial spectrum filtering image; acquiring noise degree of an initial spectrum filtering image, and acquiring merging weight of pixel points in the initial spectrum filtering image by combining the level of the image and surrounding gradient distribution of the pixel points; constructing a final spectrum filtering image according to the gray value and the merging weight of the corresponding pixel point in the initial spectrum filtering image of the image pyramid of the spectrum gray image; and analyzing the mixing degree of the natural food additive and the food raw material based on the position distribution of the additive pixel points in the final spectrum filtering image. According to the invention, the filtering results of the images with different scales of the spectral gray images are combined to obtain the final spectral filtering image, so that the image enhancement effect is improved, and the accuracy of analyzing the mixing degree of the additive and the food raw material is increased.

Description

Spectral image intelligent analysis method of natural food additive
Technical Field
The invention relates to the technical field of multi-image analysis, in particular to an intelligent analysis method for spectral images of natural food additives.
Background
In the food manufacturing process, food additives are required to be added into raw materials for stirring, so that the additives and the raw materials are ensured to be fully mixed; if the additive is unevenly stirred with the food raw materials, part of the additive of the product exceeds the standard, and the quality of the product is further disqualified. Therefore, it is extremely important to monitor the degree of mixing of food additives with food ingredients during food processing.
Acquiring a spectrum image of a mixture of a food additive and a food raw material, wherein noise possibly exists in an image acquisition process, sampling an original image by the prior method, continuing to filter the sampled image, sampling, constructing a filtered image pyramid of the original image, and superposing images in the filtered image pyramid to acquire an enhanced image; because the image blurring is caused in the sampling process and the blurring degree of the images of different layers of the image pyramid is different, the images in the image pyramid are directly overlapped, so that the image enhancement effect is poor, and further, the analysis of the spectrum image of the natural food additive is caused to generate errors.
Disclosure of Invention
In order to solve the technical problem that the analysis of spectral images of additives is error due to poor image enhancement effect caused by overlapping images with different fuzzy degrees of different layers of an image pyramid, the invention aims to provide an intelligent analysis method of spectral images of natural food additives, which adopts the following specific technical scheme:
the invention provides a spectral image intelligent analysis method of a natural food additive, which comprises the following steps:
Acquiring a spectrum gray level image of the food raw material mixture at each moment in the stirring time period;
Acquiring an image pyramid of each spectrum gray level image, and filtering an image of each layer of the image pyramid to obtain an initial spectrum filtering image of each layer of the image pyramid of each spectrum gray level image; selecting any one initial spectrum filtering image as an analysis image; acquiring suspected noise points in an analysis image, and acquiring noise degree of the analysis image according to the position distribution of the suspected noise points in a first preset neighborhood of each pixel point in the analysis image and the gray level distribution in the first preset neighborhood;
Combining the gray level difference of corresponding pixel points in the initial spectrum filtering image of each layer of the image pyramid of the spectrum gray level image and the adjacent next layer of the image pyramid, and the gradient value of the pixel point in the second preset neighborhood of each pixel point in the initial spectrum filtering image of each layer of the image pyramid with the noise degree to obtain the merging weight of each pixel point in the initial spectrum filtering image of each layer of the image pyramid of the spectrum gray level image;
obtaining a final spectrum filtering image of each spectrum gray image according to the gray values of corresponding pixel points in different initial spectrum filtering images of the image pyramid of each spectrum gray image and the merging weight;
Acquiring additive pixel points in each final spectrum filtering image; the degree of mixing of the natural food additive with the raw material is analyzed based on the location distribution of the additive pixels in each final spectrally filtered image.
Further, the method for obtaining the noise degree of the analysis image according to the position distribution of the suspected noise point in the first preset neighborhood of each pixel point in the analysis image and the gray level distribution in the first preset neighborhood comprises the following steps:
taking pixel points with gray values smaller than a preset value in the analysis image as suspected noise points;
Calculating the variance of Euclidean distance between every two suspected noise points in a first preset neighborhood of each pixel point in the analysis image, and taking the variance as the comprehensive dispersion of each pixel point in the analysis image;
Taking a connected domain formed by suspected noise points in a first preset neighborhood of each pixel point in the analysis image as a suspected noise region, taking the suspected noise region of each pixel point in the analysis image as a characteristic noise region of each pixel point in the analysis image, and counting the total number of the pixel points in the characteristic noise region as an area judgment index of each pixel point in the analysis image;
and combining the gray distribution in the first preset neighborhood of each pixel point in the analysis image, wherein the comprehensive dispersion and the area judgment index are combined to obtain the noise degree of the analysis image.
Further, the calculation formula of the noise degree of the analysis image is as follows:
; wherein Z is the noise level of the analysis image; a is the total number of pixel points in an analysis image; /(I) The area judgment index of the a pixel point in the image is analyzed; /(I)The average value of gray values of pixel points in the characteristic noise area of the a pixel point in the image is analyzed; /(I)To analyze the integrated dispersion of the a-th pixel point in the image; /(I)To analyze the gray value of the a-th pixel point in the image; norm is the normalization function; exp is an exponential function based on a natural constant e; /(I)Is a preset positive number.
Further, a calculation formula of the merging weight of each pixel point in the initial spectrum filtering image of each layer of the image pyramid of the spectrum gray level image is as follows:
,/> ; in the/> The merging weight of the g1 pixel point in a first image is the initial spectrum filtering image of the first layer of the image pyramid of the spectrum gray level image; /(I)The gray value of the g1 pixel point in the first image is obtained; /(I)The gray value of the corresponding matched pixel point of the g1 pixel point in the first image in the initial spectrum filtering image of the second layer of the image pyramid is obtained; /(I)Gradient values of the ith pixel point in the second preset neighborhood of the ith pixel point of the (g 1) th pixel point in the first image; i1 is the total number of pixel points in a second preset neighborhood of the g1 th pixel point in the first image; /(I)-The noise level for the first image; /(I)The merging weight of the g2 pixel point in the second image is the initial spectrum filtering image of the second layer of the image pyramid of the spectrum gray level image; /(I)The gray value of the g2 pixel point in the second image is obtained; /(I)The gray value of the corresponding matched pixel point in the initial spectrum filtering image of the third layer of the image pyramid for the g2 pixel point in the second image; /(I)-The noise level for the second image; /(I)The merging weight of the g3 th pixel point in a third image is the initial spectrum filtering image of the third layer of the image pyramid of the spectrum gray level image; /(I)Gradient values of the ith pixel point in the second preset neighborhood of the ith pixel point of the (g 3) th pixel point in the third image; /(I)The total number of the pixels in the second preset neighborhood of the g3 th pixel in the third image is the total number of the pixels; /(I)-The noise level for the third image; e is a natural constant; /(I)Is a preset positive number; /(I)As a function of absolute value; norms are normalization functions.
Further, the method for obtaining the final spectrum filtering image of each spectrum gray level image comprises the following steps:
Obtaining an improved gray value of each pixel point in each spectrum gray image according to the merging weight and gray values of the corresponding pixel points in different initial spectrum filter images of the image pyramid of each spectrum gray image;
And constructing a final spectrum filtering image corresponding to each spectrum gray-scale image by the improved gray-scale value of each pixel point in each spectrum gray-scale image.
Further, the calculation formula of the improved gray value of each pixel point in each spectral gray image is as follows:
; in the/> The improved gray value for the kth pixel in each spectral gray image; /(I)The merging weights of the corresponding matched pixel points in the initial spectrum filtering image of the u layer of the corresponding image pyramid for the kth pixel point in each spectrum gray level image; /(I)The gray value of a corresponding matched pixel point in an initial spectrum filtering image of a u layer of a corresponding image pyramid for a kth pixel point in each spectrum gray image; u is the total number of layers of the image pyramid for each spectral gray-scale image.
Further, the method for analyzing the mixing degree of the natural food additive and the raw materials based on the position distribution of the additive pixel points in each final spectrum filtering image comprises the following steps:
For each final spectrum filtering image, calculating the variance of Euclidean distance between every two additive pixel points in the final spectrum filtering image, and obtaining the distance judgment value of the final spectrum filtering image; taking a connected domain formed by additive pixel points in the final spectrum filtering image as an additive region, and counting the number of the additive regions as a number judgment value of the final spectrum filtering image;
Obtaining the mixing degree of the final spectrum filtering image according to the distance judging value and the quantity judging value of the final spectrum filtering image; the distance judgment value and the quantity judgment value are in positive correlation with the mixing degree;
When the mixing degree is larger than a preset mixing threshold, the mixing degree of the food raw materials and the natural food additives at the corresponding moment of the final spectral filter image corresponding to the mixing degree meets the requirement; and when the mixing degree is smaller than or equal to a preset mixing threshold value, the mixing degree of the food raw materials and the natural food additives at the corresponding moment of the final spectral filter image corresponding to the mixing degree does not meet the requirement.
Further, the method for acquiring the image pyramid of each spectrum gray level image is a Gaussian image pyramid algorithm.
Further, the total layer number of the image pyramid of each spectrum gray level image is 3.
Further, the preset mixing threshold is 0.8.
The invention has the following beneficial effects:
In the embodiment of the invention, the image of each layer of the image pyramid of the spectrum gray level image is filtered to obtain a corresponding initial spectrum filtering image, and the loss of details in the image under the condition of single filtering is reduced through multi-scale filtering; noise is generally in discrete distribution, noise points in a spectrum image are expressed as low gray values, the position distribution and the surrounding gray distribution of suspected noise points around a pixel point reflect the possibility that the pixel point belongs to noise sequentially from the discrete characteristic and the gray characteristic of the noise, and the two factors are combined and analyzed, so that the accuracy of noise degree in the analysis image is higher; considering that details in an image can be blurred in a sampling process, the gray structure of an initial spectrum filtering image at the top layer of an image pyramid is most complete, and details in an initial spectrum filtering image at the bottom layer are the sharpest, so that characteristic information of images at different layers is different; the method comprises the steps that each layer of an image pyramid of a spectrum gray level image presents gray level differences of corresponding pixel points in an initial spectrum filtering image of the next layer adjacent to the image pyramid, the contribution degree of the pixel points of the lower layer to the pixel points of the upper layer is presented, gradient values reflect whether the pixel points are in a detail area or not, and meanwhile, combining noise degrees according to characteristic information of the corresponding image, combining weights of the pixel points in the initial spectrum filtering image of each layer of the pyramid are adaptively determined; the gray values are weighted and fused by utilizing the merging weights of corresponding pixel points in different initial spectrum filtering images of an image pyramid of the spectrum gray image, so that the multi-scale initial spectrum filtering images are merged, the image enhancement effect is improved, and the detail information and the integral structure information of the image in the acquired final spectrum filtering image are better saved; further improving the accuracy of the analysis of the mixing degree of the natural food additive and the raw materials.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for intelligent analysis of spectral images of a natural food additive according to an embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following is a detailed description of a specific implementation, structure, characteristics and effects of a spectral image intelligent analysis method of a natural food additive according to the invention with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the spectral image intelligent analysis method of the natural food additive provided by the invention with reference to the accompanying drawings.
Referring to fig. 1, a method flowchart of a spectral image intelligent analysis method of a natural food additive according to an embodiment of the invention is shown, where the method includes:
Step S1: a spectral gray scale image of the food ingredient mixture at each time during the agitation period is acquired.
Specifically, food raw materials and natural food additives which need to be heated in the stirring and manufacturing process are placed into stirring equipment to be stirred, a hyperspectral camera is used for collecting hyperspectral images of food raw material mixtures at each moment in a stirring time period from the start of stirring to the completion of stirring and mixing, and gray-scale treatment is carried out on the hyperspectral images to obtain spectral gray-scale images at each moment in the stirring time period. Noise may exist in the image acquisition process, and noise in the image needs to be removed to improve the image enhancement effect.
In the embodiment of the present invention, the sampling interval of the hyperspectral image in the stirring period is set to be once every ten seconds; and carrying out graying treatment on the hyperspectral image by using a weighted average method. In other embodiments of the present invention, the method for graying the hyperspectral image may be an average method, and the like, which is not limited herein. The weighted average method and the average method are known to those skilled in the art, and are not described herein.
Step S2: acquiring an image pyramid of each spectrum gray level image, and filtering an image of each layer of the image pyramid to obtain an initial spectrum filtering image of each layer of the image pyramid of each spectrum gray level image; selecting any one initial spectrum filtering image as an analysis image; and acquiring suspected noise points in the analysis image, and acquiring the noise degree of the analysis image according to the position distribution of the suspected noise points in the first preset neighborhood of each pixel point in the analysis image and the gray level distribution in the first preset neighborhood.
The existing filtering algorithm is generally utilized to enhance the spectrum gray level image, and the enhanced spectrum gray level image is directly utilized to analyze, so that inaccurate analysis results are easily caused. According to the embodiment of the invention, the images with different scales of the spectrum gray level image are obtained, the images with different scales are subjected to filtering treatment, and the filtered images with different scales are combined to obtain the final filtered image, so that the purpose of improving the enhancement effect of the spectrum gray level image is realized.
In the embodiment of the invention, for each spectrum gray image, an image pyramid algorithm is selected to carry out downsampling on the spectrum gray image, the downsampling proportion is set to be 2, the downsampling times are set to be 2, and a three-layer image pyramid is constructed; the spectral gray level image is the first layer image of the corresponding image pyramid and is positioned at the bottommost layer of the image pyramid. The method comprises the steps of performing filtering processing on images of each layer of an image pyramid of a spectrum gray level image to obtain initial spectrum filtering images, and taking the initial spectrum filtering images corresponding to the images of each layer of the image pyramid of the spectrum gray level image as the initial spectrum filtering images of each layer of the image pyramid of the spectrum gray level image.
In the embodiment of the invention, the Gaussian image pyramid algorithm is selected to downsample the light gray image, and the downsampling ratio implementer can set the downsampling ratio according to specific conditions; and filtering by using an average filtering algorithm. In other embodiments of the present invention, the laplacian pyramid algorithm may be used to downsample the gray-scale image, and the gaussian filter algorithm is selected for filtering, which is not limited herein. In this embodiment, the image pyramid of the spectral gray scale image is a gaussian pyramid.
The gaussian image pyramid algorithm and the mean filtering algorithm are well known to those skilled in the art, and are not described herein.
For ease of description, for each spectral gray image, an initial spectral filtered image of any one layer of the image pyramid of the spectral gray image is selected as the analysis image.
Spectral images are generated by recording light energy reflected, absorbed or emitted by an object at different wavelengths or frequencies, and in general, the object in the image reflects light rays, so that colors of different wavebands appear in the image, but light reflection of noise in the image and the like cannot be identified. Therefore, noise in the spectral image is expressed as a low gray value, and pixel points with gray values smaller than a preset value in the analysis image are used as suspected noise points; in the embodiment of the invention, the preset value takes the checked value 50, and the practitioner can set the value according to the specific situation.
Noise is generally in discrete distribution, noise points in a spectrum image are in low gray values, the position distribution and the surrounding gray distribution of suspected noise points around a pixel point reflect the possibility that the pixel point belongs to noise in sequence from the discrete characteristic and the gray characteristic of the noise, and the two factors are combined and analyzed, so that the accuracy of noise degree in the analysis image is higher.
Preferably, the specific acquisition method for analyzing the noise level of the image is as follows: calculating the variance of Euclidean distance between every two suspected noise points in a first preset neighborhood of each pixel point in the analysis image, and taking the variance as the comprehensive dispersion of each pixel point in the analysis image; taking a connected domain formed by suspected noise points in a first preset neighborhood of each pixel point in the analysis image as a suspected noise region, taking the suspected noise region of each pixel point in the analysis image as a characteristic noise region of each pixel point in the analysis image, and counting the total number of the pixel points in the characteristic noise region as an area judgment index of each pixel point in the analysis image; and combining gray distribution in a first preset neighborhood of each pixel point in the analysis image, and synthesizing the dispersion and the area judgment index to obtain the noise degree of the analysis image.
As an example, if there are four suspected noise points in the first preset neighborhood of the pixel point D in the analysis imageLet/>And/>The Euclidean distance between is/>,/>And/>The Euclidean distance between is/>And/>The Euclidean distance between is/>,/>And/>The Euclidean distance between is/>,/>And/>The Euclidean distance between is/>,/>And/>The Euclidean distance between is/>Calculation/>The variance between the two is used as the comprehensive dispersion of the pixel points D in the analysis image. Because the noise in the image is in discrete distribution degree, the probability that the pixel point is in the noise area can be measured through the comprehensive dispersion degree.
It should be noted that when the a-th pixel point in the analysis image is not a suspected noise point, the a-th pixel point has no corresponding characteristic noise area, and further has no corresponding area judgment index, and the area judgment value of the a-th pixel point is set to be 0 in the embodiment of the invention; when the a-th pixel point in the analysis image is a suspected noise point, but the surrounding of the analysis image is not a suspected noise point, namely the characteristic noise area of the a-th pixel point is the self, the area judgment value of the a-th pixel point is 1. In this embodiment, the size of the first preset neighborhood isThe implementer can set up by himself according to the specific circumstances.
The calculation formula of the noise level of the analysis image is as follows:
wherein Z is the noise level of the analysis image; a is the total number of pixel points in an analysis image; An area judgment index for analyzing an a-th pixel point in the image; /(I) The method comprises the steps of analyzing the average value of gray values of pixel points in a characteristic noise area of an a-th pixel point in an image; /(I)To analyze the integrated dispersion of the a-th pixel point in the image; /(I)To analyze the gray value of the a-th pixel point in the image; norm is the normalization function; exp is an exponential function based on a natural constant e; /(I)The empirical value of 0.1 is taken for the preset positive number, and the function is to prevent the molecules from being zero to cause meaningless division.
Reflecting the possibility that the a-th pixel point in the analysis image is noise, and measuring the noise degree of the whole image by analyzing the possibility that all the pixel points in the image are noise points. Noise in the image is small and is in discrete distribution, noise points in the spectrum image are represented as low gray values, and therefore, the noise is characterized by: the noise area is smaller, the gray value is lower and the gray value is distributed in a discrete mode. When/>And when the pixel is larger, the distribution of suspected noise points in the first preset neighborhood of the a pixel in the analysis image is more discrete, which indicates that the higher the possibility that noise exists in the first preset neighborhood of the a pixel, the higher the possibility that the a pixel is noise. When/>The smaller the area of the characteristic noise region of the a pixel point is smaller and the gray value is lower, which means that the greater the possibility that the characteristic region of the a pixel point is a noise region, the greater the possibility that the a pixel point belongs to noise; when/>The smaller the time, the greater the likelihood that the a-th pixel point in the analysis image is a noise point. If the pixel point has higher possibility of belonging to noise, namely/>The larger the noise degree Z, the greater the noise degree the analysis image presents when the likelihood that all pixel points in the analysis image are noise points is greater.
Step S3: and combining the gray level difference of corresponding pixels in the initial spectrum filtering image of each layer of the image pyramid of the spectrum gray level image and the adjacent initial spectrum filtering image of the next layer of the image pyramid with the gradient value and the noise degree of the pixels in the second preset neighborhood of each pixel in the initial spectrum filtering image of each layer of the image pyramid to obtain the merging weight of each pixel in the initial spectrum filtering image of each layer of the image pyramid of the spectrum gray level image.
Specifically, the embodiment of the invention needs to combine the filtering results of different scales of each spectrum gray level image, namely different initial spectrum filtering images of the image pyramid. Because the noise in the image is more obvious in the down-sampling process, the feature information of the images in different layers of the image pyramid is different, and further the merging degree of the pixel points in different layers is different.
One pixel point of the top layer of the image pyramid corresponds to a plurality of pixel points in the initial spectrum filtering image of the adjacent lower layer of the top layer, so that when noise reduction results of images with different scales are combined, the contribution degree of the lower layer pixel point to the upper layer pixel point is different, and the combination weight of the lower layer pixel point is influenced.
Considering that details in an image can be blurred in the downsampling process, the blurring degree of the image at the bottommost layer of the image pyramid is the lowest, and the influence of the image at the topmost layer on the overall structure of the image after noise reduction treatment is the smallest, so that the gray structure of the initial spectrum filtering image at the topmost layer of the image pyramid is the most complete, and the details in the initial spectrum filtering image at the bottommost layer are the sharpest. In order to improve the noise reduction effect on the spectral gray image, the following rules are set in the embodiment of the invention:
For an initial spectrum filtering image of a first layer of the image pyramid, setting the merging weight of pixel points in a detail area to be larger as details in an image of the bottommost layer of the image pyramid are the sharpest; for an initial spectrum filtering image of a third layer of the image pyramid, as the degree of blurring is maximum in an image of the topmost layer of the image pyramid and the overall structure of the image is complete, the smaller the merging weight of the pixel points in a detail area is set, and the larger the merging weight of the pixel points in a non-detail area, namely an image structure area is set; for an initial spectrum filtering image of a second layer of the image pyramid, detail information and structure information in the image are relatively existed, and analysis of relevant factors is not carried out when two factors are considered to be of little significance.
And each layer of the image pyramid of the spectrum gray level image presents gray level difference of corresponding pixel points in an initial spectrum filtering image of the next layer adjacent to the image pyramid, the contribution degree of the pixel points of the lower layer to the pixel points of the upper layer is presented, the gradient value reflects whether the pixel points are in a detail area or not, and meanwhile, the noise degree of the image is combined, so that the merging weight of the pixel points in the initial spectrum filtering image of each layer of the pyramid is obtained.
The calculation formula of the merging weight of each pixel point in the initial spectrum filtering image of each layer of the image pyramid of the spectrum gray level image is as follows:
In the method, in the process of the invention, The method comprises the steps that the merging weight of a g1 pixel point in a first image is given, and the first image is an initial spectrum filtering image of a first layer of an image pyramid of a spectrum gray level image; /(I)The gray value of the g1 pixel point in the first image; The gray value of the corresponding matched pixel point in the initial spectrum filtering image of the g1 pixel point in the second layer of the image pyramid in the first image; /(I) Gradient values of the ith pixel point in the second preset neighborhood of the ith pixel point g1 in the first image; i1 is the total number of pixel points in a second preset neighborhood of the g1 th pixel point in the first image; /(I)Noise level for the first image; /(I)The merging weight of the g2 pixel point in the second image is the initial spectrum filtering image of the second layer of the image pyramid of the spectrum gray level image; /(I)The gray value of the g2 pixel point in the second image; /(I)The gray value of the corresponding matched pixel point in the initial spectrum filtering image of the third layer of the image pyramid for the g2 pixel point in the second image; /(I)Noise level for the second image; /(I)The combining weight of the g3 th pixel point in a third image is the initial spectrum filtering image of the third layer of the image pyramid of the spectrum gray level image; /(I)Gradient values of the ith 3 pixel points in the second preset neighborhood of the ith 3 pixel points in the third image; /(I)The total number of the pixels in the second preset neighborhood of the g3 th pixel in the third image is the total number of the pixels; /(I)Noise level of the third image; e is a natural constant; /(I)Taking an empirical value of 0.1 for a preset positive number, and preventing the molecules from being zero to cause meaningless division; /(I)As a function of absolute value; norms are normalization functions.
When (when)When the gray value of the g1 pixel point in the image of the first layer of the image pyramid of the spectrum gray image is smaller, the approximation degree between the gray values corresponding to the gray values after downsampling is larger, the change degree of the g1 pixel point in the initial spectrum filtering image of the first layer and the corresponding pixel point in the initial spectrum filtering image of the second layer is smaller, the contribution to the gray value of the pixel point in the final filtering image is larger, and the/>The larger. When/>When the pixel is larger, the probability that the g1 pixel is positioned in a detail area in the initial spectrum filtering image of the first layer is higher, and in order to ensure the detail of the filtering result to be clear, the contribution of the pixel to the final filtering result is larger, the pixel is/>The larger. /(I)When the noise of the initial spectrum filtering image of the first layer is larger, the contribution of the pixel points in the image to the final filtering result is smaller in order to avoid the noise affecting the filtering result, the noise is greater, and the noise is greaterThe smaller.
When (when)When the gray value of the g2 pixel point in the image of the second layer of the image pyramid of the spectrum gray image is smaller, the approximation degree between the gray values corresponding to the gray values after downsampling is larger, the change degree of the g2 pixel point in the initial spectrum filtering image of the second layer and the corresponding pixel point in the initial spectrum filtering image of the third layer is smaller, the contribution to the gray value of the pixel point in the final filtering image is larger, and the/>The larger. /(I)When the noise of the initial spectrum filtering image of the second layer is larger, the contribution of the pixel points in the image to the final filtering result is smaller in order to avoid the noise affecting the filtering result, the noise is greater, and the noise is greaterThe smaller.
When (when)The smaller the g3 pixel point is, the smaller the possibility that the pixel point is in the detail area in the initial spectrum filtering image of the third layer is, the larger the possibility that the pixel point is in the whole structure area of the image is, and in order to ensure the filtering image structure to be clear, the greater the contribution of the pixel point to the final filtering result is, the greater the/>The larger. Since lower scales are typically used to capture the overall structure and background information in the image, the noise suppression effect is relatively small, then/>When the noise of the initial spectrum filtering image of the third layer is larger, the contribution of the pixel point in the image to the final filtering result is smaller in order to avoid noise influenceThe smaller.
It should be noted that, the content that all pixel points in the image of each layer of the image pyramid can find the corresponding matched pixel point in the image of the adjacent layer is a known technology, and will not be described in detail here; in the embodiment of the invention, the second preset neighborhood is eight neighbors; the implementer can set up by himself according to the specific circumstances.
Step S4: and obtaining a final spectrum filtering image of each spectrum gray image according to the gray values and the merging weights of corresponding pixel points in different initial spectrum filtering images of the image pyramid of each spectrum gray image.
And weighting the gray value by utilizing the merging weight of the pixel points according to the corresponding relation of the pixel points among different initial spectrum filtering images in the image pyramid of the spectrum gray image to obtain a final enhancement result of the spectrum gray image, namely a final spectrum filtering image.
Preferably, the specific acquisition method for improving the gray value is as follows: and obtaining an improved gray value of each pixel point in each spectrum gray image according to the merging weight and gray values of the corresponding pixel points in different initial spectrum filtering images of the image pyramid of each spectrum gray image. The calculation formula for the improved gray value is as follows:
In the method, in the process of the invention, An improved gray value for the kth pixel in each spectral gray image; /(I)Combining weights of corresponding matched pixel points in the initial spectrum filtering image of the u layer of the corresponding image pyramid for the kth pixel point in each spectrum gray level image; /(I)The gray value of a corresponding matched pixel point in an initial spectrum filtering image of a u layer of a corresponding image pyramid for a kth pixel point in each spectrum gray image; u is the total layer number of the image pyramid of each spectrum gray level image, and an empirical value of 3 is taken in the embodiment of the invention.
When the following is performedWhen the gray value of the kth pixel point in the spectrum gray image is larger, the gray value weighted by the corresponding pixel point in the initial filter image of the ith layer of the image pyramid is larger, the contribution degree of the kth pixel point to the improved gray value is larger, and the/>The larger.
Constructing a final spectrum filtering image corresponding to each spectrum gray level image according to the improved gray level value of each pixel point in each spectrum gray level image; the final spectrum filtering image better saves detailed information and integral structure in the spectrum gray image, and has better enhancement effect.
Step S5: acquiring additive pixel points in each final spectrum filtering image; and analyzing the mixing degree of the natural food additive and the raw materials based on the position distribution of the additive pixel points in each final spectrum filtering image.
Because the refraction and absorption of light are different from different natural food additives, after the hyperspectral images at each moment in the stirring time period are obtained in the step S1, the additive pixel points in each hyperspectral image are obtained by utilizing a spectral imaging technology. And taking the additive pixel point in the hyperspectral image corresponding to each spectral gray image as the additive pixel point in the final spectral filter image of each spectral gray image in the corresponding pixel point in the final spectral filter image of the spectral gray image.
It should be noted that, in the embodiment of the present invention, the additive pixel points in the hyperspectral image are obtained by using a spectrum matching method, and in other embodiments of the present invention, an algorithm for classifying the spectra may be used, for example, support vector machines, neural networks, and the like, to obtain the additive pixel points. The spectrum matching method is a well-known technique and will not be described herein. Because the final spectrum filtering image is an image obtained by a series of enhancement processing of the hyperspectral image, pixel points in the two images are in one-to-one correspondence.
For each final spectrum filtering image, calculating the variance of Euclidean distance between every two additive pixel points in the final spectrum filtering image, and obtaining the distance judgment value of the final spectrum filtering image; taking a connected domain formed by additive pixel points in the final spectrum filtering image as an additive region, and counting the number of the additive regions as a number judgment value of the final spectrum filtering image; obtaining the mixing degree of the final spectrum filtering image according to the distance judgment value and the quantity judgment value of the final spectrum filtering image; the distance judgment value and the quantity judgment value are in positive correlation with the mixing degree.
It should be noted that, the method for calculating the distance judgment value of the final spectrum filtering image is similar to the method for analyzing the comprehensive dispersion of each pixel point in the image in step S2, and the difference is that: the comprehensive dispersion of each pixel point in the analysis image is calculated based on Euclidean distance between every two suspected noise points in a first preset neighborhood of each pixel point in the analysis image; and the distance judgment value of the final spectrum filtering image is calculated by the Euclidean distance between every two additive pixel points in the final spectrum filtering image.
The calculation formula of the mixing degree of each final spectrum filtering image is specifically exemplified as follows:
Wherein, C is the mixing degree of each final spectrum filtering image; SP is the number judgment value of each final spectrum filtering image; a distance judgment value for each final spectrum filtering image; norms are normalization functions.
The natural food additive is mixed with food raw materials to a poor degree, so that the natural food additive appears in a massive regional shape; because the total amount of the additives is a fixed value, the worse the mixing degree is, the fewer the number of the additive areas, and the better the mixing degree is, the more the number of the additive areas is; thus, the more discrete the distribution of additive pixels and the more additive areas, the better the natural food additive is mixed with the food material. When the distance is determinedThe larger the number judgment value SP, the more discrete the distribution of the additive pixels and the more the additive regions, the better the mixing degree of the natural food additive and the food raw material, and the larger the mixing degree C.
When the mixing degree is larger than a preset mixing threshold, the mixing degree of the food raw materials and the natural food additives at the corresponding moment of the final spectral filtering image corresponding to the mixing degree meets the requirement; when the mixing degree is smaller than or equal to the preset mixing threshold value, the mixing degree of the food raw materials and the natural food additives at the corresponding time of the final spectral filter image corresponding to the mixing degree does not meet the requirement. Under the condition that the mixing degree does not meet the requirement, the change of the environmental temperature in the food processing process can be analyzed, namely, the relationship between insufficient stirring and temperature change is judged, if the temperature heating is uneven in the stirring process, the current stirring effect is considered to have a certain relationship with the temperature, the temperature is controlled, and the original stirring speed is kept to continue stirring; if the temperature change is not uniform during the stirring, it is considered that the stirring is caused by other factors, and other factors are examined.
It should be noted that, in the embodiment of the present invention, the preset mixing threshold takes an empirical value of 0.8, and the practitioner can set the mixing threshold according to the specific situation.
The present invention has been completed.
In summary, in the embodiment of the present invention, the image of each layer of the image pyramid of the spectrum gray level image is filtered to obtain the corresponding initial spectrum filtered image; acquiring noise degree of an initial spectrum filtering image, and acquiring merging weight of pixel points in the initial spectrum filtering image by combining the level of the image and gradient distribution of surrounding pixels of the pixel points; forming a final spectrum filtering image according to the gray value and the merging weight of the corresponding pixel point in the initial spectrum filtering image of the image pyramid of the spectrum gray image; and analyzing the mixing degree of the natural food additive and the food raw material based on the position distribution of the additive pixel points in the final spectrum filtering image. According to the invention, the filtering results of the images with different scales of the spectral gray images are combined to obtain the final spectral filtering image, so that the enhancement effect is improved, and the accuracy of analyzing the mixing degree of the additive and the food raw material is increased.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.

Claims (6)

1. The spectral image intelligent analysis method of the natural food additive is characterized by comprising the following steps of:
Acquiring a spectrum gray level image of the food raw material mixture at each moment in the stirring time period;
Acquiring an image pyramid of each spectrum gray level image, and filtering an image of each layer of the image pyramid to obtain an initial spectrum filtering image of each layer of the image pyramid of each spectrum gray level image; selecting any one initial spectrum filtering image as an analysis image; acquiring suspected noise points in an analysis image, and acquiring noise degree of the analysis image according to the position distribution of the suspected noise points in a first preset neighborhood of each pixel point in the analysis image and the gray level distribution in the first preset neighborhood;
Combining the gray level difference of corresponding pixel points in the initial spectrum filtering image of each layer of the image pyramid of the spectrum gray level image and the adjacent next layer of the image pyramid, and the gradient value of the pixel point in the second preset neighborhood of each pixel point in the initial spectrum filtering image of each layer of the image pyramid with the noise degree to obtain the merging weight of each pixel point in the initial spectrum filtering image of each layer of the image pyramid of the spectrum gray level image;
obtaining a final spectrum filtering image of each spectrum gray image according to the gray values of corresponding pixel points in different initial spectrum filtering images of the image pyramid of each spectrum gray image and the merging weight;
Acquiring additive pixel points in each final spectrum filtering image; analyzing the mixing degree of the natural food additive and the raw materials based on the position distribution of the additive pixel points in each final spectrum filtering image;
The method for obtaining the noise degree of the analysis image according to the position distribution of the suspected noise point in the first preset neighborhood of each pixel point in the analysis image and the gray level distribution in the first preset neighborhood comprises the following steps:
taking pixel points with gray values smaller than a preset value in the analysis image as suspected noise points;
Calculating the variance of Euclidean distance between every two suspected noise points in a first preset neighborhood of each pixel point in the analysis image, and taking the variance as the comprehensive dispersion of each pixel point in the analysis image;
Taking a connected domain formed by suspected noise points in a first preset neighborhood of each pixel point in the analysis image as a suspected noise region, taking the suspected noise region of each pixel point in the analysis image as a characteristic noise region of each pixel point in the analysis image, and counting the total number of the pixel points in the characteristic noise region as an area judgment index of each pixel point in the analysis image;
Combining the gray distribution in the first preset neighborhood of each pixel point in the analysis image, wherein the comprehensive dispersion and the area judgment index are combined to obtain the noise degree of the analysis image;
the noise degree of the analysis image is calculated as follows:
; wherein Z is the noise level of the analysis image; a is the total number of pixel points in an analysis image; /(I) The area judgment index of the a pixel point in the image is analyzed; /(I)The average value of gray values of pixel points in the characteristic noise area of the a pixel point in the image is analyzed; /(I)To analyze the integrated dispersion of the a-th pixel point in the image; /(I)To analyze the gray value of the a-th pixel point in the image; norm is the normalization function; exp is an exponential function based on a natural constant e; /(I)Is a preset positive number;
The calculation formula of the merging weight of each pixel point in the initial spectrum filtering image of each layer of the image pyramid of the spectrum gray level image is as follows:
,/> ; in the/> The merging weight of the g1 pixel point in a first image is the initial spectrum filtering image of the first layer of the image pyramid of the spectrum gray level image; /(I)The gray value of the g1 pixel point in the first image is obtained; /(I)The gray value of the corresponding matched pixel point of the g1 pixel point in the first image in the initial spectrum filtering image of the second layer of the image pyramid is obtained; /(I)Gradient values of the ith pixel point in the second preset neighborhood of the ith pixel point of the (g 1) th pixel point in the first image; i1 is the total number of pixel points in a second preset neighborhood of the g1 th pixel point in the first image; /(I)-The noise level for the first image; /(I)The merging weight of the g2 pixel point in the second image is the initial spectrum filtering image of the second layer of the image pyramid of the spectrum gray level image; /(I)The gray value of the g2 pixel point in the second image is obtained; /(I)The gray value of the corresponding matched pixel point in the initial spectrum filtering image of the third layer of the image pyramid for the g2 pixel point in the second image; /(I)-The noise level for the second image; /(I)The merging weight of the g3 th pixel point in a third image is the initial spectrum filtering image of the third layer of the image pyramid of the spectrum gray level image; /(I)Gradient values of the ith pixel point in the second preset neighborhood of the ith pixel point of the (g 3) th pixel point in the third image; /(I)The total number of the pixels in the second preset neighborhood of the g3 th pixel in the third image is the total number of the pixels; /(I)-The noise level for the third image; e is a natural constant; /(I)Is a preset positive number; /(I)As a function of absolute value; norms are normalization functions.
2. The method for intelligent analysis of spectral images of natural food additives according to claim 1, wherein the method for obtaining final spectral filter images of each spectral gray-scale image comprises the steps of:
Obtaining an improved gray value of each pixel point in each spectrum gray image according to the merging weight and gray values of the corresponding pixel points in different initial spectrum filter images of the image pyramid of each spectrum gray image;
constructing a final spectrum filtering image corresponding to each spectrum gray level image according to the improved gray level value of each pixel point in each spectrum gray level image;
the calculation formula of the improved gray value of each pixel point in each spectrum gray image is as follows:
; in the/> The improved gray value for the kth pixel in each spectral gray image; /(I)The merging weights of the corresponding matched pixel points in the initial spectrum filtering image of the u layer of the corresponding image pyramid for the kth pixel point in each spectrum gray level image; /(I)The gray value of a corresponding matched pixel point in an initial spectrum filtering image of a u layer of a corresponding image pyramid for a kth pixel point in each spectrum gray image; u is the total number of layers of the image pyramid for each spectral gray-scale image.
3. The method for intelligent analysis of spectral images of natural food additives according to claim 1, wherein the method for analyzing the mixing degree of natural food additives and raw materials based on the position distribution of the additive pixels in each final spectral filter image comprises the following steps:
For each final spectrum filtering image, calculating the variance of Euclidean distance between every two additive pixel points in the final spectrum filtering image, and obtaining the distance judgment value of the final spectrum filtering image; taking a connected domain formed by additive pixel points in the final spectrum filtering image as an additive region, and counting the number of the additive regions as a number judgment value of the final spectrum filtering image;
Obtaining the mixing degree of the final spectrum filtering image according to the distance judging value and the quantity judging value of the final spectrum filtering image; the distance judgment value and the quantity judgment value are in positive correlation with the mixing degree;
When the mixing degree is larger than a preset mixing threshold, the mixing degree of the food raw materials and the natural food additives at the corresponding moment of the final spectral filter image corresponding to the mixing degree meets the requirement; and when the mixing degree is smaller than or equal to a preset mixing threshold value, the mixing degree of the food raw materials and the natural food additives at the corresponding moment of the final spectral filter image corresponding to the mixing degree does not meet the requirement.
4. The intelligent analysis method for spectral images of natural food additives according to claim 1, wherein the method for obtaining the image pyramid of each spectral gray level image is a gaussian image pyramid algorithm.
5. The intelligent analysis method for spectral images of natural food additives according to claim 1, wherein the total number of layers of the image pyramid of each spectral gray-scale image is 3.
6. A method of intelligent analysis of spectral images of a natural food additive according to claim 3, wherein the predetermined mixing threshold is 0.8.
CN202410331404.2A 2024-03-22 2024-03-22 Spectral image intelligent analysis method of natural food additive Active CN117952857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410331404.2A CN117952857B (en) 2024-03-22 2024-03-22 Spectral image intelligent analysis method of natural food additive

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410331404.2A CN117952857B (en) 2024-03-22 2024-03-22 Spectral image intelligent analysis method of natural food additive

Publications (2)

Publication Number Publication Date
CN117952857A CN117952857A (en) 2024-04-30
CN117952857B true CN117952857B (en) 2024-06-14

Family

ID=90805453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410331404.2A Active CN117952857B (en) 2024-03-22 2024-03-22 Spectral image intelligent analysis method of natural food additive

Country Status (1)

Country Link
CN (1) CN117952857B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111879772A (en) * 2020-07-28 2020-11-03 深圳市润德贤食品科技有限公司 Food safety intelligent management method and system based on big data

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9305362B1 (en) * 2014-02-28 2016-04-05 Xilinx, Inc. Image stabilization
CN113780218A (en) * 2021-09-17 2021-12-10 杭州指悦网络科技有限公司 Face recognition terminal for food safety monitoring
CN115100226A (en) * 2022-06-15 2022-09-23 浙江理工大学 Contour extraction method based on monocular digital image
CN115641270A (en) * 2022-09-26 2023-01-24 北京空间机电研究所 High dynamic range expansion method suitable for SCMOS (Single chip multiple Access) dual-gain imaging system
CN115862006B (en) * 2023-03-01 2023-05-16 山东长有面粉有限公司 Bran star detection method in flour milling process

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111879772A (en) * 2020-07-28 2020-11-03 深圳市润德贤食品科技有限公司 Food safety intelligent management method and system based on big data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于方向可调滤波器的血管图像增强算法;王依人;邓国庆;夏营威;张龙;刘勇;张文;;系统仿真学报;20180608(第06期);全文 *

Also Published As

Publication number Publication date
CN117952857A (en) 2024-04-30

Similar Documents

Publication Publication Date Title
CN111968080B (en) Method for detecting quality of inside and outside of Feicheng peaches based on hyperspectral and deep learning
CN108956604B (en) Method for identifying eriocheir sinensis quality based on hyperspectral image technology
CN111161362B (en) Spectral image identification method for growth state of tea tree
CN109253975A (en) Apple slight damage hyperspectral detection method based on MSC-CFS-ICA
CN110363125A (en) Using the method for Model Transfer identification different cultivars Citrus Huanglongbing pathogen
CN109324000A (en) Kuerle delicious pear soluble solids content prediction technique based on CARS-MIV-SVR
CN117764864B (en) Nuclear magnetic resonance tumor visual detection method based on image denoising
CN109342331A (en) Plum rigidity nondestructive testing method based on Vis/NIR technology
CN114965316A (en) Hyperspectral multi-parameter based water quality monitoring method and computer program product
CN117952857B (en) Spectral image intelligent analysis method of natural food additive
Ye et al. An unsupervised SAR and optical image fusion network based on structure-texture decomposition
CN111292256A (en) Texture enhancement algorithm based on microscopic hyperspectral imaging
CN110335249A (en) Citrus Huanglongbing pathogen detection method based on high light spectrum image-forming technology
CN112633301A (en) Traditional Chinese medicine tongue image greasy feature classification method based on depth metric learning
CN114937038B (en) Usability-oriented remote sensing image quality evaluation method
CN116071565A (en) Apple moldy heart disease identification method and system based on hyperspectral imaging
CN114397094B (en) Light source color rendering evaluation method based on spectrum reconstruction and color appearance model
CN112964719B (en) Hyperspectrum-based food fructose detection method and device
CN115575345A (en) Hyperspectral combination data fusion-based tilapia fillet freshness determination method
CN112949592B (en) Hyperspectral image classification method and device and electronic equipment
CN114511470A (en) Attention mechanism-based double-branch panchromatic sharpening method
Hu et al. Application of Vis-NIR hyperspectral imaging in agricultural products detection
Tanimowo et al. A Decision Tree Classification Model for Cocoa Beans Quality Evaluation Based on Digital Imaging
Jian et al. Identification and grading of tea using computer vision
CN113592737B (en) Remote sensing image topography correction effect evaluation method based on entropy weight method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant