Method and device for detecting triple-fold prism

By employing methods such as corner detection, region segmentation, and brightness calculation, combined with OpenCV functions, automated detection of tri-fold prisms is achieved. This solves the image quality problem, enables efficient and reliable detection result output, and is adaptable to the detection of tri-fold prisms of different specifications.

CN120912501APending Publication Date: 2025-11-07SHENGTAI (XINYU) ELECTRONIC IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510787511.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing tri-fold prism cameras are prone to image quality problems during light refraction, such as image blurring, image distortion, or insufficient brightness, which are difficult to detect and resolve effectively.

Method used

The method employs corner detection and extraction, region segmentation and filtering, reference corner location, brightness calculation and distortion judgment, combined with OpenCV functions for sub-pixel level precise corner location and morphological processing, and achieves automated detection through a detection device.

Benefits of technology

It enables precise testing of tri-fold prisms, effectively eliminates noise and interference factors, ensures the reliability of test results, reduces manual testing costs, improves testing speed and efficiency, and adapts to the testing needs of different types of tri-fold prisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120912501A_ABST
    Figure CN120912501A_ABST
Patent Text Reader

Abstract

The invention relates to a three-fold prism detection method and device. The method comprises the steps of image acquisition, angular point detection and extraction, region segmentation and screening, reference angular point positioning, brightness calculation and fuzzy judgment, distortion judgment and result output, and the steps of angular point detection, sub-pixel level angular point accurate positioning, region segmentation and screening, reference angular point positioning, edge angular point elimination and the like are combined. Noise and interference factors are effectively eliminated, so that key feature points in the image can be accurately extracted; through subsequent brightness calculation and linearity distortion judgment, the optical performance of the triple-fold prism can be accurately quantified, and the reliability of a detection result is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of three-fold prism detection, in particular to a three-fold prism detection method and device. BACKGROUND

[0002] The three-fold prism camera is an optical zoom technology for smartphones, usually related to periscopic lens design. Its core is to fold the light path through the prism multiple times, achieving high optical zoom while keeping the phone thin and light. The light path of the traditional camera is straight, while the periscopic lens turns the light horizontally through the prism (similar to the principle of periscope), allowing the telephoto lens to be placed horizontally inside the phone, avoiding protrusion. The three-fold prism is based on the traditional periscopic one or two refractions, further extending the equivalent focal length through three light path folds (or prism refraction), thereby improving zoom capability. Each refraction may cause light loss, resulting in a damaged final image quality, such as image blur, image distortion, or insufficient brightness, etc.

[0003] To this end, the present application provides a three-fold prism detection method and device. SUMMARY

[0004] The present application provides a three-fold prism detection method and device to address the technical problems in the prior art.

[0005] The technical solution of the present application to solve the above technical problems is as follows: a three-fold prism detection method and device; the steps of the detection method include:

[0006] Image acquisition: using a detection camera to capture a target plate image through a three-fold prism, and obtaining raw image data;

[0007] Corner point detection and extraction: after grayscale processing of the image, a corner point detection algorithm is used to extract the corner points in the image;

[0008] Region segmentation and screening: the grayscale image is binarized and segmented, the target region contour is extracted through morphological processing, and the corner points outside the contour are removed according to the contour information to determine the effective detection region;

[0009] Reference corner point positioning: in the screened corner point set, the reference corner point is determined, and its adjacent corner points above, below, left and right are found;

[0010] Brightness calculation and blur judgment: according to the corner point positioning, the peripheral rectangle of the corner point is set, the distance and angle between the corner points are calculated, the average value of the pixel values of the region of interest after grayscale processing is calculated according to the set brightness region of interest, and the average brightness value higher than the average value is obtained; the average brightness of the region of interest of the three-fold prism is compared with the preset value;

[0011] Distortion judgment: linear judgment is adopted, and whether the linear condition meets the preset range is determined;

[0012] Result output: according to the analysis result, whether the three-fold prism has image blur, image distortion or insufficient brightness is determined, and the detection result is output.

[0013] Further, the corner detection and extraction step includes: using the goodFeaturesToTrack function of opencv, and further positioning the sub-pixel level corner by the cornerSubPix function, as follows:

[0014] b1): using the goodFeaturesToTrack function to detect the corner, and setting the following parameters:

[0015] max_corners: limit the number of corners, the value range is 500-1500;

