Image rotation correction compensation method to improve the accuracy of non-invasive blood glucose detection
By performing rotation correction and compensation algorithm processing on image inconsistency caused by rotation displacement in non-invasive blood sugar detection, the problem of inaccurate measurement results is solved, and the accuracy and reliability of detection are improved.
Patent Information
- Application Number
- CN202210780237.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2042-07-04
AI Technical Summary
In the human body's non-invasive blood sugar detection, due to the autonomous or non-autonomous jitter of the subject being tested, the acquisition site is rotated and displacement, destroying the consistency of multiple three-dimensional images continuously collected by OCT in the spatial range, resulting in inaccurate measurement results.
The image rotation correction compensation method is adopted to eliminate the error caused by rotation displacement by performing a rotation correction operation on the image that occurs and performing a compensation algorithm operation on the image after the rotation correction operation, including positioning label setting, line integral calculation, rotation angle determination, image rotation correction and similarity measurement calculation of the compensation algorithm.
It improves the accuracy and reliability of non-invasive blood sugar detection, ensures accurate positioning of the skin area, reduces measurement errors caused by rotational displacement, and better blood sugar calibration and prediction.
Smart Images

Figure CN115293977B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of blood sugar detection, in particular to an image rotation correction and compensation method for improving the accuracy of non-invasive blood sugar detection. Background Art
[0002] Diabetes is a common disease in the range of high blood sugar, which is mainly caused by the lack of or partial loss of pancreatic islet function in the human body. Diabetic patients with high blood sugar for a long time will not only cause serious discomfort to their bodies, but also lead to other diseases, such as complications such as nephropathy and arteriosclerosis. Therefore, blood sugar monitoring is an important means of monitoring blood sugar for diabetic patients. For their own health, patients need to monitor blood sugar changes at all times, not only for diabetic patients, but also for healthy people to prevent high blood sugar. The commonly used effective means of measuring blood sugar is to collect fingertip blood or venous blood, but it will cause certain trauma to the human body. The optical non-invasive methods currently being studied include photoacoustic spectroscopy, near-infrared spectroscopy, polarization rotation, Raman spectroscopy and optical coherence tomography. It can be monitored for a long time, so it will become a trend in subsequent research on non-invasive blood sugar.
[0003] Optical coherence tomography (OCT) is based on the principle of low-coherence interference and has the advantages of high efficiency, non-invasiveness and high resolution. Since the concentration of glucose will cause changes in the attenuation coefficient of light entering the skin, OCT can be used to monitor the changes in the optical parameter inside the human skin tissue - the scattering coefficient, and then correlate it with the human blood sugar level. Due to individual differences, the skin areas selected that are sensitive to blood sugar will also be different. The most sensitive skin tissue depth area is obtained through an algorithm for subsequent blood sugar calibration and prediction. We calibrate the changes in the scattering coefficient of the dermis layer of human skin with the actual blood sugar value to obtain an equation. Later, we can obtain the scattering coefficient by obtaining the attenuation signal after the light enters the skin, substitute it into the calibration equation, and get the blood sugar value at the corresponding moment.
[0004] In non-invasive human blood glucose testing, the voluntary or involuntary shaking of the subject may cause rotational displacement of the acquisition site, thereby destroying the consistency of the multiple three-dimensional images continuously acquired by OCT in the spatial range, ultimately resulting in inaccurate measurement results. Summary of the invention
[0005] The purpose of the present invention is to provide an image rotation correction compensation method for improving the accuracy of non-invasive blood glucose detection, so as to solve the problem of low accuracy of measurement results caused by rotation displacement of the acquisition area in the prior art.
[0006] The present invention is implemented as follows: an image rotation correction compensation method for improving the accuracy of non-invasive blood glucose detection, characterized in that it includes performing a rotation correction operation on a rotated image, performing a compensation algorithm operation on the image after the rotation correction operation, and performing a calibration operation on the obtained data processed by the compensation algorithm and the real blood glucose value;
[0007] The rotation correction operation comprises the following steps:
[0008] A1. A positioning tag with a clear inner edge is set for the skin to be sampled, and the detection device is used to collect the positional displacement of the skin inside the positioning tag to obtain a three-dimensional image with rotational displacement, and all the two-dimensional images in the three-dimensional image are averaged along the depth Z direction to obtain an average two-dimensional image of the XY plane;
[0009] A2, binarize the average two-dimensional image obtained in step A1, distinguish the positioning label from the skin area, and use the canny edge detection operator to extract the boundary size and position of the skin area;
[0010] A3. Select a rotation angle range on the binarized average two-dimensional image, calculate line integrals of the average two-dimensional image under the coordinate axis at multiple angles within the range, and obtain multiple integral values corresponding to the angles;
[0011] A4. Find the angle corresponding to the maximum integral value. At this angle, the edge of the skin in the average two-dimensional image is perpendicular to the X and Y directions of the coordinate axis respectively. This angle is the inclination angle of the coordinate axis. Then rotate the inclination angle in the opposite direction to obtain the corrected average two-dimensional image.
[0012] A5. Perform rotation correction on each two-dimensional image in the XY direction of the three-dimensional image collected in step A1 along the tilt angle obtained in step A4 to obtain a three-dimensional image after rotation correction.
[0013] Furthermore, the present invention can be implemented according to the following technical solutions:
[0014] The compensation algorithm operation for the three-dimensional image after the rotation correction operation includes the following steps:
[0015] B1, select the first three-dimensional image after the rotation correction processing, and extract a two-dimensional image without the depth Z direction from the three-dimensional image; process the two-dimensional image according to step A2 to obtain a skin area image, and then use the skin area with an area of 1 / 4 of the center of the image as a template image;
[0016] B2, select the second 3D image after the rotation correction, extract the 2D image with the same depth in the Z direction as in step B1, process the 2D image according to step A2 to obtain the skin area image; take the upper left corner of the skin area image as the starting point, select multiple target images by translating rightward pixel by pixel according to the size of the template image, until it stops at the right boundary; and for all the pixels below the upper left corner of the skin area image to the bottom of the image, select multiple target images one by one by translating rightward pixel by pixel according to the size of the template image, until it stops at the right boundary, thus obtaining a set of 2D images of the target image;
[0017] B3, performing similarity measurement calculation on the template image saved in step B1 and the two-dimensional images in the two-dimensional image set obtained in step B2, respectively, to obtain a two-dimensional correlation coefficient matrix containing all target images related to the template image;
[0018] B4. Find the maximum correlation coefficient value in the two-dimensional matrix of correlation coefficients obtained in step B3, and compare it with the set threshold value 0.7. If the maximum correlation coefficient value is greater than the threshold, find the coordinate position corresponding to the maximum correlation coefficient value in the two-dimensional matrix, and then extract the two-dimensional images of all depths of the three-dimensional image in step B2 at the coordinate position, and reconstruct them into a new three-dimensional skin image to participate in the blood glucose calculation, that is, complete the image compensation algorithm operation after the rotation correction operation; if the maximum value in the matrix is less than the threshold, discard the three-dimensional image in step B2, and perform the next image data calculation and repeat steps B2, B3, and B4 until all the collected three-dimensional images are processed.
[0019] The obtained data processed by the compensation algorithm are calibrated with the real blood sugar value to obtain the linear relationship between the scattering coefficient of different areas of the skin image and the blood sugar value.
[0020] The calibration operation is to obtain a relationship equation by performing least square fitting on the collected real blood sugar value and the scattering coefficient of different depth areas in the skin image at the corresponding moment. Different depth areas have different scattering coefficients and correspondingly have different relationship equations.
[0021] In step A3, the average two-dimensional image is line-integrated along the y′ direction, and the formula is as follows:
[0022]
[0023] in,
[0024] In step B3, the size of the target image S is M*N, and the size of the template image T is M*N, then the similarity measure, i.e., the correlation coefficient, can be defined as:
[0025]
[0026] Where R(i,j) is the correlation between the target image and the template image at (i,j);
[0027] E(S(i,j)) and E(T) are the average grayscale value of the target image and the average grayscale value of the template at (i,j) respectively;
[0028] When performing image matching, the template image is moved pixel by pixel on the target image through an algorithm to obtain a target image matrix.
[0029] The rotation correction compensation algorithm of the present invention eliminates the errors caused by rotation and displacement in the process of collecting blood sugar data images, thereby improving the accurate positioning of the skin area involved in blood sugar calculation. Among them, the positioning tag and line integral calculation are introduced to locate and accurately extract the area involved in blood sugar calculation, thereby eliminating the influence of rotation displacement. At the same time, in order to avoid the generation of this error caused by rotation displacement, the compensation algorithm is used to eliminate the errors caused by rotation displacement in the collection area, thereby improving the accuracy and reliability of optical non-invasive blood sugar detection, and better calibrating and predicting blood sugar. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of the positioning label structure of the present invention.
[0031] Figure 2 It is the image that has been offset and is collected by the present invention.
[0032] Figure 3 It is a comparison diagram before and after the rotation correction operation of the present invention.
[0033] Figure 4 It is a process diagram of obtaining the skin area inside the positioning tag and the template image during the operation of the correction and compensation algorithm of the present invention.
[0034] Figure 5 It is the target image of the image compensation algorithm after the rotation correction operation of the template image and the template image that best matches the template image. It can be intuitively seen on the image that the image in the unique matching area has a high similarity with the template.
[0035] Figure 6 This is a comparison chart of blood glucose prediction data before and after being processed by the rotation correction compensation algorithm.
[0036] Figure 7 This is a Clarke error grid analysis comparison chart of blood glucose prediction data and actual data before and after rotation correction compensation algorithm processing. DETAILED DESCRIPTION
[0037] like Figure 1 and Figure 2 As shown, the image rotation correction and compensation method for improving the accuracy of non-invasive blood glucose detection of the present invention includes performing a rotation correction operation on the rotated image, performing a compensation algorithm operation on the image after the rotation correction operation, and calibrating the data obtained after the compensation algorithm processing with the actual blood glucose value.
[0038] The rotation correction operation includes the following steps:
[0039] A1. Set a positioning label with a clear inner edge for the skin to be collected, such as Figure 1 As shown, the present invention uses an OCT test piece with a square inner edge as a positioning label.
[0040] like Figure 2 As shown, a detection device is used to collect the position offset of the skin in the positioning tag to obtain a three-dimensional image with rotational displacement. All two-dimensional images in the three-dimensional image are averaged along the depth Z direction to obtain an average two-dimensional image of the XY plane, so that the approximate area of the skin can be roughly seen.
[0041] A2. Binarize the average two-dimensional image obtained in step A1, distinguish the positioning label from the skin area, and use the canny edge detection operator to extract the boundary size and position of the skin area.
[0042] A3. Select a rotation angle range on the binarized average two-dimensional image, calculate the line integrals of the average two-dimensional image under the coordinate axes at multiple angles within the range, and obtain multiple integral values corresponding to the angles.
[0043] A4. Find the angle corresponding to the maximum integral value. At this angle, the edge of the skin in the average two-dimensional image is perpendicular to the X and Y directions of the coordinate axis. This angle is the inclination angle of the coordinate axis. Rotate this angle in the opposite direction to obtain the corrected average two-dimensional image. The inclination angle of this direction offset from the horizontal coordinate axis is the angle of rotation offset of the image.
[0044] Steps A3 and A4 are mainly to calculate the projection of an average two-dimensional image in different coordinate axis directions, that is, to perform line integral operations in different coordinate axis directions, and to obtain a sudden maximum integral value in each coordinate axis direction. The maximum value is selected from the integral values in multiple different directions, that is, a straight line in the image is exactly perpendicular to the coordinate axis direction. The angle of this direction offset from the horizontal coordinate axis direction is the angle of rotation of the image.
[0045] The average 2D image is the integral along the y′ direction, and the formula is as follows:
[0046]
[0047] in,
[0048] The rotation correction algorithm used is a method of calculating the line integral of the coordinate axis at different angles by tilting the coordinate axis. When the line integral value changes suddenly, it is considered that there is a straight line, which is the boundary of the image. By selecting a rotation angle range, within which each rotation angle corresponds to a coordinate axis tilted at a different angle, the integral of the image under the coordinate axis is calculated. When the image is exactly perpendicular to the coordinate axis, the tilt angle of the coordinate axis is obtained, and then the angle is rotated in the opposite direction to obtain the corrected image.
[0049] A5, each two-dimensional image in the XY direction of the three-dimensional image collected in step A1 is rotated and corrected along the tilt angle obtained in step A4 to obtain a three-dimensional image after rotation correction. Figure 3 As shown, the data size before and after rotation is made consistent, which reduces the amount of calculation for subsequent data processing and facilitates intuitive display comparison.
[0050] The three-dimensional image processed by the above rotation correction algorithm is then compensated to eliminate the influence of displacement. The compensation algorithm mainly calculates the similarity between the same-sized areas in the target image and the template image, thereby obtaining the area image that is most similar to the template, indicating that this area in the target image is most similar to the template image, and then the target image of this area is used as the best position for subsequent blood sugar calculation.
[0051] The compensation algorithm for the three-dimensional image after the rotation correction operation includes the following steps:
[0052] B1. As shown in Figure A, select the first 3D image after rotation correction, and extract a 2D image without depth Z from the 3D image. Process the 2D image according to step A2 to obtain a skin area image, and then use the skin area template image with the area of 1 / 4 of the center of the image as the template image. Figure 4 As shown, the area behind the template image that participates in blood glucose calculation and the template used for the compensation algorithm are saved so that they can be directly called during subsequent testing.
[0053] Specifically, the rough positioning is first performed through the positioning label, and then the three-dimensional skin image is averaged along the depth Z direction, and the maximum inter-class variance method is used to obtain the threshold, and then the binary operation is performed to form a black-and-white XY surface image, with the skin area as 1 and the background as 0. After the morphological operation, the burrs and noise in the skin boundary area are removed by corrosion, but the skin image area is reduced, and the expansion operation removes noise and restores the image area size. At this time, the boundary of the skin area is relatively smooth.
[0054] B2. Select the second three-dimensional image after rotation correction, and extract the two-dimensional image with the same depth in the Z direction as in step B1. Process this two-dimensional image according to step A2 to obtain a skin area image. Taking the upper left corner of the skin area image as the starting point, select multiple target images by translating to the right pixel by pixel according to the size of the template image (X*Y) until it stops at the right boundary. After that, translate downward one pixel position from the starting point, select multiple target images by translating to the right pixel by pixel according to the size of the template image (X*Y) until it stops at the right boundary. And for all pixels below the upper left corner of the skin area image to the bottom of the image, select multiple target images one by one by translating to the right pixel by pixel according to the size of the template image until it stops at the right boundary, so as to obtain a two-dimensional image set of the target image.
[0055] B3. Perform similarity measurement calculations on the template image saved in step B1 and the two-dimensional images in the two-dimensional image set obtained in step B2, respectively, to obtain a two-dimensional correlation coefficient matrix containing all target images correlated with the template image.
[0056] Specifically, assuming that the size of the target image S is M*N and the size of the template image T is M*N, the similarity measure, i.e., the correlation coefficient, can be defined as:
[0057]
[0058] Where R(i,j) is the correlation between the target image and the template image at (i,j).
[0059] E(S(i,j)) and E(T) are the average grayscale value of the target image and the average grayscale value of the template at (i,j) respectively.
[0060] When the value of R(i,j) is closer to 1, it indicates that the similarity between the two is higher and the images are more matched; conversely, it indicates that the similarity is not high and the images do not match. When performing image matching, the template image and all target images are calculated separately through the algorithm to obtain a correlation coefficient matrix. The position corresponding to the maximum value in the matrix is the position with the highest similarity to the template image.
[0061] B4, find the maximum correlation coefficient value in the two-dimensional matrix of the correlation coefficients obtained in step B3, and compare it with the set threshold value 0.7. If the maximum correlation coefficient value is greater than the threshold value, find the coordinate position (X*Y coordinate) corresponding to the maximum correlation coefficient value in the two-dimensional matrix, and then extract the two-dimensional images of all depths of the three-dimensional image in step B2 at the coordinate position, and reconstruct them into a new three-dimensional skin image to participate in the blood sugar calculation, that is, complete the image compensation algorithm operation after the rotation correction operation; if the maximum value in the matrix is less than the threshold value, discard the three-dimensional image in step B2, and perform the calculation of the next image data (the third three-dimensional image to the Nth three-dimensional image) and repeat steps B2, B3, and B4. Until all the collected three-dimensional images are processed.
[0062] like Figure 5 The template image and the target image of the image compensation algorithm after the rotation correction operation that best matches the template image are shown in FIG. It can be seen intuitively in the image that the image in the only matching area has a high similarity with the template.
[0063] According to the need, 100 three-dimensional images can be collected in one experiment, and then these 100 images are rotated and corrected. The first three-dimensional image is roughly positioned (processed according to step A2) to obtain the skin area (remove the positioning label area) image, and the skin area of the center 1 / 4 area of the image is used as the template image to match the following 99 three-dimensional images. The principle of template image selection is to select the area range of the middle 1 / 4 area. Figure 4 The dotted box in the second picture shows the selected template. Perform a rough positioning operation on the 2nd to 100th three-dimensional images, and extract the two-dimensional images with the same depth in the Z direction as in B1. Using the template image size as the window, move each two-dimensional image pixel by pixel, and obtain the 2nd to 100th target image set. After calculating the similarity measurement between the template image and the 99 target image sets, retain the three-dimensional images that are greater than the threshold. Then, according to the coordinate position corresponding to the maximum correlation coefficient of each group, extract the new three-dimensional reconstructed skin image for blood glucose calculation.
[0064] The data processed by the compensation algorithm is calibrated with the real blood sugar value to obtain the linear relationship between the scattering coefficient and the blood sugar value in different areas of the skin image for subsequent blood sugar prediction. The data after the rotation correction compensation algorithm is more in line with the real blood sugar value. Figure 6 (a) shows the comparison between the predicted blood sugar value data and the real data without the rotation correction algorithm. (b) shows the comparison between the predicted blood sugar value data and the real data after the rotation correction algorithm. Figure 7(a) shows the Clarke error grid analysis of blood glucose prediction data and real data without rotation correction compensation algorithm processing. (b) shows the Clarke error grid analysis of blood glucose prediction data and real data after rotation correction compensation algorithm processing. Figure 7 The proportion of Central A zone increased from 33.34% to 52.08%.
[0065] The calibration operation is to obtain the relationship equation by least square fitting the collected real blood sugar value and the scattering coefficient of different depth areas in the skin image at the corresponding time. Different depth areas have different scattering coefficients and corresponding to different relationship equations. The skin image at the same position at different times is obtained, and then the scattering coefficient of different areas in the skin depth direction is linearly fitted with the real blood sugar value. The linearity between the scattering coefficient and the blood sugar value in a certain area of the skin depth is the best, and this area is selected for subsequent prediction processing.
Claims
1. An image rotation correction compensation method for improving the accuracy of non-invasive blood glucose detection, characterized in that: The method includes performing a rotation correction operation on the rotated image, performing a compensation algorithm operation on the image after the rotation correction operation, and performing a calibration operation on the obtained data processed by the compensation algorithm and the real blood sugar value; The rotation correction operation comprises the following steps: A1. A positioning tag with a clear inner edge is set for the skin to be sampled, and the detection device is used to collect the positional displacement of the skin inside the positioning tag to obtain a three-dimensional image with rotational displacement, and all the two-dimensional images in the three-dimensional image are averaged along the depth Z direction to obtain an average two-dimensional image of the XY plane; A2, binarize the average two-dimensional image obtained in step A1, distinguish the positioning label from the skin area, and use the canny edge detection operator to extract the boundary size and position of the skin area; A3. Select a rotation angle range on the binarized average two-dimensional image, calculate line integrals of the average two-dimensional image under the coordinate axis at multiple angles within the range, and obtain multiple integral values corresponding to the angles; A4. Find the angle corresponding to the maximum integral value. At this angle, the edge of the skin in the average two-dimensional image is perpendicular to the X and Y directions of the coordinate axis respectively. This angle is the inclination angle of the coordinate axis. Then rotate the inclination angle in the opposite direction to obtain the corrected average two-dimensional image. A5, performing rotation correction on each of the two-dimensional images in the XY direction in the three-dimensional image collected in step A1 along the tilt angle obtained in step A4, to obtain a three-dimensional image after rotation correction; The compensation algorithm operation for the three-dimensional image after the rotation correction operation includes the following steps: B1, select the first three-dimensional image after the rotation correction processing, and extract a two-dimensional image without the depth Z direction from the three-dimensional image; process the two-dimensional image according to step A2 to obtain a skin area image, and then use the skin area with an area of 1 / 4 of the center of the image as a template image; B2, select the second 3D image after the rotation correction, extract the 2D image with the same depth in the Z direction as in step B1, process the 2D image according to step A2 to obtain the skin area image; take the upper left corner of the skin area image as the starting point, select multiple target images by translating rightward pixel by pixel according to the size of the template image, until it stops at the right boundary; and for all the pixels below the upper left corner of the skin area image to the bottom of the image, select multiple target images one by one by translating rightward pixel by pixel according to the size of the template image, until it stops at the right boundary, thus obtaining a set of 2D images of the target image; B3, performing similarity measurement calculation on the template image saved in step B1 and the two-dimensional images in the two-dimensional image set obtained in step B2, respectively, to obtain a two-dimensional correlation coefficient matrix containing all target images related to the template image; B4. Find the maximum correlation coefficient value in the two-dimensional matrix of correlation coefficients obtained in step B3, and compare it with the set threshold value 0.
7. If the maximum correlation coefficient value is greater than the threshold, find the coordinate position corresponding to the maximum correlation coefficient value in the two-dimensional matrix, and then extract the two-dimensional images of all depths of the three-dimensional image in step B2 at the coordinate position, and reconstruct them into a new three-dimensional skin image to participate in the blood glucose calculation, that is, complete the image compensation algorithm operation after the rotation correction operation; if the maximum value in the matrix is less than the threshold, discard the three-dimensional image in step B2, and perform the next image data calculation and repeat steps B2, B3, and B4 until all the collected three-dimensional images are processed.
2. The image rotation correction compensation method for improving the accuracy of non-invasive blood glucose detection according to claim 1 is characterized in that: The obtained data processed by the compensation algorithm are calibrated with the real blood sugar value to obtain the linear relationship between the scattering coefficient of different areas of the skin image and the blood sugar value.
3. The image rotation correction compensation method for improving the accuracy of non-invasive blood glucose detection according to claim 2 is characterized in that: The calibration operation is to obtain a relationship equation by performing least square fitting on the collected real blood sugar value and the scattering coefficient of different depth areas in the skin image at the corresponding moment. Different depth areas have different scattering coefficients and correspondingly have different relationship equations.
4. The image rotation correction compensation method for improving the accuracy of non-invasive blood glucose detection according to claim 1 is characterized in that In step A3, the average two-dimensional image is line-integrated along the y′ direction, and the formula is as follows: in, 5. The image rotation correction compensation method for improving the accuracy of non-invasive blood glucose detection according to claim 1 is characterized in that In step B3, the size of the target image S is M*N, and the size of the template image T is M*N, then the similarity measure, i.e., the correlation coefficient, is defined as: Where R(i,j) is the correlation between the target image and the template image at (i,j); E(S(i,j)) and E(T) are the average grayscale value of the target image and the average grayscale value of the template at (i,j) respectively; When performing image matching, the template image is moved pixel by pixel on the target image through an algorithm to obtain a set of target image matrices.
Citation Information
Patent Citations
Cerebral hemorrhage classification, positioning and prediction method based on three-dimensional deep learning model
CN110503630A