Evaluation method, test device and test method for endoscope optical imaging distortion
By calculating the pixel and grid distances of grid intersections, a multi-order equation relationship was established, and the problem of singleness in the evaluation of distortion value of endoscopic optical imaging was solved, achieving more accurate distortion evaluation and lesion recognition.
Patent Information
- Application Number
- CN202411989749.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In the prior art, the evaluation method of endoscopic optical imaging distortion value is single, and cannot accurately reflect the complex distortion format, affecting polyp and lesion feature recognition and size estimation.
By obtaining the mesh test target image captured by the endoscopy, calculating the pixels and mesh distances of the mesh intersection points, establishing a multi-order equation relationship, generating the mesh coordinate value after normalization, and calculating the distortion distortion rate.
More accurate endoscopic optical imaging distortion assessment methods are provided to help technicians and clinicians better understand and interpret diagnostic images on monitors, improving lesion recognition and size estimation.
Smart Images

Figure CN119379569B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical devices, and in particular to an evaluation method, a testing device and a testing method for endoscope optical imaging distortion. Background Art
[0002] Endoscope is a commonly used medical device, widely used in disease examination and surgical treatment in related departments. Endoscopes currently on the market are divided into rigid endoscopes and flexible endoscopes according to whether their insertion sections are bendable; and they can be divided into optical endoscopes and electronic endoscopes according to the imaging principle.
[0003] When an endoscope's image sensor captures an image, it generally forms a barrel distortion, such as Figure 1 As shown, it is necessary to quantitatively evaluate the distortion of the image.
[0004] The evaluation method of the distortion value in the prior art is generally as follows: Figure 2 As shown, Figure 2 The solid line outside the middle is the original image, and the dotted line inside is the actual distorted image. The calculation method of the distortion value is:
[0005]
[0006] However, the value calculated by this method is a single distortion value. Since distortion may affect the feature recognition and size estimation of polyps and other lesions, a single distortion value may mislead complex distortion formats (such as irregular image distortion). Therefore, a new distortion assessment method is needed to help technicians or clinicians better understand and interpret diagnostic images on the monitor.
[0007] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0008] The main purpose of the present invention is to provide an evaluation method, a test device and a test method for the amount of endoscope optical imaging distortion, aiming to solve the above-mentioned technical problems in the prior art.
[0009] In order to achieve the above object, the present invention also provides a method for evaluating the amount of distortion of an endoscope optical imaging, the method comprising:
[0010] Acquire a first image of the grid test target obtained by the above-mentioned test method, wherein the first image is an image of the grid test target captured by the endoscope body at the working distance;
[0011] According to the first image, pixel coordinate values of each grid intersection point of the first image along a first direction from a central grid point are obtained, wherein the central grid point is a grid intersection point located at the center of the first image;
[0012] According to the pixel coordinate values, the pixel distance and the grid distance between each grid intersection and the central grid point are calculated in units of pixel number and grid number respectively;
[0013] According to the calculated pixel distance and grid distance, a first relational expression between the pixel distance and the grid distance is obtained;
[0014] Calculate the first grid distance of the edge grid point according to the first relational expression and the first pixel distance of the edge grid point in each grid intersection, wherein the edge grid point is the outermost grid intersection on the side opposite to the central grid point along the first direction of each grid intersection;
[0015] Normalizing the pixel distance and the grid distance of each grid intersection according to the first pixel distance and the first grid distance;
[0016] According to the normalized pixel distance and grid distance of each grid intersection, a second relational expression of the normalized pixel distance and grid distance is established;
[0017] Generate a third relational expression between the real grid coordinate value of each grid intersection and the actual size on the imaging device according to the second relational expression and the real size coordinate value of each grid intersection;
[0018] According to the third relationship, the distortion rate of the first image along the first direction is calculated.
[0019] Preferably, in the method for evaluating the amount of distortion of endoscope optical imaging, obtaining the first relationship between the pixel distance and the grid distance based on the calculated pixel distance and grid distance includes:
[0020] According to the calculated pixel distance and grid distance, a first relational expression Ru=f(Rd) of the pixel distance and grid distance is obtained by fitting, wherein the first relational expression is a two-variable multi-time equation;
[0021] Ru is the grid distance between each grid intersection and the central grid point;
[0022] Rd is the pixel distance between each grid intersection and the central grid point;
[0023] Accordingly, calculating the first grid distance of the edge grid points according to the first relational expression and the first pixel distance of the edge grid points at each grid intersection includes:
[0024] Substitute the first pixel distance of the edge grid point into the first relational expression Ru=f(Rd) to calculate the first grid distance Ru1 of the edge grid point.
[0025] Preferably, in the method for evaluating the amount of distortion of endoscope optical imaging, the second relationship between the normalized pixel distance and the grid distance is established based on the normalized pixel distance and the grid distance of each grid intersection, including:
[0026] According to the normalized pixel distance Rd' and grid distance Ru' of each grid intersection, a second relational expression Rd'=f(Ru') of the normalized pixel distance and grid distance is obtained by fitting, wherein the second relational expression is a two-variable multi-time equation;
[0027] Where Rd' is the normalized pixel distance of each grid intersection, Rd'=Rd / Rd1;
[0028] Ru' is the normalized grid distance of each grid intersection, Ru'=Ru / Ru1;
[0029] Preferably, in the method for evaluating the amount of endoscopic optical imaging distortion, the step of generating a third relational expression of the real grid coordinate value of each grid intersection and the actual size on the imaging device according to the second relational expression and the real size coordinate value of each grid intersection includes:
[0030] When the actual size of each grid on the grid test target is a×a and the size of a single pixel of the image sensor of the imaging device is b×b, Y is the actual size of each grid intersection on the imaging device, Y=b×Rd=b×Rd'×Rd1; X is the actual grid coordinate value of each grid intersection, X=a×Ru=a×Ru'×Ru1;
[0031] Substituting X and Y into the second relational expression Rd'=f(Ru'), the third relational expression Y=F(X) is obtained.
[0032] Preferably, in the method for evaluating the amount of endoscopic optical imaging distortion, after generating a third relationship between the real grid coordinate value of each grid intersection and the actual size on the imaging device according to the second relationship and the real size coordinate value of each grid intersection, the evaluation method further comprises:
[0033] According to the third relationship, the distortion value is calculated, and the calculation formula of the distortion value is as follows:
[0034] ;
[0035] Among them, the third relationship is Y=F(X);
[0036] Y is the actual size of each grid intersection on the imaging device;
[0037] X is the actual grid coordinate value of each grid intersection.
[0038] Preferably, in the method for evaluating the amount of distortion of endoscope optical imaging, calculating the distortion rate of the first image along the first direction according to the third relationship includes:
[0039] The third relationship Y=F(X) is differentially derived to obtain the distortion rate of the first image along the first direction.
[0040] Preferably, in the method for evaluating the amount of distortion of endoscope optical imaging, before the step of respectively calculating the pixel distance and the grid distance between each grid intersection and the central grid point in units of the number of pixels and the number of grids according to the pixel coordinate values, and after the step of obtaining the pixel coordinate values of each grid intersection of the first image along the first direction from the central grid point according to the first image, the evaluation method further comprises:
[0041] The pixel coordinates of the central grid point of each grid intersection are transformed into a zero point, and the pixel coordinate values of other grid intersections are adjusted in sequence according to the pixel spacing with the central grid point.
[0042] In order to achieve the above object, the present invention further provides a computer device, the computer device comprising:
[0043] at least one processor; and,
[0044] a memory communicatively connected to the at least one processor; wherein,
[0045] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the above-mentioned method for evaluating the amount of endoscopic optical imaging distortion.
[0046] In order to achieve the above-mentioned object, the present invention also provides a computer-readable storage medium storing a computer program, which implements the above-mentioned method for evaluating the amount of endoscopic optical imaging distortion when executed by a processor.
[0047] To achieve the above object, the present invention provides a testing device for endoscope optical imaging distortion. The first image in the above-mentioned method for evaluating the endoscope optical imaging distortion is obtained by using the testing device. The testing device comprises:
[0048] Grid test targets;
[0049] an endoscope body, arranged in a lateral spacing with the grid test target and arranged perpendicularly to the surface of the grid test target, the endoscope body having a mounting end close to the grid test target, the mounting end being provided with an imaging device;
[0050] a monitor, electrically connected to the imaging device, for displaying the image of the grid test target captured by the imaging device;
[0051] The processor is electrically connected to the endoscope body and is configured to acquire the image of the grid test target captured by the imaging device and analyze the image of the grid test target.
[0052] In order to achieve the above object, the present invention also provides a testing method using the above-mentioned endoscope optical imaging distortion testing device for testing, the testing method comprising:
[0053] Placing a grid test target in front of an imaging surface of an imaging device of an endoscope body, wherein the imaging surface is arranged parallel to a surface of the grid test target;
[0054] According to the image of the grid test target captured by the imaging device displayed on the monitor, adjusting the grid test target so that the mounting end of the endoscope body is located at the center of the grid test target;
[0055] Adjusting the distance between the grid test target and the mounting end to a preset working distance;
[0056] The image of the grid test target is captured by the imaging device and stored.
[0057] The present invention has at least the following beneficial effects:
[0058] The present invention acquires a first image; based on the first image, obtains pixel coordinate values of each grid intersection of the first image along a first direction from a central grid point, wherein the central grid point is a grid intersection located at the center of the first image; based on the pixel coordinate values, the pixel distance and grid distance of each grid intersection with the central grid point are calculated in units of pixel number and grid number, respectively; based on the calculated pixel distance and grid distance, obtains a first relational expression of the pixel distance and grid distance; based on the first relational expression and the first pixel distance of the edge grid point in each grid intersection, calculates the first grid distance of the edge grid point, wherein the edge grid point is each grid intersection in the first direction opposite to the central grid point. the outermost grid intersection on one side; normalizing the pixel distance and grid distance of each grid intersection according to the first pixel distance and the first grid distance respectively; establishing a second relational expression of the normalized pixel distance and grid distance according to the normalized pixel distance and grid distance of each grid intersection; generating a third relational expression of the real grid coordinate value of each grid intersection and the actual size on the imaging device according to the second relational expression and the real size coordinate value of each grid intersection; calculating the distortion rate of the first image along the first direction according to the third relational expression, so that the distortion rate of each grid intersection can be evaluated, which is convenient for helping technicians or clinicians to better understand and interpret the diagnostic images on the monitor. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A schematic diagram showing barrel distortion of an image captured by an image sensor at the front end of an endoscope;
[0060] Figure 2 for Figure 1 Schematic diagram of distorted image;
[0061] Figure 3 A schematic diagram of an embodiment of a device for testing the optical imaging distortion of an endoscope provided by the present invention;
[0062] Figure 4 for Figure 3 Schematic diagram of a medium grid test target with a single grid of 5mm×5mm;
[0063] Figure 5 To adopt Figure 3 A schematic diagram of an image to be analyzed obtained by the test device;
[0064] Figure 6 A schematic diagram of an embodiment of a method for testing the optical imaging distortion of an endoscope provided by the present invention;
[0065] Figure 7A schematic diagram of an embodiment of a method for evaluating the amount of optical imaging distortion of an endoscope provided by the present invention;
[0066] Figure 8 A schematic diagram of obtaining the pixel coordinate value of the 0th grid intersection point (center grid point) of the present invention;
[0067] Fig. 9 A schematic diagram of obtaining the pixel coordinate value of the first grid intersection point along the horizontal direction from the center grid point in the present invention;
[0068] Fig.10 The present invention is a schematic diagram of reading the actual number of grids between each grid intersection and the central grid point in units of grid numbers;
[0069] Fig.11 It is a schematic diagram of fitting the second relational equation of the present invention;
[0070] Fig.12 A schematic diagram of the size of the grid test target of the present invention;
[0071] Fig.13 A schematic diagram of the size of the grid test target of the present invention when photographed on an image sensor of an imaging device;
[0072] Fig.14 Ru' and M LR A schematic diagram of an embodiment of a fitting curve;
[0073] Fig.15 A schematic diagram of a computer device according to the present invention.
[0074] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0075] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0076] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0077] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0078] In the embodiments of the present invention, the term "plurality" refers to two or more than two, and other quantifiers are similar.
[0079] In the present invention, unless otherwise specified, the directional words used, such as "up, down, top, bottom", usually refer to the directions shown in the drawings, or to the components themselves in the vertical, perpendicular or gravity directions; similarly, for ease of understanding and description, "inside and outside" refer to the inside and outside relative to the outline of each component itself, but the above-mentioned directional words are not used to limit the present invention.
[0080] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it can be understood by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present invention. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present invention can also be implemented. The division of the following embodiments is for the convenience of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other under the premise of no contradiction.
[0081] The present invention provides a device for testing the optical imaging distortion of an endoscope. Figure 3 As shown, the testing device for the endoscope optical imaging distortion comprises a grid test target 3, an endoscope body 1, a monitor 5 and a processor 4.
[0082] The size of each grid on the grid test target 3 can be of different specifications, for example, Figure 4 As shown, the size of a single small grid on the grid test target 3 can be 5mm×5mm. The size of a single small grid on the grid test target can also be determined based on the distance between the mounting end 2 of the endoscope body 1 and the grid test target. Generally, when the distance between the mounting end 2 of the endoscope body 1 and the grid test target is larger, the size of a single small grid on the grid test target can be selected to be larger; when the distance between the mounting end 2 of the endoscope body 1 and the grid test target is smaller, the size of a single small grid on the grid test target can be selected to be smaller, so that the number of grids on the image acquired by the endoscope body 1 can be guaranteed.
[0083] The spacing between the grid test target 3 and the endoscope body 1 is adjustable. In this way, when the size of a single small grid on the grid test target is constant, the number of grids of the grid test target 3 captured by the endoscope body 1 can be adjusted by adjusting the spacing between the grid test target 3 and the endoscope body 1.
[0084] In addition, the grid test target 3 can be moved in the up, down, left, and right directions relative to the mounting end 2 of the endoscope body 1, so as to adjust the center of the grid test target 3 in the image acquired by the endoscope body 1 to be exactly in the middle of the image, which is convenient for subsequent calculations.
[0085] The endoscope body 1 is arranged with a lateral spacing from the grid test target 3 and is arranged perpendicular to the surface of the grid test target 3. The endoscope body 1 has a mounting end 2 close to the grid test target 3, and the mounting end 2 is provided with an imaging device. When it is necessary to capture the image of the grid test target 3, it can be captured by the imaging device. In addition, the mounting end 2 is also provided with a lighting device, which can cooperate with the imaging device to provide a clearer image to avoid the influence of limited light and affect the image quality. When it is necessary to capture the image of the grid test target 3, the position of the grid test target 3 can be adjusted first so that the central grid point of the grid test target 3 is in the middle of the captured image.
[0086] The monitor 5 is electrically connected to the imaging device. The monitor 5 is used to display the image of the grid test target 3 captured by the imaging device, and is also convenient for the operator to observe. When operating, the operator usually observes the image on the monitor 5 to choose how to adjust the position of the grid test target 3.
[0087] The processor 4 is electrically connected to the endoscope body 1. The processor 4 can obtain and store images taken by the imaging device. Figure 5 More specifically, the processor 4 includes a camera with a built-in camera function, and the camera captures the image captured by the imaging device and stores it; it may also include an external camera, and the image captured by the imaging device is captured by the external camera and sent to the processor 4 for storage. The specific setting can be selected as needed.
[0088] In addition, the processor 4 is also configured to perform analysis and processing based on the captured images and analyze the amount of endoscope optical imaging distortion.
[0089] The present invention also provides a testing method using the above-mentioned endoscope optical imaging distortion testing device for testing. Figure 6 The flowchart of the method for testing the distortion of endoscope optical imaging is shown.
[0090] like Figure 6As shown, in step S101, the grid test target 3 is placed on the optical platform. At this time, the position of the grid test target 3 on the optical platform is adjustable. The grid test target 3 can be moved in the up-down direction, the left-right direction, and can also be moved forward and backward relative to the installation position of the endoscope body 1 to adjust the distance between the grid test target 3 and the endoscope body 1.
[0091] In step S102, the endoscope body 1 is placed on the optical platform, and the imaging surface of the imaging device at the mounting end 2 of the endoscope body 1 is adjusted so that the imaging surface is parallel to the grid test target 3. The step S102 may be preceded by placing the endoscope body 1 on the optical platform before step S101, and the specific method may be selected according to the operating habits. The imaging surface of the imaging device of the endoscope body 1 is parallel to the grid test target 3, so as to avoid the deviation of the captured image and affect the test results. Specifically, the grid test target 3 is placed in front of the imaging surface of the imaging device of the endoscope body 1, and the imaging surface is arranged parallel to the surface of the grid test target 3.
[0092] In step S103, the processor 4 and the monitor 5 are turned on. The image of the grid test target captured by the endoscope body 1 can be observed through the monitor 5, so as to adjust the grid test target to a suitable position.
[0093] In step S104, observe the image on the monitor 5, adjust the grid test target 3, make the mounting end 2 of the endoscope located at the center of the grid test target, and adjust the distance between the grid test target 3 and the mounting end 2 to the working distance. It is possible to first adjust the position of the grid test target 3 in the up, down, left, and right directions so that the mounting end 2 of the endoscope is located at the center of the grid test target, and then adjust the distance between the grid test target 3 and the mounting end 2; it is also possible to first adjust the distance between the grid test target 3 and the mounting end 2, and then adjust the position of the grid test target 3 in the up, down, left, and right directions so that the mounting end 2 of the endoscope is located at the center of the grid test target, and there is no limitation here. It should be noted that the working distance between the grid test target 3 and the mounting end 2 can be determined according to actual needs. For example, the working distance may be different in different application scenarios.
[0094] In step S105, the image captured by the imaging device is saved. The image of the grid test target 3 is captured by the imaging device and stored. Specifically, the processor 4 may include a shooting device with a built-in shooting function, and the image captured by the imaging device is shot by the shooting device and stored; or an external shooting device may be provided, and the image captured by the imaging device is shot by the external shooting device and sent to the processor 4 for storage. Figure 5 Schematically shows the first image of the grid test target 3 captured, Figure 5 The central grid point in is located in the middle of the first image.
[0095] The present invention also provides a method for evaluating the amount of endoscope optical imaging distortion. Figure 7 A flow chart of a method for evaluating the amount of endoscopic optical imaging distortion is shown.
[0096] like Figure 7 As shown, Figure 7 In step S201, a first image is obtained. The first image is an image of the grid test target captured by the endoscope body at the working distance; in other embodiments, the first image may also be a first image of the grid test target 3 captured by the above-mentioned test method. It should be noted that the center position of the grid test target in the captured first image is in the middle of the first image, and the distance between the grid test target 3 and the mounting end 2 is the working distance.
[0097] At step S202, pixel coordinate values of grid intersections are sequentially read from the central grid point along the first direction to the edge. The central grid point is a grid intersection located at the center of the first image. The first direction may be horizontal, vertical, or other directions, and the distortion rate in which direction may be analyzed may be determined as required. For example, if the distortion rate in the horizontal direction needs to be analyzed, the pixel coordinate values of grid intersections are sequentially obtained from the central grid point to the edge in the horizontal direction.
[0098] The pixel coordinate values of the grid intersections may be obtained by reading the values through automatic image reading software or manually, and no specific limitation is made here.
[0099] Figure 8 and Fig. 9 The schematic diagram of obtaining the pixel coordinate values of the grid intersection is shown. Figure 8 The schematic diagram of obtaining the pixel coordinate value of the 0th grid intersection point (center grid point) is shown. Fig. 9 A schematic diagram of obtaining the pixel coordinate value of the first grid intersection point along the horizontal direction from the center grid point is shown. Figure 8 and Fig. 9 The lower left corner shows the corresponding pixel coordinate value. For example, the pixel coordinate value of the center grid point is (966,535), and the pixel coordinate value of the first grid intersection point along the horizontal direction from the center grid point is (1018,535). As shown in Table 1, Table 1 shows the original pixel coordinate values of each grid intersection point along the horizontal direction. The grid intersection point with serial number 0 in Table 1 is the center grid point, and the grid intersection point with serial number 1 is the first grid intersection point along the horizontal direction from the center grid point, and so on.
[0100] Table 1 An embodiment of each grid intersection along the horizontal direction
[0101]
[0102] At step S203, the first coordinate transformation is performed to convert the pixel coordinate values so that the pixel coordinates of the central grid point are zero, and the pixel coordinates of other grid intersections are adjusted in sequence. That is, the pixel coordinates of the central grid point are defined as (0,0), and the pixel coordinates of other grids are adjusted in sequence. More specifically, the pixel coordinates of the central grid point of each grid intersection are transformed to zero, and the pixel coordinate values of other grid intersections are adjusted in sequence according to the pixel spacing with the central grid point.
[0103] Taking the pixel coordinate values in Table 1 as an example, the adjusted pixel coordinate values are shown in Table 2. More specifically, in the first coordinate transformation, after the pixel coordinate value of the central grid point is adjusted to (0,0), the coordinates of other grid intersection points are determined according to the pixel distance from the central grid point. For example, the pixel coordinate value of the second grid intersection point in Table 2 is (1018-966, 535-535), the pixel coordinate value of the third grid intersection point is (1069-966, 535-535), ..., and so on.
[0104] Table 2 Pixel coordinate values of each grid intersection after adjustment
[0105]
[0106] At step S204, the pixel distance between each grid intersection and the central grid point is calculated in units of pixel numbers, which is recorded as Rd. The pixel distance between each grid intersection and the central grid point is calculated, that is, the distance between the grid intersection and the central grid point along the first direction. Taking the first direction as the horizontal direction as an example, when calculating the pixel distance between each grid intersection and the central grid point, the vertical coordinate is discarded and only the horizontal coordinate is taken. The pixel distance between the grid intersection and the central grid point is the horizontal coordinate of the grid intersection minus the horizontal coordinate of the central grid point. Table 3 illustrates the pixel distance between each grid intersection and the central grid point after adjusting the pixel coordinate values in Table 2.
[0107] Table 3 Calculation of pixel distance
[0108]
[0109] In step S205, the grid distance Ru between each grid intersection and the central grid point is calculated in units of grid numbers. The grid distance between each grid intersection and the central grid point is the actual number of grids from each grid intersection to the central grid point, such as Fig.10 Table 4 shows the actual number of grids at each grid intersection in the horizontal direction in Table 1. The 9th grid intersection is not a complete integer grid point because it is at the image boundary. Therefore, the actual number of grids at the 9th grid intersection cannot be determined. It may be 8.5, 8.7, 8.8, etc.
[0110] Table 4 Grid distances between each grid intersection and the central grid point
[0111]
[0112] At step S206, the first data fitting is performed to form a first relational expression Ru=f(Rd) between Rd and Ru. The first relational expression between Rd and Ru is formed by data fitting. Specifically, a binary multivariate equation can be used for fitting, and each coefficient can be solved.
[0113] Table 5 Rd and Ru of each grid intersection
[0114]
[0115] Table 5 is an embodiment of the Rd and Ru of each grid intersection point obtained in the horizontal direction. Taking the data in Table 5 as an example, the following first relationship can be obtained by fitting:
[0116] ; (1)
[0117] Among them, the fitting accuracy R of formula (1) 2 >0.9999.
[0118] In step S207, the pixel coordinate Rd1 at the edge is substituted into the first relational expression to obtain Ru1. Taking Table 5 as an example, the Ru value of the 9th grid intersection, that is, Ru1, is unknown. At this time, Rd1 is known, and Rd1 can be substituted into the first relational expression (here, equation (1)) to obtain Ru1. As shown in Table 6, Ru1 can be obtained to be 8.9.
[0119] Table 6 Updated Rd and Ru of each grid intersection
[0120]
[0121] The second coordinate transformation is performed at step S208. According to Rd1 and Ru1, the Rd and Ru of the grid intersections are normalized to obtain Rd' and Ru'. According to the grid distance and pixel distance of the outermost grid intersection, the Rd and Ru of the grid intersection are normalized. It can be understood that the grid distance and pixel distance of the outermost grid intersection are normalized, and the grid distances and pixel distances of other grid intersections are adjusted in proportion. That is, the grid distance of each grid intersection is multiplied by (1 / Ru1), and the pixel distance of each grid intersection is multiplied by (1 / Rd1). Table 7 shows the Ru' and Rd' after normalization of each grid intersection in Table 6.
[0122] Table 7 Normalized Ru' and Rd' of each grid intersection
[0123]
[0124] At step S209, a second data fitting is performed to form a second relational expression Rd'=f(Ru') between Rd' and Ru'. The second relational expression Rd'=f(Ru') between Rd' and Ru' is formed by data fitting. Specifically, a binary multivariate equation can be used for fitting and each coefficient can be solved.
[0125] Fig.11 is the second relational expression formed by fitting the data in Table 7. Taking the data in Table 7 as an example, the second relational expression after fitting is:
[0126] ; (2)
[0127] In formula (2), x represents Ru' and y represents Rd'. The fitting accuracy R of formula (2) is 2 >0.9999.
[0128] At step S210, the third coordinate transformation is performed, and the real size coordinate values of Rd' and Ru' in Rd'=f(Ru') are replaced to obtain Y=F(X), where X represents the real grid coordinate value of each grid intersection, and Y represents the actual size of each grid intersection on the imaging device.
[0129] It should be noted that Fig.12 A schematic diagram illustrating the lateral dimensions of a single grid in a grid test target; Fig.13 The figure shows the corresponding length of a single grid in the grid test target captured by the image sensor. Fig.12 and Fig.13 The size of the grid test target captured on the image sensor of the imaging device is different from the size of the grid test target itself, but there is a one-to-one correspondence.
[0130] Where X and Y are the actual size coordinates of Ru and Rd. It can also be understood that dX is the original physical size of the grid test target (for example, in mm), and dY is the actual shooting size of the image taken by the image sensor of the imaging device on its photosensitive surface (for example, in mm). Taking the actual size of each grid in the grid test target as a×a as an example, X is a×Ru, x=Ru'=Ru / Ru1, x=X / (a×Ru1); taking the single pixel size of the image sensor of the imaging device as b×b as an example, Y is b×Rd, y=Rd'=Rd / Rd1, y=Y / (b×Rd1). Substituting x=X / (a×Ru1) and y=Y / (b×Rd1) into the second relationship, we get Y=F(X).
[0131] k y Y = y ∈ [0, 1] and k xTaking X=x∈[0,1] as an example, substituting it into equation (2), we get:
[0132] ; (3)
[0133] Formula (3) can be transformed into formula (4) as follows:
[0134] ; (4).
[0135] In step S211, Y=F(X) is differentially derived to obtain the distortion rate along the first direction. Taking the first direction as the horizontal direction as an example, for the imaging device of the endoscope body 1, for the same dX length, when moving from the center to the edge, the corresponding dX will gradually decrease (that is, the distortion becomes more and more serious), so it is necessary to use the horizontal distortion rate M LR To characterize the distortion rate from the center to the edge in the horizontal direction. When the first direction is other directions, the lateral distortion rate can be referred to, which will not be described in detail here.
[0136] Taking formula (4) as an example, M LR The calculation formula is:
[0137] ; (5)
[0138] Where x is Ru'.
[0139] For example, the actual size of each grid a×a is 5mm×5mm, and the size of a single pixel of the image sensor b×b is 1.75μm×1.75μm. x =1 / (a×Ru1)=1mm / (5*8.9)=0.0225mm, k y =1 / (b×Rd1)=1mm / (1.75*398 / 1000)=1.4358mm.
[0140] K x and k y Substituting into formula (5), we get:
[0141] ; (6)
[0142] The lateral distortion rate M at each grid intersection can be calculated by formula (6): LR , as shown in Table 8.
[0143] Table 8 Transverse distortion rate at each grid intersection
[0144]
[0145] Fig.14 This is a schematic diagram drawn according to formula (6). Fig.14 It can directly reflect the continuous distortion rate of the horizontal direction on the image, and reflect the distortion property of the endoscope. By putting the data of different endoscopes in one graph, the distortion property and performance of different endoscopes can be compared directly.
[0146] It should be noted that when the first direction is the longitudinal direction, the above principle can be used to calculate the longitudinal continuous distortion rate. The first direction can also be a diagonal direction or other directions, which are not given one by one here, and the calculation method can refer to the horizontal direction.
[0147] At step S212, the distortion value is calculated. The above X represents the real grid coordinates of each grid intersection, and Y represents the actual size of each grid intersection on the imaging device. It can also be understood that X represents the size of the undistorted image, and Y represents the size of the distorted image. Then the calculation formula of the distortion value is as follows:
[0148] ; (6)
[0149] Taking Y = F (X) as an example, substituting it into formula (6) we get:
[0150] ; (7)
[0151] Furthermore, assuming that Y = Rd' (k y =1) and assuming that the first grid along the first direction from the center grid point of the distorted image is not distorted, the maximum X is 0.13*8.9k x =0.13*8.9,
[0152] At this time, formula (7) is transformed into:
[0153] ; (8).
[0154] The results of calculating the distortion value according to formula (9) are shown in Table 9.
[0155] Table 9 Calculation results of distortion values
[0156]
[0157] It should be noted that, as mentioned above, the lateral distortion rate M LR , is obtained by comparing the distorted image with the actual object (one is the image, the other is the object corresponding to the image). Distortion value D RADIt is calculated by the distorted image and the undistorted image (both are images, but the undistorted image here is calculated by the grid size at the exact center). Both can reflect the distortion law of the image, so that technicians or clinicians can better understand and interpret the diagnostic image on the monitor 5, and make targeted technical improvements and optimizations for technicians to better correct image distortion.
[0158] In order to achieve the above object, the present invention also provides a computer device, such as Fig.15 As shown, the computer device includes at least one processor 301; and a memory 302 that is communicatively connected to the at least one processor 301; wherein the memory 302 stores instructions that can be executed by the at least one processor 301, and the instructions are executed by the at least one processor 301 so that the at least one processor 301 can execute the above-mentioned method for evaluating the endoscopic optical imaging distortion.
[0159] The memory 302 and the processor 301 are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 301 and the memory 302 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor 301 is transmitted on a wireless medium through an antenna, and further, the antenna also receives data and transmits the data to the processor 301.
[0160] The processor 301 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 302 can be used to store data used by the processor 301 when performing operations.
[0161] In order to achieve the above object, the present invention provides a computer-readable storage medium storing a computer program, which implements the above-mentioned method for evaluating the amount of endoscopic optical imaging distortion when executed by a processor.
[0162] That is, those skilled in the art can understand that all or part of the steps in the above-described implementation methods can be completed by instructing relevant hardware through a program. This program is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor 301 (processor) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0163] Obviously, the above-described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, those of ordinary skill in the art can make other different forms of changes or modifications without making creative efforts, and all of them should fall within the protection scope of the present invention.
Claims
1. A method for evaluating the amount of distortion of endoscope optical imaging, characterized in that: include: Acquire a first image, wherein the first image is an image of a grid test target captured by the endoscope body at a working distance; According to the first image, pixel coordinate values of each grid intersection point of the first image along a first direction from a central grid point are obtained, wherein the central grid point is a grid intersection point located at the center of the first image; According to the pixel coordinate values, the pixel distance and the grid distance between each grid intersection and the central grid point are calculated in units of pixel number and grid number respectively; According to the calculated pixel distance and grid distance, a first relationship between the pixel distance and the grid distance is obtained by fitting; Calculate the first grid distance of the edge grid point according to the first relational expression and the first pixel distance of the edge grid point in each grid intersection, wherein the edge grid point is the outermost grid intersection on the side opposite to the central grid point along the first direction of each grid intersection; Normalizing the pixel distance and the grid distance of each grid intersection according to the first pixel distance and the first grid distance; According to the normalized pixel distance and grid distance of each grid intersection, a second relationship between the normalized pixel distance and grid distance is established by fitting; According to the second relational expression and the real size coordinate value of each grid intersection, a third relational expression of the real grid coordinate value of each grid intersection and the actual size on the imaging device is generated, and the method for generating the third relational expression includes: when the actual size of each grid on the grid test target is a×a; the single pixel size of the image sensor of the imaging device is b×b, Y is the actual size of each grid intersection on the imaging device, Y=b×Rd=b×Rd'×Rd1; X is the real grid coordinate value of each grid intersection, X=a×Ru=a×Ru'×Ru1; X and Y are substituted into the second relational expression Rd'=f(Ru'), and the third relational expression is obtained as Y=F(X); According to the third relationship, the distortion rate of the first image along the first direction is calculated.
2. The method for evaluating the amount of endoscopic optical imaging distortion according to claim 1, characterized in that: The first relationship between the pixel distance and the grid distance is obtained according to the calculated pixel distance and grid distance, including: According to the calculated pixel distance and grid distance, a first relational expression Ru=f(Rd) of the pixel distance and grid distance is obtained by fitting, wherein the first relational expression is a two-variable multi-time equation; Ru is the grid distance between each grid intersection and the central grid point; Rd is the pixel distance between each grid intersection and the central grid point; Accordingly, calculating the first grid distance of the edge grid points according to the first relational expression and the first pixel distance of the edge grid points at each grid intersection includes: Substitute the first pixel distance of the edge grid point into the first relational expression Ru=f(Rd) to calculate the first grid distance Ru1 of the edge grid point.
3. The method for evaluating the amount of endoscopic optical imaging distortion according to claim 2, characterized in that: The step of establishing a second relational expression of normalized pixel distance and grid distance according to the normalized pixel distance and grid distance of each grid intersection includes: According to the normalized pixel distance Rd' and grid distance Ru' of each grid intersection, a second relational expression Rd'=f(Ru') of the normalized pixel distance and grid distance is obtained by fitting, wherein the second relational expression is a two-variable multi-time equation; Where Rd' is the normalized pixel distance of each grid intersection, Rd'=Rd / Rd1; Ru' is the normalized grid distance of each grid intersection, Ru'=Ru / Ru1.
4. The method for evaluating the amount of endoscopic optical imaging distortion according to claim 1, wherein: Calculating the distortion rate of the first image along the first direction according to the third relationship includes: The third relationship Y=F(X) is differentially derived to obtain the distortion rate of the first image along the first direction.
5. The method for evaluating the amount of endoscopic optical imaging distortion according to claim 1, characterized in that: After generating a third relationship between the real grid coordinate value of each grid intersection and the actual size on the imaging device according to the second relationship and the real size coordinate value of each grid intersection, the evaluation method further includes: According to the third relationship, the distortion value is calculated, and the calculation formula of the distortion value is as follows: ; Among them, the third relationship is Y=F(X); Y is the actual size of each grid intersection on the imaging device; X is the actual grid coordinate value of each grid intersection.
6. The method for evaluating the amount of endoscopic optical imaging distortion according to claim 1, characterized in that: Before the step of calculating the pixel distance and the grid distance between each grid intersection and the central grid point in units of pixel number and grid number according to the pixel coordinate values, and after the step of obtaining the pixel coordinate values of each grid intersection of the first image along the first direction from the central grid point according to the first image, the evaluation method further includes: The pixel coordinates of the central grid point of each grid intersection are transformed into a zero point, and the pixel coordinate values of other grid intersections are adjusted in sequence according to the pixel spacing with the central grid point.
7. A computer device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method for evaluating the endoscopic optical imaging distortion amount as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for evaluating the amount of endoscopic optical imaging distortion according to any one of claims 1 to 6 is implemented.
9. A device for testing the optical imaging distortion of an endoscope, characterized in that: The first image in the method for evaluating the amount of endoscopic optical imaging distortion according to any one of claims 1 to 6 is obtained by using the testing device, the testing device comprising: Grid test targets; an endoscope body, arranged in a lateral spacing with the grid test target and arranged perpendicularly to the surface of the grid test target, the endoscope body having a mounting end close to the grid test target, the mounting end being provided with an imaging device; a monitor, electrically connected to the imaging device, for displaying the image of the grid test target captured by the imaging device; The processor is electrically connected to the endoscope body and is configured to acquire the image of the grid test target captured by the imaging device and analyze the image of the grid test target.
10. A testing method using the testing device for endoscope optical imaging distortion as claimed in claim 9, characterized in that: include: Placing a grid test target in front of an imaging surface of an imaging device of an endoscope body, wherein the imaging surface is arranged parallel to a surface of the grid test target; According to the image of the grid test target captured by the imaging device displayed on the monitor, adjusting the grid test target so that the mounting end of the endoscope body is located at the center of the grid test target; Adjusting the distance between the grid test target and the mounting end to a preset working distance; The image of the grid test target is captured by the imaging device and stored.
Citation Information
Patent Citations
Lens distortion measuring method based on large-viewing-angle collimator tube
CN103994875A
Image distortion correction method based on conic curve and real-time correction device
CN106204480A