[0016] quality_level: minimum acceptable corner quality parameter, the value range is 0.01-0.1;

[0017] min_distance: minimum detection pixel distance, the value range is 20-50;

[0018] block_size: block size for calculating the derivative covariance matrix of each pixel field, the value range is 7-11;

[0019] b2): using the cornerSubPix function to accurately position the sub-pixel level corner, and setting the following parameters:

[0020] winSize: size of search window, the value range is 9-15;

[0021] epsilon: refinement expected accuracy, the value range is 0.001-0.05.

[0022] Further, the region segmentation and screening step includes:

[0023] A1: the threshold binary segmentation of the gray processing image is performed;

[0024] A2: open operation and inflation processing are performed;

[0025] A3: the connected region count of the image after open operation and inflation processing is performed, whether there is only one contour in the image is determined, if there is more than one, the detection is ended, otherwise the detection is continued;

[0026] A4: the corner outside the contour in the previous step is removed.

[0027] Further, the reference corner positioning step includes:

[0028] Find the reference corner and its adjacent upper, lower, left and right four corners; get the current corner p c The upper, lower, left and right adjacent four corners p u , p d , p l , p r , all meet the reference corner and record its upper, lower, left and right adjacent corners and end in advance; wherein D u , D d , D l , D r respectively represent the distance adjacent to the upper, lower, left and right, and x and y represent the two-dimensional coordinates of the corner;

[0029]

[0030]

[0031] Where Δ is generally set to 2-10.

[0032] Further, the constraint conditions of the reference corner positioning include:

[0033] The distance range UD between the current corner and the upper or lower adjacent corner is UD L , UD H ], the distance range LR between the current corner and the left or right adjacent corner is LR L , LR H ], and the distance range D between the current corner and the left or right adjacent corner is D L , D H ],

[0034]

[0035] Wherein α is generally set to 0.01-0.05.

[0036] Further, after the reference corner positioning, the edge corner is removed:

[0037] Traverse all the four quadrant corner points of the corner to see if they are all within the above contour M, and the following is to confirm the coordinates of the four quadrant corners:

[0038]

[0039] The four quadrant corner coordinates of each corner need to be contained in the contour, otherwise the corner needs to be removed.

[0040] Further, the step of calculating the brightness includes:

[0041] Find the left upper, right upper, left lower and right lower adjacent nearest blocks of each corner;

[0042] Find the maximum 8 nearest corner points of each corner point;

[0043] At the same time, the distance between the corner point p c and other corner points p n needs to meet one of the three:

[0044] |p c -p n |∈UD or |p c -p n |∈LR or |p c -p n |∈D;

[0045] Set step to find the maximum 8 nearest corner points of each corner point p[i]; in turn, select 3 corner points from the nearest corner points, respectively p[m], p[j], p[k];

[0046]

[0047] If one of (1), (2), (3), (4) is met, compare the average brightness of the region of interest of the three-folding prism with the preset value, otherwise reselect the 3 corner points of the nearest corner points;

[0048] Where β is set to 1-10, and the default is 5.

[0049]

[0050] Where μ is set to 1-10,

[0051] Area control:

[0052] The area A1 surrounded by the four corner points p[i], p[m], p[j], p[k]:

[0053] The area A2 calculated by the length of two corner points:

[0054]

[0055] The reference area A3 of the reference corner point:

[0056]

[0057] Need to meet:

[0058]

[0059] Need to meet all ①②③, otherwise it is not the left upper or right upper or left lower or right lower adjacent nearest block of the current corner point.

[0060] Further, the distortion judgment step includes:

[0061] The row and column corner points are sequenced;

[0062] According to the adjacent block corner points obtained by the corner point positioning, the corner points of each row and each column are sequentially sequenced and determined;

[0063] The starting corner point of each row is confirmed by the method that the current corner point does not have an adjacent left corner point as the starting corner point, and the right corner point of the current corner point is sequentially found, and the corner point set of each row is sequentially found and arranged in order;

[0064] The starting corner point of each column is confirmed by the method that the current corner point does not have an adjacent upper corner point as the starting corner point, and the lower corner point of the current corner point is sequentially found, and the corner point set of each column is sequentially found and arranged in order;

[0065] The slope angle of a row of sequentially arranged corner point sets is obtained:

[0066]

[0067] The linearity R is obtained:

