Endoscope field angle calibration method and system, electronic device, storage medium
By acquiring the physical parameters of the endoscope lens assembly and calculating the target resolution, and using cropping and scaling techniques, the problem of low efficiency and poor accuracy in the calibration of the endoscope field of view in the prior art is solved, and fast and accurate field of view calibration is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI SHIXIN MEDICAL TECH CO LTD
- Filing Date
- 2023-08-22
- Publication Date
- 2026-05-29
AI Technical Summary
Existing methods for calibrating the field of view of endoscopes are inefficient and inaccurate, and cannot achieve field of view calibration quickly and accurately.
By acquiring the physical parameters of the endoscope lens assembly, performing field-of-view calibration preprocessing, calculating the target resolution, and cropping and/or scaling the standard display image until the actual field-of-view parameters match the target field-of-view parameters, automatic calibration is achieved.
It enables rapid and accurate calibration of the endoscope's field of view, improving calibration efficiency and accuracy.
Smart Images

Figure CN117177033B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of endoscopy technology, and in particular to an endoscopy field of view calibration method and system, electronic device and storage medium. Background Technology
[0002] Currently, due to varying requirements for the field of view of endoscopic products, it is necessary to calibrate the field of view of these products to meet specifications. However, existing calibration methods are inefficient and inaccurate, and cannot quickly and effectively calibrate the field of view of endoscopes. Summary of the Invention
[0003] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention proposes an endoscope field of view calibration method and system, electronic device and storage medium, which can quickly and effectively achieve automatic calibration of the endoscope's field of view.
[0004] On one hand, the endoscopic field of view calibration method according to an embodiment of the present invention includes the following steps:
[0005] Obtain the physical parameters of the endoscope lens assembly; the physical parameters include the maximum field of view of the objective lens, the image sensor acquisition resolution width, and the image sensor acquisition resolution height;
[0006] Based on the physical parameters, a field of view calibration preprocessing is performed to obtain the fixed focal distance of the endoscope lens assembly and the standard display image corresponding to the maximum field of view parameter of the objective lens;
[0007] Obtain the target field of view parameters, and calculate the target resolution corresponding to the target field of view parameters based on the target field of view parameters and the focal distance;
[0008] Based on the target resolution and the resolution of the standard display image, the first cropping parameter is obtained;
[0009] The standard display image is cropped and / or scaled according to the first cropping parameter to obtain the first image;
[0010] The actual field of view parameters of the first image are obtained through image recognition;
[0011] When the actual field of view parameter is inconsistent with the target field of view parameter, the first cropping parameter is adjusted according to the comparison result between the actual field of view parameter and the target field of view parameter, and the standard display image is cropped and / or scaled according to the adjusted first cropping parameter until the actual field of view parameter of the finally obtained image is consistent with the target field of view parameter, thereby completing the field of view calibration.
[0012] According to some embodiments of the present invention, the step of performing field-of-view calibration preprocessing based on the physical parameters to obtain the focal length of the endoscope lens assembly and the standard display image corresponding to the maximum field-of-view parameter of the objective lens includes:
[0013] Based on the physical parameters, the distance between the endoscope lens assembly and the object being detected by the endoscope lens assembly is adjusted so that the image resolution height and image resolution width of the display image obtained by the endoscope lens assembly from the object being detected are equal to the image sensor acquisition resolution height and image sensor acquisition resolution width, respectively, and the field of view parameter of the display image is equal to the maximum field of view parameter of the objective lens. At this time, the display image is the standard display image, the distance between the object being detected and the endoscope lens assembly is the fixed focal distance, and the object being detected is the field of view test plate.
[0014] According to some embodiments of the present invention, the field of view test plate is provided with a plurality of lines arranged in a circular array, each line being used to indicate a corresponding field of view angle; the step of obtaining the actual field of view parameters of the first image through image recognition includes:
[0015] Using an optical character recognition algorithm, a complete line circle closest to the edge of the first image and its corresponding field of view angle are identified.
[0016] Based on the field of view angles, the actual field of view angle parameters corresponding to the first image are obtained.
[0017] According to some embodiments of the present invention, the step of obtaining the target field of view parameters and calculating the target resolution corresponding to the target field of view parameters based on the target field of view parameters and the focal distance includes:
[0018] Based on the target field of view parameters and the focal distance, a triangulation algorithm is used to calculate the image width, image height, and image diagonal length corresponding to the target field of view parameters.
[0019] The target resolution is obtained based on the image width, the image height, and the image diagonal length.
[0020] The formulas for calculating the image width, the image height, and the image diagonal length are as follows:
[0021]
[0022]
[0023]
[0024] Wherein, W represents the image width, H represents the image height, C represents the image diagonal length, D represents the objective lens focal length, θ represents the target field of view parameter, and k1, k2, and k3 are all constants.
[0025] According to some embodiments of the present invention, k3 = 2.
[0026] According to some embodiments of the present invention, when the actual field of view parameter is inconsistent with the target field of view parameter, adjusting the first cropping parameter based on the comparison result of the actual field of view parameter and the target field of view parameter, and cropping and / or scaling the standard display image according to the adjusted first cropping parameter, includes:
[0027] When the actual field of view parameter is inconsistent with the target field of view parameter, the difference between the actual field of view parameter and the target field of view parameter is calculated;
[0028] Based on the difference, the difference resolution is obtained;
[0029] Based on the difference resolution, the difference clipping parameters are obtained;
[0030] The first cropping parameter is adjusted according to the difference cropping parameter to obtain the second cropping parameter, and the standard display image is cropped and / or scaled according to the second cropping parameter to obtain the second image.
[0031] According to some embodiments of the present invention, when the actual field of view parameter is inconsistent with the target field of view parameter, adjusting the first cropping parameter based on the comparison result of the actual field of view parameter and the target field of view parameter, and cropping and / or scaling the standard display image according to the adjusted first cropping parameter, includes:
[0032] When the actual field of view parameter is inconsistent with the target field of view parameter, the difference between the actual field of view parameter and the target field of view parameter is calculated;
[0033] Based on the difference, the difference resolution is obtained;
[0034] Based on the difference resolution and the target resolution, the corrected calibration resolution is obtained;
[0035] Based on the corrected calibration resolution, a second cropping parameter is obtained, and the standard display image is cropped and / or scaled according to the second cropping parameter to obtain a second image.
[0036] On the other hand, the endoscopic field of view calibration system according to an embodiment of the present invention includes:
[0037] The acquisition module is used to acquire the physical parameters of the endoscope lens assembly; the physical parameters include the maximum field of view of the objective lens, the image sensor acquisition resolution width, and the image sensor acquisition resolution height.
[0038] The preprocessing module is used to perform field angle calibration preprocessing based on the physical parameters to obtain the focal distance of the endoscope lens assembly and the standard display image corresponding to the maximum field angle parameter of the objective lens.
[0039] The calculation module is used to obtain the target field of view parameters and calculate the target resolution corresponding to the target field of view parameters based on the target field of view parameters and the focal distance.
[0040] A conversion module is used to obtain a first cropping parameter based on the target resolution and the resolution of the standard display image;
[0041] The cropping module is used to crop and / or scale the standard display image according to the first cropping parameters to obtain a first image;
[0042] The image recognition module is used to obtain the actual field of view parameters of the first image through image recognition;
[0043] A calibration module is used to adjust the first cropping parameter based on the comparison result of the actual field-of-view parameter and the target field-of-view parameter when the actual field-of-view parameter is inconsistent with the target field-of-view parameter, and to crop and / or scale the standard display image according to the adjusted first cropping parameter until the actual field-of-view parameter of the finally obtained image is consistent with the target field-of-view parameter, thereby completing the field-of-view calibration. On the other hand, an electronic device according to an embodiment of the present invention includes:
[0044] Memory, used to store program instructions;
[0045] The processor is used to call the program instructions stored in the memory and execute the endoscope field angle calibration method of the above embodiment according to the obtained program instructions.
[0046] On the other hand, according to the storage medium of the present invention, the storage medium stores computer-executable instructions for causing a computer to perform the endoscope field-of-view calibration method described in the above embodiments.
[0047] The endoscope field-of-view calibration method, system, electronic device, and storage medium according to embodiments of the present invention have at least the following beneficial effects: By acquiring the physical parameters of the endoscope lens assembly and performing field-of-view calibration preprocessing on the endoscope, the endoscope obtains a standard display image by capturing a test plate and calculates the target resolution corresponding to the target field-of-view parameters; then, based on the comparison result between the target resolution and the resolution of the standard display image, the standard display image is cropped and / or scaled until the resolution of the final image is consistent with the target resolution, thereby completing the field-of-view calibration. The endoscope field-of-view calibration method according to embodiments of the present invention can quickly and accurately achieve automatic calibration of the endoscope's field of view.
[0048] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0049] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0050] Figure 1 This is a flowchart of the steps of the endoscope field of view calibration method according to an embodiment of the present invention;
[0051] Figure 2 This is a schematic diagram of the imaging angle of an endoscope;
[0052] Figure 3 This is a schematic diagram of the endoscope field of view calibration system according to an embodiment of the present invention. Detailed Implementation
[0053] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0054] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.
[0055] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0056] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0057] Currently, due to varying requirements for the field of view of endoscopic products, it is necessary to calibrate the field of view of these products to meet specifications. However, existing calibration methods are inefficient and inaccurate, and cannot quickly and effectively calibrate the field of view of endoscopes.
[0058] To address this, embodiments of the present invention provide an endoscope field of view calibration method, system, electronic device, and storage medium. By acquiring the physical parameters of the endoscope lens assembly and performing field of view calibration preprocessing on the endoscope, the endoscope obtains a standard display image by capturing a test plate, and the target resolution corresponding to the target field of view parameters is calculated. Then, based on the difference between the target resolution and the resolution of the standard display image, the standard display image is cropped and / or scaled until the resolution of the final image matches the target resolution, thereby completing the endoscope field of view calibration. The endoscope field of view calibration method, system, electronic device, and storage medium according to embodiments of the present invention can quickly and accurately achieve automatic calibration of the endoscope's field of view.
[0059] The following is in conjunction with the appendix Figure 1-3 This invention provides a detailed description of the endoscopic field-of-view calibration method, system, electronic device, and storage medium according to embodiments of the present invention.
[0060] On the one hand, such as Figure 1 As shown in the figure, an endoscope field of view calibration method is proposed in this embodiment of the invention, which includes the following steps:
[0061] Step S100: Obtain the physical parameters of the endoscope lens assembly.
[0062] Specifically, the physical parameters of an endoscope lens assembly typically include the objective lens's maximum field of view, the image sensor's acquisition resolution width, and the image sensor's acquisition resolution height. The objective lens's maximum field of view refers to the angle formed by the two edges of the maximum range through which the image of the target object can pass through the objective lens; this is an inherent parameter of the objective lens at the factory. The image sensor's acquisition resolution width and height refer to the pixel size of the image sensor; these are also inherent parameters of the image sensor at the factory. Obtaining these physical parameters of the endoscope lens assembly facilitates subsequent calibration preprocessing, enabling automatic calibration of the endoscope based on the required target field of view.
[0063] Step S200: Based on the physical parameters, perform field of view calibration preprocessing to obtain the fixed focal distance of the endoscope lens assembly and the standard display image corresponding to the maximum field of view parameter of the objective lens.
[0064] Specifically, before performing field-of-view calibration, a preprocessing step is required. This preprocessing involves continuously optimizing and adjusting the test environment of the endoscope lens assembly to obtain the focal length of the endoscope lens assembly and the standard display image obtained by the endoscope lens assembly from the field-of-view test board. The test environment for field-of-view calibration preprocessing includes a test board, which is an existing field-of-view test board used as the testing object for the endoscope lens assembly. The test board has multiple lines arranged in a circular array, each line indicating the corresponding field-of-view angle. Due to the characteristics of the field-of-view parameters of the endoscope lens assembly, the field-of-view angle corresponding to the line that appears most completely and clearly at the edge of the display image obtained by the endoscope lens assembly from the test board can be used to characterize the field-of-view parameters of the endoscope lens assembly. During the calibration preprocessing, the size and height of the test board are adjusted to enable the endoscope lens assembly to capture a display image of the test board. By continuously adjusting the distance between the test board and the endoscope lens assembly, when the width and height of the image resolution of the captured display image are respectively relative to the width and height of the image sensor acquisition resolution, and the field of view angle corresponding to the edge coil of the display image is equal to the maximum field of view parameter of the objective lens of the endoscope lens assembly, the distance between the test board and the endoscope lens assembly is obtained at this time, which is the focal length of the endoscope lens assembly. The display image obtained by capturing the test board is the standard display image corresponding to the maximum field of view parameter.
[0065] Understandably, the distance between the test plate and the endoscope lens assembly can be adjusted manually or automatically using mechanical equipment. The size of the test plate depends on the maximum field of view parameter of the endoscope lens assembly's objective lens. The lines on the test plate should include the field of view angle corresponding to the maximum field of view parameter of the objective lens. For example, when the maximum field of view parameter of the endoscope lens assembly's objective lens is 200°, in order for the image captured by the endoscope lens assembly to show the line corresponding to 200°, the test plate needs to have line circles corresponding to 200°. The test plate can also have line circles greater than 200°; the more line circles it has, the larger the size of the test plate becomes. Thus, the maximum field of view parameter of the endoscope lens assembly affects the selection of the test plate size. By adjusting the height of the test plate, the test plate falls within the field of view range of the endoscope lens assembly, allowing the lens assembly to capture and display the image. Specifically, the size and height of the test plate are adjusted before the calibration preprocessing and do not require real-time adjustment. During the calibration preprocessing, the distance between the endoscope lens assembly and the test plate is continuously adjusted so that the endoscope imaging system can acquire the display image of the test plate captured by the lens assembly. The endoscope imaging system has a recognition component that can identify the resolution width and height of the display image, as well as the lines and circles on the test plate. It can be used to identify the image resolution width and image resolution height of the display image captured by the endoscope camera assembly on the test plate, and can also identify the lines and circles in the display image.
[0066] Understandably, by correcting the preprocessing and using the physical parameters of the lens assembly as a standard, the testing environment of the endoscope lens assembly can be adjusted more accurately and efficiently to obtain the fixed focal distance.
[0067] Step S300: Obtain the target field of view parameters, and calculate the target resolution corresponding to the target field of view parameters based on the target field of view parameters and the fixed focal distance.
[0068] Specifically, the target field of view parameter is a preset field of view parameter, representing the desired field of view angle of the endoscope lens assembly. The target field of view parameter is less than or equal to the maximum field of view parameter of the endoscope lens assembly's objective lens. After obtaining the physical parameters of the lens assembly, the focal length, and the target field of view parameter, configuration and initialization are performed first. These parameters are input into the debugging application interface of the test system and initialized into the device's local configuration. This allows the test system to calculate the target resolution corresponding to the target field of view parameter using a triangulation algorithm based on the configured parameters. To obtain the target resolution, a triangulation algorithm is first used to calculate the image width, image height, and image diagonal length corresponding to the target field of view parameter; then, the target resolution is obtained based on the image width, image height, and image diagonal length. Figure 2As shown, it illustrates the calculation process of the trigonometric algorithm, and the calculation formula is as follows:
[0069]
[0070]
[0071]
[0072] Where W represents the image width, H represents the image height, C represents the image diagonal length, D represents the focal distance, θ represents the target field of view parameter, and k1, k2, and k3 are all constants. By substituting the obtained focal distance into D and the target field of view parameter into θ, the image width W, image height H, and image diagonal length C can be calculated. Then, using the conversion relationship between pixel units and length units, i.e., pixel unit = (cm * dpi) / 2.54, the target resolution can be obtained. In this example, after verification and optimization of the triangulation algorithm, the final resolution was determined. k3=2, that is:
[0073]
[0074]
[0075]
[0076] Specifically, in order to verify and optimize the triangulation algorithm and determine the values of k1, k2 and k3, we can use equations (1)-(3) to substitute the focal distance into D and the maximum field of view parameter of the objective lens into θ to calculate the standard resolution of the endoscope. Then, we compare the calculated standard resolution with the resolution of the standard display image. Based on the comparison results, we continuously optimize the parameters of the triangulation algorithm so that the calculated standard resolution is consistent with the resolution of the standard display image, thereby finally determining the values of k1, k2 and k3, optimizing the triangulation algorithm, and making the target resolution calculated based on the target field of view parameter more accurate.
[0077] Step S400: Obtain the first cropping parameters based on the target resolution and the resolution of the standard display image.
[0078] Specifically, after calculating the target resolution, it is compared with the resolution of the standard display image obtained by the endoscope after preprocessing and calibrating the field of view to capture the test board. Based on the comparison result, the width, height, and other parameters that need to be cropped from the standard display image can be obtained, thus obtaining the first cropping parameters. For example, assuming the resolution of the standard display image is M1 and the resolution of the target field of view is M2, the first cropping parameters are the width and height parameters corresponding to the resolution obtained by subtracting M1 from M2. In practical applications, the first cropping parameters can be automatically calculated based on the target resolution and the standard display image using a CV algorithm (computer vision algorithm). The CV algorithm depends on the application platform. For example, HiSilicon provides relevant API interface functions for direct use, while other platforms need to modify the open-source OpenCV algorithm appropriately.
[0079] Step S500: Crop and / or scale the standard display image according to the first cropping parameters to obtain the first image.
[0080] Specifically, based on the calculated first cropping parameter, the standard display image is cropped and / or scaled. Cropping and scaling are two distinct actions. Cropping refers to cutting the original standard display image with its center position as the reference point, thereby reducing the field of view. Scaling typically refers to electronic magnification or reduction, i.e., simulating the effect of a magnifying glass through software, while the actual window size remains unchanged, thus adjusting the field of view. In this embodiment, cropping or scaling can be performed alone, or a combination of cropping and scaling can be used to adjust the resolution of the standard display image.
[0081] Step S500: Obtain the actual field of view parameters of the first image through image recognition.
[0082] Specifically, in this example, the test board has multiple lines arranged in a circular array. Each line indicates the corresponding field of view angle. For example, adjacent lines can be spaced 1°, 5°, or other values as needed. The innermost line represents a field of view angle of 1°, the second innermost line represents a field of view angle of 2°, and so on. Then, image recognition is performed using an Optical Character Recognition (OCR) algorithm to identify the complete line circle closest to the image edge in the first image. Based on the recognition result, the field of view angle corresponding to this edge circle is determined as the actual field of view angle parameter of the first image.
[0083] Step S600: When the actual field of view parameter is inconsistent with the target field of view parameter, adjust the first cropping parameter according to the comparison result between the actual field of view parameter and the target field of view parameter, and crop and / or scale the standard display image according to the adjusted first cropping parameter until the actual field of view parameter of the finally obtained image is consistent with the target field of view parameter, thereby completing the field of view calibration.
[0084] Specifically, when the actual field of view parameters of the first image match the target field of view parameters, it indicates that the endoscope's field of view is equal to the target field of view, and calibration has been completed, so no further cropping is needed. However, when the actual field of view parameters of the first image do not match the target field of view parameters, the first cropping parameter needs to be adjusted, and the standard display image is cropped and / or scaled according to the adjusted first cropping parameter. This process is repeated until the actual field of view parameters of the final endoscope display image match the target field of view parameters, thus completing the automatic calibration of the endoscope's field of view.
[0085] Furthermore, step S600 includes the following four sub-steps:
[0086] Step S610: When the actual field of view parameter is inconsistent with the target field of view parameter, calculate the difference between the actual field of view parameter and the target field of view parameter;
[0087] Step S620: Obtain the difference resolution based on the difference;
[0088] Step S630: Obtain the difference clipping parameters based on the difference resolution;
[0089] Step S640: Adjust the first cropping parameter according to the difference cropping parameter to obtain the second cropping parameter, and crop and / or scale the standard display image according to the second cropping parameter to obtain the second image.
[0090] Specifically, the difference cropping parameters obtained in steps S610-S640 are used to characterize the difference relationship between the actual field of view parameters and the target field of view parameters. The difference between the two field of view parameters is converted into the resolution difference of the image. Based on the image resolution difference, the corresponding difference cropping parameters are obtained. The difference cropping parameters are superimposed with the first cropping parameters. The superposition process can be either subtraction or summation to obtain the corrected cropping parameters. Based on the corrected cropping parameters, the standard display image is re-cropped to obtain the second image. When the actual field of view parameters of the second image are consistent with the target field of view parameters, the field of view calibration is completed. If the actual field of view parameters of the second image are still inconsistent with the target field of view parameters, steps S610-S640 are repeated until the actual field of view parameters are consistent with the target field of view parameters.
[0091] As another embodiment of step S600, step S600 includes:
[0092] Step S650: When the actual field of view parameter is inconsistent with the target field of view parameter, calculate the difference between the actual field of view parameter and the target field of view parameter;
[0093] Step S660: Obtain the difference resolution based on the difference;
[0094] Step S670: Obtain the corrected calibration resolution based on the difference resolution and the target resolution;
[0095] Step S680: Obtain the second cropping parameter based on the corrected calibration resolution.
[0096] Specifically, in this embodiment, after obtaining the difference relationship between the actual field of view parameter and the target field of view parameter, the difference resolution corresponding to the difference is superimposed with the target resolution corresponding to the target field of view parameter to calibrate the target field of view parameter and obtain the corrected calibration resolution. The calibration resolution is converted by the CV algorithm to obtain the second cropping parameter, and the standard display image is re-cropped based on the second cropping parameter.
[0097] According to the endoscope field of view calibration method of the present invention, the physical parameters of the endoscope lens assembly are first obtained. Then, the endoscope is preprocessed for field of view calibration by adjusting the size, height, and distance between the test plate and the endoscope lens assembly to make the image captured by the endoscope on the test plate a standard display image. At this time, the distance between the test plate and the endoscope lens assembly is the focal distance. Based on the required target field of view parameters, physical parameters, and focal distance, the target resolution can be calculated. Then, by comparing the target resolution with the resolution of the standard display image, a cropping parameter is obtained. The standard display image is cropped and / or scaled using the cropping parameter, so that the resolution of the display image of the endoscope lens assembly is consistent with the target resolution. Based on the target resolution, the standard display image is continuously cropped and / or scaled, thereby enabling rapid and accurate automatic calibration of the endoscope's field of view.
[0098] On the other hand, based on the endoscopic field of view calibration method of the above-mentioned embodiments, the present invention also proposes an endoscopic field of view calibration system, such as... Figure 3 As shown, the system includes:
[0099] The acquisition module 100 is used to acquire the physical parameters of the endoscope lens assembly; the physical parameters include the maximum field of view of the objective lens, the image sensor acquisition resolution width, and the image sensor acquisition resolution height.
[0100] The preprocessing module 200 is used to perform field-of-view calibration preprocessing based on the physical parameters to obtain the fixed focal distance of the endoscope lens assembly and the standard display image corresponding to the maximum field-of-view parameter of the objective lens;
[0101] The calculation module 300 is used to obtain the target field of view parameters and calculate the target resolution corresponding to the target field of view parameters based on the target field of view parameters and the fixed focal distance.
[0102] The conversion module 400 is used to obtain a first cropping parameter based on the target resolution and the resolution of the standard display image;
[0103] The cropping module 500 is used to crop and / or scale the standard display image according to the first cropping parameters to obtain a first image;
[0104] The image recognition module 600 is used to obtain the actual field of view parameters of the first image through image recognition;
[0105] The calibration module 700 is used to adjust the first cropping parameter according to the comparison result of the actual field of view parameter and the target field of view parameter when the actual field of view parameter is inconsistent with the target field of view parameter, and to crop and / or scale the standard display image according to the adjusted first cropping parameter until the actual field of view parameter of the finally obtained image is consistent with the target field of view parameter, thereby completing the field of view calibration.
[0106] According to an embodiment of the present invention, the endoscope field of view calibration system acquires the physical parameters of the endoscope lens assembly through the acquisition module 100; then, the preprocessing module 200 performs field of view calibration preprocessing on the endoscope to obtain the focal length of the endoscope lens assembly and the standard display image corresponding to the maximum field of view parameter of the objective lens; the calculation module 300 calculates the target resolution corresponding to the target field of view parameter; then, the conversion module 400 obtains the first cropping parameter based on the target resolution and the resolution of the standard display image; finally, the cropping module 500 performs cropping on the endoscope through a test plate according to the first cropping parameter. The obtained display image is cropped and / or scaled to obtain a first image; the image recognition module 600 obtains the actual field of view parameters of the first image through image recognition; the calibration module 700 compares the actual field of view parameters with the target field of view parameters. When the actual field of view parameters are inconsistent with the target field of view parameters, the first cropping parameter is adjusted according to the comparison result of the actual field of view parameters and the target field of view parameters, and the standard display image is cropped and / or scaled according to the adjusted first cropping parameter until the actual field of view parameters of the finally obtained image are consistent with the target field of view parameters, thereby completing the field of view calibration. The endoscope field of view calibration system according to the embodiments of the present invention can quickly and accurately realize the automatic calibration of the field of view of the endoscope.
[0107] On the other hand, embodiments of the present invention also propose an electronic device, comprising:
[0108] Memory, used to store program instructions;
[0109] The processor is used to call the program instructions stored in the memory and execute the above-mentioned endoscope field of view calibration method according to the obtained program instructions.
[0110] The processor can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to achieve the technical solutions provided in the embodiments of this application.
[0111] The memory can be implemented in the form of read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory and called by the processor to execute the endoscopic field-of-view calibration method of the embodiments of this application. The memory and the processor can be connected via a bus or similar means.
[0112] On the other hand, embodiments of the present invention also provide a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described endoscopic field-of-view calibration method.
[0113] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0114] Although specific embodiments are described herein, those skilled in the art will recognize that many other modifications or alternative embodiments are also within the scope of this disclosure. For example, any of the functions and / or processing capabilities described in connection with a particular device or component can be performed by any other device or component. Furthermore, while various exemplary embodiments and architectures have been described according to embodiments of this disclosure, those skilled in the art will recognize that many other modifications to the exemplary embodiments and architectures described herein are also within the scope of this disclosure.
[0115] The foregoing description, with reference to block diagrams and flowcharts of systems, methods, systems, and / or computer program products according to exemplary embodiments, has described certain aspects of this disclosure. It should be understood that one or more blocks in the block diagrams and flowcharts, as well as combinations of blocks in the block diagrams and flowcharts, can be implemented by executing computer-executable program instructions, respectively. Similarly, according to some embodiments, some blocks in the block diagrams and flowcharts may not need to be executed in the order shown, or may not all need to be executed. Furthermore, additional components and / or operations beyond those shown in the blocks in the block diagrams and flowcharts may exist in some embodiments.
[0116] Therefore, blocks in block diagrams and flowcharts support combinations of means for performing a specified function, combinations of elements or steps for performing a specified function, and program instruction means for performing a specified function. It should also be understood that each block in a block diagram and flowchart, and combinations of blocks in block diagrams and flowcharts, can be implemented by a dedicated hardware computer system or a combination of dedicated hardware and computer instructions that performs a specific function, element, or step.
[0117] The program modules, applications, etc., described herein may include one or more software components, including, for example, software objects, methods, data structures, etc. Each such software component may include computer-executable instructions that, in response to execution, cause at least a portion of the functionality described herein (e.g., one or more operations of the exemplary methods described herein) to be performed.
[0118] Software components can be coded using any of a variety of programming languages. An exemplary programming language could be a low-level programming language, such as assembly language associated with a specific hardware architecture and / or operating system platform. Software components including assembly language instructions may need to be converted into executable machine code by an assembler before being executed by the hardware architecture and / or platform. Another exemplary programming language could be a higher-level programming language that is portable across multiple architectures. Software components including higher-level programming languages may need to be converted into an intermediate representation by an interpreter or compiler before execution. Other examples of programming languages include, but are not limited to, macro languages, shell or command languages, job control languages, scripting languages, database query or search languages, or report writing languages. In one or more exemplary embodiments, a software component containing instructions from one of the above-described programming language examples can be executed directly by the operating system or other software components without first being converted into another form.
[0119] Software components can be stored as files or other data storage structures. Software components of similar type or related function can be stored together in a specific directory, folder, or library. Software components can be static (e.g., pre-defined or fixed) or dynamic (e.g., created or modified at runtime).
[0120] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A method for calibrating the field of view of an endoscope, characterized in that, Includes the following steps: Obtain the physical parameters of the endoscope lens assembly; the physical parameters include the maximum field of view of the objective lens, the image sensor acquisition resolution width, and the image sensor acquisition resolution height; Based on the physical parameters, a field of view calibration preprocessing is performed to obtain the fixed focal distance of the endoscope lens assembly and the standard display image corresponding to the maximum field of view parameter of the objective lens; Obtain the target field of view parameters, and calculate the target resolution corresponding to the target field of view parameters based on the target field of view parameters and the focal distance; Based on the target resolution and the resolution of the standard display image, the first cropping parameter is obtained; The standard display image is cropped and / or scaled according to the first cropping parameter to obtain the first image; The actual field of view parameters of the first image are obtained through image recognition; When the actual field of view parameter is inconsistent with the target field of view parameter, the first cropping parameter is adjusted according to the comparison result between the actual field of view parameter and the target field of view parameter, and the standard display image is cropped and / or scaled according to the adjusted first cropping parameter until the actual field of view parameter of the finally obtained image is consistent with the target field of view parameter, thereby completing the field of view calibration.
2. The endoscopic field of view calibration method according to claim 1, characterized in that, The step of performing field-of-view calibration preprocessing based on the physical parameters to obtain the fixed focal distance of the endoscope lens assembly and the standard display image corresponding to the maximum field-of-view parameter of the objective lens includes: Based on the physical parameters, the distance between the endoscope lens assembly and the object being detected by the endoscope lens assembly is adjusted so that the image resolution height and image resolution width of the display image obtained by the endoscope lens assembly from the object being detected are equal to the image sensor acquisition resolution height and image sensor acquisition resolution width, respectively, and the field of view parameter of the display image is equal to the maximum field of view parameter of the objective lens. At this time, the display image is the standard display image, the distance between the object being detected and the endoscope lens assembly is the fixed focal distance, and the object being detected is the field of view test plate.
3. The endoscopic field of view calibration method according to claim 2, characterized in that, The field-of-view testing plate is provided with multiple lines arranged in a circular array, each line indicating a corresponding field-of-view angle; the step of obtaining the actual field-of-view parameters of the first image through image recognition includes: Using an optical character recognition algorithm, a complete line circle closest to the edge of the first image and its corresponding field of view angle are identified. Based on the field of view angles, the actual field of view angle parameters corresponding to the first image are obtained.
4. The endoscopic field of view calibration method according to claim 1, characterized in that, The step of acquiring the target field of view parameters and calculating the target resolution corresponding to the target field of view parameters based on the target field of view parameters and the focal distance includes: Based on the target field of view parameters and the focal distance, a triangulation algorithm is used to calculate the image width, image height, and image diagonal length corresponding to the target field of view parameters. The target resolution is obtained based on the image width, the image height, and the image diagonal length. The formulas for calculating the image width, the image height, and the image diagonal length are as follows: Where W represents the image width, H represents the image height, C represents the image diagonal length, D represents the focal distance, θ represents the target field of view parameter, and k1, k2, and k3 are all constants.
5. The endoscopic field of view calibration method according to claim 4, characterized in that, k3=2。 6. The endoscopic field of view calibration method according to claim 1, characterized in that, When the actual field of view parameter is inconsistent with the target field of view parameter, the first cropping parameter is adjusted according to the comparison result between the actual field of view parameter and the target field of view parameter, and the standard display image is cropped and / or scaled according to the adjusted first cropping parameter, including: When the actual field of view parameter is inconsistent with the target field of view parameter, the difference between the actual field of view parameter and the target field of view parameter is calculated; Based on the difference, the difference resolution is obtained; Based on the difference resolution, the difference clipping parameters are obtained; The first cropping parameter is adjusted according to the difference cropping parameter to obtain the second cropping parameter, and the standard display image is cropped and / or scaled according to the second cropping parameter to obtain the second image.
7. The endoscopic field of view calibration method according to claim 1, characterized in that, When the actual field of view parameter is inconsistent with the target field of view parameter, the first cropping parameter is adjusted according to the comparison result between the actual field of view parameter and the target field of view parameter, and the standard display image is cropped and / or scaled according to the adjusted first cropping parameter, including: When the actual field of view parameter is inconsistent with the target field of view parameter, the difference between the actual field of view parameter and the target field of view parameter is calculated; Based on the difference, the difference resolution is obtained; Based on the difference resolution and the target resolution, the corrected calibration resolution is obtained; Based on the corrected calibration resolution, a second cropping parameter is obtained, and the standard display image is cropped and / or scaled according to the second cropping parameter to obtain a second image.
8. An endoscope field of view calibration system, characterized in that, include: The acquisition module is used to acquire the physical parameters of the endoscope lens assembly; the physical parameters include the maximum field of view of the objective lens, the image sensor acquisition resolution width, and the image sensor acquisition resolution height. The preprocessing module is used to perform field angle calibration preprocessing based on the physical parameters to obtain the focal distance of the endoscope lens assembly and the standard display image corresponding to the maximum field angle parameter of the objective lens. The calculation module is used to obtain the target field of view parameters and calculate the target resolution corresponding to the target field of view parameters based on the target field of view parameters and the focal distance. A conversion module is used to obtain a first cropping parameter based on the target resolution and the resolution of the standard display image; The cropping module is used to crop and / or scale the standard display image according to the first cropping parameters to obtain a first image; The image recognition module is used to obtain the actual field of view parameters of the first image through image recognition; The calibration module is used to adjust the first cropping parameter according to the comparison result of the actual field of view parameter and the target field of view parameter when the actual field of view parameter is inconsistent with the target field of view parameter, and to crop and / or scale the standard display image according to the adjusted first cropping parameter until the actual field of view parameter of the finally obtained image is consistent with the target field of view parameter, thereby completing the field of view calibration.
9. An electronic device, characterized in that, include: Memory, used to store program instructions; The processor is configured to call program instructions stored in the memory and execute the endoscope field-of-view calibration method according to any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores computer-executable instructions for causing a computer to perform the endoscope field-of-view calibration method according to any one of claims 1-7.