Optical fiber image real-time correction method, device, storage medium, and electronic device
By calculating the real-time correction coefficient of the fiber pair composed of the optical fiber center, the optical fiber image is corrected in real-time, which solves the deviation problem caused by the optical fiber image due to noise and improves the image accuracy.
Patent Information
- Application Number
- CN202310347299.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-03
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2043-04-03
AI Technical Summary
In the prior art, the deviation problem caused by noise in optical fiber images has not been effectively solved, affecting the accuracy of the image.
By calculating the real-time correction coefficient of the fiber pair composed of the optical fiber center, including gain parameters and bias parameters, real-time correction of the fiber image is performed, noise interference is eliminated, and image accuracy is improved.
Accurate correction of fiber optic images is achieved, noise interference is eliminated, image accuracy is improved, and the problem of fiber optic image deviation is solved.
Smart Images

Figure CN116584874B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of optical fiber imaging, and more specifically, to a method, device, storage medium, and electronic device for real-time correction of optical fiber images. Background Art
[0002] Microendoscopes are widely used in medical observation and detection. Optical fibers and galvanometers are important components of microendoscopes. An entire optical fiber is usually composed of tens of thousands of optical fiber units. Usually, the center position of each optical fiber unit is fixed. In actual use, due to the limitations of the scanning accuracy of the galvanometer and the bending changes of the optical fiber during use, it is impossible to ensure that each scan is in the same position when the end face is fixed. Therefore, as time changes, the scanning position of the galvanometer and the position of the optical fiber will change, and accordingly, the center position of each optical fiber unit in an entire optical fiber will also change. This phenomenon is called fiber drift.
[0003] When solving the problem of fiber drift, it is necessary to perform real-time correction of the fiber image according to the image output by the fiber, and then perform image correction. However, when the fiber transmits the image, it is interfered by many reasons, such as noise, which causes the pixel signal of the original image to be inaccurate.
[0004] With regard to the problem in the related art that the optical fiber image deviates from the original image due to noise, no effective solution has been proposed so far. Summary of the invention
[0005] The main purpose of the present application is to provide a method, device, storage medium, and electronic device for real-time correction of optical fiber images to solve the problem in the related art that the optical fiber image deviates from the original image due to noise.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for real-time correction of optical fiber images is provided, the method comprising: receiving an original signal of an optical fiber image, wherein the original signal is an optical signal directly output by the optical fiber; calculating a real-time correction coefficient based on an optical fiber pair composed of optical fiber centers of the optical fiber, wherein the optical fiber comprises a plurality of line bundles, each line bundle corresponding to an optical fiber center; performing real-time correction on the original signal according to the real-time correction coefficient to determine a corrected signal.
[0007] Optionally, calculating the real-time correction coefficient based on the fiber pair formed by the fiber center of the optical fiber includes: determining the fiber pair including the fiber center from the multiple fiber centers of the optical fiber image; calculating the fiber pair parameters and the fiber pair correlation based on the fiber pairs in multiple frames of continuous images; and calculating the real-time correction coefficient based on the fiber pair parameters and the fiber pair correlation.
[0008] Optionally, determining a fiber pair including the fiber center from the multiple bundles of optical fibers includes: determining multiple adjacent fiber centers within a preset range around the fiber center; and forming fiber pairs with the fiber center and the multiple adjacent fiber centers, respectively.
[0009] Optionally, calculating the fiber pair parameters and fiber pair correlation based on the fiber pairs in multiple frames of continuous images includes: fitting the grayscale value of each fiber pair based on the fiber pairs in the multiple frames of continuous images to determine its change relationship curve; calculating the fiber pair parameters based on the change relationship curve, the fiber pair parameters including gain parameters and bias parameters; and calculating the fiber pair correlation based on the Pearson correlation coefficient of the grayscale value of each fiber pair.
[0010] Optionally, calculating the real-time correction coefficient according to the fiber pair parameters and the fiber pair correlation includes: determining the weight of the fiber pair according to the fiber pair correlation; calculating the real-time correction coefficient according to the gain parameter, bias parameter and the weight of the fiber pair, wherein the real-time correction coefficient includes a real-time gain coefficient and a real-time bias coefficient.
[0011] Optionally, the original signal is corrected in real time according to the real-time correction coefficient, and determining the corrected signal includes: multiplying the original signal by the real-time gain coefficient, adding the real-time offset coefficient, and calculating the corrected signal.
[0012] Optionally, according to the optical fiber pairs in multiple frames of continuous images, the grayscale value of each optical fiber pair is fitted, and before determining its change relationship curve, the method also includes: eliminating data with zero grayscale value of pixel points in the multiple frames of continuous images; eliminating outliers in the multiple frames of continuous images; wherein the outliers are data determined based on the residual median of the optical fiber pair and are far away from the residual median.
[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a real-time correction device for optical fiber images is provided, comprising: a receiving module for receiving the original signal of the optical fiber image, wherein the original signal is an optical signal directly output by the optical fiber; a calculation module for calculating a real-time correction coefficient based on an optical fiber pair composed of optical fiber centers of the optical fiber, wherein the optical fiber includes multiple bundles, and the multiple bundles include the optical fiber center; a correction module for performing real-time correction on the original signal according to the real-time correction coefficient to determine the corrected signal.
[0014] In order to achieve the above object, according to another aspect of the present application, a computer-readable storage medium is provided, wherein the storage medium is used to store a program, wherein the program executes any one of the above-mentioned methods for real-time correction of optical fiber images.
[0015] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an electronic device is provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned methods for real-time correction of optical fiber images.
[0016] The present application receives the original signal of the optical fiber image, wherein the original signal is the optical signal directly output by the optical fiber; calculates the real-time correction coefficient according to the optical fiber pair composed of the optical fiber center of the optical fiber, wherein the optical fiber includes a plurality of line bundles, and each line bundle corresponds to the optical fiber center; performs real-time correction on the original signal according to the real-time correction coefficient to determine the corrected signal. The real-time correction coefficient is determined by using the optical fiber pair, and the original signal of the optical fiber is corrected in real time, thereby improving the accuracy of the optical fiber image and eliminating the deviation of the optical fiber image. This solves the problem of the optical fiber image in the related art that is caused by noise and has a deviation from the original image. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 is a flow chart of a method for real-time correction of optical fiber images provided according to an embodiment of the present application;
[0019] Figure 2 is a schematic diagram of a real-time optical fiber image correction device provided according to an embodiment of the present application;
[0020] Figure 3 It is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0022] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] The present invention is described below in conjunction with preferred implementation steps. Figure 1 is a flow chart of a method for real-time correction of optical fiber images provided according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0025] Step S101, receiving an original signal of an optical fiber image, wherein the original signal is an optical signal directly output by the optical fiber;
[0026] Step S102, calculating a real-time correction coefficient according to an optical fiber pair composed of optical fiber centers of the optical fiber, wherein the optical fiber includes a plurality of line bundles, each line bundle corresponding to an optical fiber center;
[0027] Step S103, performing real-time correction on the original signal according to the real-time correction coefficient to determine a corrected signal.
[0028] The above steps receive the original signal of the optical fiber image, wherein the original signal is the optical signal directly output by the optical fiber; calculate the real-time correction coefficient according to the optical fiber pair composed of the optical fiber center of the optical fiber, wherein the optical fiber includes multiple line bundles, and each line bundle corresponds to the optical fiber center; perform real-time correction on the original signal according to the real-time correction coefficient to determine the corrected signal. The real-time correction coefficient is determined by using the optical fiber pair to perform real-time correction on the original signal of the optical fiber, thereby improving the accuracy of the optical fiber image and eliminating the deviation of the optical fiber image. This solves the problem of the optical fiber image in the related art that is caused by noise and has a deviation from the original image.
[0029] The execution subject of the above steps may be a medical endoscope device, which may include a processor, a calculator or a controller and other data processing devices to perform the data processing operations in the above steps, such as steps S101 to S103.
[0030] The medical endoscope may include an endoscope, an optical fiber, an image processor and a display. The endoscope collects images and transmits them through the optical fiber to the image processor for image processing, and then the images are displayed on the display. The image processor may include the processor, a computer, a controller or a server and other devices with data processing capabilities.
[0031] Considering that the optical fiber image is disturbed by various reasons during the transmission process, resulting in the difference between the collected optical fiber image signal and the collected image initial signal, this embodiment provides a real-time correction method, using an optical fiber pair including the center of the optical fiber in the optical fiber to calculate a real-time correction coefficient, and correcting the optical fiber image in real time by the real-time correction coefficient for subsequent analysis and display.
[0032] The optical fiber includes a plurality of line bundles, and each line bundle has a corresponding image area in the optical fiber image. The optical fiber center is the pixel point or pixel coordinate corresponding to the center of the line bundle in the image area.
[0033] It should be noted that in order to allow the fiber center to effectively form multiple fiber pairs, the fiber center selected above can be one of the multiple fiber centers in the middle area of the fiber image. The fiber center selected in this way has adjacent fiber centers in all directions. When forming a fiber pair, the fiber center and other fiber centers within a preset range are respectively formed into fiber pairs. The connection relationship mathematical model established in this way is more in line with the actual situation, and the calculated real-time correction coefficient is more accurate.
[0034] The above real-time correction coefficient may include a gain parameter and an offset parameter. The corrected signal can be obtained by multiplying the gain parameter with the original signal and adding the offset parameter.
[0035] Optionally, calculating the real-time correction coefficient based on the fiber pair at the fiber center of the optical fiber includes: determining the fiber pair including the fiber center from multiple fiber centers of the optical fiber image; calculating fiber pair parameters and fiber pair correlation based on the fiber pairs in multiple frames of continuous images; and calculating the real-time correction coefficient based on the fiber pair parameters and the fiber pair correlation.
[0036] Since there are multiple fiber centers in the fiber image, there are many possible ways to form a fiber pair. When analyzing, you first need to select a fiber center for analysis. The real-time correction coefficient of the fiber center is obtained by analysis. When correcting, the image area corresponding to the fiber center is corrected by the real-time correction coefficient to achieve correction of the entire fiber image.
[0037] In this embodiment, all optical fiber centers can be analyzed one by one to maximize the correction effect of the optical fiber image.
[0038] Optionally, determining a fiber pair including a fiber center from multiple optical fiber bundles includes: determining multiple adjacent fiber centers within a preset range around the fiber center; and forming fiber pairs with the fiber center and the multiple adjacent fiber centers, respectively.
[0039] When selecting a fiber pair, the center of the currently analyzed fiber is taken as the center, and multiple adjacent fiber centers within a preset range and the currently analyzed fiber center are combined into fiber pairs, so that the correlation of the constructed data model and the determined fiber pairs is more in line with the actual situation, and the accuracy of the correction is improved.
[0040] Optionally, calculating the fiber pair parameters and fiber pair correlation based on the fiber pairs in multiple frames of continuous images includes: fitting the grayscale value of each fiber pair based on the fiber pairs in the multiple frames of continuous images to determine its change relationship curve; calculating the fiber pair parameters based on the change relationship curve, the fiber pair parameters including gain parameters and bias parameters; and calculating the fiber pair correlation based on the Pearson correlation coefficient of the grayscale value of each fiber pair.
[0041] The mathematical model created by the fiber pair is:
[0042]
[0043]
[0044] Solving it yields:
[0045]
[0046] In the formula, υ i (t) represents the gray value of the center position of the ith fiber unit in the tth frame fiber image, υ j (t) represents the gray value of the center position of the jth fiber unit in the tth frame fiber image, α i represents the gain coefficient of the gray value at the center position of the i-th fiber unit, β i The bias coefficient of the gray value at the center position of the i-th fiber unit, α j The gain coefficient of the gray value at the center position of the jth fiber unit, β j The bias coefficient of the gray value at the center position of the jth fiber unit, ε ij (t) represents the error term between the gray value of the position of the center of the i-th optical fiber unit and the center of the j-th optical fiber unit in the t-th frame optical fiber image and the fitting curve.
[0047] The Pearson correlation coefficient is used to measure v i 、v j The degree of correlation, the Pearson correlation coefficient between two variables is defined as the quotient of the covariance and the standard deviation between the two variables.
[0048]
[0049] In the formula, ρ X,Y For the two fiber units of the fiber pair v i 、v j The relativity of X is the gray value of vi, and Y is the gray value of v j Gray value, cov is the covariance, σ X , σ Y They are v i and v j The standard deviation of .
[0050] Optionally, calculating the real-time correction coefficient based on the fiber pair parameters and the fiber pair correlation includes: determining the weight of the fiber pair based on the fiber pair correlation; calculating the real-time correction coefficient based on the gain parameter, bias parameter and weight of the fiber pair, wherein the real-time correction coefficient includes a real-time gain coefficient and a real-time bias coefficient.
[0051] According to the degree of correlation between the fiber pairs, a corresponding weight is assigned to each fiber pair, and the real-time correction coefficients, including real-time gain coefficients and real-time bias coefficients, are calculated based on the fiber pair coefficients. The original image is corrected in real time to obtain the real signal.
[0052] Optionally, the original signal is corrected in real time according to the real-time correction coefficient, and determining the corrected signal includes: multiplying the original signal with the real-time gain coefficient, adding the real-time offset coefficient, and calculating the corrected signal.
[0053] Optionally, before fitting the grayscale value of each fiber pair in the multiple continuous frames of images and determining the change relationship curve thereof, the method further includes: removing the data whose grayscale value of the pixel point in the multiple continuous frames of images is zero; removing the outliers in the multiple continuous frames of images, wherein the outliers are data determined based on the residual median of the fiber pair and are far from the residual median position, that is, data whose distance from the residual median position exceeds a preset distance.
[0054] When calculating the fiber pair coefficients, remove the data with pixel grayscale values of 0 and remove outliers. The above two cases do not participate in the fiber pair parameter calculation. Method for removing outliers: set the respective outlier standards according to the residual median σ of each group of fiber pairs. Data with a pixel grayscale value of 0 is an invalid signal. Participating in the fiber pair parameter calculation will introduce noise. Removing data with a pixel grayscale value of 0 will make the image correction more accurate. If there are data with large errors in the data, remove outliers to reduce the impact on the fitting results, and the image correction will be more accurate.
[0055] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0056] It should be noted that the present application also provides an optional implementation, which is described in detail below.
[0057] This embodiment provides a method for real-time correction of optical fiber images. The following is an explanation of the terms involved in this embodiment:
[0058] Fiber center: The optical fiber is divided into a cladding and a core. The core has a large transmittance. The pixel point with the largest transmittance of each optical fiber (hexagonal structure) is regarded as the fiber center of the optical fiber.
[0059] Fiber pair: When a laser light source excites the object to be measured, the signals collected by optical fibers at similar positions have a certain relationship. Optical fibers with a certain relationship are considered to be a fiber pair.
[0060] Fiber pair coefficient: It is solved based on N frames of images and used to calculate the real-time correction coefficient.
[0061] Since the optical fiber image is disturbed by various reasons, the pixel signal of the collected original image is inaccurate. To address the problem of inaccurate pixel signal, a mathematical model is used to restore the original real signal.
[0062] Original signal*real-time correction coefficient=corrected signal.
[0063] Real-time correction coefficient: The real-time correction coefficient is calculated based on the fiber pair coefficient solution and is used to correct the image in real time.
[0064] Problems with the related technology: the calculated real-time correction coefficient is inaccurate, and the image obtained after the real-time correction of the original image still has large noise.
[0065] The method of this embodiment is as follows: the optical fiber center and other optical fiber centers within its circular neighborhood (R>10) are respectively formed into optical fiber pairs, and a stable connection relationship is directly established. A mathematical model is established through the optical fiber pair relationship established in N consecutive frames of images, and the optical fiber pair coefficients are regressed to calculate the optical fiber pair correlation. According to the degree of correlation of the optical fiber pairs, a corresponding weight is assigned to each group of optical fiber pairs, and a real-time correction coefficient is calculated according to the optical fiber pair coefficient, and the original image is corrected in real time to obtain a real signal.
[0066] Orthogonal regression estimation of fiber pair parameters: gain a ij , bias b ij
[0067]
[0068]
[0069]
[0070]
[0071] υ i (t) represents the gray value of the center position of the ith fiber unit in the tth frame fiber image, υ j (t) represents the gray value of the center position of the jth fiber unit in the tth frame fiber image, α i represents the gain coefficient of the gray value at the center position of the i-th fiber unit, β i The bias coefficient of the gray value at the center position of the i-th fiber unit, α j The gain coefficient of the gray value at the center position of the jth fiber unit, β j The bias coefficient of the gray value at the center position of the jth fiber unit, ε ij (t) represents the error term between the gray value of the position of the center of the i-th optical fiber unit and the center of the j-th optical fiber unit in the t-th frame optical fiber image and the fitting curve.
[0072] When calculating the fiber pair coefficient, remove the data with pixel grayscale value containing 0 and remove outliers. The above two cases do not participate in the fiber pair parameter calculation. Method for removing outliers: set the outlier standard according to the residual median σ of each group of fiber pairs.
[0073] Beneficial effects: Data with a pixel grayscale value of 0 is an invalid signal, which will introduce noise when participating in the calculation of fiber pair parameters. Removing data with a pixel grayscale value of 0 will make image correction more accurate. If there is data with large errors in the data, outliers can be removed to reduce the impact on the fitting results, making image correction more accurate.
[0074] Fiber pair correlation: measured by Pearson correlation coefficient v i 、v j The degree of correlation, the Pearson correlation coefficient between two variables is defined as the quotient of the covariance and the standard deviation between the two variables.
[0075]
[0076] In the formula, ρ X,Y For the two fiber units of the fiber pair v i 、v j The relativity of X is the gray value of vi, and Y is the gray value of v j Gray value, cov is the covariance, σ X , σ Y They are v i and vj The standard deviation of .
[0077] Each set of fiber pair weights is activated according to the fiber pair correlation.
[0078] Get real-time correction coefficient α i , β i , correct the original signal of the optical fiber image.
[0079] In the related technology, a triangular mesh is established by the center of the optical fiber. The two optical fiber centers of each edge form a group of optical fiber pairs. In this way, the optical fiber center only directly forms an optical fiber pair with the surrounding pixel points, and has a weak connection with the optical fiber centers outside the range of the surrounding pixel points. If a certain optical fiber center is an invalid signal, the overall connection relationship is affected, which ultimately leads to inaccurate real-time correction coefficients.
[0080] In this implementation, the optical fiber center and other optical fiber centers within its circular neighborhood (R>10) are respectively formed into optical fiber pairs. Through this direct and stable optical fiber pair grouping method, and according to the degree of correlation between the optical fiber pairs, corresponding weights are assigned to each group of optical fiber pairs to solve and calculate the real-time correction coefficient of the optical fiber. Because the mathematical model established in this way is more in line with the characteristics of the optical fiber, the real-time correction is performed through the calculated real-time correction coefficient, and the image effect is better.
[0081] Figure 2 is a schematic diagram of a real-time optical fiber image correction device provided according to an embodiment of the present application, such as Figure 2 As shown, the embodiment of the present application also provides a real-time correction device for optical fiber images. It should be noted that the real-time correction device for optical fiber images in the embodiment of the present application can be used to execute the real-time correction method for optical fiber images provided in the embodiment of the present application. The real-time correction device for optical fiber images provided in the embodiment of the present application is introduced below. The device includes: a receiving module 21, a computing module 22, and a correction module 23, as follows.
[0082] A receiving module 21 is used to receive the original signal of the optical fiber image, wherein the original signal is an optical signal directly output by the optical fiber; a computing module 22 is connected to the above-mentioned receiving module 21, and is used to calculate a real-time correction coefficient based on an optical fiber pair composed of optical fiber centers of the optical fiber, wherein the optical fiber includes a plurality of line bundles, and each line bundle corresponds to an optical fiber center; a correction module 23 is connected to the above-mentioned computing module 22, and is used to perform real-time correction on the original signal according to the real-time correction coefficient to determine a corrected signal.
[0083] The above-mentioned optical fiber image real-time correction device receives the original signal of the optical fiber image, wherein the original signal is the light signal directly output by the optical fiber; calculates the real-time correction coefficient according to the optical fiber pair composed of the optical fiber center of the optical fiber, wherein the optical fiber includes a plurality of line bundles, and each line bundle corresponds to a fiber center; performs real-time correction on the original signal according to the real-time correction coefficient to determine the corrected signal. The real-time correction coefficient is determined by using the optical fiber pair to perform real-time correction on the original signal of the optical fiber, thereby improving the accuracy of the optical fiber image and eliminating the deviation of the optical fiber image. This solves the problem in the related art that the optical fiber image deviates from the original image due to noise.
[0084] The optical fiber image real-time correction device includes a processor and a memory. The receiving module 21, the calculation module 22, the correction module 23, etc. are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
[0085] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem in the related art that the user cannot determine whether the capacitive pen that is not originally provided with the capacitive screen is compatible when used is solved by adjusting the kernel parameters.
[0086] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0087] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the real-time optical fiber image correction method or the optical fiber image correction method is implemented.
[0088] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the optical fiber image real-time correction method or the optical fiber image correction method when running.
[0089] Figure 3 is a schematic diagram of an electronic device provided according to an embodiment of the present application, such as Figure 3 As shown, an embodiment of the present application provides an electronic device 30, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the above-mentioned real-time optical fiber image correction method or the steps of the optical fiber image correction method are implemented.
[0090] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0091] The present application also provides a computer program product, which, when executed on a fiber optic image real-time correction device, is suitable for executing a program initialized with any of the above method steps.
[0092] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0093] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable fiber optic image real-time correction device to produce a machine, so that the instructions executed by the processor of the computer or other programmable fiber optic image real-time correction device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0094] These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable optical fiber image real-time correction device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0095] These computer program instructions can also be loaded onto a computer or other programmable fiber optic image real-time correction device, so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0096] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0097] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0098] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0099] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0100] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0101] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for real-time correction of optical fiber images, characterized in that: The method comprises: Receiving an original signal of an optical fiber image, wherein the original signal is an optical signal directly output by the optical fiber; Calculating a real-time correction coefficient based on an optical fiber pair composed of optical fiber centers of the optical fiber, wherein the optical fiber includes a plurality of line bundles, each line bundle corresponds to an optical fiber center; wherein the optical fiber center is a pixel point or pixel coordinate corresponding to the center of the line bundle in the image area; According to the real-time correction coefficient, the original signal is corrected in real time to determine a corrected signal; The calculating of the real-time correction coefficient according to the optical fiber pair formed by the optical fiber center of the optical fiber comprises: Determining a fiber pair including the fiber center from the multiple fiber centers of the fiber image, including: determining multiple adjacent fiber centers within a preset range around the fiber center; forming fiber pairs with the fiber center and the multiple adjacent fiber centers respectively; Calculating fiber pair parameters and fiber pair correlation according to the fiber pairs in multiple frames of continuous images, including: fitting the grayscale value of each fiber pair according to the fiber pairs in multiple frames of continuous images to determine its change relationship curve; calculating the fiber pair parameters according to the change relationship curve, the fiber pair parameters including gain parameters and bias parameters; calculating the fiber pair correlation according to the correlation coefficient of the grayscale value of each fiber pair; The real-time correction coefficient is calculated according to the optical fiber pair parameter and the optical fiber pair correlation, wherein the ... Determining a weight of the optical fiber pair according to the optical fiber pair correlation; Calculating a real-time correction coefficient according to a gain parameter, a bias parameter and the weight of the optical fiber pair, wherein the real-time correction coefficient includes a real-time gain coefficient and a real-time bias coefficient; Among them, the mathematical model created by the optical fiber pair is: ; In the formula, υ i (t) represents the gray value of the center position of the ith fiber unit in the tth frame fiber image, υ j (t) represents the gray value of the center position of the jth fiber unit in the tth frame fiber image, α i represents the gain coefficient of the gray value at the center position of the i-th fiber unit, β i The bias coefficient of the gray value at the center position of the i-th fiber unit, α j The gain coefficient of the gray value at the center position of the jth fiber unit, β j The bias coefficient of the gray value at the center position of the jth fiber unit, ε ij (t) represents the error term between the gray value of the position of the center of the i-th optical fiber unit and the center of the j-th optical fiber unit in the t-th frame optical fiber image and the fitting curve.
2. The method according to claim 1, characterized in that According to the real-time correction coefficient, the original signal is corrected in real time, and determining the corrected signal includes: The original signal is multiplied by the real-time gain coefficient, and the real-time offset coefficient is added to calculate a corrected signal.
3. The method according to claim 1, characterized in that According to the optical fiber pairs in the multiple frames of continuous images, before fitting the grayscale value of each optical fiber pair to determine the variation relationship curve thereof, the method further comprises: Eliminate the data with zero grayscale value of pixels in multiple frames of continuous images; Outliers in multiple frames of continuous images are removed; wherein the outliers are data determined based on the residual median of the optical fiber pair and are far away from the residual median.
4. A real-time optical fiber image correction device, characterized in that: include: A receiving module, used to receive the original signal of the optical fiber image, wherein the original signal is the optical signal directly output by the optical fiber; A calculation module, for calculating a real-time correction coefficient according to a fiber pair composed of the fiber centers of the optical fiber, wherein the optical fiber includes a plurality of line bundles, each of which corresponds to a fiber center; and for determining a fiber pair including the fiber center from the plurality of fiber centers of the optical fiber image, including: determining a plurality of adjacent fiber centers within a preset range around the fiber center; forming fiber pairs with the fiber center and the plurality of adjacent fiber centers, respectively; calculating fiber pair parameters and fiber pair correlation according to the fiber pairs in multiple frames of continuous images; including: fitting the grayscale value of each fiber pair according to the fiber pairs in multiple frames of continuous images to determine its variation relationship curve; calculating the fiber pair parameters according to the variation relationship curve, the fiber pair parameters including gain parameters and bias parameters; and calculating the fiber pair correlation according to the correlation coefficient of the grayscale value of each fiber pair; The calculation module is also used to calculate the real-time correction coefficient according to the fiber pair parameters and the fiber pair correlation, which includes: determining the weight of the fiber pair according to the fiber pair correlation; calculating the real-time correction coefficient according to the gain parameter, bias parameter and weight of the fiber pair, wherein the real-time correction coefficient includes a real-time gain coefficient and a real-time bias coefficient; wherein the mathematical model created by the fiber pair is: ; In the formula, υ i (t) represents the gray value of the center position of the ith fiber unit in the tth frame fiber image, υ j (t) represents the gray value of the center position of the jth fiber unit in the tth frame fiber image, α i represents the gain coefficient of the gray value at the center position of the i-th fiber unit, β i The bias coefficient of the gray value at the center position of the i-th fiber unit, α j The gain coefficient of the gray value at the center position of the jth fiber unit, β j The bias coefficient of the gray value at the center position of the jth fiber unit, ε ij (t) represents the error term between the gray value of the position of the center of the i-th fiber unit and the center of the j-th fiber unit in the t-th frame fiber image and the fitting curve; The correction module is used to perform real-time correction on the original signal according to the real-time correction coefficient to determine a corrected signal.
5. A computer-readable storage medium, characterized in that: The storage medium is used to store a program, wherein the program executes the optical fiber image real-time correction method according to any one of claims 1 to 3.
6. An electronic device, characterized in that: The invention comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the optical fiber image real-time correction method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Gain medium of Raman amplifier
CN101093338A
Continuous and real-time calibration of fiber-based microscopic images
CN103959328A
Optical fiber bundle image processing method and device
CN107678153A
Confocal endoscope image processing method and system and computer equipment
CN111415312A
Optical fiber image correction method and device and computer readable storage medium
CN113570520A