[0068]

[0069] The linearity of each row and each column is sequentially obtained, and whether they all meet the requirements is judged.

[0070] On the other hand, a detection device of a three-fold prism is provided, which is applied to the detection method of the three-fold prism, and the device comprises:

[0071] The detection device is connected to the detection camera device for capturing the three-fold prism and the three-fold prism test device for moving the measured three-fold prism in the operation box through a data connection line;

[0072] The detection camera device is used to capture the image of the three-fold prism and is connected to the control detection device;

[0073] The three-fold prism test device table is used to place the measured three-fold prism in the operation box, and the operation box is connected to the control detection device through a control device.

[0074] The three-fold prism test device table is used to place the measured three-fold prism in the operation box, and the operation box is connected to the control detection device through a control device.

[0075] By combining the corner point detection, the sub-pixel level corner point accurate positioning, the region segmentation and screening, the reference corner point positioning and the edge corner point elimination, the noise and the interference factors are effectively excluded, so that the key feature points in the image can be accurately extracted. The subsequent brightness calculation and linearity distortion judgment can accurately quantify the optical performance of the three-fold prism, and ensure the reliability of the detection result.

[0076] The whole detection process can be automated, and can effectively improve the detection speed and efficiency. Especially under the cooperation of the device, the automatic process can quickly judge whether the three-fold prism has image blur, image distortion or insufficient brightness and other problems, and output the results, greatly reducing the cost and time of manual detection, meeting the needs of mass production.

[0077] By setting a series of adjustable parameters (such as the number of corner points, quality parameters, distance thresholds, brightness ranges, etc.), different types and specifications of three-fold prisms can be flexibly adjusted to meet different detection needs, and effectively judge whether the lens has blur, distortion, dirt and other problems, and feedback to avoid product loss.

[0078] The device mainly consists of a control detection device, a detection camera device and a three-fold prism test device table. The connection between the components is convenient, easy to operate, easy to maintain and upgrade, and has good engineering application prospects. Through the movement control of the control box, batch detection of multiple three-fold prisms can be realized, further improving the detection efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0079] Figure 1 Figure 1 is a flowchart of a three-fold prism detection method;

[0080] Figure 2 Figure 2 is a bmp diagram in an embodiment;

[0081] Figure 3 Figure 3 is an initial detection corner point diagram in an embodiment;

[0082] Figure 4 Figure 4 is a threshold binarization segmentation diagram in an embodiment;

[0083] Figure 5 Figure 5 is a diagram after erosion and dilation processing in an embodiment;

[0084] Figure 6 Figure 6 is a diagram of the corner points of the contour edge drawn in an embodiment;

[0085] Figure 7 Figure 7 is a diagram of removing edge corner points in an embodiment;

[0086] Figure 8 Figure 8 is a diagram of blur and dirt conditions in an embodiment;

[0087] Figure 9 Figure 9 is a diagram of distortion judgment in an embodiment;

[0088] Figure 10 Figure 10 is a connection diagram of a three-fold prism detection device in an embodiment;

[0089] Figure 11 Fig. 1 is a schematic diagram of a control box in an embodiment;

[0090] Figure 12 Fig. 2 is a schematic diagram of a chart in an embodiment. DETAILED DESCRIPTION

[0091] The technical solutions in the embodiments of the present application will be clearly and completely described in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0092] In the description of the present application, the terms "first", "second" are used only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise explicitly and specifically limited.

[0093] In the description of the present application, the term "for example" is used to indicate "as an example, illustration or explanation". Any embodiment described as "for example" in the present application is not necessarily interpreted as more preferred or more advantageous than other embodiments. The following description is given in order to enable any person skilled in the art to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that those skilled in the art can recognize that the present application can be implemented without using these specific details. In other examples, well-known structures and processes will not be described in detail to avoid unnecessary details making the description of the present application obscure. Therefore, the present application is not intended to be limited to the shown embodiments, but is consistent with the broadest scope of principles and features disclosed in the present application.

[0094] As shown in Fig. 1, a detection method of a three-fold prism includes the following steps: Figure 1

[0095] S1: image acquisition: using a detection camera to capture a chart image passing through a three-fold prism, and obtaining original image data;

[0096] S2: corner point detection and extraction: after gray-scale processing of the image, a corner point detection algorithm is used to extract the corner points in the image;

