A target, angle resolution detection method, device, equipment and detection system
By designing angular resolution test patterns and marking patterns on the target, and using Hough transform to detect the center of the marking pattern, the system automatically moves and extracts line pair images, thus solving the error and efficiency problems in the angular resolution detection of the camera device and achieving efficient and accurate detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SONOSCAPE MEDICAL CORP
- Filing Date
- 2022-03-08
- Publication Date
- 2026-06-09
AI Technical Summary
In the existing technology, the angular resolution detection results of camera devices are prone to operational errors and subjective errors, resulting in low detection efficiency and a large workload for detection personnel.
Design a target comprising an angular resolution test pattern and a marker pattern on a substrate. Detect the center pixel position of the marker pattern using Hough transform. Automatously move standard line pairs and extract line pair images. Determine the angular resolution based on the sharpness of the line pair images.
The system automates the angular resolution detection of the camera device, improving detection efficiency and accuracy while reducing operational errors.
Smart Images

Figure CN116777974B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of angular resolution testing technology, and in particular to a target, angular resolution testing method, apparatus, equipment and testing system. Background Technology
[0002] Image quality is a crucial parameter for evaluating the performance of an imaging optical system. Currently, the People's Republic of China pharmaceutical industry standard YY0068.1-2008 specifies that angular resolution is used to measure the imaging quality of a camera device. Angular resolution is defined as the reciprocal of the limiting angle of resolution of the smallest resolvable equidistant fringe width at a given optical working distance, with respect to the entrance pupil center of the optical lens. One essential parameter for calculating angular resolution is the number of resolvable line pairs per millimeter.
[0003] Currently, this is usually done by testing personnel, such as production staff and quality inspectors, who will... Figure 14 The standard line pairs of each level in the resolution plate shown in JB / T 9328-1999 are moved to the target detection position of the camera device. Then, the highest standard line pair level that the camera device can identify at the target detection position is subjectively judged, and the limit number of line pairs that the camera device can distinguish per millimeter at the target detection position is obtained. This leads to the introduction of operational error and subjective error into the angular resolution detection results, resulting in insufficient accuracy of the detection results, a large workload for the detection personnel, and low detection efficiency. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a target, angular resolution detection method, apparatus, equipment, and detection system that can improve the efficiency and accuracy of angular resolution detection. The specific solution is as follows:
[0005] In a first aspect, this application discloses a target for detecting the angular resolution of a camera device, characterized in that the target comprises:
[0006] A substrate, the surface of which is formed with an angular resolution test pattern, the angular resolution test pattern including a marking pattern and a multi-level standard line pair group, each level of the standard line pair group including at least one standard line pair in an arrangement direction.
[0007] Specifically, when the target and the camera device are aligned, the center of the marking pattern corresponds to the target detection position of the camera device.
[0008] Optionally, the marking pattern is a marking circle.
[0009] Optionally, the multi-level standard line pairs are arranged around the marking circle in hierarchical order.
[0010] Optionally, the radius of the marking circle is greater than or equal to the diagonal length of the standard line pair.
[0011] Optionally, the imaging device is an endoscope; the angular resolution test pattern includes 5, wherein when the target and the endoscope are aligned, the center of one of the marked circles is located at the center of the endoscope's field of view, and the centers of the other 4 marked circles are respectively located at four points orthogonally arranged on the first reticle that coincides with 70% of the endoscope's field of view.
[0012] Optionally, the surface of the substrate is further formed with a unit relative distortion test pattern, which includes: a second reticle circle with a radius of 25 mm concentric with the center mark circle and a third reticle circle with a radius of 17.5 mm, wherein four circular spots with a diameter less than or equal to 4 mm are evenly distributed on the third reticle circle.
[0013] Optionally, the surface of the substrate may also be formed with an entrance pupil field of view test pattern, the entrance pupil field of view test pattern including: a second reticle circle with a radius of 25 mm concentric with the mark circle located at the center and a fourth reticle circle with a radius of 12.5 mm.
[0014] Secondly, this application discloses an angular resolution detection method applied to a detection system including a camera device and the aforementioned target, the method comprising:
[0015] Once the target and the camera device are aligned, an image of the target is acquired and recorded as the target image.
[0016] The marker pattern in the target image is detected to obtain the pixel position of the center of the marker pattern;
[0017] Multiple standard line pairs in the target are moved sequentially to the pixel position, corresponding detection images are acquired, and images containing only the standard line pairs are extracted from the detection images to obtain multiple line pair images;
[0018] Based on the sharpness of each line pair image, the maximum number of line pairs that the camera device can distinguish per millimeter at the pixel location is determined.
[0019] The angular resolution of the camera device at the pixel location is determined based on the number of line pairs that can be distinguished per millimeter.
[0020] Optionally, the marking pattern is a marking circle;
[0021] Then, detecting the marker pattern in the target image to obtain the pixel position of the center of the marker pattern includes:
[0022] The target image is subjected to Hough transform detection to obtain the center position and pixel radius of the marker circle; wherein the center position of the marker circle is the pixel position.
[0023] Optionally, the surface of the substrate is formed with a field of view circle and i angular resolution test patterns, i≥2; when the target and the camera device are aligned, the field of view circle coincides with the edge of the maximum field of view of the camera device;
[0024] Then, the step of performing Hough transform detection on the target image to obtain the center position and pixel radius of the marker circle includes:
[0025] Based on the image size of the target image, a Hough transform is performed on the target image to obtain the pixel radius of the field of view circle;
[0026] Based on the physical radius of the field of view circle and each marker circle on the target, and the pixel radius of the field of view circle, the estimated radius of each marker circle in the target image is calculated.
[0027] For each of the marked circles, a masking process is performed on the target image to obtain a mask image for each marked circle; wherein, the complete circle in each mask image is only the corresponding marked circle;
[0028] Based on the calculated radius, Hough transform detection is performed on the mask image of each of the marked circles to obtain the center position and pixel radius of each marked circle.
[0029] Optionally, the radius of the marking circle is greater than or equal to the diagonal length of the standard line pair;
[0030] Then, the step of extracting an image containing only the standard line pairs from the detected image to obtain multiple line pair images includes:
[0031] The side length of the rectangular region is determined based on the pixel radius of the marked circle;
[0032] The following processing is performed on each of the detected images to obtain multiple line pair images:
[0033] Centered on the center of the marked circle, and based on the side length of the rectangular region, a rectangular region is cropped to obtain an image of a rectangular region where only the corresponding standard line pairs are complete line pairs;
[0034] Contour detection is performed on the rectangular region image, and the contour area of all contours is calculated;
[0035] The bounding box parameters are determined based on the largest outline area, and the bounding box parameters are used to extract a line pair image containing only the standard line pairs from the rectangular region image.
[0036] Optionally, determining the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location based on the sharpness of each of the line pair images includes:
[0037] Calculate the sharpness of each of the line pairs in the image;
[0038] The sharpness of each line pair image is compared with a preset sharpness evaluation standard to determine a first evaluation level; wherein, the sharpness comparison result of the line pair image corresponding to the first evaluation level is identifiable and has the highest level;
[0039] Based on the first evaluation level, the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location is determined.
[0040] Optionally, determining the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location based on the sharpness of each of the line pair images further includes:
[0041] The sharpness of each line pair image is compared with a preset sharpness evaluation standard to determine a second evaluation level; wherein, the sharpness comparison result of the line pair image corresponding to the second evaluation level is uncertain;
[0042] Then, determining the maximum number of recognizable line pairs per millimeter at the pixel location based on the first evaluation level includes:
[0043] Based on the first evaluation level and the second evaluation level, the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location is determined.
[0044] Optionally, calculating the sharpness of each of the line pairs of images includes:
[0045] For each line pair image: determine the arrangement direction of the line pairs in the line pair image, process the line pair image using the edge detection operator corresponding to the arrangement direction to obtain a gradient image, and calculate the sharpness of the line pair image based on the gradient image.
[0046] Optionally, the method further includes:
[0047] For each line pair level, a corresponding sharpness evaluation standard is preset.
[0048] Optionally, for each line pair level, a corresponding sharpness evaluation standard is preset, including:
[0049] Move the standard line pair of each level to the center of the marked circle to obtain an image sequence of the standard line pair of each level from unclear to clear;
[0050] The target number of target line pair images is determined from the image sequence; wherein the target line pair images are line pair images between those that the human eye can just not distinguish from the standard line pair and those that the human eye can just distinguish from the standard line pair.
[0051] Based on the image sharpness of the target line pairs with the target number, a corresponding level of sharpness evaluation criteria is determined.
[0052] Optionally, determining the corresponding level of sharpness evaluation criteria based on the sharpness of the target line pairs image according to the target number includes:
[0053] The maximum and minimum values are determined from the image sharpness of the target line pairs of the target number, and the parameter ranges corresponding to the maximum and minimum values are determined as the sharpness evaluation criteria of the corresponding level;
[0054] Wherein, if the sharpness of the line pair image at the corresponding level is greater than the maximum value, then the sharpness comparison result of the line pair image at the corresponding level is identifiable;
[0055] If the sharpness of the line pair image at the corresponding level is within the range of the parameters, then the sharpness comparison result of the line pair image at the corresponding level is uncertain.
[0056] If the sharpness of the line pair image at the corresponding level is less than the minimum value, then the sharpness comparison result of the line pair image at the corresponding level is unrecognizable.
[0057] Optionally, the detection system includes a camera device and the aforementioned target, the device comprising:
[0058] The target image acquisition module is used to acquire an image of the target after the target and the camera device have been aligned and adjusted, and the image is recorded as the target image;
[0059] A marker pattern detection module is used to detect marker patterns in the target image to obtain the pixel position of the center of the marker pattern;
[0060] The detection image acquisition module is used to sequentially move multiple standard line pairs in the target to the pixel position and acquire the corresponding detection image;
[0061] A line pair image extraction module is used to extract images containing only the standard line pairs from the detected image to obtain multiple line pair images;
[0062] The distinguishable line pair determination module is used to determine the maximum number of distinguishable line pairs per millimeter that the camera device can recognize at the pixel position based on the sharpness of each line pair image.
[0063] An angular resolution determination module is used to determine the angular resolution of the camera device at the pixel position based on the maximum number of recognizable line pairs per millimeter.
[0064] Thirdly, this application discloses an electronic device, including:
[0065] Memory, used to store computer programs;
[0066] A processor is used to execute the computer program to implement the aforementioned angular resolution detection method.
[0067] Fourthly, this application discloses a detection system, including a camera device and the aforementioned target.
[0068] As can be seen, the target for detecting the angular resolution of a camera device disclosed in this application includes: a substrate, on the surface of which an angular resolution test pattern is formed. The angular resolution test pattern includes a marker pattern and a multi-level standard line pair group, each level of the standard line pair group including at least one standard line pair arranged in at least one direction. When the target and the camera device are aligned, the center of the marker pattern corresponds to the target detection position of the camera device. That is, in this application, the angular resolution test pattern in the target includes not only a multi-level standard line pair group but also a marker pattern. Furthermore, when the target and the camera device are aligned, the center of the marker pattern corresponds to the target detection position of the camera device. Thus, during angular resolution detection, the pixel position of the target detection position in the image can be determined by identifying the marker pattern in the target image. Therefore, after moving each standard line pair to the target detection position, a line pair image containing only each standard line pair can be accurately extracted based on the pixel position. The angular resolution at the target detection position can be determined based on the clarity of each line pair image, which facilitates automated detection and improves the efficiency and accuracy of angular resolution detection. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0070] Figure 1 A target provided for this application;
[0071] Figure 2 A flowchart of an angular resolution detection method provided in this application;
[0072] Figure 3 A mask image with a central field of view provided for this application;
[0073] Figure 4 A mask image for the upper right field of view provided in this application;
[0074] Figure 5 This application provides a test image acquired after moving a line pair to the center position of the corresponding marked circle;
[0075] Figure 6 A coarsely extracted line pair image provided in this application;
[0076] Figure 7 This application provides a filtered line-pair image;
[0077] Figure 8 This application provides a line pair binarized image;
[0078] Figure 9 This application provides a precisely extracted line pair image;
[0079] Figure 10 This application provides a gradient image corresponding to a line pair image;
[0080] Figure 11 A flowchart of a specific endoscopic angular resolution detection method provided in this application;
[0081] Figure 12 This is a schematic diagram of the structure of an angular resolution detection device disclosed in this application;
[0082] Figure 13 This is a structural diagram of an electronic device disclosed in this application;
[0083] Figure 14 This is a schematic diagram of the resolution plate in the existing technology JB / T 9328-1999. Detailed Implementation
[0084] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0085] Currently, the target for testing the angular resolution of endoscopes is as follows: Figure 14The JB / T 9328-1999 resolution plate shown typically arranges multiple levels of standard line pairs in a rectangular area within the target. Using such a target usually requires manual movement of each level of standard line pair to the target detection position for the camera to capture the corresponding line pair image. This process is time-consuming, inefficient, and prone to introducing operational errors, affecting detection accuracy. Therefore, this application provides a target that facilitates automated detection, improving the efficiency and accuracy of angular resolution testing.
[0086] See Figure 1 As shown in the embodiment of this application, a target is disclosed, the target comprising:
[0087] A substrate, the surface of which is formed with an angular resolution test pattern, the angular resolution test pattern including a marking pattern and a multi-level standard line pair group, each level of the standard line pair group including at least one standard line pair in an arrangement direction.
[0088] Specifically, when the target and the camera device are aligned, the center of the marking pattern corresponds to the target detection position of the camera device.
[0089] As can be seen, the angular resolution test pattern in the target disclosed in this application includes not only a multi-level standard line pair group, but also a marker pattern. When the target and the camera device are aligned, the center of the marker pattern corresponds to the target detection position of the camera device. Thus, when performing angular resolution testing, the pixel position of the target detection position in the image can be obtained by identifying the marker pattern in the target image. Therefore, after moving each standard line pair to the target detection position, the line pair image containing only each standard line pair can be accurately extracted based on the pixel position. The angular resolution at the target detection position can be determined based on the clarity of each line pair image, which is beneficial for achieving automated detection and improving the efficiency and accuracy of angular resolution testing.
[0090] In one embodiment, the substrate is a transparent substrate, which can reduce the difficulty of light adjustment, reduce the impact of local exposure, and improve the detection effect. Of course, in other embodiments, the substrate can also be a non-transparent substrate, such as a black background with a transparent pattern area or a white background.
[0091] In one implementation, such as Figure 1As shown, the marking pattern is a marking circle. This facilitates the detection of the marking circle in the acquired image and the determination of its center position (pixel position) and pixel radius. Furthermore, it allows for compatibility with other test patterns (such as the unit relative distortion test pattern described later), expanding the target's testing capabilities. Of course, it is understood that in other embodiments, the marking pattern can also be of other shapes, as long as it can be identified in the target image, thereby pinpointing the pixel coordinates of the target detection location.
[0092] Furthermore, in order to facilitate the step-by-step identification of standard line pairs at each level and improve detection efficiency, the multi-level standard line pairs can be arranged around the marking circle in order of level.
[0093] Furthermore, in order to facilitate the determination of the pixel size of each standard line pair and to more accurately extract the line pair image containing only the standard line pairs from the test image, the radius of the marker circle can be greater than or equal to the diagonal length of the standard line pair.
[0094] In one embodiment, the imaging device is an endoscope; the angular resolution test pattern includes 5, wherein when the target and the endoscope are aligned, the center of one of the marked circles is located at the center of the endoscope's field of view, and the centers of the other 4 marked circles are respectively located at four points orthogonally arranged on a first reticle that coincides with 70% of the endoscope's field of view.
[0095] Furthermore, in one embodiment, a unit relative distortion test pattern is formed on the surface of the substrate. The unit relative distortion test pattern includes a second reticle circle R25 with a radius of 25 mm, which is concentric with the mark circle located at the center, and a third reticle circle R17.5 with a radius of 17.5 mm. The third reticle circle has four circular spots with a diameter less than or equal to 4 mm evenly distributed on it.
[0096] Furthermore, the surface of the substrate is also formed with an entrance pupil field of view test pattern, which includes: a second reticle circle R25 with a radius of 25 mm and concentric with the mark circle located at the center, and a fourth reticle circle R12.5 with a radius of 12.5 mm.
[0097] In other words, the target provided in this application can not only detect the angular resolution of the camera device, but also be compatible with the detection of unit relative distortion and entrance pupil field of view.
[0098] Furthermore, it is understood that this application does not limit the number of standard line pairs or which levels of standard line pairs are arranged in the target; this can be determined based on the approximate angular resolution of the camera device under test. For example, in this application, to accommodate the angular resolution of the endoscope, only the 7th to 14th levels of standard line pairs can be arranged in the target, removing standard line pairs of lower levels that are clearly identifiable by the endoscope, and standard line pairs of higher levels that are clearly indistinguishable by the endoscope, thus avoiding pattern redundancy.
[0099] See Figure 2 As shown in the figure, this application discloses an angular resolution detection method applied to a detection system including a camera device and the aforementioned target, wherein the camera device can be, for example, an endoscope. The method may include, but is not limited to, the following steps:
[0100] Step S11: After the target and the camera device have completed the centering adjustment, an image of the target is acquired and recorded as the target image.
[0101] Step S12: Detect the marker pattern in the target image to obtain the pixel position of the center of the marker pattern.
[0102] In one embodiment, the marking pattern is a marking circle; then, in this application embodiment, Hough transform detection can be performed on the target image to obtain the center position and pixel radius of the marking circle; wherein, the center position of the marking circle is the pixel position.
[0103] Furthermore, in one embodiment, the surface of the substrate is formed with a field of view circle and i angular resolution test patterns, i≥2; when the target and the camera device are aligned, the field of view circle coincides with the maximum field of view edge of the camera device; then, performing Hough transform detection on the target image to obtain the center position and pixel radius of the marker circle specifically includes the following steps:
[0104] Step 000: Based on the image size of the target image, perform Hough transform detection on the target image to obtain the pixel radius of the field of view circle;
[0105] Step 001: Based on the physical radius of the field of view circle and each marker circle on the target and the pixel radius of the field of view circle, calculate the estimated radius of each marker circle in the target image;
[0106] Step 002: Perform masking processing on the target image for each of the marked circles to obtain a mask image for each marked circle; wherein, the complete circle in each mask image is only the corresponding marked circle;
[0107] Step 003: Perform Hough transform detection on the mask image of each of the marked circles based on the calculated radius to obtain the center position and pixel radius of each marked circle.
[0108] It should be noted that due to imaging errors, the optical axis will be offset to some extent, resulting in a certain deviation between the center of the marked circle in the image and the center of the field of view. However, this deviation does not affect detection, and this application still considers the center of the marked circle to be the target detection position. Furthermore, due to imaging errors, the image will have a certain degree of distortion, which is particularly noticeable at the edge of the field of view. Therefore, in order to improve testing accuracy, it is necessary to extract line pairs based on the pixel radius and center position of the detected marked circle.
[0109] In one specific implementation, this embodiment first acquires an image after the target and endoscope have been aligned and adjusted to obtain a target image. Then, Hough transform is used to detect the marker circles and their center coordinates corresponding to the five target detection positions, which are shown in the figure. (See figure) Figure 1 As shown, five target detection locations were identified, along with their center coordinates. Around each target detection location, multiple standard line pairs of varying levels were arranged. Each standard line pair consisted of one horizontal, one vertical, and two diagonal standard line pairs. The higher the level of the line pair group, the denser the lines within it, making them more difficult to distinguish.
[0110] It should be noted that since the target contains multiple circles with different radii, directly performing the Hough transform would detect all the circles, and would be very time-consuming. Therefore, in order to quickly and accurately detect five marked circles in the center and diagonal directions, this embodiment utilizes prior information about the target. The specific steps are as follows:
[0111] a. First, detect the center coordinates (x0, y0) of the field of view circle. Assuming the width and height of the image are w and h respectively, the largest circle in the image is the field of view circle, i.e., the edge of the field of view. The radius of the field of view circle is slightly less than w / 2. Therefore, in this embodiment, the radius range of the detected circle is set to [w / 2-Δr1, w / 2], where Δr1 is a given adjustable margin. When setting it, it is necessary to ensure that w / 2-Δr1 is less than the radius of the largest circle and greater than the radius of the second largest circle in the image, so that the Hough transform can only detect the circular outline of the edge of the field of view and obtain the pixel radius viewR and the center coordinates (x0, y0) of the field of view circle.
[0112] b. Perform masking on the original image, preserving information within a rectangular region of size [w1, h1] centered at (x0, y0). See [link to documentation]. Figure 3 As shown, Figure 3This application provides a mask image for a central field of view. The concept behind setting w1 and h1 is as follows: based on the prior physical dimensions of the central marker circle on the target, the gratings R8.17, R12.5, R17.5, and R25 on the target, and the edge contour of the field of view, along with the viewR obtained in the previous step, the radius of each marker circle can be roughly calculated. w1 and h1 must be larger than the diameter of the central marker circle and smaller than the diameter of the R8.17 grating circle, thus obtaining a mask image that retains only the central marker circle from the original image. The prior physical dimension information refers to the physical radius. It is understood that if the prior physical dimension information of each marker circle is consistent, the corresponding calculated radius will also be consistent. Therefore, this application embodiment uses the central marker circle for calculation to obtain the calculated radius of the central marker circle, which is also the calculated radius of each marker circle.
[0113] c. Detect the central field-of-view marker circle. Assume the radius of the central marker circle calculated in the previous step is approximately refR. Set the radius range of the detection circle to [refR-Δr2, refR+Δr2]. Perform a Hough transform on the mask image obtained in the previous step to obtain the detection radius ctR and center coordinates (xct, yct) of the central marker circle. Similarly, Δr2 is a set adjustable margin.
[0114] d. Perform masking on the original image, preserving information within a rectangular region of size [w / 2, h / 4] in the upper right corner of the image. See [link to documentation]. Figure 4 As shown, Figure 4 This application provides a mask image for the upper right field of view. The specific size of the rectangular area can be adjusted. The adjustment idea is still to retain only the marker circle in the upper right corner of the original image in the mask image, and not include or only include a small part of the black circle in the upper right corner of the R17.5 dividing circle.
[0115] e. Detect the upper right field of view marker circle. Similarly, set the radius range of the detection circle to [refR-Δr2, refR+Δr2], and perform a Hough transform on the mask image obtained in the previous step to obtain the radius rtR and center coordinates (xrt, yrt) of the upper right marker circle.
[0116] f. Detect the radii ltR, lbR, rbR and center coordinates (xlt, ylt), (xlb, ylb), and (xrb, yrb) of the marker circles in the upper left, lower left, and lower right corners, respectively, using methods similar to d and e.
[0117] Step S13: Move multiple standard line pairs in the target to the pixel position in sequence, acquire the corresponding detection image, and extract the image containing only the standard line pairs from the detection image to obtain multiple line pair images.
[0118] In a specific implementation, based on the physical distance between each pair of standard lines and the center of the corresponding marker pattern, a shifting device can be used to move the target or endoscope, shifting multiple pairs of standard lines to the pixel position of the center of the marker pattern at the detected target detection location. For example, see [link to relevant documentation]. Figure 5 As shown, Figure 5 This is a test image acquired after moving a line pair to the center of a corresponding marked circle, as provided in an embodiment of this application. Figure 5 The line pair currently moving to the center of the marker circle in the upper right field of view is the vertical line pair of the 7th level line pair group in the upper right field of view, such as... Figure 5 As shown, the line pair is already at the center of the detected upper right field of view marker circle.
[0119] In one implementation, the radius of the marker circle is greater than or equal to the diagonal length of the standard line pair; then, the specific steps of extracting images containing only the standard line pairs from the detected image to obtain multiple line pair images include:
[0120] Step 100: Determine the side length of the rectangular region based on the pixel radius of the marked circle;
[0121] For each of the detected images, perform the following steps 101-203 to obtain multiple line pair images:
[0122] Step 101: Using the center of the marked circle as the center, and according to the side length of the rectangular area, a rectangular area is cut off to obtain a rectangular area image containing the corresponding standard line pairs as complete line pairs;
[0123] Step 102: Perform contour detection on the rectangular region image and calculate the contour area of all contours;
[0124] In a specific implementation, the embodiments of this application may filter the rectangular region image to obtain a filtered image; binarize the filtered image to obtain a binary image; and perform contour detection on the binary image.
[0125] The filtering process can include image smoothing processes such as median filtering and mean filtering. The binarization process can include global or local binarization methods such as Otsu's method, valley minimum method, bimodal average method, Bernsen method, and Niblack method.
[0126] Step 103: Determine the bounding box parameters based on the largest outline area, and extract the corresponding line pair image from the rectangular region image using the bounding box parameters.
[0127] That is, the embodiment of the present application can first perform rough extraction to obtain a rectangular region image in which only the corresponding standard line pair is a complete line pair (that is, including the standard line pair and other interference information), and then perform fine extraction to obtain an image that only contains the corresponding standard line pair.
[0128] Taking the vertical line pair of the 7th-level line pair group in the upper right field of view that has moved to the center position of the upper right field of view marking circle as an example, the embodiment of the present application first roughly extracts the standard line pair: intercept a rectangular region with (xrt, yrt) as the center and a side length of rtR + Δh1 from the detection image that moves from the standard line pair to the center of the circle to obtain a roughly extracted line pair image. Among them, Δh1 is a given adjustable margin, and the setting idea is: Δh1 < rtR / 2, so that only the corresponding standard line pair in the roughly extracted image is a complete line pair, and usually taking about rtR / 3 is more appropriate. See Figure 6 shown, Figure 6 which is a roughly extracted line pair image provided by the embodiment of the present application. Then, accurately extract the standard line pair: first use median filtering to smooth the roughly extracted image, as Figure 7 shown, Figure 7 which is a filtered line pair image provided by the embodiment of the present application. Then, use the Otsu method to perform binary processing on the image, as Figure 8 shown, Figure 8 which is a line pair binary image provided by the embodiment of the present application. Then, perform contour detection on the binary image. First, calculate the contour areas of all the found contours, and the one with the largest area is considered to be the standard line pair region. Obtain the rectangular frame parameters according to the largest contour and extract them from the roughly extracted line pair image, that is, obtain the accurately extracted standard line pair image. As Figure 9 shown, Figure 9 which is an accurately extracted line pair image provided by the embodiment of the present application.
[0129] It should be noted that since the pixel radius of the marking circle is relatively easy to determine, when designing the target in the embodiment of the present application, the radius of the marking circle is made slightly larger than or equal to the size of a single standard line pair pattern. For example, the diagonal length can be used as a reference. In this way, the interception range can be directly determined according to the detected pixel radius without too much arithmetic transformation.
[0130] Step S14: Determine the limit number of resolvable line pairs per millimeter that the imaging device can recognize at the pixel position based on the clarity of each of the line pair images.
[0131] In one implementation manner, step S14 may specifically include the following steps:
[0132] Step 200: Calculate the clarity of each of the line pair images;
[0133] In one implementation, for each line pair image: the arrangement direction of the line pairs in the line pair image can be determined, the line pair image can be processed using an edge detection operator corresponding to the arrangement direction to obtain a gradient image, and the sharpness of the line pair image can be calculated based on the gradient image.
[0134] For example, if the line pairs are arranged in a vertical direction, the edge detection operator is:
[0135]
[0136] If the line pairs are arranged in parallel or diagonal directions, then the edge detection operator is:
[0137] , or
[0138] In other embodiments, other edge detection operators may also be used, such as the Sobel operator, Roberts operator, Prewitt operator, Laplacian operator, etc.
[0139] See Figure 10 As shown, Figure 10 This application provides a gradient image corresponding to a line pair image, which is generated using edge detection operators corresponding to vertical line pairs. Figure 9 The resulting gradient image is processed. The Tenengrad function is used to calculate the sharpness evaluation parameters of the line pair image. S The formula is as follows:
[0140]
[0141] Where G(x, y) is the gradient at pixel (x, y).
[0142] Step 201: Compare the sharpness of each line pair image with a preset sharpness evaluation standard to determine a first evaluation level; wherein, the sharpness comparison result of the line pair image corresponding to the first evaluation level is identifiable and has the highest level (i.e., it contains the most line pairs).
[0143] In one implementation, the sharpness of a line pair image in a specified arrangement direction within each level of standard line pair group can be compared with a preset sharpness evaluation standard to determine the first evaluation level.
[0144] The "specified arrangement direction" can be predetermined based on the actual application of the camera device. In this way, the angular resolution of the arrangement direction that the camera device focuses on can be concentrated, thus simplifying the detection process.
[0145] Alternatively, in some embodiments, the "specified arrangement direction" can specifically be the arrangement direction corresponding to the line pair image with the lowest sharpness. In this way, the angular resolution of the camera device at the target detection position can be determined according to the most stringent recognition criteria. Thus, in this embodiment, the sharpness parameter corresponding to each line pair in the specified level of standard line pair group can be calculated; the sharpness parameters are compared, and the arrangement direction corresponding to the smallest sharpness parameter is determined as the specified arrangement direction.
[0146] In another implementation, the overall sharpness of line pair images in multiple specified orientations within each level's standard line pair group can be determined first. The overall sharpness of each level's standard line pair group is then compared with a preset sharpness evaluation standard to determine the first evaluation level. Further, in a specific implementation, the overall sharpness of the corresponding level can be calculated based on the sharpness of line pair images in multiple specified orientations within each level's standard line pair group. For example, the average sharpness of line pair images in multiple specified orientations within each level's standard line pair group can be calculated to obtain the overall sharpness of the corresponding level. In another implementation, gradient images of line pair images in multiple specified orientations within each level's standard line pair group can be determined, and the overall sharpness of the corresponding level can be determined based on these gradient images.
[0147] For example, given two line pairs with specified orientations, such as vertical and horizontal, edge detection is performed to obtain gradient images Gx and Gy for each orientation. Then, in the formula for calculating the sharpness evaluation parameter S, G(x, y) is calculated using the following formula:
[0148]
[0149] It should be noted that in some embodiments, sharpness can also be calculated using other no-reference image sharpness evaluation functions such as the energy gradient function, Brenner gradient function, Laplacian gradient function, and SMD (Sum of Modulus of Gray Difference) function.
[0150] Step 202: Based on the first evaluation level, determine the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location.
[0151] In another implementation, step S14 may specifically include the following steps:
[0152] Step 300: Calculate the sharpness of each of the line pairs images;
[0153] Step 301: Compare the sharpness of each line pair image with a preset sharpness evaluation standard to determine a first evaluation level and a second evaluation level; wherein, the sharpness comparison result of the line pair image corresponding to the first evaluation level is identifiable and has the highest level (i.e., it contains the most line pairs); the sharpness comparison result of the line pair image corresponding to the second evaluation level is uncertain.
[0154] Step 302: Based on the first evaluation level and the second evaluation level, determine the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location.
[0155] Furthermore, this application can also preset corresponding sharpness evaluation criteria for each line pair level, with specific steps including:
[0156] Step 400: Move the standard line pair of each level to the center of the marked circle to obtain an image sequence of the standard line pair of each level from unclear to clear;
[0157] In a specific implementation, external conditions such as light source brightness can be fixed first, the standard line pair can be moved to the center of the corresponding field of view mark circle, and then the focus ring can be adjusted to make the standard line pair on the image blurry and indistinguishable. The image can be acquired, the focus ring can be finely adjusted to make the standard line pair on the image clearer than before, the image can be acquired, and so on, until an image sequence of the standard line pair from unclear to clear is obtained.
[0158] Step 401: Determine the target number of target line pair images from the image sequence; wherein, the target line pair images are line pair images between those that the human eye can just not distinguish and those that the human eye can just distinguish.
[0159] Step 402: Based on the image sharpness of the target line pairs with the target number, determine the corresponding level of sharpness evaluation criteria.
[0160] The calculation method for the sharpness of the target line pair in the image can be found in the aforementioned content and will not be repeated here.
[0161] In one implementation, a maximum and a minimum value can be determined from the sharpness of the target number of target line pair images, and the parameter range corresponding to the maximum and the minimum values can be determined as the sharpness evaluation standard for the corresponding level. Specifically, if the sharpness of the line pair image at the corresponding level is greater than the maximum value, the sharpness comparison result for the line pair image at the corresponding level is identifiable; if the sharpness of the line pair image at the corresponding level is within the parameter range, the sharpness comparison result for the line pair image at the corresponding level is uncertain; and if the sharpness of the line pair image at the corresponding level is less than the minimum value, the sharpness comparison result for the line pair image at the corresponding level is unidentifiable.
[0162] Accordingly, based on the first evaluation level and the second evaluation level, determining the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location includes: determining the average of the maximum number of recognizable line pairs per millimeter corresponding to the first evaluation level and the maximum number of recognizable line pairs per millimeter corresponding to the second evaluation level as the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location. Furthermore, if the sharpness parameter of the level above the first evaluation level is less than the minimum value in the parameter range of the corresponding level, then the maximum number of recognizable line pairs per millimeter corresponding to the first evaluation level is directly determined as the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location.
[0163] In another implementation, the mean value of the sharpness parameter of the target number of target images can be determined, and the mean value of the parameter can be used as the preset sharpness evaluation standard for the corresponding level. If the sharpness of the line pair image at the corresponding level is greater than the mean value of the parameter, the sharpness comparison result of the line pair image at the corresponding level is identifiable; otherwise, it is unidentifiable.
[0164] Accordingly, based on the first evaluation level, determining the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel position includes: directly determining the maximum number of recognizable line pairs per millimeter corresponding to the first evaluation level as the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel position.
[0165] In a specific implementation, the number of distinguishable line pairs per millimeter of the evaluation line can be obtained by looking up a table. That is, the table includes the number of distinguishable line pairs per millimeter for different levels of line pairs.
[0166] That is, in the solution provided by this application, the preset clarity evaluation criterion can be a standard value or a range. It should be noted that in the steps of detecting the angular resolution in the national standard, when identifying whether a line pair can be resolved, if the resolvable line pair is in a state where it cannot be determined at this level but is clearly resolvable at the upper level (i.e., the level with fewer line pairs), the median value of the upper-level line pair and the current-level line pair can be taken. Therefore, when formulating the clarity evaluation criterion in the embodiments of this application, in addition to formulating a value to evaluate whether a line pair can be resolved, an interval [T1, T2] can also be specified such that when T1 < clarity parameter S < T2, it is determined that the line pair group is in a critical state and it cannot be determined whether it is resolvable. That is, the standard parameter range is an interval with the maximum and minimum values of the clarity parameters of the target image as endpoints. The clarity evaluation criterion can be formulated for a line pair in a specified arrangement direction in the standard line pair group, or the clarity evaluation criterion can be formulated for the comprehensive clarity of multiple line pairs in a specified arrangement direction in the standard line pair group.
[0167] For example, to formulate the clarity evaluation criterion for the 7th-level vertical line pair in the upper right field of view, first fix external conditions such as the light source brightness, and move the 7th-level vertical line pair to the center position of the corresponding field mark circle; then adjust the focusing ring to make the line pair on the image blurred and indistinguishable, collect an image, and slightly adjust the focusing ring to make the line pair on the image a little clearer than the previous time, and collect an image. Operate in this way until an image sequence of the 7th-level vertical line pair from unclear to clear is obtained, and then process the image sequence to finally obtain a set of clarity parameters. Take the three images that can just be determined to be resolvable, and calculate the average value of the clarity parameters of these three images as the objective evaluation criterion for evaluating whether the 7th-level vertical line pair can be resolved. Similarly, the clarity evaluation criteria for vertical line pairs at different levels can be obtained.
[0168] It should be noted that the imaging device used to determine the preset clarity evaluation criterion is the same model as the imaging device to be evaluated, and during the process of determining the preset clarity evaluation criterion, external conditions such as the light source brightness are the same as those when detecting the angular resolution of the endoscopic device to be evaluated.
[0169] According to the solution provided by the embodiments of this application, the preset clarity evaluation criterion for each level can be determined. It should be noted that if the edge distortion of the endoscope is not serious, a set of preset clarity evaluation criteria can be formulated. If the edge distortion of the endoscope is serious, two sets of preset clarity evaluation criteria need to be formulated, one for the central field of view and one for the edge field of view. That is, for the same level, the preset clarity evaluation criteria for the central field of view and the edge field of view are determined separately.
[0170] Step S15: Determine the angular resolution of the imaging device at the pixel position according to the maximum number of resolvable line pairs per millimeter.
[0171] In this application, the calculation of the angular resolution of an endoscope is used as an example for illustration. Specifically, the calculation formula is as follows:
[0172]
[0173] in, r(d) The limit of distinguishable line pairs per millimeter, expressed in units of (lp / mn). a This is the distance from the tip of the endoscope to the entrance pupil. d This refers to the optical working distance.
[0174] Thus, according to the method provided in the embodiments of this application, the angular resolution of the five fields of view positions of the endoscope to be evaluated—central field of view, upper left, lower left, upper right, and lower right—can be detected.
[0175] The following section uses the preset sharpness evaluation standard as an example to detail the endoscopic angular resolution detection process. (See also...) Figure 11 As shown, Figure 11 This is a flowchart illustrating a specific endoscopic angular resolution detection method disclosed in an embodiment of this application. The detection begins by acquiring an image after the target and endoscope have been aligned and adjusted. The Hough transform is used to detect the marker circles and their center coordinates at five field-of-view positions. First, the target or endoscope is moved to shift the standard line pairs to the center of the marker circle at the corresponding field-of-view position. For example, the lowest-level standard line pairs in the upper right field of view are first moved to the center of the marker circle in the upper right field of view. The standard line pairs are then coarsely extracted, resulting in an image containing the standard line pairs and other interference information. The process involves precisely extracting standard line pairs to obtain an image containing only these pairs. Post-processing of the line pair image involves calculating the line pair image sharpness parameter S. This parameter is then compared to a pre-defined sharpness evaluation standard T for that level of line pair. If S is greater than T, the line pair is considered identifiable, and the target line pair is replaced with the next level target line pair. If the next level line pair is less than T, it is considered unidentifiable. The highest-level identifiable standard line pair is then output. A table is then consulted to obtain the corresponding limit of recognizable line pairs per millimeter, angular resolution is calculated, and the calculation result for the corresponding field of view is output. For example, if a level 7 standard line pair is identifiable, it is replaced with a level 8 standard line pair. If the level 8 standard line pair is unidentifiable, the angular resolution is calculated using the limit of recognizable line pairs per millimeter corresponding to the level 7 standard line pair. In other words, in the specific detection process, for any field of view, target line pairs can be detected in ascending order of level (this is merely an example; in other embodiments, target line pairs can also be detected in descending order of level). Based on the aforementioned steps, the angular resolution at five field-of-view positions is tested to obtain the angular resolution of the endoscope to be evaluated at the five field-of-view positions.
[0176] It should be noted that currently, in the process of testing the angular resolution of endoscopes, the limit of resolvable line pairs per millimeter is usually obtained by testing personnel, such as production personnel and quality inspectors, through subjective judgment. This introduces operational and subjective errors into the angular resolution testing results, resulting in insufficient accuracy. Furthermore, it increases the workload for testing personnel and reduces testing efficiency. Therefore, the angular resolution testing solution provided in this application can improve the accuracy and efficiency of angular resolution testing.
[0177] The solution provided in this application first acquires an image of the target after the target and the camera device have been aligned, and this image is recorded as the target image. Then, the marking pattern in the target image is detected to obtain the pixel position of the center of the marking pattern. Next, multiple standard line pairs in the target are sequentially moved to the pixel position, and corresponding detection images are acquired. Images containing only the standard line pairs are extracted from the detection images to obtain multiple line pair images. Then, based on the sharpness of each line pair image, the maximum number of line pairs that the camera device can recognize per millimeter at the pixel position is determined. Finally, based on the maximum number of line pairs that can be recognized per millimeter, the angular resolution of the camera device at the pixel position is determined. In this way, by calculating the sharpness of each line pair image, the maximum number of line pairs that the camera device can recognize per millimeter at the pixel position is determined, and thus the angular resolution of the camera device at the pixel position is obtained. This reduces the operational difficulty for inspection personnel, reduces inspection time, thereby improving inspection efficiency, and avoids subjective and operational errors caused by different inspection personnel, thereby improving the accuracy of the inspection results.
[0178] See Figure 12 As shown, this application discloses an angular resolution detection device applied to a detection system including a camera device and the aforementioned target. The device includes:
[0179] The target image acquisition module 11 is used to acquire an image of the target when the target and the camera device have completed the centering adjustment, and record it as the target image;
[0180] The marker pattern detection module 12 is used to detect the marker pattern in the target image to obtain the pixel position of the center of the marker pattern;
[0181] The detection image acquisition module 13 is used to move multiple standard line pairs in the target to the pixel position in sequence and acquire the corresponding detection image;
[0182] Line pair image extraction module 14 is used to extract images containing only the standard line pairs from the detected image to obtain multiple line pair images;
[0183] The distinguishable line pair determination module 15 is used to determine the maximum number of distinguishable line pairs per millimeter that the camera device can recognize at the pixel position based on the sharpness of each line pair image.
[0184] Angle resolution determination module 16 is used to determine the angle resolution of the camera device at the pixel position based on the number of line pairs that can be distinguished per millimeter.
[0185] As can be seen, in this embodiment, after the target and the camera device have been aligned, an image of the target is acquired and recorded as the target image. Then, the marking pattern in the target image is detected to obtain the pixel position of the center of the marking pattern. Next, multiple standard line pairs in the target are sequentially moved to the pixel position, and corresponding detection images are acquired. Images containing only the standard line pairs are extracted from the detection images to obtain multiple line pair images. Then, based on the sharpness of each line pair image, the maximum number of line pairs that the camera device can recognize per millimeter at the pixel position is determined. Finally, based on the maximum number of line pairs that can be recognized per millimeter, the angular resolution of the camera device at the pixel position is determined. In this way, by calculating the sharpness of each line pair image, the maximum number of line pairs that the camera device can recognize per millimeter at the pixel position is determined, and thus the angular resolution of the camera device at the pixel position is obtained. This reduces the operational difficulty for inspection personnel, reduces inspection time, thereby improving inspection efficiency, and avoids subjective and operational errors caused by different inspection personnel, thereby improving the accuracy of the inspection results.
[0186] In one embodiment, the marking pattern is a marking circle; then, the marking pattern detection module 12 is specifically used to perform Hough transform detection on the target image to obtain the center position and pixel radius of the marking circle; wherein, the center position of the marking circle is the pixel position.
[0187] Furthermore, the surface of the substrate is formed with a field of view circle and i angular resolution test patterns, i≥2; when the target and the camera device are aligned, the field of view circle coincides with the edge of the maximum field of view of the camera device; then, the marker pattern detection module 12 specifically includes:
[0188] The field-of-view circle pixel radius determination submodule is used to perform Hough transform detection on the target image based on the image size of the target image in order to obtain the pixel radius of the field-of-view circle;
[0189] The radius estimation submodule is used to estimate the radius of each marker circle in the target image based on the physical radius of the field of view circle and each marker circle on the target and the pixel radius of the field of view circle.
[0190] A mask processing submodule is used to perform mask processing on the target image for each of the marked circles to obtain a mask image for each of the marked circles; wherein, the complete circle in each mask image is only the corresponding marked circle;
[0191] The marker circle center position and pixel radius detection submodule is used to perform Hough transform detection on the mask image of each marker circle based on the calculated radius to obtain the center position and pixel radius of each marker circle.
[0192] Furthermore, if the radius of the marked circle is greater than or equal to the diagonal length of the standard line pair, then the line pair image extraction module 14 specifically includes:
[0193] The rectangular region side length determination submodule is used to determine the rectangular region side length based on the pixel radius of the marked circle;
[0194] The line pair image acquisition submodule is used to perform the following processing on each of the detected images to obtain multiple line pair images: taking the center position of the marked circle as the center and cropping a rectangular region according to the side length of the rectangular region to obtain a rectangular region image in which only the corresponding standard line pairs are complete line pairs; performing contour detection on the rectangular region image and calculating the contour area of all contours; determining the bounding box parameters based on the largest contour area, and using the bounding box parameters to extract the line pair image in the rectangular region image that only includes the standard line pairs.
[0195] In one embodiment, the distinguishable line pair determination module 15 specifically includes:
[0196] A sharpness calculation submodule is used to calculate the sharpness of each of the line pairs of images;
[0197] The first evaluation level determination submodule is used to compare the sharpness of each line pair image with a preset sharpness evaluation standard to determine the first evaluation level; wherein, the sharpness comparison result of the line pair image corresponding to the first evaluation level is identifiable and has the highest level;
[0198] The distinguishable line pair determination submodule is used to determine, based on the first evaluation level, the maximum number of distinguishable line pairs per millimeter that the camera device can recognize at the pixel location.
[0199] Furthermore, the distinguishable line logarithm determination module 15 also includes:
[0200] The second evaluation level determination submodule is used to compare the sharpness of each line pair image with a preset sharpness evaluation standard to determine the second evaluation level; wherein, the sharpness comparison result of the line pair image corresponding to the second evaluation level is uncertain.
[0201] Then, the distinguishable line pair determination submodule is specifically used to determine the maximum number of distinguishable line pairs per millimeter that the camera device can recognize at the pixel position based on the first evaluation level and the second evaluation level.
[0202] Furthermore, the sharpness calculation submodule is specifically used for each line pair image to: determine the arrangement direction of the line pairs in the line pair image, process the line pair image using an edge detection operator corresponding to the arrangement direction to obtain a gradient image, and calculate the sharpness of the line pair image based on the gradient image.
[0203] Furthermore, the device also includes a sharpness evaluation standard preset module, used to preset corresponding sharpness evaluation standards for each line pair level.
[0204] In one implementation, the sharpness evaluation standard preset module specifically includes:
[0205] The image sequence acquisition submodule is used to move the standard line pair of each level to the center position of the marked circle and acquire the image sequence of the standard line pair of each level from unclear to clear.
[0206] The target line pair image determination submodule is used to determine the target number of target line pair images from the image sequence; wherein, the target line pair images are line pair images between those that the human eye can just not distinguish and those that the human eye can just distinguish.
[0207] The sharpness evaluation standard determination submodule is used to determine the corresponding level of sharpness evaluation standard based on the sharpness of the target line pairs image with the target number.
[0208] In one implementation, the sharpness evaluation standard determination submodule is specifically used to determine the maximum and minimum values from the sharpness of the target line pairs image of the target number, and to determine the parameter range corresponding to the maximum and minimum values as the sharpness evaluation standard of the corresponding level.
[0209] Wherein, if the sharpness of the line pair image at the corresponding level is greater than the maximum value, then the sharpness comparison result of the line pair image at the corresponding level is identifiable;
[0210] If the sharpness of the line pair image at the corresponding level is within the range of the parameters, then the sharpness comparison result of the line pair image at the corresponding level is uncertain.
[0211] If the sharpness of the line pair image at the corresponding level is less than the minimum value, then the sharpness comparison result of the line pair image at the corresponding level is unrecognizable.
[0212] See Figure 13As shown in the figure, this application discloses an electronic device 20, including a processor 21 and a memory 22; wherein, the memory 22 is used to store a computer program; the processor 21 is used to execute the computer program to implement the angular resolution detection method disclosed in the foregoing embodiments.
[0213] For details regarding the specific process of the above-mentioned angle resolution detection method, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0214] Furthermore, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, and the storage method can be temporary storage or permanent storage.
[0215] In addition, the electronic device 20 also includes a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26; wherein, the power supply 23 is used to provide operating voltage for the various hardware devices on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0216] Furthermore, this application also discloses a detection system, including a camera device, the aforementioned target, and the aforementioned electronic device. The aforementioned angular resolution detection method can be implemented through this detection system. The specific process of the aforementioned angular resolution detection method can be referred to the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0217] In addition, to enable fully automated detection, the detection system may also include a displacement device that is mechanically connected to the camera device or the target and communicatively connected to the aforementioned electronic equipment, and is able to cause relative displacement between the camera device and the target according to the control signal of the electronic equipment.
[0218] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0219] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0220] The above provides a detailed description of a target, angular resolution detection method, apparatus, equipment, and detection system provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A target for detecting the angular resolution of a camera device, characterized in that, The target includes: A substrate, the surface of which is formed with an angular resolution test pattern, the angular resolution test pattern including a marking pattern and a multi-level standard line pair group, each level of the standard line pair group including at least one standard line pair in an arrangement direction. Specifically, when the target and the camera device are aligned, the center of the marking pattern corresponds to the target detection position of the camera device. During angular resolution detection, the pixel position of the target detection position in the image is obtained by identifying the marking pattern in the target image. After moving each standard line pair to the target detection position, a line pair image containing only each standard line pair is extracted based on the pixel position. The angular resolution at the target detection position is determined based on the sharpness of each line pair image.
2. The target according to claim 1, characterized in that, The marking pattern is a marking circle.
3. The target according to claim 2, characterized in that, The multi-level standard line pairs are arranged around the marking circle in hierarchical order.
4. The target according to claim 2, characterized in that, The radius of the marked circle is greater than or equal to the diagonal length of the standard line pair.
5. The target according to any one of claims 2 to 4, characterized in that, The camera device is an endoscope; The angular resolution test pattern includes 5 circles. When the target and the endoscope are aligned, the center of one of the marked circles is located at the center of the endoscope's field of view, and the centers of the other 4 marked circles are located at four points orthogonally arranged on the first reticle that coincides with 70% of the endoscope's field of view.
6. The target according to claim 5, characterized in that, The surface of the substrate is also formed with a unit relative distortion test pattern, which includes a second reticle circle with a radius of 25 mm concentric with the center mark circle and a third reticle circle with a radius of 17.5 mm. The third reticle circle has four circular spots with a diameter of less than or equal to 4 mm evenly distributed on it.
7. The target according to claim 5, characterized in that, The surface of the substrate is also formed with an entrance pupil field of view test pattern, which includes a second reticle circle with a radius of 25 mm and a fourth reticle circle with a radius of 12.5 mm, which is concentric with the mark circle located at the center.
8. A method for detecting angular resolution, characterized in that, Applied to a detection system including a camera device and a target as described in claim 1, the method includes: Once the target and the camera device are aligned, an image of the target is acquired and recorded as the target image. The marker pattern in the target image is detected to obtain the pixel position of the center of the marker pattern; Multiple standard line pairs in the target are moved sequentially to the pixel position, corresponding detection images are acquired, and images containing only the standard line pairs are extracted from the detection images to obtain multiple line pair images; Based on the sharpness of each line pair image, the maximum number of line pairs that the camera device can distinguish per millimeter at the pixel location is determined. The angular resolution of the camera device at the pixel location is determined based on the number of line pairs that can be distinguished per millimeter.
9. The angular resolution detection method according to claim 8, characterized in that, The marking pattern is a marking circle; Then, detecting the marker pattern in the target image to obtain the pixel position of the center of the marker pattern includes: The target image is subjected to Hough transform detection to obtain the center position and pixel radius of the marker circle; wherein the center position of the marker circle is the pixel position.
10. The angular resolution detection method according to claim 9, characterized in that, The surface of the substrate is formed with a field of view circle and i angular resolution test patterns, i≥2; when the target and the camera device are aligned, the field of view circle coincides with the edge of the maximum field of view of the camera device; Then, the step of performing Hough transform detection on the target image to obtain the center position and pixel radius of the marker circle includes: Based on the image size of the target image, a Hough transform is performed on the target image to obtain the pixel radius of the field of view circle; Based on the physical radius of the field of view circle and each marker circle on the target, and the pixel radius of the field of view circle, the estimated radius of each marker circle in the target image is calculated. For each of the marked circles, a masking process is performed on the target image to obtain a mask image for each marked circle; wherein, the complete circle in each mask image is only the corresponding marked circle; Based on the calculated radius, Hough transform detection is performed on the mask image of each of the marked circles to obtain the center position and pixel radius of each marked circle.
11. The angular resolution detection method according to claim 9, characterized in that, The radius of the marked circle is greater than or equal to the diagonal length of the standard line pair; Then, the step of extracting an image containing only the standard line pairs from the detected image to obtain multiple line pair images includes: The side length of the rectangular region is determined based on the pixel radius of the marked circle; The following processing is performed on each of the detected images to obtain multiple line pair images: Centered on the center of the marked circle, and based on the side length of the rectangular region, a rectangular region is cropped to obtain an image of a rectangular region where only the corresponding standard line pairs are complete line pairs; Contour detection is performed on the rectangular region image, and the contour area of all contours is calculated; The bounding box parameters are determined based on the largest outline area, and the bounding box parameters are used to extract a line pair image containing only the standard line pairs from the rectangular region image.
12. The angular resolution detection method according to claim 9, characterized in that, Determining the maximum number of recognizable line pairs per millimeter at the pixel location based on the sharpness of each line pair image includes: Calculate the sharpness of each of the line pairs in the image; The sharpness of each line pair image is compared with a preset sharpness evaluation standard to determine a first evaluation level; wherein, the sharpness comparison result of the line pair image corresponding to the first evaluation level is identifiable and has the highest level; Based on the first evaluation level, the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location is determined.
13. The angular resolution detection method according to claim 12, characterized in that, The step of determining the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location based on the sharpness of each of the line pair images further includes: The sharpness of each line pair image is compared with a preset sharpness evaluation standard to determine a second evaluation level; wherein, the sharpness comparison result of the line pair image corresponding to the second evaluation level is uncertain; Then, determining the maximum number of recognizable line pairs per millimeter at the pixel location based on the first evaluation level includes: Based on the first evaluation level and the second evaluation level, the maximum number of recognizable line pairs per millimeter that the camera device can identify at the pixel location is determined.
14. The angular resolution detection method according to claim 12 or 13, characterized in that, The calculation of the sharpness of each of the line pairs of images includes: For each line pair image: determine the arrangement direction of the line pairs in the line pair image, process the line pair image using the edge detection operator corresponding to the arrangement direction to obtain a gradient image, and calculate the sharpness of the line pair image based on the gradient image.
15. The angular resolution detection method according to claim 12 or 13, characterized in that, The method further includes: For each line pair level, a corresponding sharpness evaluation standard is preset.
16. The angular resolution detection method according to claim 15, characterized in that, For each line pair level, a corresponding sharpness evaluation standard is preset, including: Move the standard line pair of each level to the center of the marked circle to obtain an image sequence of the standard line pair of each level from unclear to clear; The target number of target line pair images is determined from the image sequence; wherein the target line pair images are line pair images between those that the human eye can just not distinguish from the standard line pair and those that the human eye can just distinguish from the standard line pair. Based on the image sharpness of the target line pairs with the target number, a corresponding level of sharpness evaluation criteria is determined.
17. The angular resolution detection method according to claim 16, characterized in that, The determination of the corresponding level of sharpness evaluation criteria based on the sharpness of the target line pairs in the image according to the target number includes: The maximum and minimum values are determined from the image sharpness of the target line pairs of the target number, and the parameter ranges corresponding to the maximum and minimum values are determined as the sharpness evaluation criteria of the corresponding level; Wherein, if the sharpness of the line pair image at the corresponding level is greater than the maximum value, then the sharpness comparison result of the line pair image at the corresponding level is identifiable; If the sharpness of the line pair image at the corresponding level is within the range of the parameters, then the sharpness comparison result of the line pair image at the corresponding level is uncertain. If the sharpness of the line pair image at the corresponding level is less than the minimum value, then the sharpness comparison result of the line pair image at the corresponding level is unrecognizable.
18. An angular resolution detection device, characterized in that, Applied to a detection system including a camera device and a target as described in claim 1, the device comprising: The target image acquisition module is used to acquire an image of the target after the target and the camera device have been aligned and adjusted, and the image is recorded as the target image; A marker pattern detection module is used to detect marker patterns in the target image to obtain the pixel position of the center of the marker pattern; The detection image acquisition module is used to sequentially move multiple standard line pairs in the target to the pixel position and acquire the corresponding detection image; A line pair image extraction module is used to extract images containing only the standard line pairs from the detected image to obtain multiple line pair images; The distinguishable line pair determination module is used to determine the maximum number of distinguishable line pairs per millimeter that the camera device can recognize at the pixel position based on the sharpness of each line pair image. An angular resolution determination module is used to determine the angular resolution of the camera device at the pixel position based on the maximum number of recognizable line pairs per millimeter.
19. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the angular resolution detection method as described in any one of claims 8 to 17.
20. A detection system, characterized in that, It includes a camera device, a target as described in claim 1, and an electronic device as described in claim 19.