Disclosure of Invention
The first aspect of the present invention discloses a method for correcting image distortion, the method for correcting image distortion in the present invention includes the steps of:
s1: determining the number n of image scanning points;
s2: acquiring a voltage value and an image height value of each image scanning point, recording as a first data group, wherein the first data group is (x)1,y1)、(x2,y2)、(x3,y3)…(xn,yn) (ii) a Obtaining y ═ f (x) from the first data set; wherein, the voltage value is x, and the image height value is y; wherein y ═ f (x) is a nonlinear function;
s3: performing linear compensation correction on the y ═ f (x), and obtaining a second data set;
s4: and inputting the second data set into a control system to obtain a corrected image.
In a preferred embodiment, the specific steps of S3 are as follows: obtaining the inverse function of y ═ f (x), and recording x ═ f-1(y) linear assignment of y, respectively denoted as y11、y22、y33…ynn(ii) a According to x ═ f-1(y) obtaining x11、x22、x33…xnnObtaining a second data set respectively as (x)11,y11)、(x22,y22)、(x33,y33)…(xnn,ynn) (ii) a The second data set is a corrected voltage value and an image height value.
In a preferred embodiment, the second data set is stored in the control system, and in operation, the control system may retrieve the second data set directly to obtain the corrected image.
In a preferred embodiment, the specific steps of S3 are as follows: get y ═ f1(x),y=f1(x) Is a linear variation; and carrying out linear assignment on y, and respectively recording as y111、y222、y333…ynnn(ii) a According to y ═ f1(x) Respectively find x111、x222、x333…xnnnObtaining a second data set respectively as (x)111,y111)、(x222,y222)、(x333,y333)…(xnnn,ynnn) (ii) a The second data set is a corrected voltage value and an image height value.
In a second aspect of the invention, an optical coherence tomography apparatus is disclosed, which implements the above-described method for correcting image distortion.
A third aspect of the invention discloses a confocal laser fundus imager that implements the above-described method of correcting image distortion.
A fourth aspect of the present invention discloses a fundus scanning system that implements the above-described method for correcting image distortion.
A fifth aspect of the present invention discloses a fundus camera that implements the above-described method for correcting image distortion.
In a fifth aspect of the present invention, a laser treatment apparatus is disclosed, which implements the above-mentioned method for correcting image distortion.
Compared with the prior art, the method for correcting the image distortion can solve the problem of the image distortion from a bottom hardware layer, avoids using a complex image processing algorithm in the traditional scheme, and simplifies the design of equipment.
Detailed Description
In order to make the technical solution of the present invention clearer, the technical solution of the present invention is further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, a first aspect of the present invention discloses a method for correcting image distortion, which includes the following steps:
s1: determining the number n of image scanning points;
the term "number of image scanning points" refers to the number of pixels in the horizontal or vertical direction of the image.
In the invention, the number n of scanning points is not particularly limited, and the larger the value of the number n of scanning points is, the more favorable the correction of image distortion is; however, when the value of n is too large, the amount of data to be processed by the system is large.
S2: acquiring a voltage value and an image height value of each image scanning point, recording as a first data group, wherein the first data group is (x)1,y1)、(x2,y2)、(x3,y3)…(xn,yn) (ii) a Obtaining y ═ f (x) from the first data set; wherein, the voltage value is x, and the image height value is y; wherein y ═ f (x) is a nonlinear function;
the term "voltage value" refers to the rotation angle of the scanning galvanometer and the corresponding input voltage value.
The term "image height value" refers to the width of the scanned image.
For one image, a first data set, respectively (x), is obtained by optical fitting software1,y1)、(x2,y2)、(x3,y3)…(xn,yn) (ii) a Then performing function fitting on the first data set to obtain y ═ f (x); where y ═ f (x) is a nonlinear change due to: the scanning linear velocities of the galvanometers are different, so that certain image distortion is brought to the edge and the center of an image. Meanwhile, in practical processes, due to the curvature of the retina of the human eye and the aberration of the optical system, the distance between the X galvanometer and the Y galvanometer generates image distortion, so that Y ═ f (X) is a nonlinear change, and ideally, Y ═ f (X) is a linear change.
S3: performing linear compensation correction on the y ═ f (x), and obtaining a second data set;
in the above step S2, y ═ f (x) is a nonlinear change due to various reasons, that is, the image is distorted, and for eliminating the image distortion, those skilled in the art use an image processing algorithm to perform post-processing on the image to eliminate the distortion. For the scheme of the invention, technical innovation is carried out from a bottom hardware layer so as to eliminate the distortion condition. The invention conception of the invention is as follows: and (3) performing linear compensation based on the curve y ═ f (x) obtained by fitting to obtain a linearly-changed galvanometer voltage value, and further eliminating the distortion of the image from the bottom hardware layer.
In a preferred embodiment, the specific steps of S3 are as follows: obtaining the inverse function of y ═ f (x), and recording x ═ f-1(y) linear assignment of y, respectively denoted as y11、y22、y33…ynn(ii) a According to x ═ f-1(y) obtaining x11、x22、x33…xnnObtaining a second data set respectively as (x)11,y11)、(x22,y22)、(x33,y33)…(xnn,ynn) (ii) a The second data set is a corrected voltage value and an image height value.
In f (x), wherein x1、x2、x3…xnIs linearly varied, y1、y2、y3…ynFor non-linear changes, e.g. f (x) 6 x 10, obtained by optical fitting software during the course of the experiment-6x5-5*10-13x4+0.006x3+5*10-11x2+0.5577x,R21 is ═ 1; negating f (x) to obtain x ═ f-1(y) re-linearly assigning y, respectively denoted as y11、y22、y33…ynn(ii) a Again according to x ═ f-1(y) obtaining corresponding x11、x22、x33…xnnObtaining a second data set respectively as (x)11,y11)、(x22,y22)、(x33,y33)…(xnn,ynn) (ii) a The second data set is the corrected voltage value and the image height value. The function and the inverse function are symmetrical about y-x, and the corrected voltage value is changed linearly, so that image distortion is eliminated.
The formula (f), (x) is only an example, and the scope of the present invention is not limited to the formula as long as the inventive concept based on the present invention is equivalent to the present invention.
In a preferred embodiment, the second data set is stored in the control system, and in operation, the control system may retrieve the second data set directly to obtain the corrected image.
And the corrected second data group is stored in the control system, so that the workload in the operation process of the system can be reduced.
In another preferred embodiment, the specific step of S3 is: get y ═ f1(x),y=f1(x) Is a linear variation; and carrying out linear assignment on y, and respectively recording as y111、y222、y333…ynnn(ii) a According to y ═ f1(x) Respectively find x111、x222、x333…xnnnObtaining a second data set respectively as (x)111,y111)、(x222,y222)、(x333,y333)…(xnnn,ynnn) (ii) a The second data set is a corrected voltage value and an image height value.
Get y ═ f1(x),y=f1(x) Is a linear variation; expressed in the form of y-kx, for each mirror a fixed coefficient k, according to which y-f1(x) And carrying out linear assignment on y, and respectively recording as y111、y222、y333…ynnn(ii) a According to y ═ f1(x) Respectively find x111、x222、x333…xnnnObtaining a second data set respectively as (x)111,y111)、(x222,y222)、(x333,y333)…(xnnn,ynnn) (ii) a The second data set is a corrected voltage value and an image height value. In this embodiment, y ═ f (x) can be compensated to a linear function.
For the present invention, the linear function is not a strict linear function, and any linear or linear-like variation is within the scope of the present invention.
S4: and inputting the second data set into a control system to obtain a corrected image.
And inputting the corrected second data set into a control system and operating the system, so that a corrected image can be obtained.
In a preferred embodiment, the second data set is stored in the control system, and in operation, the control system may retrieve the second data set directly to obtain the corrected image.
And the corrected second data group is stored in the control system, so that the workload in the operation process of the system can be reduced.
In a second aspect of the invention, an optical coherence tomography apparatus is disclosed, which implements the above-described method for correcting image distortion.
A third aspect of the invention discloses a confocal laser fundus imager that implements the above-described method of correcting image distortion.
A fourth aspect of the present invention discloses a fundus scanning system that implements the above-described method for correcting image distortion.
A fifth aspect of the present invention discloses a fundus camera that implements the above-described method for correcting image distortion.
In a sixth aspect of the present invention, a laser treatment apparatus is disclosed, which implements the above-mentioned method for correcting image distortion.
In the present invention, the method for correcting image distortion can be applied to ophthalmic medical devices such as optical coherence tomography, confocal laser fundus imager, fundus camera, slit lamp, etc., and certainly, the method is not limited to the illustrated devices, and all the inventive concepts using the present invention fall within the scope of the present invention.
Compared with the prior art, the method for correcting the image distortion can solve the problem of the image distortion from a bottom hardware layer, avoids using a complex image processing algorithm in the traditional scheme, and simplifies the design of equipment.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.