[0097] S3: region segmentation and screening: the gray-scale image is binarized and segmented, the target region contour is extracted through morphological processing, and the corner points outside the contour are removed according to the contour information to determine the effective detection region;​

[0098] S4: Reference corner positioning: In the screened corner point set, a reference corner is determined, and its upper, lower, left and right adjacent corners are found;

[0099] S5: Brightness calculation and blur judgment: According to the corner positioning, the peripheral rectangle thereof is obtained, a constraint condition is set, the distance and angle between the corners are calculated, the average value of the pixel values of the region of interest after gray processing is counted according to the set brightness region of interest, and the average brightness value higher than the average value is obtained; the average brightness of the region of interest of the three-fold prism is obtained, which is compared with the preset value;

[0100] S6: Distortion judgment: Linear judgment is adopted, and whether the linear condition meets the preset range is determined;

[0101] S7: Result output: According to the above analysis result, whether the three-fold prism has image blur, image distortion or insufficient brightness is judged, and the detection result is outputted.

[0102] In one embodiment as shown in Figures 2-9 , a detection method of a three-fold prism comprises:

[0103] Step 1: Capture the measured three-fold prism to obtain image data, here using bmp image, as shown in Figure 2 .

[0104] Step 2: Image graying.

[0105] Step 3: Corner point detection processing of the whole image. The goodFeaturesToTrack function of opencv is called, and the cornerSubPix function is used to extract sub-pixel level corner points, so as to improve the positioning accuracy of the corner points and obtain the corner points. Here, the goodFeaturesToTrack function needs to be set with the input parameters, such as limiting the number of corner points max_corners, the minimum acceptable corner point quality parameter quality_level, the minimum detection pixel distance min_distance, the block size block_size of calculating the derivative covariance matrix of each pixel field, etc., and finally the corner points are sorted in descending order of quality degree; the cv: cornerSubPix function mainly concerns the size of the search window winSize and the expected precision epsilon. Here, max_corners is 1000, quality_level is 0.01-0.1, min_distance is 20-50, block_size is 7-11, winSize is 11, and epsilon is 0.01.

[0106] Step 4: Determine the detection region.

[0107] Step 4.1: Threshold binarization segmentation is performed on the grayscale processed image of step 2, using the threshold function of opencv, and here the binarization directly uses the binarization based on the Otsu algorithm (publicly disclosed), that is, the THRESH_OTSU threshold type of opencv is used.

[0108] Step 4.2: Opening operation and dilation processing are performed. The morphologyEx and dilate functions of opencv are called respectively, and the main parameters involved are the kernel and the number of opening operations, the kernel and the number of dilation operations. Here the kernel of opening and dilation operation uses a 5*5 rectangular convolution kernel, and the number of opening and dilation operations is generally 0-4, such as the number of opening operations is 1 and the number of dilation operations is 3.

[0109] Step 4.3: The connected region count is performed on the image of step 4.2. Here the findContours function of opencv is called, and the main parameters involved are the contour retrieval mode and the contour approximation method, and here the contour retrieval mode is to detect only the outermost contour, and the contour approximation method is to delete redundant points and keep the contour end point method. It is judged whether the image only exists one contour, if more than one, the detection is ended, otherwise continue to detect.

[0110] Step 4.4: The corner points outside the contour of step 4.3 are removed, as shown in Figure 6 The contour edge M+ the corner points p[i] inside the contour are drawn.

[0111] Step 5: The reference corner point and the adjacent upper and lower four corner points are found. Actually, generally p[i] corner point i=0 is the reference corner point.

[0112] Get the current corner point p c The upper and lower adjacent four corner points p u , p d , p l , p r , all satisfy D u , D d , D l , D r respectively,.x and.y represent the two-dimensional coordinates of the corner point.

[0113]

[0114]

[0115] Here Δ is generally set to 2-10, which is 5. That is to ensure that the chart graph cannot be tilted too much.

[0116] Step 6: Set the constraints, according to step 5, set the range of the upper or lower, left or right, diagonal adjacent distance of each corner point.

[0117] The current corner point and the upper or lower adjacent distance range UD ∈ [UD L , UD H ], the current corner point and the left or right adjacent distance range LR ∈ [LR L , LR H ], the current corner point and the left or right adjacent distance range D ∈ [D L , D H ],

