B-scan Image Alignment Method and System in Optical Coherence Layer Imaging
By performing cross-correlation and statistical analysis of B-scan images in OCT technology and selecting the optimal alignment scheme, the image blur problem caused by red blood cell rotation is solved, and more accurate blood flow velocity measurement and three-dimensional reconstruction are achieved.
Patent Information
- Application Number
- CN202510533544.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-04-27
AI Technical Summary
When measuring blood flow velocity, the B-scan image is blurred due to the rotation of red blood cells and the instability of the tester, and the location of the red blood cells cannot be accurately determined, resulting in a large error in the calculation of blood flow velocity.
Multiple B-scan images were aligned by cross-correlation analysis, statistical analysis and optimization analysis methods, and the optimal alignment scheme was selected through the grayscale value map to accurately locate the red blood cell position.
The error in blood flow velocity measurement is reduced, the accuracy of B-scan images and the accuracy of three-dimensional reconstruction are improved, and the reliability of medical diagnosis is enhanced.
Smart Images

Figure CN120070517B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical coherence layer imaging, and particularly to a method and system for aligning B-scan images in optical coherence layer imaging. Background Art
[0002] The statements in this part merely provide background art related to the present invention and do not necessarily constitute prior art.
[0003] Optical Coherence Tomography (OCT) technology, as a new type of three-dimensional tomography technology, is widely used in the field of medical image processing due to its non-contact, non-invasive, fast imaging speed, high detection sensitivity and other characteristics. Due to these characteristics, it has certain applications in measuring the blood flow velocity of blood vessels.
[0004] There is important research on OCT imaging in measuring blood flow velocity. However, due to various uncontrollable factors such as the self-rotation of the measured red blood cells in the blood vessels during B-scan scanning (two-dimensional cross-sectional scanning) and the fact that the measured person cannot remain completely still, some images are blurred during the measurement process. That is, the information of the red blood cells obtained by B-scan scanning is always larger than the actual range, and only the approximate velocity can be calculated through the area range where the red blood cells exist. It is impossible to accurately determine the specific position of the red blood cells to calculate the accurate blood flow velocity. Summary of the Invention
[0005] To solve the deficiencies of the prior art, the present invention provides a method and system for aligning B-scan images in optical coherence layer imaging. By using cross-correlation analysis, statistical analysis and optimization analysis, the scanned B-scan images are aligned to reduce the ambiguity during B-scan scanning, more accurately locate the specific position of the red blood cells, and reduce the error in blood flow velocity measurement.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] In the first aspect, the present invention provides a method for aligning B-scan images in optical coherence layer imaging.
[0008] A method for aligning B-scan images in optical coherence layer imaging includes the following processes:
[0009] Obtain multiple B-scan images with the same size at the same position through optical coherence layer scanning, and the number and position of pixel points included in each B-scan image are the same;
[0010] Calculate the total gray value of each pixel to obtain a gray value map, where each pixel on the gray value map corresponds to a calculated total gray value;
[0011] Taking the first pixel of the gray value map as the center and the number of pixels occupied by the blood vessel on the gray value map as the diameter, enclose a circular area. In the circular area, select two B-scan images for cross-correlation analysis, move the image position, determine the position with the maximum cross-correlation coefficient to complete alignment, and perform sequential alignment on the remaining B-scan images to obtain an alignment scheme;
[0012] Taking multiple other pixels of the gray value map as the center, obtain multiple alignment schemes, and select the optimal alignment scheme according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching rate.
[0013] As a further limitation of the first aspect of the present invention, calculating the total gray value of any pixel ( ), includes:
[0014] Set the number of B-scan images as N, and the gray value at the pixel ( ) of each B-scan image is , then the total gray value of ( ) is: .
[0015] As a further limitation of the first aspect of the present invention, the first pixel is the pixel with the maximum gray value, the multiple other pixels do not include the first pixel, and the gray values of the multiple other pixels are all greater than the set threshold.
[0016] As a further limitation of the first aspect of the present invention, selecting two B-scan images for cross-correlation analysis, moving the image position, and determining the position with the maximum cross-correlation coefficient to complete alignment, includes:
[0017] Taking two adjacent sides of the B-scan image as the X-axis and Y-axis respectively, set up an XOY rectangular coordinate system, fix one B-scan as the first B-scan, move the other B-scan along the X-axis, and the other B-scan is used as the second B-scan to find the image position when the cross-correlation coefficient is the largest; then fix the X-axis and move the position of the second B-scan along the Y-axis to find the image position when the cross-correlation coefficient is the largest again. This position is the aligned position of these two B-scans.
[0018] As a further limitation of the first aspect of the present invention, performing sequential alignment on the remaining B-scan images to obtain an alignment scheme, includes:
[0019] Taking the first B-scan as the fixed B-scan image, calibrate each of the remaining B-scan images in sequence; alternatively, assuming the number of B-scan images is N, taking the calibrated second B-scan as the fixed B-scan image, calibrate the third B-scan, taking the calibrated third B-scan as the fixed B-scan image, calibrate the fourth B-scan, and taking the calibrated (N - 1)th B-scan as the fixed B-scan image, calibrate the Nth B-scan.
[0020] As a further limitation of the first aspect of the present invention, assuming the width of the selected blood vessel is , the resolution of the imaging device is , determine the number of pixels occupied by the blood vessel in the image as , where represents rounding up.
[0021] As a further limitation of the first aspect of the present invention, select the optimal alignment scheme according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching, including:
[0022] Calculate the alignment evaluation result : , where is the weight of the expected cross-correlation coefficient, is the weight of the expected coincidence degree, is the weight of the key point matching rate, , is the expected cross-correlation coefficient, is the expected coincidence degree, is the key point matching rate.
[0023] As a further limitation of the first aspect of the present invention, the expected cross-correlation coefficient is: = , in the formula, is the cross-correlation coefficient between the first B-scan and the th B-scan in the region S, is the total number of B-scan samples minus the reference sample number 1, and S is the total area of the aligned B-scan graph.
[0024] As a further limitation of the first aspect of the present invention, the expected coincidence degree is: , where is the number of coincidence points between the first B-scan and the th B-scan in the region S, S is the total area of the aligned B-scan graph, is the total number of pixel points, It is the total number of B-scan samples taken minus the number of reference samples, which is 1.
[0025] As a further limitation of the first aspect of the present invention, the total area of the aligned B-scan pattern is: , where X and Y are the original length and width of the B-scan respectively, and the unit of both is the number of pixels. is the maximum value of the rightward shift of the X-axis during alignment. is the maximum value of the leftward movement of the X-axis during alignment. is the maximum value of the rightward shift of the Y-axis during alignment. is the maximum value of the leftward movement of the Y-axis during alignment.
[0026] As a further limitation of the first aspect of the present invention, the key point matching rate is : , where is the number of selected key points. is the number of B-scans with the same gray value as the reference B-scan image at the selected key points.
[0027] In the second aspect, the present invention provides a B-scan image alignment system in optical coherence layer imaging.
[0028] A B-scan image alignment system in optical coherence layer imaging, comprising:
[0029] An image acquisition unit, configured to: obtain multiple B-scan images with the same size at the same position through optical coherence layer scanning, and the number and position of pixel points included in each B-scan image are the same;
[0030] A total gray value calculation unit, configured to: calculate the total gray value of each pixel point to obtain a gray value map, and each pixel point on the gray value map corresponds to a calculated total gray value;
[0031] An alignment scheme generation unit, configured to: take the first pixel point of the gray value map as the center and the number of pixels occupied by blood vessels on the gray value map as the diameter to enclose a circular area. In the circular area, select two B-scan images for cross-correlation analysis, move the image position, determine the position with the maximum cross-correlation coefficient to complete alignment, and perform sequential alignment on the remaining B-scan images to obtain an alignment scheme;
[0032] An alignment scheme optimization unit, configured to: take multiple other pixel points of the gray value map as the center to obtain multiple alignment schemes, and select the optimal alignment scheme according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching rate.
[0033] In a third aspect, the present invention provides a computer device, comprising: a processor and a computer-readable storage medium;
[0034] The processor is adapted to execute a computer program;
[0035] The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the B-scan image alignment method in optical coherence layer imaging as described in the first aspect of the present invention.
[0036] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, and the computer program is adapted to be loaded and executed by a processor to implement the B-scan image alignment method in optical coherence layer imaging as described in the first aspect of the present invention.
[0037] In a fifth aspect, the present invention provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the B-scan image alignment method in optical coherence layer imaging as described in the first aspect of the present invention.
[0038] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0039] 1. The present invention innovatively proposes a B-scan image alignment strategy in optical coherence layer imaging. By using cross-correlation analysis, statistical analysis, and optimization analysis, the scanned B-scan images are aligned to reduce the ambiguity during B-scan, more accurately locate the specific position of red blood cells, and reduce the error in blood flow velocity measurement.
[0040] 2. The present invention innovatively proposes a B-scan image alignment strategy in optical coherence layer imaging. Taking multiple other pixel points of the grayscale value map as the center, multiple alignment schemes are obtained, and the optimal alignment scheme is selected according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching rate, ensuring the accuracy of the alignment scheme.
[0041] 3. The present invention takes a certain pixel point of the grayscale value map as the center and the number of pixels occupied by blood vessels on the grayscale value map as the diameter to enclose a circular area, and aligns two B-scan images in the circular area. By combining the number of pixels occupied by blood vessels, the accuracy of B-scan images is further ensured.
[0042] Advantages of additional aspects of the present invention will be partially given in the following description, partially become obvious from the following description, or be understood through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings forming a part of this invention are used to provide a further understanding of the invention. The schematic embodiments and descriptions thereof of the invention are used to explain the invention and do not constitute an improper limitation of the invention.
[0044] Figure 1 It is a schematic flowchart of the B-scan image alignment method in optical coherence layer imaging provided for Embodiment 1 of the present invention;
[0045] Figure 2 It is a schematic diagram of the grayscale value map provided for Embodiment 1 of the present invention;
[0046] Figure 3 It is a schematic diagram of image misalignment provided for Embodiment 1 of the present invention;
[0047] Figure 4 It is a schematic diagram of a B-scan image alignment system in optical coherence layer imaging provided for Embodiment 2 of the present invention;
[0048] Figure 5 It is a schematic diagram of a computer device provided for Embodiment 3 of the present invention. Detailed implementation manners
[0049] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0050] It should be noted that the following detailed descriptions are all exemplary and are intended to provide a further description of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0051] Without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.
[0052] Embodiment 1:
[0053] The purpose of aligning B-scan images (i.e., two-dimensional tomographic images) in optical coherence tomography is mainly to obtain high-quality and distortion-free three-dimensional images. Specifically, B-scan image alignment plays a crucial role in OCT imaging, and its reasons and purposes mainly include:
[0054] (1) Three-dimensional reconstruction: In OCT imaging, by acquiring multiple B-scan images of a sample at different positions and then aligning and superimposing these images, the three-dimensional structure of the sample can be reconstructed; B-scan image alignment is a key step in realizing this process, which ensures the correct spatial correspondence of each two-dimensional image, so as to accurately restore the three-dimensional shape of the sample.
[0055] (2) Distortion elimination: Due to factors such as possible slight movement of the sample, errors in the scanning system, or noise during data acquisition, individual B-scan images may have certain distortions. Through B-scan image alignment, these distortions can be corrected, making the reconstructed three-dimensional image more accurate and realistic.
[0056] (3) Resolution improvement: Aligning multiple B-scan images can also improve the resolution of the images to a certain extent. Since each B-scan image is obtained by scanning the sample from different angles, they contain information about the sample in different directions. By integrating and aligning this information, a more detailed and clear image can be obtained.
[0057] (4) Auxiliary diagnosis: In medical diagnosis, OCT technology is often used to obtain high-resolution images of internal human tissues. B-scan image alignment can ensure the accuracy and reliability of these images, thus providing more accurate diagnostic basis for doctors. For example, in the diagnosis of ophthalmic diseases, the aligned OCT images can help doctors observe the layered structure and pathological conditions of the retina more clearly.
[0058] In summary, the purpose of B-scan image alignment in optical coherence tomography is to obtain high-quality, distortion-free three-dimensional images, thereby improving the accuracy and reliability of diagnosis. In practical applications, this usually requires the assistance of advanced image processing algorithms and technologies to achieve.
[0059] Given that the existing methods cannot accurately determine the specific position of red blood cells to calculate the accurate blood flow velocity, this implementation method proposes a B-scan image alignment method in optical coherence tomography, including the following processes:
[0060] S1: Determine the relationship between the blood vessel width and the resolution of the OCT device.
[0061] Assume that the width of the selected blood vessel is μm, and the resolution of the imaging device is μm. Determine the number of pixels occupied by the blood vessel in the image as: where, represents rounding up.
[0062] More specifically, it is necessary to determine the number of pixels occupied by the blood vessel in the actual imaging picture according to the accuracy of the device. Taking capillaries as an example, the inner diameter of capillaries is generally 6 μm - 9 μm. Assuming the resolution of the imaging device is 2 μm, then capillaries should occupy 3 - 5 pixel points in the image. To ensure that imaging data will not be lost, the present invention can take 5 as the number of pixels occupied by the selected capillaries to facilitate determining the proper range space of the blood vessel.
[0063] S2: Obtain multiple B-scan images at the same location through OCT scanning.
[0064] Here, it is assumed that there are N B-scan images, and each B-scan image is rectangular, with the same size for each B-scan image, and the number and position of the pixel points included are the same.
[0065] S3: Statistically calculate the sum of the grayscale values at each pixel point.
[0066] Suppose a total of N B-scan pictures are statistically calculated, and the total number of pixel points in the obtained B-scan images is , in the order from top left to bottom right, the pixel points are respectively denoted as ( , ).
[0067] Assume that the sum of the grayscale values at ( , ) is statistically calculated. Let the grayscale values of each B-scan image at ( , ) be respectively , then the total value of the grayscale statistics at ( , ) is:
[0068] (1);
[0069] Calculate the statistical grayscale values of each other pixel point in this way.
[0070] More specifically, in the imaging picture displayed by B-scan, assume that one B-scan is scanned one hundred times, that is, one hundred B-scan images are obtained in one cross-section. By statistically calculating the grayscale values of each point of these one hundred B-scan images and then performing a summation operation, and denoting this value as the grayscale statistical value, the sum of the grayscale values obtained at each pixel point can be obtained. Thus, we can obtain a statistically calculated data graph, which reflects the distribution of the grayscale values of the one hundred selected B-scan images at each pixel point.
[0071] S4: Obtain the total grayscale value of each pixel point according to the statistical grayscale value.
[0072] According to the statistical result, a grayscale value graph is obtained. As shown in Figure 2 , the total grayscale value obtained by statistics is marked at each pixel point. Specifically, it includes ( , ), ( , )... ( , ), ( , ) ··· ( , ) ··· ( , ) and other grayscale total values at pixel points.
[0073] S5: Align the B-scan using cross-correlation.
[0074] Taking the pixel with the largest grayscale value in the obtained image (i.e., the first pixel point) as the center and the number of pixels a corresponding to the blood vessel as the diameter, a circular region is defined. Within this region, two B-scan images are selected for cross-correlation analysis, and the cross-correlation coefficient is r. On this basis, one of the B-scans (i.e., the first B-scan) is fixed, and the other B-scan (i.e., the second B-scan) is moved along the X-axis, and the cross-correlation coefficient is recalculated. The image position when the cross-correlation coefficient r is the largest is found. Then, the X-axis is fixed, and the other B-scan is moved along the Y-axis, and the image position when the cross-correlation coefficient r is the largest is found again. This position is the aligned position of these two B-scans.
[0075] Then, the remaining images are finally aligned with the B-scan in the above manner. Specifically, taking the first B-scan as the fixed B-scan image, the calibration of each of the remaining other B-scan images is performed in sequence. Or, in some other implementation manners, assuming the number of B-scan images is N, taking the calibrated second B-scan as the fixed B-scan image, the calibration of the third B-scan is performed, taking the calibrated third B-scan as the fixed B-scan image, the calibration of the fourth B-scan is performed, and taking the calibrated (N - 1)th B-scan as the fixed B-scan image, the calibration of the Nth B-scan is performed.
[0076] More specifically, the present invention selects a pixel point with the highest statistical value as the reference point. From the knowledge of probability statistics, the possibility of this point being the true value of the blood vessel is the greatest. Then, returning to the original B-scan image, in the first B-scan image obtained by scanning, with this point as the center and a diameter of five pixel points (the number of pixel points occupied by capillaries in the device resolution), a circular region is made. Within this region, the first B-scan image and the second B-scan image are selected, and the region defined in the first B-scan image is mapped to the second B-scan image, and the cross-correlation between the two images in the selected region is analyzed.
[0077] When the cross-correlation between two regions is relatively high, it indicates that the two images are better aligned. Conversely, the alignment is worse. After calculating the cross-correlation for the first time, the entire second B-scan is moved along the X-axis in pixel units to find the position with the maximum cross-correlation when moving along the X-axis. Then, this operation is repeated along the Y-axis until the point with the maximum cross-correlation is found. Subsequently, the above operation is repeated for the third to the hundredth B-scan images to obtain one of the alignment schemes.
[0078] In this implementation, preferably, when the alignment of the two images is completed as described above, still taking the first image as a reference, find the region for cross-correlation analysis. With the center of the original selected region as the center, on the basis of the original region with a pixel diameter, increase the radius by one pixel, that is, increase the diameter by two pixels, and perform cross-correlation analysis on the two aligned images again. Since the alignment method with the highest cross-correlation has been found within the original cross-correlation analysis range, after expanding the range, the cross-correlation coefficient r will decrease. If the degree of decrease in the cross-correlation coefficient is not very obvious, it proves that the previous alignment result is relatively good. Conversely, it proves that the previously selected alignment method is slightly lacking.
[0079] S6: Repeat the experiment and select the optimal scheme.
[0080] After the B-scan alignment in S5 is completed, according to the graph of the total pixel gray value statistics, select another point with a higher total gray value statistics and different from the region selected in S5 as the center (it can also be understood as other pixel points with a total gray value greater than the set threshold), delimit the region for cross-correlation analysis, and then perform alignment. Thus, multiple different alignment schemes can be obtained. Compare the different alignment schemes obtained. Among the alignment results, select the optimal alignment scheme according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching rate.
[0081] During the B-scan alignment process, since the B-scan images need to be aligned by moving along the X and Y axes, it will cause misalignment of the aligned images, as Figure 3 shown. During the process of S5, find the maximum value of the rightward offset along the X-axis when aligning each image and the maximum value of the leftward movement . Similarly, find the maximum values of the upward and downward offsets along the Y-axis and . Since the offset is very small compared to the entire B-scan image, discard the part that deviates from the selected reference image after alignment as invalid values. The total area of the aligned B-scan graph can be obtained as:
[0082] (2);
[0083] Among them, S is the total area of the B-scan image after alignment, and X and Y are the original length and width of the B-scan, both in pixel units.
[0084] It can be seen that when different sample points are selected for registration operations, due to the differences in the offset during the registration of each image, the S of the finally obtained B-scan image is different. Therefore, it is not possible to simply use the total area of the angiogram for comparison. For this reason, the present invention proposes a method for testing the alignment effect of the B-scan, which evaluates the alignment effect of the B-scan from three directions, namely the expected cross-correlation coefficient , the expected coincidence degree and the key point matching rate .
[0085] The expected cross-correlation coefficient is:
[0086] = (3);
[0087] In the formula, is the cross-correlation coefficient between the first B-scan and the th B-scan in the region S, is the total number of B-scan samples taken minus the reference sample number 1.
[0088] The expected coincidence degree is:
[0089] (4);
[0090] In the formula, is the number of coincidence points between the first B-scan and the th B-scan in the region S. The specific calculation method is to compare the aligned first B-scan and the th B-scan in the region S, and record the number of points where the gray values are the same in the same region of the th B-scan and the reference image, which is the number of coincidence points. In the formula, S is the total number of pixel points, and n is the total number of B-scan samples taken minus the reference sample number 1.
[0091] The key point matching rate is:
[0092] (5);
[0093] In the formula, m is the number of selected key points, The number of B-scans with the same gray value as that at the selected key points in the reference B-scan image. The selection basis of the key points can be made according to the total gray value map counted in the previous step 3.
[0094] The final B-scan alignment evaluation result is:
[0095] (6);
[0096] In the formula, is the weight of the expected cross-correlation coefficient, is the weight of the expected coincidence degree, is the weight of the key point matching rate, .
[0097] Embodiment 2:
[0098] As Figure 4 shown, this implementation provides a B-scan image alignment system in optical coherence layer imaging, including:
[0099] An image acquisition unit, configured to: obtain multiple B-scan images with the same size at the same position through optical coherence layer scanning, and the number and position of pixel points included in each B-scan image are the same;
[0100] A total gray value calculation unit, configured to: calculate the total gray value of each pixel point to obtain a gray value map, and each pixel point on the gray value map corresponds to a calculated total gray value;
[0101] An alignment scheme generation unit, configured to: take the first pixel point of the gray value map as the center, and use the number of pixels occupied by blood vessels on the gray value map as the diameter to enclose a circular area. In the circular area, select two B-scan images for cross-correlation analysis, move the image position, determine the position with the maximum cross-correlation coefficient to complete alignment, and perform alignment on the remaining B-scan images in sequence to obtain an alignment scheme;
[0102] An alignment scheme optimization unit, configured to: take multiple other pixel points of the gray value map as the center to obtain multiple alignment schemes, and select the optimal alignment scheme according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching rate.
[0103] For the specific working process of each unit, see the introduction in Embodiment 1, which will not be elaborated here.
[0104] It can be understood that the above-mentioned units can be separately or all combined into one or several other units to form, or some of them can be further split into multiple smaller units in terms of function to form, which can achieve the same operations without affecting the realization of the technical effects of the embodiments of the present application. The above units are divided based on logical functions. In practical applications, the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present application, the system can also include other units. In practical applications, these functions can also be assisted by other units and can be realized by the cooperation of multiple units.
[0105] According to another embodiment of the present application, the system described in this embodiment can be constructed and the method of Embodiment 1 of the present application can be implemented by running a computer program (including program code) that can execute the respective steps involved in the corresponding method described in Embodiment 1 on a general computing device such as a computer including processing elements and storage elements such as a central processing unit (CPU), a random access memory (RAM), and a read-only memory (ROM). The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above computing device through the computer-readable recording medium and run therein.
[0106] Embodiment 3:
[0107] As Figure 5 shown, this implementation provides an electronic device, which includes a processor 1001, a communication interface 1002, and a computer-readable storage medium 1003. Among them, the processor 1001, the communication interface 1002, and the computer-readable storage medium 1003 can be connected through a bus or other means.
[0108] Among them, the communication interface 1002 is used to receive and send data. The computer-readable storage medium 1003 can be stored in the memory of the electronic device. The computer-readable storage medium 1003 is used to store a computer program, and the computer program includes program instructions. The processor 1001 is used to execute the program instructions stored in the computer-readable storage medium 1003.
[0109] The processor 1001 (or CPU (Central Processing Unit, central processor)) is the computing core and control core of the electronic device, and is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function.
[0110] The processor 1001 is configured to execute the following process:
[0111] Obtain multiple B-scan images of the same size at the same position through optical coherence layer scanning, and the number and position of the pixel points included in each B-scan image are the same;
[0112] Calculate the total gray value of each pixel point to obtain a gray value map, and each pixel point on the gray value map corresponds to a calculated total gray value;
[0113] Taking the first pixel point of the gray value map as the center and the number of pixels occupied by the blood vessel on the gray value map as the diameter, delineate a circular area. In the circular area, select two B-scan images for cross-correlation analysis, move the image position, determine the position with the maximum cross-correlation coefficient to complete alignment, and perform sequential alignment on the remaining B-scan images to obtain an alignment scheme;
[0114] Taking multiple other pixel points of the gray value map as the center, obtain multiple alignment schemes, and select the optimal alignment scheme according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching rate.
[0115] For the specific working process, see the introduction in Embodiment 1 and will not be elaborated here.
[0116] Embodiment 4:
[0117] This implementation provides a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in an electronic device for storing programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the electronic device and, of course, the extended storage medium supported by the electronic device. The computer-readable storage medium provides a storage space, and this storage space stores the processing system of the electronic device.
[0118] Moreover, one or more instructions suitable for being loaded and executed by the processor are also stored in this storage space. These instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory; optionally, it can also be at least one computer-readable storage medium located far from the aforementioned processor.
[0119] In one embodiment, one or more instructions are stored in the computer-readable storage medium; the processor loads and executes one or more instructions stored in the computer-readable storage medium to implement the following process:
[0120] Obtain multiple B-scan images of the same size at the same position through optical coherence layer scanning. The number and position of the pixel points included in each B-scan image are the same;
[0121] Calculate the total gray value of each pixel point to obtain a gray value map. Each pixel point on the gray value map corresponds to a calculated total gray value;
[0122] Taking the first pixel point of the gray value map as the center and the number of pixels occupied by blood vessels on the gray value map as the diameter, enclose a circular area. In the circular area, select two B-scan images to perform cross-correlation analysis on them. Move the image position to determine the position with the maximum cross-correlation coefficient to complete alignment, and perform sequential alignment on the remaining B-scan images to obtain an alignment scheme;
[0123] Taking multiple other pixel points of the gray value map as the center, obtain multiple alignment schemes, and select the optimal alignment scheme according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching rate.
[0124] For the specific working process, refer to the introduction in Embodiment 1 and will not be elaborated here.
[0125] Embodiment 5:
[0126] This implementation provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to enable the electronic device to perform the following process:
[0127] Obtain multiple B-scan images of the same size at the same position through optical coherence layer scanning. The number and position of the pixel points included in each B-scan image are the same;
[0128] Calculate the total gray value of each pixel point to obtain a gray value map. Each pixel point on the gray value map corresponds to a calculated total gray value;
[0129] Taking the first pixel point of the gray value map as the center and the number of pixels occupied by blood vessels on the gray value map as the diameter, enclose a circular area. In the circular area, select two B-scan images to perform cross-correlation analysis on them. Move the image position to determine the position with the maximum cross-correlation coefficient to complete alignment, and perform sequential alignment on the remaining B-scan images to obtain an alignment scheme;
[0130] Taking multiple other pixel points of the gray value map as the center, obtain multiple alignment schemes, and select the optimal alignment scheme according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching rate.
[0131] For the specific working process, please refer to the description in Embodiment 1 and will not be elaborated here.
[0132] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0133] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data processing device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0134] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An alignment method for B-scan images in optical coherence tomography, characterized in that It includes the following processes: Obtain multiple B-scan images with the same size at the same position through optical coherence layer scanning, and the number and position of pixel points included in each B-scan image are the same; Calculate the total gray value of each pixel point to obtain a gray value map, and each pixel point on the gray value map corresponds to a calculated total gray value; Taking the first pixel point of the gray value map as the center and the number of pixels occupied by blood vessels on the gray value map as the diameter, enclose a circular area. In the circular area, select two B-scan images to perform cross-correlation analysis, move the image position, determine the position with the maximum cross-correlation coefficient to complete alignment, and perform sequential alignment on the remaining B-scan images to obtain an alignment scheme; The first pixel point is the pixel point with the maximum gray value, the multiple other pixel points do not include the first pixel point, and the gray values of the multiple other pixel points are all greater than a set threshold; Taking multiple other pixel points of the gray value map as the center, obtain multiple alignment schemes, and select the optimal alignment scheme according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching rate; Expected cross-correlation coefficient is: = ; Wherein, is the cross-correlation coefficient between the first B-scan and the th B-scan within the region S, is the total number of B-scan samples minus the number of reference samples 1, and S is the total area of the aligned B-scan images; Desired coincidence degree is as follows: ; Among them, is the number of overlapping points between the 1st B-scan and the th B-scan within the region S, where S is the total area of the aligned B-scan images, is the total number of pixel points, is the total number of B-scan samples taken minus the number of reference samples, which is 1; The key point matching rate is : ; Among them, is the number of selected key points, is the number of B-scans with the same gray value as the reference B-scan image at the selected key points.
2. The B-scan image alignment method in optical coherence layer imaging according to claim 1, characterized in that Calculate the total grayscale value of any pixel point ( ), including: Set the number of B-scan images to N, and the gray value at the pixel point ( ) of each B-scan image is , then the total gray value of ( ) is: .
3. The B-scan image alignment method in optical coherence layer imaging according to claim 1, characterized in that Select two B-scan images to perform cross-correlation analysis on them, move the image position, and determine the position with the maximum cross-correlation coefficient to complete alignment, including: Taking two adjacent sides of the B-scan image as the X-axis and Y-axis respectively, set up a right-handed coordinate system XOY. Fix one B-scan as the first B-scan, move the other B-scan along the X-axis, and the other B-scan is used as the second B-scan to find the image position when the cross-correlation coefficient is the largest; then fix the X-axis, move the position of the second B-scan along the Y-axis, and find the image position when the cross-correlation coefficient is the largest again. This position is the aligned position of these two B-scan images.
4. The B-scan image alignment method in optical coherence layer imaging according to claim 3, characterized in that Performing sequential alignment on the remaining B-scan images to obtain an alignment scheme, including: Taking the first B-scan as the fixed B-scan image, sequentially calibrating the remaining other B-scan images; or, assuming the number of B-scan images is N, taking the calibrated second B-scan as the fixed B-scan image, calibrating the third B-scan, taking the calibrated third B-scan as the fixed B-scan image, calibrating the fourth B-scan, and taking the calibrated (N - 1)th B-scan as the fixed B-scan image, calibrating the Nth B-scan.
5. The B-scan image alignment method in optical coherence layer imaging according to any one of claims 1-3, characterized in that Assume that the width of the selected blood vessel is , the resolution of the imaging device is , and the number of pixels occupied by the blood vessel on the image is determined to be , where represents rounding up.
6. The B-scan image alignment method in optical coherence layer imaging according to claim 1, characterized in that Select an optimal alignment scheme based on the expected cross-correlation coefficient, expected coincidence degree, and key point matching, including: Calculate the alignment evaluation result : , where is the weight of the expected cross-correlation coefficient, is the weight of the expected coincidence degree, is the weight of the key point matching rate, , is the expected cross-correlation coefficient, is the expected coincidence degree, is the key point matching rate.
7. The B-scan image alignment method in optical coherence layer imaging according to claim 1, characterized in that: Total area of the B-scan pattern after alignment is as follows: ; Wherein, X and Y are respectively the original length and width of the B-scan, both in the unit of pixel number. is the maximum value of the rightward offset of the X-axis during alignment. is the maximum value of the leftward movement of the X-axis during alignment. is the maximum value of the rightward offset of the Y-axis during alignment. is the maximum value of the leftward movement of the Y-axis during alignment.
8. An alignment system for B-scan images in optical coherence tomography, characterized in that, It includes: An image acquisition unit configured to: obtain multiple B-scan images of the same size at the same position through optical coherence layer scanning, and the number and position of pixel points included in each B-scan image are the same; A total gray value calculation unit configured to: calculate the total gray value of each pixel point to obtain a gray value map, and each pixel point on the gray value map corresponds to a calculated total gray value; An alignment scheme generation unit configured to: with the first pixel point of the gray value map as the center and the number of pixels occupied by blood vessels on the gray value map as the diameter, enclose a circular area. In the circular area, select two B-scan images for cross-correlation analysis, move the image position, determine the position with the maximum cross-correlation coefficient to complete alignment, and sequentially align the remaining B-scan images to obtain an alignment scheme; The first pixel point is the pixel point with the maximum gray value, the multiple other pixel points do not include the first pixel point, and the gray values of the multiple other pixel points are all greater than a set threshold; An alignment scheme optimization unit configured to: with multiple other pixel points of the gray value map as the center, obtain multiple alignment schemes, and select an optimal alignment scheme according to the expected cross-correlation coefficient, expected coincidence degree, and key point matching rate; Expected cross-correlation coefficient is as follows: = ; Wherein, is the cross-correlation coefficient between the first B-scan and the th B-scan within the region S, is the total number of B-scan samples minus the number of reference samples 1, and S is the total area of the aligned B-scan images; Desired coincidence degree is as follows: ; Among them, is the number of overlapping points between the first B-scan and the th B-scan within the region S, where S is the total area of the aligned B-scan images, is the total number of pixel points, is the total number of B-scan samples taken minus the reference sample number 1; The key point matching rate is : ; Among them, is the number of selected key points, is the number of B-scans with the same gray value as that in the reference B-scan image at the selected key points.
9. A computer device, characterized in that, It includes: A processor and a computer-readable storage medium; The processor is adapted to execute a computer program; The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the B-scan image alignment method in optical coherence layer imaging according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is adapted to be loaded and executed by the processor for the B-scan image alignment method in optical coherence layer imaging according to any one of claims 1 to 7.
11. A computer program product, characterized in that, The computer program product includes a computer program, and when the computer program is executed by the processor, the B-scan image alignment method in optical coherence layer imaging according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Optical coherence tomography retina image correction method and device
CN114343565A
Method for improving quality of scanned image based on multi-frame registration and averaging algorithm
CN115829891A