A method, device and medium for detecting distortion of optical material
In the optical material distortion detection, the camera lens is used to capture the image of the calibration chart and related parameters, and the distortion of the optical material is directly evaluated, which solves the problem of low accuracy of optical material distortion detection in the existing technology and improves the camera parameter calibration. Accuracy and product yield.
Patent Information
- Application Number
- CN202210599521.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-05-30
AI Technical Summary
Existing optical material distortion detection methods cannot accurately determine the impact of optical material distortion on camera lenses, resulting in low calibration accuracy of internal and external parameters of the camera and affecting product yield.
By obtaining the image to be detected of the calibration chart captured by the camera lens through the target optical material, the actual two-dimensional and three-dimensional coordinates of the target point are extracted, and combined with the relevant parameters of the camera, it is determined whether the optical material meets the preset distortion conditions, and the optical material is directly evaluated. Effect on camera shooting results.
It improves the accuracy of optical material distortion detection, enhances the calibration accuracy of internal and external parameters of the camera, and improves product yield.
Smart Images

Figure CN114913243B
Abstract
Description
Technical Field
[0001] The present application relates to the field of optical technology, and in particular to a method, device and medium for detecting distortion of optical materials. Background Art
[0002] In the design of virtual reality (VR) products, it is necessary to use a camera to capture images, and then use a tracking algorithm to call the camera's intrinsic and extrinsic parameters for image processing based on the images captured by the camera to locate and track the user's position. It can be seen that the accuracy of the camera's intrinsic and extrinsic parameters is very important for positioning. Therefore, during the production and testing of VR products, it is necessary to accurately calibrate the camera's intrinsic and extrinsic parameters, and then write the intrinsic and extrinsic parameters into the device for a series of image processing such as positioning during product use.
[0003] During the use of VR products, if the camera lens is directly exposed to the outside of the product and is in a position prone to wear, the camera lens is easily worn, resulting in blurry pictures taken by the camera, which in turn affects the image processing results. Usually, in order to protect the camera lens from wear, a layer of transparent optical material is covered in front of the camera lens.
[0004] Since the optical material is located in the imaging optical path of the camera, there are certain requirements for the optical performance of the optical material. It should not seriously affect the normal optical path, and should not cause serious refraction and diffraction, etc. If the optical material affects the optical path, it will affect the calibration accuracy of the camera's intrinsic and extrinsic parameters, thereby affecting the accuracy of the algorithms that rely on the camera's intrinsic and extrinsic parameters.
[0005] At present, the surface parameters of optical materials can be accurately simulated, and then the degree of distortion can be determined by the parameters of the surface parameters. The distortion of optical materials will cause the image captured by the camera to be distorted and offset. Alternatively, a stress detection method can be used to detect the degree of distortion of optical materials, that is, by determining the distribution of internal stress of the optical material to determine the flatness of the optical material, and then determine the degree of distortion of the optical material. The current method for detecting the distortion of optical materials that protect lenses mainly judges the distortion based on the properties of the optical materials themselves. It is impossible to know the impact of optical material distortion on the camera, and the accuracy of eliminating bad optical materials is low. In other words, the current detection method can only eliminate bad optical materials based on whether the optical material itself is distorted, and cannot eliminate bad optical materials based on the impact on the image captured by the camera.
[0006] It can be seen that how to detect the distortion of optical materials according to the influence of optical materials on the camera, eliminate optical materials with excessive distortion, improve the calibration accuracy of internal and external parameters of the camera, and thus improve the product yield rate, is an urgent problem to be solved by technical personnel in this field. Summary of the invention
[0007] The purpose of this application is to provide a method, device and medium for detecting the distortion of optical materials, which detects the distortion of optical materials based on the influence of the optical materials on the images taken by the camera, so as to eliminate optical materials with severe distortion and thus improve the yield rate of the product.
[0008] In order to solve the above technical problems, the present application provides a method for detecting distortion of optical materials, comprising:
[0009] Obtain an image to be detected by photographing a calibration chart through a target optical material using a camera lens;
[0010] Extracting the actual two-dimensional coordinates of the target point from the image to be detected, and obtaining the actual three-dimensional coordinates corresponding to the target point on the calibration chart according to the actual two-dimensional coordinates; wherein the target point is any point appearing in the image to be detected;
[0011] Determine a reference two-dimensional coordinate and a reference three-dimensional coordinate according to the actual two-dimensional coordinate, the actual three-dimensional coordinate and camera-related parameters;
[0012] Whether the target optical material meets a preset distortion condition is determined according to the actual two-dimensional coordinate, the reference two-dimensional coordinate, the actual three-dimensional coordinate, and the reference three-dimensional coordinate.
[0013] Preferably, the calibration chart is a chart of an array chart composed of a plurality of dots.
[0014] Preferably, each of the dots is encoded with a different two-dimensional code, and the actual two-dimensional coordinates of the target point are extracted from the image to be detected, including:
[0015] Identify the two-dimensional code corresponding to the target point to obtain the actual two-dimensional coordinates.
[0016] Preferably, the camera-related parameters include: intrinsic parameters, extrinsic parameters and distortion parameters of the camera.
[0017] Preferably, determining whether the target optical material satisfies a preset distortion condition based on the actual two-dimensional coordinate, the reference two-dimensional coordinate, the actual three-dimensional coordinate and the reference three-dimensional coordinate comprises:
[0018] Determine a two-dimensional error between the actual two-dimensional coordinate and the reference two-dimensional coordinate, and a three-dimensional error between the actual three-dimensional coordinate and the reference three-dimensional coordinate;
[0019] Obtaining statistical indicators of each of the two-dimensional errors and each of the three-dimensional errors, wherein the statistical indicators include a sum and / or an average and / or a median and / or a variance;
[0020] Determine whether each of the statistical indicators exceeds the corresponding preset thresholds;
[0021] If both are exceeded, it is determined that the target optical material meets the preset distortion condition.
[0022] Preferably, after determining the two-dimensional error between the actual two-dimensional coordinate and the reference two-dimensional coordinate, and the three-dimensional error between the actual three-dimensional coordinate and the reference three-dimensional coordinate, the method further comprises:
[0023] generating a first color temperature map and a second color temperature map according to the two-dimensional error and the three-dimensional error;
[0024] The first color temperature diagram and the second color temperature diagram are compared to determine the distortion of the target optical material.
[0025] Preferably, before extracting the actual two-dimensional coordinates of the target point from the image to be detected, the method further includes:
[0026] Obtaining the light-transmitting area of the target optical material;
[0027] The range for extracting the actual two-dimensional coordinates is determined according to the area of the light-transmitting region.
[0028] In order to solve the above technical problems, the present application also provides a distortion detection device for optical materials, comprising:
[0029] The first acquisition module is used to acquire the image to be detected obtained by shooting the calibration chart through the target optical material by the camera lens;
[0030] An extraction module, used to extract the actual two-dimensional coordinates of the target point from the image to be detected; wherein the target point is any point appearing in the image to be detected;
[0031] A second acquisition module is used to acquire the actual three-dimensional coordinates corresponding to the target point on the calibration chart according to the actual two-dimensional coordinates;
[0032] A first determining module, configured to determine a reference two-dimensional coordinate and a reference three-dimensional coordinate according to the actual two-dimensional coordinate, the actual three-dimensional coordinate and camera-related parameters;
[0033] The second determination module is used to determine whether the target optical material meets a preset distortion condition according to the actual two-dimensional coordinate, the reference two-dimensional coordinate, the actual three-dimensional coordinate and the reference three-dimensional coordinate.
[0034] In order to solve the above technical problems, the present application also provides a distortion detection device for optical materials, comprising a memory for storing a computer program;
[0035] A processor is used to implement the steps of the optical material distortion detection method as described above when executing the computer program.
[0036] In order to solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the optical material distortion detection method as described above are implemented.
[0037] The present invention provides a method for detecting distortion of optical materials, comprising: obtaining an image to be detected obtained by a camera lens shooting a calibration chart through a target optical material, and obtaining relevant parameters of the camera. Extracting the actual two-dimensional coordinates of the target point from the image to be detected, and obtaining the actual three-dimensional coordinates corresponding to the two-dimensional coordinates on the calibration chart, and then calculating and determining the reference two-dimensional coordinates and the reference three-dimensional coordinates through the actual two-dimensional coordinates, the actual three-dimensional coordinates and the camera-related parameters, and finally, determining whether the target optical material meets the preset distortion condition according to the actual two-dimensional coordinates, the reference two-dimensional coordinates, the actual three-dimensional coordinates and the reference three-dimensional coordinates. It can be seen that the technical means provided by the present application, by collecting the image to be detected obtained by shooting the calibration chart through the optical material with the camera, and determining the actual two-dimensional coordinates, the reference two-dimensional coordinates, the actual three-dimensional coordinates and the reference three-dimensional coordinates of the target point in the image to be detected according to some relevant parameters of the image to be detected and the camera itself, and then determining whether the optical material meets the distortion condition, that is, determining whether the optical material is distorted by detecting the influence of the optical material on the camera shooting result, avoiding the low accuracy caused by determining the distortion condition only by judging the properties of the optical material itself, improving the calibration accuracy of the internal and external parameters of the camera, and then improving the product yield.
[0038] In addition, the present application also provides a distortion detection device and medium for optical materials, which correspond to the above-mentioned distortion detection method for optical materials and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 A flow chart of a method for detecting distortion of an optical material provided in an embodiment of the present application;
[0041] Figure 2A schematic diagram of capturing an image to be detected provided in an embodiment of the present application;
[0042] Figure 3 A structural diagram of a distortion detection device for optical materials provided in an embodiment of the present application;
[0043] Figure 4 A structural diagram of a distortion detection device for optical materials provided in another embodiment of the present application;
[0044] The reference numerals are as follows: 1 is a camera, 2 is a calibration chart, and 3 is a target optical material. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] The core of this application is to provide a method, device and medium for detecting distortion of optical materials. The image to be detected is obtained by shooting a calibration chart through the optical material through the camera lens, and the actual two-dimensional coordinates, reference two-dimensional coordinates, actual three-dimensional coordinates and reference three-dimensional coordinates of the target point in the image to be detected are determined according to the relevant parameters of the image to be detected and the camera itself to determine whether the optical material meets the distortion conditions, that is, by detecting the influence of the optical material on the camera shooting results, it is determined whether the optical material is distorted, thereby improving the accuracy of detecting optical materials and improving the yield rate of products.
[0047] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0048] With the continuous development of science and technology, virtual reality (VR) products are gradually entering people's lives. When designing VR products, it is necessary to use camera lenses to capture images, and according to the images captured by the camera, the camera's internal and external parameters call algorithms for image processing to achieve positioning and tracking of the user's position. Therefore, the accuracy of the camera's internal and external parameters is very important for position positioning. Therefore, during the production and testing of VR products, it is necessary to accurately calibrate the camera's internal and external parameters, and then write the internal and external parameters into the device for a series of image processing such as positioning during product use.
[0049] During the use of VR products, if the camera lens is directly exposed to the outside of the product and is in a position prone to wear, the camera lens is easily worn, resulting in blurry pictures taken by the camera, which in turn affects the image processing results. Usually, in order to protect the camera lens from wear, a layer of transparent optical material is covered in front of the camera lens.
[0050] Since the optical material is located in the imaging optical path of the camera, there are certain requirements for the optical performance of the optical material. It should not seriously affect the normal optical path, and should not cause serious refraction and diffraction, etc. If the optical material affects the optical path, it will affect the calibration accuracy of the camera's intrinsic and extrinsic parameters, thereby affecting the accuracy of the algorithms that rely on the camera's intrinsic and extrinsic parameters.
[0051] At present, the surface parameters of optical materials can be accurately simulated, and then the degree of distortion can be determined by the parameters of the surface parameters. The distortion of optical materials will cause the image captured by the camera to be distorted and offset. Alternatively, a stress detection method can be used to detect the degree of distortion of optical materials, that is, by determining the distribution of stress inside the optical material to determine the flatness of the optical material, and then determine the degree of distortion of the optical material. At present, the distortion detection method for the optical material protecting the camera lens mainly judges the distortion based on the properties of the optical material itself, but cannot know the impact of the distortion of the optical material on the camera, which leads to low accuracy in eliminating bad optical materials. In other words, the current detection method can only eliminate bad optical materials based on whether the optical material itself is distorted, and cannot eliminate bad optical materials based on the impact on the image captured by the camera.
[0052] In order to detect the distortion of optical materials according to the influence of optical materials on camera lenses, eliminate optical materials with excessive distortion, improve the calibration accuracy of internal and external parameters of the camera, and thus improve the product yield, an embodiment of the present application provides a method for detecting the distortion of optical materials. The camera lens shoots a calibration chart through the optical material to be detected to obtain an image to be detected, and then determines the actual two-dimensional coordinates, reference two-dimensional coordinates, actual three-dimensional coordinates and reference three-dimensional coordinates of the target point in the image to be detected according to the image to be detected and relevant parameters of the camera itself, and then determines whether the optical material meets the distortion condition, that is, determines the distortion of the optical material by determining the influence of the optical material on the image captured by the camera lens, thereby improving the accuracy of detecting optical materials.
[0053] Figure 1 A flowchart of a method for detecting distortion of an optical material provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0054] S10: Acquire an image to be detected obtained by photographing a calibration chart through a target optical material using a camera lens.
[0055] In a specific embodiment, the relative positions of the high-precision camera and the calibration chart are fixed, and the fixed positions remain unchanged, and then the target optical material is placed on the optical path of the camera lens shooting the calibration chart, that is, the camera lens can shoot the calibration chart through the target optical material to obtain the image to be detected. Then, the image to be detected shot by the camera lens is obtained in step S10.
[0056] It should be noted that the calibration chart is a pre-set chart, wherein the chart is an array chart composed of multiple dots, or an array chart composed of rectangular dots. The shape and composition of the chart are not limited in this application, but no matter what shape the dots are composed of, each dot on the chart is encoded with a different QR code. From the perspective of accuracy, an array chart composed of multiple dots is preferred.
[0057] S11: extracting the actual two-dimensional coordinates of the target point from the image to be detected, and obtaining the actual three-dimensional coordinates corresponding to the target point on the calibration chart based on the two-dimensional coordinates; wherein the target point is any point appearing in the image to be detected.
[0058] It is understandable that after obtaining the image to be detected, the actual two-dimensional coordinates of the target point can be extracted by identifying the two-dimensional code of each point in the image to be detected, wherein the target point is any point appearing in the image to be detected, and the extracted target point can be one or more, which is not limited in this application. In addition, it should be noted that before extracting the actual two-dimensional coordinates of the target point, the area of the light-transmitting area of the target optical material can be obtained first, and then the number of target points to be obtained can be determined based on the area of the light-transmitting area. After obtaining the actual two-dimensional coordinates of the target point, the actual three-dimensional coordinates on the corresponding chart can be found on the calibration chart based on the actual two-dimensional coordinates.
[0059] It should be noted that when the calibration chart selects an array chart composed of circular dots, the actual two-dimensional coordinates are the coordinates of the center of the target point in the image to be detected, and the actual three-dimensional coordinates are the actual three-dimensional center coordinates of the actual two-dimensional coordinates on the calibration chart. If the array chart composed of rectangular dots is selected, the actual two-dimensional coordinates are the coordinates of the center point of the rectangle, and correspondingly, the actual three-dimensional coordinates are the actual three-dimensional center coordinates of the actual two-dimensional coordinates on the calibration chart.
[0060] S12: Determine a reference two-dimensional coordinate and a reference three-dimensional coordinate according to the actual two-dimensional coordinate, the actual three-dimensional coordinate and camera-related parameters.
[0061] Obtain the camera's internal parameters Mint, external parameters RT, distortion parameters KP and other related parameters. Among them, the internal parameter Mint is related to factors such as the camera focal length and film size. The external parameter RT is the direction relationship between the camera and the calibration chart. The distortion parameter KP includes radial distortion coefficients (k1, k2, k3) and tangential distortion coefficients (p1, p2). Radial distortion occurs in the process of converting the camera coordinate system to the physical coordinate system, that is, the position of the pixel is deviated, which is related to the distance from the pixel to the image. The reason for the tangential distortion is that the lens is not completely parallel to the image, that is, the lens is not parallel to the film, which causes distortion.
[0062] In a specific embodiment, after obtaining the actual two-dimensional coordinates Px1 and the actual three-dimensional coordinates Pw1 of the target point, the actual three-dimensional coordinates Pw1 of the target point are reprojected to obtain the reference two-dimensional coordinates Px2 through the intrinsic parameters Mint, the extrinsic parameters RT and the distortion parameters KP of the camera, that is, the intrinsic parameters Mint, the extrinsic parameters RT, the distortion parameters KP and the actual three-dimensional coordinates Pw1 of the camera are calculated to obtain the reference two-dimensional coordinates Px2. That is, X=Pw1*RT*Mint, where Pw1 is the actual three-dimensional coordinates Pw1 of the target point, and the calculated X value is substituted into the equation of the distortion parameter KP to calculate the reference two-dimensional coordinates Px2. The equation of the distortion parameter KP is k1*X+k2*X^2+k3*X^3. It is worth noting that the accuracy can be improved by calculating higher-order distortion coefficients, and the calculation accuracy can be set according to actual needs.
[0063] Through the camera's intrinsic parameters Mint, extrinsic parameters RT and distortion parameters KP, the actual two-dimensional coordinates Px1 of the target point are reprojected to obtain the reference three-dimensional coordinates Pw2, that is, the camera's intrinsic parameters Mint, extrinsic parameters RT, distortion parameters KP and actual two-dimensional coordinates are calculated to obtain the reference three-dimensional coordinates Pw2. That is, knowing the actual two-dimensional coordinates Px1, the inverse function is obtained through the actual two-dimensional coordinates Px1 to obtain the X value, and the actual three-dimensional coordinates Pw2 are calculated based on the X value. In other words, in X=Pw2*RT*Mint, the reference three-dimensional coordinates Pw2 are calculated based on the known X value. Thus, according to the actual two-dimensional coordinates, the reference two-dimensional coordinates and the reference three-dimensional coordinates are calculated based on the actual three-dimensional coordinates and the camera-related parameters.
[0064] S13: Determine whether the target optical material meets a preset distortion condition based on the actual two-dimensional coordinate, the reference two-dimensional coordinate, the actual three-dimensional coordinate, and the reference three-dimensional coordinate.
[0065] After obtaining the actual two-dimensional coordinate Px1, the reference two-dimensional coordinate Px2, the actual three-dimensional coordinate Pw1 and the reference three-dimensional coordinate Pw2, the two-dimensional error re-pre-err-2d between the actual two-dimensional coordinate Px1 and the reference two-dimensional coordinate Px2 is calculated, and the three-dimensional error re-pre-err-3d between the actual three-dimensional coordinate Pw1 and the reference three-dimensional coordinate Pw2 is calculated, and statistical indicators of the two-dimensional error re-pre-err-2d and the three-dimensional error re-pre-err-3d are obtained, and it is judged whether each statistical indicator exceeds the corresponding preset threshold value to determine whether the target optical material meets the distortion condition.
[0066] In a specific implementation, a first color temperature map and a second color temperature map may be generated according to the two-dimensional error and the three-dimensional error, and whether the target optical material is distorted may be further determined by comparing the first color temperature map and the second color temperature map.
[0067] The optical material distortion detection method provided in the embodiment of the present application includes: obtaining the image to be detected obtained by the camera lens shooting the calibration chart through the target optical material, and obtaining the relevant parameters of the camera. Extracting the actual two-dimensional coordinates of the target point from the image to be detected, and obtaining the actual three-dimensional coordinates corresponding to the two-dimensional coordinates on the calibration chart, and then determining the reference two-dimensional coordinates and the reference three-dimensional coordinates through the actual two-dimensional coordinates, the actual three-dimensional coordinates and the camera-related parameters, and finally, determining whether the target optical material meets the preset distortion condition according to the actual two-dimensional coordinates, the reference two-dimensional coordinates, the actual three-dimensional coordinates and the reference three-dimensional coordinates. It can be seen that the technical means provided by the present application, by collecting the image to be detected obtained by shooting the calibration chart through the optical material, and determining the actual two-dimensional coordinates, the reference two-dimensional coordinates, the actual three-dimensional coordinates and the reference three-dimensional coordinates of the target point in the image to be detected according to the image to be detected and some relevant parameters of the camera itself, and then determining whether the optical material meets the distortion condition, that is, by detecting the influence of the optical material on the camera shooting result to determine whether the optical material is distorted, avoiding the low accuracy caused by determining the distortion only by judging the properties of the optical material itself, improving the calibration accuracy of the internal and external parameters of the camera, and then improving the product yield.
[0068] Figure 2 A schematic diagram of capturing an image to be detected provided in an embodiment of the present application. In a specific embodiment, as Figure 2 As shown, the relative positions of the camera 1 and the calibration chart 2 are fixed, and then the target optical material 3 is placed between the camera lens and the calibration chart 2. Of course, it must be noted that the camera lens must be able to photograph the calibration chart 2 through the target optical material 3, that is, the target optical material 3 is on the optical path of the camera lens photographing the calibration chart 2.
[0069] It is worth noting that the calibration chart 2 can be a chart of an array diagram composed of multiple circular dots, or a chart of an array diagram composed of multiple rectangular dots. Since the accuracy of the chart composed of rectangular points can only be integers, while the origin can be accurate to decimals, in order to improve the accuracy, the embodiment of the present application preferably calibrates the chart 2 as a chart of an array diagram composed of multiple circular dots.
[0070] Before performing distortion detection on optical materials, the calibration chart 2 is pre-set, and the actual three-dimensional coordinates of each point on the calibration chart 2 are obtained, so that after the actual two-dimensional coordinates are extracted from the captured image to be detected, the corresponding actual three-dimensional coordinates on the calibration chart 2 can be quickly matched. It is understandable that in order to improve the accuracy, the number of calibration points can be set as much as possible, that is, the density of the origins on the calibration chart 2 can be made as large as possible.
[0071] The optical material distortion detection method provided in the embodiment of the present application sets the calibration chart as a chart of an array chart composed of multiple dots, thereby improving the accuracy of extracting actual two-dimensional coordinates and actual three-dimensional coordinates, thereby improving the accuracy of detecting the distortion of the target optical material and improving the yield rate of the product.
[0072] On the basis of the above embodiments, if the dots are solid origins, after the camera lens shoots the calibration chart through the target optical material to obtain the image to be detected, it is necessary to sort and calculate each origin and perform a series of processing to obtain the actual two-dimensional left side of each dot. Obviously, this will increase the amount of data calculation, thereby reducing the distortion detection efficiency of the optical material. Therefore, in order to improve the distortion detection efficiency of the optical material, the embodiment of the present application sets multiple dots to different two-dimensional code codes. When extracting the actual two-dimensional coordinates of the target point from the image to be detected, the actual two-dimensional coordinates can be directly obtained by identifying the two-dimensional code corresponding to the target point. Of course, in addition to the two-dimensional code, it can also be a black and white checkerboard, etc., which is not limited by this application.
[0073] The distortion detection method of optical materials provided in the embodiment of the present application sets each dot in the calibration chart as a different QR code, and can obtain the actual two-dimensional coordinates of the target point by quickly identifying the QR code, thereby improving the distortion detection efficiency of the optical material.
[0074] In a specific implementation, when the reference two-dimensional coordinates and reference three-dimensional coordinates are determined according to the actual two-dimensional coordinates, the actual three-dimensional coordinates and the camera-related parameters, the camera-related parameters include the intrinsic parameter Mint, the extrinsic parameter RT and the distortion parameter KP. Among them, the intrinsic parameter Mint is a parameter related to factors such as the focal length of the camera and the size of the film, that is, the intrinsic parameter Mint is determined by the camera itself and does not change due to the external environment. The extrinsic parameter RT is the directional relationship between the camera and the calibration chart. The distortion parameter KP includes radial distortion coefficients (k1, k2, k3) and tangential distortion coefficients (p1, p2). The radial distortion occurs in the process of converting the camera coordinate system to the physical coordinate system, that is, the position of the pixel is deviated, which is related to the distance from the pixel to the image. The reason for the tangential distortion is that the lens is not completely parallel to the image, that is, the lens is not parallel to the film, which causes distortion.
[0075] It is understandable that an actual two-dimensional coordinate corresponds to a reference three-dimensional coordinate, and an actual three-dimensional coordinate also corresponds to a reference two-dimensional coordinate. Therefore, after obtaining the actual two-dimensional coordinate and the actual three-dimensional coordinate of the target point according to the image to be detected captured by the camera lens, the reference two-dimensional coordinate is obtained by calculating the camera's intrinsic parameter Mint, extrinsic parameter RT, distortion parameter KP and the actual three-dimensional coordinate, and the reference three-dimensional coordinate is obtained by calculating the camera's intrinsic parameter Mint, extrinsic parameter RT, distortion parameter KP and the actual two-dimensional coordinate.
[0076] The optical material distortion detection method provided in the embodiment of the present application combines the camera's intrinsic parameters, extrinsic parameters, distortion parameters and other related parameters with the actual two-dimensional coordinates and actual three-dimensional coordinates of the target point to perform analysis to determine the reference two-dimensional coordinates and reference three-dimensional coordinates, so as to determine the distortion of the target optical material. In this way, by detecting the impact of the optical material on the camera shooting results, it is possible to determine whether the optical material is distorted, thereby improving the product yield.
[0077] On the basis of the above embodiment, after calculating the reference two-dimensional coordinate Px2 and the reference three-dimensional coordinate Pw2 according to the relevant parameters of the camera itself, the actual two-dimensional coordinate Px1 and the actual three-dimensional coordinate Pw1, the two-dimensional error re-pre-err-2d between the actual two-dimensional coordinate Px1 and the reference two-dimensional coordinate Px2, and the three-dimensional error re-pre-err-3d between the actual three-dimensional coordinate Pw1 and the reference three-dimensional coordinate Pw2 are calculated.
[0078] In fact, in order to improve the accuracy of distortion detection of optical materials, the coordinates of multiple target points are usually obtained from the image to be detected to detect the distortion of the target optical material. Of course, the relative position between the camera and the calibration card can be adjusted to obtain an image to be detected at each relative position, and the distortion of the optical material can be detected based on each target point in the multiple images to be detected. This application does not limit this.
[0079] After obtaining the two-dimensional error re-pre-err-2d and the three-dimensional error re-pre-err-3d of each target point, the statistical indicators of the two-dimensional error re-pre-err-2d and the three-dimensional error re-pre-err-3d are obtained, wherein the statistical indicators include the sum and / or the average value and / or the median and / or the variance. Determine whether the target optical material is distorted based on each statistical indicator. For example, calculate and determine the two-dimensional error average value and the three-dimensional error average value of each target point. When the two-dimensional error average value exceeds the two-dimensional error preset threshold value, and the three-dimensional error average value exceeds the three-dimensional error preset threshold value, it is determined that the target optical material is distorted and can be eliminated. It is also possible to judge based on other indicators in the statistical indicators to determine whether the target optical material is distorted. Of course, it is also possible to combine multiple statistical indicators for analysis to determine whether the target optical material is distorted, which is not limited in this application.
[0080] The optical material distortion detection method provided in the embodiment of the present application determines the two-dimensional error between the actual two-dimensional coordinates and the reference two-dimensional coordinates, as well as the three-dimensional error between the actual three-dimensional coordinates and the reference three-dimensional coordinates, and obtains statistical indicators of each two-dimensional error and each three-dimensional error, wherein the statistical indicators include the sum and / or the average value and / or the median and / or the variance. When each statistical indicator exceeds the corresponding preset threshold value, it is determined that the target optical material is distorted. Thus, the influence of the optical material on the camera lens shooting result is combined to determine whether the optical material is distorted, and the distortion is determined by analyzing multiple statistical indicators, thereby improving the accuracy of detecting the distortion of the optical material and thus improving the yield rate of the product.
[0081] On the basis of the above embodiments, in order to further improve the distortion detection accuracy of optical materials, after obtaining the two-dimensional error re-pre-err-2d and the three-dimensional error re-pre-err-3d, a first color temperature map and a second color temperature map can be generated based on the two-dimensional error and the three-dimensional error, and then, by comparing the first color temperature map and the second color temperature map, it is further determined whether the target optical material is distorted.
[0082] In fact, after obtaining the first color temperature map and the second color temperature map, the distortion distribution of the target optical material can be observed intuitively through the first color temperature map and the second color temperature map, which is convenient for adjusting the production line and thus improving the product yield.
[0083] The optical material distortion detection method provided in the embodiment of the present application generates a first color temperature map and a second color temperature map based on a two-dimensional error and a three-dimensional error, and compares the first color temperature map and the second color temperature map to determine the distortion of the target optical material. Thus, based on the statistical indicators of the two-dimensional error and the three-dimensional error, the distortion of the optical material is determined in combination with the generated first color temperature map and the second color temperature map, thereby improving the distortion detection accuracy, and further improving the calibration accuracy of the internal and external parameters of the camera.
[0084] In the specific implementation, in order to accurately detect the distortion of all areas of the target optical material, before extracting the actual two-dimensional coordinates of the target point from the image to be detected, the light-transmitting area of the target optical material is first obtained to facilitate the adjustment of the position of the target optical material, thereby ensuring that the camera lens can shoot through all areas of the lock optical material when shooting the calibration chart. At the same time, the range of extracting the actual two-dimensional coordinates can be determined based on the area of the light-transmitting area, which can avoid the actual two-dimensional coordinates extracted are not the points photographed through the optical material, causing unnecessary calculations and reducing detection efficiency.
[0085] The optical material distortion detection method provided in the embodiment of the present application obtains the area of the light-transmitting region of the target optical material before extracting the actual two-dimensional coordinates of the target point from the image to be detected, and determines the range of extracting the actual two-dimensional coordinates based on the area of the light-transmitting region. Thus, it is ensured that the image to be detected is captured through all areas of the target optical material, and the range of extracting the actual two-dimensional coordinates is determined based on the area of the light-transmitting region, thereby avoiding obtaining invalid target points, thereby reducing the amount of calculation, and improving detection efficiency and detection accuracy.
[0086] In the above embodiments, the optical material distortion detection method is described in detail, and the present application also provides an embodiment corresponding to the optical material distortion detection device. It should be noted that the present application describes the embodiments of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware structure perspective.
[0087] Figure 3 A structural diagram of a distortion detection device for optical materials provided in an embodiment of the present application, such as Figure 3 As shown, the device comprises:
[0088] The first acquisition module 10 is used to acquire the image to be detected obtained by shooting the calibration chart through the target optical material by the camera lens.
[0089] The extraction module 11 is used to extract the actual two-dimensional coordinates of the target point from the image to be detected; wherein the target point is any point appearing in the image to be detected.
[0090] The second acquisition module 12 is used to acquire the actual three-dimensional coordinates corresponding to the target point on the calibration chart according to the two-dimensional coordinates.
[0091] The first determination module 13 is used to determine the reference two-dimensional coordinates and the reference three-dimensional coordinates according to the actual two-dimensional coordinates, the actual three-dimensional coordinates and the camera related parameters.
[0092] The second determination module 14 is used to determine whether the target optical material meets the preset distortion condition according to the actual two-dimensional coordinates, the reference two-dimensional coordinates, the actual three-dimensional coordinates and the reference three-dimensional coordinates.
[0093] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0094] The optical material distortion detection device provided in the embodiment of the present application includes: obtaining the image to be detected obtained by the camera lens shooting the calibration chart through the target optical material, and obtaining the relevant parameters of the camera. Extracting the actual two-dimensional coordinates of the target point from the image to be detected, and obtaining the actual three-dimensional coordinates corresponding to the two-dimensional coordinates on the calibration chart, and then determining the reference two-dimensional coordinates and the reference three-dimensional coordinates through the actual two-dimensional coordinates, the actual three-dimensional coordinates and the camera-related parameters, and finally, determining whether the target optical material meets the preset distortion condition according to the actual two-dimensional coordinates, the reference two-dimensional coordinates, the actual three-dimensional coordinates and the reference three-dimensional coordinates. It can be seen that the technical means provided by the present application, by collecting the image to be detected obtained by shooting the calibration chart through the optical material, and determining the actual two-dimensional coordinates, the reference two-dimensional coordinates, the actual three-dimensional coordinates and the reference three-dimensional coordinates of the target point in the image to be detected according to the image to be detected and some relevant parameters of the camera itself, and then determining whether the optical material meets the distortion condition, that is, by detecting the influence of the optical material on the camera shooting result to determine whether the optical material is distorted, avoiding the low accuracy caused by determining the distortion only by judging the properties of the optical material itself, improving the calibration accuracy of the internal and external parameters of the camera, and then improving the product yield.
[0095] Figure 4 A structural diagram of a distortion detection device for optical materials provided in another embodiment of the present application, such as Figure 4 As shown, the optical material distortion detection device comprises: a memory 20 for storing a computer program;
[0096] The processor 21 is used to implement the steps of the optical material distortion detection method mentioned in the above embodiment when executing the computer program.
[0097] The optical material distortion detection device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0098] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (Digital Signal Processor, referred to as DSP), a field programmable gate array (Field-Programmable Gate Array, referred to as FPGA), and a programmable logic array (Programmable Logic Array, referred to as PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (Central Processing Unit, referred to as CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processor (Graphics Processing Unit, referred to as GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (Artificial Intelligence, referred to as AI) processor, which is used to process computing operations related to machine learning.
[0099] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the optical material distortion detection method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the relevant data involved in the optical material distortion detection method.
[0100] In some embodiments, the optical material distortion detection device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0101] Those skilled in the art will understand that Figure 4 The structure shown in the figure does not constitute a limitation on the distortion detection device of optical materials, and may include more or fewer components than those shown in the figure.
[0102] The optical material distortion detection device provided in the embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: optical material distortion detection method.
[0103] The distortion detection device for optical materials provided in the embodiment of the present application obtains an image to be detected by capturing an image to be detected by a camera shooting a calibration chart through an optical material, and determines the actual two-dimensional coordinates, reference two-dimensional coordinates, actual three-dimensional coordinates and reference three-dimensional coordinates of the target point in the image to be detected based on the image to be detected and some relevant parameters of the camera itself, and then determines whether the optical material meets the distortion condition, that is, determines whether the optical material is distorted by detecting the influence of the optical material on the camera shooting result, avoids the low accuracy caused by determining the distortion condition only by judging the properties of the optical material itself, improves the calibration accuracy of the internal and external parameters of the camera, and thus improves the product yield.
[0104] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0105] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program code.
[0106] The above is a detailed introduction to the distortion detection method, device and medium of an optical material provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0107] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for detecting distortion of an optical material, characterized in that: include: Obtain an image to be detected by photographing a calibration chart through a target optical material using a camera lens; Extracting the actual two-dimensional coordinates of the target point from the image to be detected, and obtaining the actual three-dimensional coordinates corresponding to the target point on the calibration chart according to the actual two-dimensional coordinates; wherein the target point is any point appearing in the image to be detected; Determine the reference two-dimensional coordinates and the reference three-dimensional coordinates according to the actual two-dimensional coordinates, the actual three-dimensional coordinates and camera-related parameters; wherein the camera-related parameters include: intrinsic parameters, extrinsic parameters and distortion parameters of the camera; Determining whether the target optical material meets a preset distortion condition according to the actual two-dimensional coordinate, the reference two-dimensional coordinate, the actual three-dimensional coordinate, and the reference three-dimensional coordinate; The calibration chart is a chart of an array chart composed of a plurality of dots; each dot is encoded with a different two-dimensional code, and the actual two-dimensional coordinates of the target point extracted from the image to be detected include: Identify the two-dimensional code corresponding to the target point to obtain the actual two-dimensional coordinates; Wherein, determining whether the target optical material satisfies a preset distortion condition according to the actual two-dimensional coordinate, the reference two-dimensional coordinate, the actual three-dimensional coordinate and the reference three-dimensional coordinate comprises: Determine a two-dimensional error between the actual two-dimensional coordinate and the reference two-dimensional coordinate, and a three-dimensional error between the actual three-dimensional coordinate and the reference three-dimensional coordinate; Obtaining statistical indicators of each of the two-dimensional errors and each of the three-dimensional errors, wherein the statistical indicators include a sum and / or an average and / or a median and / or a variance; Determine whether each of the statistical indicators exceeds the corresponding preset thresholds; If both are exceeded, it is determined that the target optical material meets the preset distortion condition.
2. The method for detecting distortion of optical materials according to claim 1, characterized in that: After determining the two-dimensional error between the actual two-dimensional coordinate and the reference two-dimensional coordinate, and the three-dimensional error between the actual three-dimensional coordinate and the reference three-dimensional coordinate, the method further includes: generating a first color temperature map and a second color temperature map according to the two-dimensional error and the three-dimensional error; The first color temperature diagram and the second color temperature diagram are compared to determine the distortion of the target optical material.
3. The method for detecting distortion of optical materials according to claim 1, characterized in that: Before extracting the actual two-dimensional coordinates of the target point from the image to be detected, the method further includes: Obtaining the light-transmitting area of the target optical material; The range for extracting the actual two-dimensional coordinates is determined according to the area of the light-transmitting region.
4. A distortion detection device for optical materials, characterized in that: include: The first acquisition module is used to acquire the image to be detected obtained by shooting the calibration chart through the target optical material by the camera lens; An extraction module, used to extract the actual two-dimensional coordinates of the target point from the image to be detected; wherein the target point is any point appearing in the image to be detected; A second acquisition module is used to acquire the actual three-dimensional coordinates corresponding to the target point on the calibration chart according to the actual two-dimensional coordinates; A determination module, used to determine a reference two-dimensional coordinate and a reference three-dimensional coordinate according to the actual two-dimensional coordinate, the actual three-dimensional coordinate and camera-related parameters; wherein the camera-related parameters include: intrinsic parameters, extrinsic parameters and distortion parameters of the camera; A second determination module, configured to determine whether the target optical material satisfies a preset distortion condition according to the actual two-dimensional coordinate, the reference two-dimensional coordinate, the actual three-dimensional coordinate and the reference three-dimensional coordinate; Wherein, the calibration chart is a chart of an array chart composed of a plurality of dots, each dot is encoded with a different two-dimensional code, and the extraction module is specifically used to identify the two-dimensional code corresponding to the target point to obtain the actual two-dimensional coordinates; Wherein, the second determination module is specifically used to determine a two-dimensional error between the actual two-dimensional coordinate and the reference two-dimensional coordinate, and a three-dimensional error between the actual three-dimensional coordinate and the reference three-dimensional coordinate; Obtaining statistical indicators of each of the two-dimensional errors and each of the three-dimensional errors, wherein the statistical indicators include a sum and / or an average and / or a median and / or a variance; Determine whether each of the statistical indicators exceeds the corresponding preset thresholds; If both are exceeded, it is determined that the target optical material meets the preset distortion condition.
5. A distortion detection device for optical materials, characterized in that: comprising a memory for storing a computer program; A processor is used to implement the steps of the optical material distortion detection method as described in any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for detecting distortion of optical materials according to any one of claims 1 to 3 are implemented.