[0118] Where α is generally set to 0.01-0.05, here it is set to 0.02.

[0119] Step 7: Remove the edge corner points (since the extraction of edge corner points may cause inaccurate corner point grabbing due to the proximity of the dark edge, so it needs to be removed)

[0120] Traverse all the corner points to see if the four quadrant corner points are within the upper contour M, and the following is to confirm the coordinates of the four quadrant corner points.

[0121]

[0122] Each corner point's four quadrant corner point coordinates need to be included in the contour, otherwise the corner point needs to be removed; as shown in the figure, the edge corner points are removed. Figure 7

[0123] Step 8: Calculate the brightness value.

[0124] Step 8.1: Get the peripheral rectangle according to the corner point of step 7. According to the set brightness region of interest, such as the region of interest here is 15% and 20% of the whole image, such as the whole image resolution is 4096*3072, the region of interest pixel is 614*614pixel.

[0125] Step 8.2: Calculate the average value of the pixel value of the region of interest after step 2 grayscale processing (remove black line pixels), and calculate the average brightness value higher than the average value.

[0126] Step 8.3: Get the average brightness of the trifold prism region of interest, and compare it with the pre-set value.

[0127] Step 9: Find the upper left, upper right, lower left, and lower right adjacent nearest blocks of each corner point.

[0128] Step 9.1: Find the maximum 8 nearest corner points of each corner point (sort and filter by comparing the distance between the current corner point and other corner points). ​

[0129] Simultaneous corner point p c Distance from other corner points p n need to meet one of the three:

[0130] |p c -p n |∈UD or |p c -p n |∈LR or |p c -p n |∈D

[0131] Step 9.2: Set the constraint condition that step 9.1 finds the maximum 8 nearest corner points of each corner point p[i]. In turn, select 3 corner points from the nearest corner points, respectively p[m], p[j], p[k].

[0132]

[0133]

[0134] If one of (1), (2), (3), (4) is met, then perform step 8.3, otherwise reselect the 3 corner points of the nearest corner points.

[0135] Step 9.3: Determine if the following operation is performed under the constraint condition of step 9.2, if it is met, then proceed to step 8.4, otherwise reselect the 3 corner points of the nearest corner points.

[0136] Where β is set to 1-10, default is 5.

[0137]

[0138] Where μ is set to 1-10, default is 5.

[0139] Area control:

[0140] The area A1 enclosed by the four corner points p[i], p[m], p[j], p[k] (here you can use the contourArea function of opencv to calculate)

[0141] The area A2 calculated by the length of two corner points:

[0142]

[0143] The reference area A3 of the reference corner point:

[0144]

[0145] Need to meet:

[0146]

[0147] Need all meet ①②③, otherwise not the current corner point of the top left or top right or bottom left or bottom right adjacent nearest block.

[0148] Step 9.4: as 9.3, if the current corner point does not find the adjacent nearest block or more than four adjacent nearest block, indicating that the image may exist blur or dirty.

[0149] Step 10: line and column corner point sorting.

[0150] Step 10.1: according to the adjacent block corner point obtained in step 9, the corner point of each row and column can be sorted in turn.

[0151] The starting corner point confirmation method of each row is that the current corner point does not exist adjacent left corner point as the starting corner point, and the right corner point of the current corner point is found in turn, and the corner point set of each row is found in turn, and arranged in order.

[0152] The starting corner point confirmation method of each column is that the current corner point does not exist adjacent upper corner point as the starting corner point, and the lower corner point of the current corner point is found in turn, and the corner point set of each column is found in turn, and arranged in order.

[0153] Step 10.2: abnormal situation processing.

[0154] The starting two corner points of the current row and the last corner point of other rows or the starting one corner point of the current row and the last two corner points of other rows are traversed in turn, and whether the absolute difference of the included angle of the three corner points and 180° is also less than μ (the parameter has been explained before) is seen. If it is satisfied, it means that there is blur in the three-fold prism.

[0155] Similarly, the starting two corner points of the current column and the last corner point of other columns or the starting one corner point of the current column and the last two corner points of other columns are traversed in turn, and whether the absolute difference of the included angle of the three corner points and 180° is also less than μ (the parameter has been explained before) is seen. If it is satisfied, it means that there is blur in the three-fold prism.

[0156] Otherwise, the image has no blur phenomenon.

