Rapid and convenient analysis method for determining mildew and redness of stored white sugar
Through image analysis and fitting technology, the RGB color information of the white sugar sample is analyzed to determine whether it has deteriorated, which solves the problem of lack of intelligent detection methods in the existing technology and realizes fast and convenient monitoring and early warning of white sugar deterioration.
Patent Information
- Application Number
- CN202411435147.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-15
AI Technical Summary
The existing technology lacks intelligent detection methods to quickly and conveniently determine whether the sugar is spoiled or color changed, resulting in the possibility of accidentally eating spoiled sugar, affecting health.
By setting the lighting environment, take pictures of the sugar sample to be tested, perform image analysis to obtain RGB color information, convert it into a spatial three-dimensional variable array, fit it into a fitting plane, and compare it with the reference fitting plane, and determine whether the sugar is white through the angle between the normal vectors. normal.
It realizes quick and convenient monitoring and early warning of the deterioration of white sugar, avoids accidentally eating spoiled white sugar, and saves a lot of working time.
Smart Images

Figure CN119334886A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of white sugar storage performance analysis, and in particular to a fast and convenient method for determining the mildew and redness analysis of stored white sugar. Background Art
[0002] The red color of sugar is indeed a sign of deterioration. Because it has been stored for a long time or in a high temperature environment, the sugar is contaminated by microorganisms and deteriorates. During the deterioration process, the nutrients in the sugar are destroyed and toxic substances such as aflatoxin may be generated. Eating it may cause gastrointestinal inflammation.
[0003] In addition, if the color of white sugar turns red, it may have deteriorated and become moldy. If ingested by mistake, it may cause diarrhea and abdominal pain, and in severe cases, it may cause allergic reactions.
[0004] Therefore, once white sugar deteriorates or changes color, it should not be used to avoid affecting your health.
[0005] Currently, the detection for judging whether white sugar has turned red is generally performed by human eyes, and there is little intelligent detection technology for white sugar turning red at this stage. Therefore, there is an urgent need for an intelligent technology that can detect whether white sugar has turned red to solve the problems of the existing technology. Summary of the invention
[0006] The purpose of the invention is to provide a quick and convenient method for monitoring the reddening of white granulated sugar, so as to efficiently and conveniently measure the reddening of stored white granulated sugar and solve the problem of lack of related methods. To solve the problems existing in the prior art.
[0007] In order to solve the problems existing in the prior art, the present invention adopts the following technical solutions:
[0008] A quick and convenient method for determining the mildew and redness of stored white sugar includes the following steps:
[0009] Set up the lighting environment;
[0010] Place the sample to be tested under the same lighting environment and take photos to obtain photos of the sample to be tested;
[0011] Performing image analysis on the sample to be tested to obtain multiple pixel points and their corresponding RGB color information;
[0012] Convert the RGB color information corresponding to the plurality of pixel points to obtain a three-dimensional spatial variable array;
[0013] Fitting the spatial three-dimensional variable array to obtain a fitting plane;
[0014] The obtained fitting plane is compared with the reference fitting plane. If the normal vector angle between the fitting plane and the reference fitting plane is less than or equal to 30°, the sample to be tested is a normal sugar sample; if the normal vector angle between the fitting plane and the reference fitting plane is greater than or equal to 60°, the sample to be tested is an abnormal sugar sample.
[0015] As an improvement of the technical solution of the method for quickly and conveniently determining the redness of stored white sugar, a reference normal sugar sample is obtained by artificial naked eye identification;
[0016] Placing the reference normal sugar sample under the same lighting environment and photographing it to obtain a reference sample photo;
[0017] Performing image analysis on the reference sample photo to obtain multiple pixel points and their corresponding RGB color information;
[0018] Convert the RGB color information to obtain a three-dimensional spatial variable array of a reference sample;
[0019] The spatial three-dimensional variable array of the reference sample is fitted to obtain the reference fitting plane.
[0020] As an improvement of the technical solution of the method for quickly and conveniently determining the reddening of stored white sugar, when performing image analysis on the photo of the sample to be tested, a plurality of pixels and RGB color information of each of the pixels are obtained;
[0021] The pixel points are randomly divided into a plurality of pixel point groups, the RGB color information of the pixel points corresponding to each pixel point group is converted to obtain a spatial three-dimensional variable array, and the spatial three-dimensional variable array is fitted to obtain a plurality of fitting planes.
[0022] As an improvement on the technical solution of the method for quickly and conveniently analyzing the mildew and redness of stored white sugar of the present invention, 1000 pixels with larger weights are randomly grouped, with 100 pixels in each group.
[0023] As an improvement to the technical solution of the method for quickly and conveniently analyzing the mildew and redness of stored white sugar of the present invention, the three-dimensional array of space is fitted, and the fitting is performed using the least squares method.
[0024] As an improvement on the technical solution of the method for quickly and conveniently determining and storing white sugar mold and redness analysis of the present invention, the RGB color information of each pixel is (R, G, B), and the color information of the pixel is converted into a point on the coordinate axis.
[0025] Beneficial effects of the present invention:
[0026] In the present invention, by determining the normal vector angle between the reference fitting plane and the fitting plane of the sample to be tested, it is judged whether the sample color of the sample to be tested has changed, and by utilizing the difference in angle difference, the stored white sugar can be quickly monitored and warned in real time through image algorithm and fitting. The method is convenient, time-saving and saves a lot of work. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is the RGB pixel distribution map of the sample photo to be tested;
[0028] Figure 2 Schematic diagram of RGB information extraction and processing of the sample photo to be tested. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical scheme and beneficial effects of the present invention clearer, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0030] A quick and convenient method for determining the mildew and redness of stored white sugar includes the following steps:
[0031] Set up the lighting environment;
[0032] Place the sample to be tested under the same lighting environment and take photos to obtain photos of the sample to be tested;
[0033] Perform image analysis on the sample to be tested to obtain multiple pixel points and their corresponding RGB information;
[0034] Convert RGB information to obtain a spatial three-dimensional variable array;
[0035] Fit the spatial three-dimensional variable array to obtain a fitting plane;
[0036] The obtained fitting plane is compared with the reference fitting plane. If the normal vector angle between the fitting plane and the reference fitting plane is less than or equal to 30°, the sample to be tested is a normal sugar sample; if the normal vector angle between the fitting plane and the reference fitting plane is greater than or equal to 60°, the sample to be tested is an abnormal sugar sample.
[0037] In some embodiments of the present invention, a reference normal sugar sample is obtained by artificial naked eye identification; the reference normal sugar sample is placed in the same lighting environment and photographed to obtain a reference sample photo; the reference sample photo is subjected to image analysis to obtain a plurality of pixel points and their corresponding RGB information; the RGB information is converted to obtain a spatial three-dimensional variable array of the reference sample; the spatial three-dimensional variable array of the reference sample is fitted to obtain a reference fitting plane.
[0038] In some embodiments of the present invention, a plurality of pixel points are obtained, the pixel points with larger weights are randomly grouped, corresponding RGB information is obtained for each group of pixel points, and the RGB information is converted to obtain a spatial three-dimensional variable array; the spatial three-dimensional variable array is fitted to obtain a plurality of fitting planes.
[0039] In some embodiments of the present invention, a plurality of pixel points are obtained, the first 1000 points with larger weights are randomly grouped, the RGB information corresponding to each group of 100 pixel points is obtained, the corresponding three-dimensional spatial variable array is obtained, and the three-dimensional spatial variable array is fitted to obtain a plurality of fitting planes.
[0040] In some implementations of the present invention, a spatial three-dimensional variable array is fitted, and the fitting is performed using a least squares method.
[0041] In some embodiments of the present invention, the RGB color information of each pixel is (R, G, B), and the color information of the pixel is converted into a point on a coordinate axis.
[0042] In detail, the present invention provides a rapid and convenient method for determining whether stored white sugar has turned moldy and red, which is used to detect whether the white sugar has deteriorated into red, so as to avoid the storage of white sugar from deteriorating, thereby affecting the taste of the food or avoiding the occurrence of accidental ingestion of deteriorated white sugar.
[0043] In the present invention, a lighting environment is first set, and a photo of the sample to be tested is taken under the same lighting environment to obtain the photo of the sample to be tested. In this way, firstly, the influence of light on the image is avoided, and secondly, after the photo of the sample to be tested is obtained, preparation is made for the next step of image analysis of the photo of the sample to be tested.
[0044] After obtaining the photo of the sample to be tested, image analysis is performed on the photo of the sample to be tested to obtain multiple pixel points and their corresponding RGB information.
[0045] In detail, in the present invention, Figure 1 As shown, when performing image analysis, the part to be tested of the sample photo to be tested is enlarged, and the pixel points and their RGB information in the part to be tested are obtained, and the RGB information is converted to obtain a spatial three-dimensional variable array, that is, the RGB information of the pixel points is represented on the coordinate axis, and a pixel point RGB information coordinate diagram is obtained.
[0046] Then, the spatial three-dimensional variable array is fitted to obtain the fitting plane;
[0047] The obtained fitting plane is compared with the reference fitting plane. If the normal vector angle between the fitting plane and the reference fitting plane is less than or equal to 30°, the sample to be tested is a normal sugar sample; if the normal vector angle between the fitting plane and the reference fitting plane is greater than or equal to 60°, the sample to be tested is an abnormal sugar sample.
[0048] In more detail, Figure 2 As shown, after obtaining the RGB color information of a single pixel, (R, G, B) is obtained, and (R, G, B) is placed in the coordinate system to form a scattered point. Since there are multiple pixels, the multiple pixels gradually present a plane effect in the coordinate system, and since there are multiple pixels corresponding to multiple spatial three-dimensional variable arrays, the spatial three-dimensional variable array is plane-fitted, preferably, the least squares method is used for plane fitting to obtain a fitting plane.
[0049] As an embodiment of the present invention, the sample to be tested can be used to obtain an array of spatial three-dimensional variables, that is, multiple (R, G, B). The least square method is used to perform plane fitting.
[0050] The first 1000 pixels with larger weights were randomly grouped, with each 100 pixels as a group, and the corresponding three-dimensional spatial arrays were obtained for fitting to obtain the fitting plane.
[0051] The obtained fitting plane is compared with the reference fitting plane. If the normal vector angle between the fitting plane and the reference fitting plane is less than or equal to 30°, the sample to be tested is a normal sugar sample; if the normal vector angle between the fitting plane and the reference fitting plane is greater than or equal to 60°, the sample to be tested is an abnormal sugar sample.
[0052] By utilizing the difference in angles, image algorithms and fitting can be used to quickly monitor and warn the stored white sugar in real time. This method is convenient, time-saving, and saves a lot of work.
[0053] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making any creative work shall fall within the scope of protection of the present invention.
Claims
1. A fast and convenient method for determining the redness of stored sugar due to mold, characterized in that: The following steps are included: Set up the lighting environment; Place the sample to be tested under the same lighting environment and take photos to obtain photos of the sample to be tested; Performing image analysis on the sample to be tested to obtain multiple pixel points and their corresponding RGB color information; Convert the RGB color information corresponding to the plurality of pixel points to obtain a three-dimensional spatial variable array; Fitting the spatial three-dimensional variable array to obtain a fitting plane; The obtained fitting plane is compared with the reference fitting plane. If the normal vector angle between the fitting plane and the reference fitting plane is less than or equal to 30°, the sample to be tested is a normal sugar sample; if the normal vector angle between the fitting plane and the reference fitting plane is greater than or equal to 60°, the sample to be tested is an abnormal sugar sample.
2. The fast and convenient method for determining the redness of stored white sugar due to mildew according to claim 1, characterized in that: A reference normal sugar sample was obtained by manual visual identification; Placing the reference normal sugar sample under the same lighting environment and photographing it to obtain a reference sample photo; Performing image analysis on the reference sample photo to obtain multiple pixel points and their corresponding RGB color information; Convert the RGB color information to obtain a three-dimensional spatial variable array of a reference sample; The spatial three-dimensional variable array of the reference sample is fitted to obtain the reference fitting plane.
3. The fast and convenient method for determining the redness of stored sugar due to mildew according to claim 1, characterized in that: When performing image analysis on the photograph of the sample to be tested, a plurality of pixels and RGB color information of each of the pixels are obtained; The pixel points are randomly divided into a plurality of pixel point groups, the RGB color information of the pixel points corresponding to each pixel point group is converted to obtain a spatial three-dimensional variable array, and the spatial three-dimensional variable array is fitted to obtain a plurality of fitting planes.
4. The fast and convenient method for determining the redness of stored sugar due to mildew according to claim 3, characterized in that: The 1000 pixels with larger weights are randomly grouped, with 100 pixels in each group.
5. The fast and convenient method for determining the redness of stored sugar due to mildew according to claim 1, characterized in that: The spatial three-dimensional array is fitted, and the fitting is performed using a least squares method.
6. The fast and convenient method for determining the redness of stored sugar due to mildew according to claim 5, characterized in that: The RGB color information of each pixel is (R, G, B), and the color information of the pixel is converted into a point on the coordinate axis.
Citation Information
Patent Citations
Yellowing material identification method for rice color sorting
CN111814808A
Point cloud detection method and device for Mini Led appearance detection
CN117593320A
Calculating Conjunctival Redness
US20130226008A1
Image capture system
US9072929B1