[0157] Step 11: distortion judgment. Here, the linearity is judged. That is, whether the linearity meets the preset range is judged according to the following formula. Here, the corner point set of a row is taken as an example to explain, and the corner point set p[j], j∈[m,w].

[0158] Step 11.1: get its slope angle A deg

[0159]

[0160] Step 11.2: get the linearity R of each row and column:

[0161]

[0162] Step 11.3: get the linearity of each row and column in turn, whether it meets the requirements.

[0163] For example here:

[0164] The calculated brightness of interest is 195.515, the minimum linearity value of all rows is 99.8599, the minimum linearity value of the column is 99.638, and the linearity specification is [99,0100], which meets the requirements. At the same time, according to the above method, there is no blur and dirt.

[0165] In another embodiment, as shown in Figures 10-12 A detection device for a three-fold prism is provided, comprising:

[0166] Control detection device: connect the detection camera device that captures the three-fold prism and the three-fold prism test device that controls the movement of the three-fold prism placed in the control box through the data connection line. Here is composed of control and detection software on the computer. Connect to the detection camera through the connection line, and detect the image captured by the detection camera, and analyze whether the image exists image blur, image distortion or insufficient brightness. At the same time, through the control connection line connected to the control box of the three-fold prism test device table, it is used to move each three-fold prism in turn for detection.

[0167] Detection camera device: used to capture three-fold prism image, connected to control detection device. Adjust the distance to ensure that the captured image is clear enough to take a clear chart image.

[0168] Three-fold prism test device table: the three-fold prism to be tested is placed in the control box, and the control box is connected to the control detection device through a control device, so that the control box can move in turn according to the established position, and each three-fold prism is detected in turn to complete automation. Above the three-fold prism test device is a chart composed of square grids, with a line thickness of 15um and a grid length of 200um (the line thickness and length can also be adjusted). Ensure that the chart is placed on the light entrance surface of the three-fold prism. The chart and the three-fold prism maintain a certain distance, which can be 1-5cm. The two sides between the chart and the three-fold prism are light source plates to ensure that enough light enters the three-fold prism and is refracted out, so that the detection camera can capture a clear image.

[0169] In this embodiment, the device mainly consists of three parts: a control and detection device, a detection camera device, and a tri-fold prism testing platform. The components are easy to connect, simple to operate, easy to maintain and upgrade, and have good engineering application prospects. Through the movement control of the control box, batch testing of multiple tri-fold prisms can be achieved, further improving the testing efficiency.

[0170] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0171] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method of detecting a triple fold prism, characterized by the steps of Comprise: Image acquisition: using the detection camera to capture the target image through the three-fold prism, and obtain the original image data; Corner detection and extraction: after the image is processed by grayscale, the corner detection algorithm is used to extract the corners in the image; Region segmentation and screening: the gray image is binarized and segmented, the target region contour is extracted through morphological processing, and the corners outside the contour are removed according to the contour information to determine the effective detection region; Reference corner positioning: in the screened corner set, the reference corner is determined, and the corners adjacent to it are found; Brightness calculation and fuzzy judgment: according to the corner positioning, the peripheral rectangle of the corner is obtained, the constraint condition is set, the distance and angle between the corners are calculated, the average brightness value of the region of interest after grayscale processing is calculated according to the set brightness region of interest, and the average brightness value higher than the average value is calculated; The average brightness of the three-fold prism region of interest is obtained, and the preset value is compared; Distortion judgment: linear judgment is adopted, and whether the linear degree meets the preset range is judged; Result output: according to the above analysis results, whether the three-fold prism exists image blur, image distortion or insufficient brightness is judged, and the detection result is output.

2. The method of claim 1, wherein, The corner detection and extraction step includes: using the goodFeaturesToTrack function of opencv, and further positioning the sub-pixel level corner through the cornerSubPix function, as follows: b1): using the goodFeaturesToTrack function to detect the corner, setting the following parameters: max_corners: limit the number of corners, the value range is 500-1500; quality_level: minimum acceptable corner quality parameter, the value range is 0.01-0.1; min_distance: minimum detection pixel distance, the value range is 20-50; block_size: block size for calculating the derivative covariance matrix of each pixel field, the value range is 7-11; b2): using the cornerSubPix function to accurately position the sub-pixel level corner, setting the following parameters: winSize: the size of the search window, the value range is 9-15; epsilon: expected accuracy of refinement, the value range is 0.001-0.

05.

3. The method of claim 1, wherein the three-fold prism is a three-fold roof prism. The region segmentation and screening step includes: A1: threshold binarization segmentation of the grayscale processed image; A2: open operation and inflation processing; A3: count the connected regions of the image after open operation and inflation processing, judge whether there is only one contour in the image, if more than one, the detection is ended, otherwise continue to detect; A4: remove the corners outside the contour in the above step.

4. The method of claim 3, wherein the three-fold prism is a three-fold roof prism. The reference corner positioning step includes: Find the reference corner and its adjacent four corners above, below, left and right; get the current corner p c The four adjacent corners above, below, left and right of p u , p d , p l , p r , all meet the reference corner is found and its adjacent four corners above, below, left and right are recorded and the process is ended in advance; wherein D u , D d , D l , D r respectively represent the distance with the adjacent corners above, below, left and right, and x and y represent the two-dimensional coordinates of the corner Where Δ is generally set to 2-10.

5. The method of claim 4, wherein the three-fold prism is a three-fold roof prism. The constraint condition of reference corner positioning includes: current corner and the upper or lower adjacent spacing range UD ∈ [UD L , UD H ], current corner and the left or right adjacent spacing range LR ∈ [LR L , LR H ], current corner and the left or right adjacent spacing range D ∈ [D L , D H ], Where α is generally set to 0.01-0.

05.

6. The method of claim 5, wherein the three-fold prism is a three-fold roof prism. Remove the edge corners after reference corner positioning: Traverse whether the four quadrant corners of all corners are in the above contour M, the following is the confirmation of the coordinates of the four quadrant corners; The four quadrant corner point coordinates of each corner point need to be included in the contour, otherwise the corner point needs to be removed.

7. The method of claim 6, wherein the three-fold prism is a three-fold roof prism. The step of calculating the brightness further comprises: Finding the left upper, right upper, left lower and right lower adjacent nearest blocks of each corner point; Finding the maximum 8 nearest corner points of each corner point; Simultaneous corner points p c Distance from other corner points p n need to satisfy one of the three: |p c -p n |∈UD or |p c -p n |∈LR or |p c -p n |∈D; Setting the constraint condition of finding the maximum 8 nearest corner points of each corner point p[i]; sequentially selecting 3 corner points from the nearest corner points, which are p[m], p[j] and p[k]; If one of (1), (2), (3) and (4) is satisfied, then the average brightness of the region of interest of the three-fold prism is compared with the preset value, otherwise the 3 nearest corner points are reselected; wherein β is set to 1-10, Wherein μ is set to 1-10; Area control: The area A1 surrounded by the four corner points p[i], p[m], p[j] and p[k]: The length calculation area A2 of two corner points: The reference area A3 of the reference corner point: The following needs to be met: All of ①, ② and ③ need to be met, otherwise it is not the left upper or right upper or left lower or right lower adjacent nearest block of the current corner point.

8. The method of claim 7, wherein the three-fold prism is a three-fold roof prism. The distortion judgment step comprises: Carrying out row and column corner point sorting; According to the adjacent block corner points obtained by corner point positioning, the corner points of each row and each column can be sequentially sorted and determined; The starting corner point confirmation method of each row is that the current corner point does not have an adjacent left corner point as the starting corner point, and the right corner point of the current corner point is sequentially found to sequentially find the corner point set of each row and arrange them in order; The starting corner point confirmation method of each column is that the current corner point does not have an adjacent upper corner point as the starting corner point, and the lower corner point of the current corner point is sequentially found to sequentially find the corner point set of each column and arrange them in order; The slope angle of a row of sequentially arranged corner point sets is obtained: The linearity R is obtained: The linearity of each row and each column is sequentially obtained to determine whether they all meet the requirements.

9. A device for detecting a triple-folded prism, characterized by The device is applied to the detection method of the three-fold prism according to any one of claims 1-8, and the device comprises: A control detection device: connecting a detection camera device for capturing the three-fold prism and a three-fold prism testing device for moving the measured three-fold prism in a control box through a data connection line; A detection camera device: used for capturing the image of the three-fold prism, connected to the control detection device; A three-fold prism testing device table: the measured three-fold prism is placed in a control box, and the control box is connected to the control detection device through a control device.