Optical module ghost detection method, detection device and medium
By using testing mechanisms and cameras in optical module detection, combined with grayscale value analysis and correction processing, the problem of inaccurate ghost detection in the prior art is solved, and the precise measurement of ghost position and grayscale value is achieved. Improve the accuracy of optical product quality evaluation.
Patent Information
- Application Number
- CN202211060588.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-08-31
AI Technical Summary
The prior art is difficult to accurately detect ghost positions and values in optical modules, which affects the determination of optical product quality.
Using a test mechanism, including the camera, by adjusting the camera's optical axis coincides with the optical axis of the optical module to be measured, using the test picture (black base image and white pattern) to obtain the pixel gray scale value on the detection line, and determine the ghost position and gray scale The overall position and intensity of the ghost are calculated in combination with flat field correction and noise reduction processing.
It realizes accurate detection of ghost positions and grayscale values, and improves the accurate determination of optical product quality.
Smart Images

Figure CN115452325B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of optical product detection, and more specifically, to a method, device and medium for detecting ghost images of an optical module. Background Art
[0002] In an imaging optical system, the main light emitted by an object follows the laws of geometric optics and forms a corresponding image on the image plane or a specified plane, which is called the primary image. In contrast to the primary image, there is often stray light in the imaging optical system; this stray light is mostly caused by non-ideal factors such as multiple reflections on the lens interface, scattering from lens defects, and scattering from physical structures. In actual application scenarios, this stray light often forms a "ghost image" or "ghost shadow" at certain locations in the picture.
[0003] In the prior art, the detection of ghost images can often only determine whether the ghost image phenomenon exists, but cannot determine the location and value of the ghost image, which is not conducive to the accurate determination of the quality of optical products.
[0004] In view of this, it is necessary to provide a new technical solution to solve the above problems. Summary of the invention
[0005] One purpose of the present application is to provide a new technical solution for a method, a detection device and a medium for detecting ghost images of an optical module.
[0006] According to a first aspect of the present application, a method for detecting ghost images of an optical module is provided, wherein the method uses a testing mechanism for detection, the testing mechanism includes a camera, and an optical module to be tested is placed on the testing mechanism;
[0007] The detection method comprises:
[0008] When adjusting the optical axis of the camera to coincide with the optical axis of the optical module to be tested, controlling the optical module to be tested to play a test picture, and controlling the camera to take a picture of the test picture; the test picture includes a black background and a white pattern on the black background;
[0009] Acquire the geometric center of the white pattern, radiate toward the outline of the white pattern from the geometric center as the starting point and acquire a plurality of detection lines;
[0010] Obtaining grayscale values of pixels included in the detection line;
[0011] The positions of the ghosts distributed on the detection line and the grayscale values of the ghosts are obtained according to the grayscale values of the pixels included on the detection line.
[0012] Optionally, obtaining the geometric center of the white pattern includes:
[0013] The contour position of the white pattern is acquired, and the geometric center is obtained by fitting according to the contour position.
[0014] Optionally, the plurality of detection lines divide the white pattern into equal parts according to preset angles.
[0015] Optionally, obtaining the grayscale value of the pixel on the detection line includes:
[0016] For a pixel included in one of the detection lines, at least three reference pixels are taken around the pixel, and the average value of the grayscale value of the pixel itself and the grayscale value of the reference pixel is taken as the grayscale value of the pixel on the detection line.
[0017] Optionally, acquiring the distribution position of the ghost on the detection line according to the grayscale values of the pixels included on the detection line includes:
[0018] Pixels with grayscale values greater than or equal to the threshold are determined as ghosts, and positions of the ghosts on the detection line are obtained according to positions of the pixels with grayscale values greater than or equal to the threshold on the detection line.
[0019] Optionally, obtaining the grayscale value of the ghost includes:
[0020] For a position of ghost distribution on one of the detection lines, the average grayscale value of a preset area is taken as the grayscale value of the ghost at the position, taking the position as the center.
[0021] Optionally, the step of obtaining the grayscale value of the ghost image further includes:
[0022] Performing flat field correction on the camera and obtaining a flat field correction coefficient, and correcting the grayscale value of the ghost according to the flat field correction coefficient; and / or,
[0023] Perform noise reduction on the grayscale values of ghost images.
[0024] Optionally, the background noise removal process includes:
[0025] The optical module to be tested is controlled to play a black picture and the camera is controlled to shoot the black picture. For a position of ghost distribution on the detection line, the background noise value of the black picture at the position is calculated, and the difference between the grayscale value of the ghost at the position and the background noise value is taken.
[0026] Optionally, the detection method further comprises:
[0027] The overall position of the ghost is obtained according to the position of the ghost distributed on each of the detection lines, and / or the overall grayscale value of the ghost is obtained according to the grayscale value of the ghost distributed on each of the detection lines.
[0028] Optionally, the detection method further comprises:
[0029] The intensity of the ghost image is obtained according to the ratio of the overall grayscale value of the ghost image to the grayscale value of the display screen of the optical module to be measured.
[0030] According to a second aspect of the present application, a device for detecting ghost images of an optical module is provided, the device comprising:
[0031] A control module, which is used to control the optical module to be tested to play a test picture when the optical axis of the camera is adjusted to coincide with the optical axis of the optical module to be tested, and is used to control the camera to take a picture of the test picture; the test picture includes a black background and a white pattern on the black background;
[0032] A first acquisition module, used for acquiring the geometric center of the white pattern and for acquiring a plurality of detection lines;
[0033] A second acquisition module, used to acquire the grayscale value of the pixels included in the detection line;
[0034] The third acquisition module is used to acquire the position of the ghost distribution on the detection line and the grayscale value of the ghost according to the grayscale values of the pixels included in the detection line.
[0035] According to a third aspect of the present application, a computer-readable storage medium is also provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the method for detecting ghost images of an optical module described in the first aspect is executed.
[0036] The optical module ghost detection method, detection device and medium provided in the embodiments of the present application can detect the specific location where the ghost appears, as well as the grayscale value of the ghost; this can be more helpful in accurately determining the quality of optical products.
[0037] Other features and advantages of the present application will become apparent from the following detailed description of exemplary embodiments of the present application with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with the description, serve to explain the principles of the application.
[0039] Figure 1 The figure shows a schematic diagram of the structure of the testing mechanism in the embodiment of the present application;
[0040] Figure 2 It is a schematic diagram of the steps of the method for detecting ghost images of an optical module according to an embodiment of the present application;
[0041] Figure 3The figure shows a principle block diagram of a device for detecting ghost images of an optical module according to an embodiment of the present application;
[0042] Figure 4 Shown is a principle block diagram of an electronic device according to an embodiment of the present application;
[0043] Figure 5a-5d Shown is a schematic diagram of a test picture in an embodiment of the present application;
[0044] Figure 6 It is a schematic diagram of obtaining multiple detection lines in step S102 of the method for detecting ghost images of an optical module in an embodiment of the present application. DETAILED DESCRIPTION
[0045] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present application.
[0046] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.
[0047] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0048] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0049] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0050] <Testing Agency>
[0051] Figure 1It is a structural schematic diagram of a testing mechanism according to an embodiment of the present application, the testing mechanism includes a product tooling 10 and a camera 11, the product tooling 10 is used to place and fix the optical module 01 to be tested; the camera 11 is used to shoot the picture displayed by the optical module 01 to be tested; it also includes a six-axis adjustment table 12, the six-axis adjustment table 12 is connected to the camera 11, the six-axis adjustment table 12 is used to adjust the lens posture of the camera 11, so that the optical axis of the camera 11 coincides with the optical axis of the optical module 01 to be tested; it also includes a lifting platform 13, the lifting platform 13 is used to calibrate the verticality of the lens of the camera 11; it can also include a displacement platform 14, the product tooling 10 is arranged on the displacement platform 14, the displacement platform 14 is used to push the product tooling 10, so that the optical axis of the optical module 01 to be tested coincides with the optical axis of the camera 11.
[0052] <Method Example>
[0053] Reference Figure 2 As shown, according to an embodiment of the present application, a method for detecting ghost images of an optical module is provided, which uses a testing mechanism for detection, wherein the testing mechanism 1 includes a camera, and the optical module to be tested is placed on the testing mechanism;
[0054] The detection method comprises:
[0055] S101, controlling the optical module to be tested to play a test picture and controlling the camera to take a picture of the test picture while adjusting the optical axis of the camera to coincide with the optical axis of the optical module to be tested; the test picture includes a black background and a white pattern on the black background;
[0056] The optical module detected in the embodiment of the present application can be, for example, a VR Pancake module; in step S101, first adjust the optical axis of the camera to coincide with the optical axis of the optical module to be tested. When adjusting the optical axis, for example, the position of the product tooling 10 can be moved by the displacement table 14, thereby achieving the movement of the position of the optical module placed on the product tooling 10; and the position of the camera 11 can also be moved by the six-axis adjustment table 12, so as to achieve the coincidence of the optical axis of the camera 11 with the optical axis of the optical module to be tested. In addition, the vertical distance between the camera 11 and the optical module to be tested can be adjusted by the lifting platform 13 so that the vertical distance between the two meets the working requirements. After the optical axis of the camera is adjusted to coincide with the optical axis of the optical module to be tested, the position of the ghost image can be accurately measured; then the optical module to be tested is controlled to play the test picture, and the camera is controlled to take a picture of the test picture; the test picture presents a pattern of a black background and a white pattern. Optionally, refer to Figure 5a-5dAs shown, the white pattern can be, for example, a white ring; it can also be a white rectangular frame; it can also be a plurality of discretely distributed white dots, and the plurality of white dots are distributed on the same circumference; it can also be a white line. Generally speaking, for an optical module, such as a VR Pancake module, when the VR Pancake module performs product simulation, it is roughly known which position area of the product is the location where the ghost is the strongest, and the white pattern is designed at the location where the ghost is the strongest, which can improve the test efficiency.
[0057] S102, obtaining the geometric center of the white pattern, radiating toward the outline of the white pattern from the geometric center as the starting point, and obtaining a plurality of detection lines;
[0058] In step S102, since the optical axis of the camera and the optical axis of the optical module to be tested have been adjusted to coincide in the above step S101, the position where the ghost appears and the position where the white pattern is located are centrally symmetrically distributed in the image; for example, when the white pattern is a white ring, the position where the ghost appears and the white ring are distributed in concentric circles. When obtaining the geometric center of the white pattern, the contour position of the white pattern is first obtained, and then the geometric center of the white pattern is obtained by fitting according to the contour position of the white pattern. When obtaining the detection line, the line drawn from the geometric center of the white pattern toward the contour position of the white pattern is used as the detection line; optionally, multiple detection lines are evenly distributed, for example, referring to Figure 6 As shown, when the white pattern is a white circle, a horizontal line of 0° is first drawn from the center of the white circle to the outline of the white circle, and then other detection lines are made at intervals of a predetermined angle, such as 20°, so that these detection lines divide the white circle into 18 equal parts. The above predetermined angle can be adjusted according to actual needs.
[0059] S103, obtaining the grayscale value of the pixels included in the detection line;
[0060] In step S103, taking the detection line of the 0° horizontal line taken above as an example, the grayscale value of each pixel on the 0° horizontal line, that is, the brightness value of each pixel, is read; in order to make the grayscale value of the pixel read more accurate, the grayscale value reading method described below is adopted: for example, for the point A pixel on the 0° horizontal line, the grayscale value of the point A pixel itself is read, and then the grayscale values of at least three reference pixels around the point A pixel are read. Optionally, four pixels in the up, down, left and right directions around the point A pixel are taken as reference pixels. Then, the grayscale value of the point A pixel finally read = (the grayscale value of the point A pixel itself + the grayscale values of the above four reference pixels) / 5, that is, the average of the grayscale values of the point A pixel and the four reference pixels is taken as the final grayscale value of the point A pixel.
[0061] In summary, the grayscale value reading method is: for a pixel included in a detection line, at least three reference pixels are taken around the pixel, and the average value of the grayscale value of the pixel itself and the grayscale value of the reference pixel is used as the grayscale value of the pixel on the detection line.
[0062] S104 , obtaining the positions of the ghosts distributed on the detection line and the grayscale values of the ghosts according to the grayscale values of the pixels included on the detection line.
[0063] In step S104, when determining whether a certain pixel on a detection line is a ghost, a threshold value can be pre-defined. When the grayscale value of a certain pixel is greater than or equal to the threshold value, the pixel is determined to be a ghost; then, according to the distribution position of pixels whose grayscale values are greater than or equal to the threshold value on the detection line, the distribution position of the ghost on the detection line can be obtained. At the same time, the grayscale value of the pixel determined to be a ghost is the grayscale value of the ghost; optionally, in order to improve the accuracy of detection, the following method is used when obtaining the grayscale value of the ghost: for a position of the ghost distribution on a detection line, take the average grayscale value of a preset area with the position as the center as the grayscale value of the ghost at the position; optionally, the preset area can be, for example, an area of 5*5 pixels.
[0064] In summary, the method for detecting ghost images of an optical module provided in the embodiment of the present application can detect the specific location where the ghost image appears, as well as the grayscale value of the ghost image; this can be more helpful in accurately determining the quality of optical products.
[0065] In one embodiment, the detection method further comprises:
[0066] The overall position of the ghost is obtained according to the position of the ghost distributed on each of the detection lines, and / or the overall grayscale value of the ghost is obtained according to the grayscale value of the ghost distributed on each of the detection lines.
[0067] In some tests, if you need to focus on the ghosting at one or some positions, you only need to look at the position and grayscale value of the ghosting distribution on the detection line. In other tests, if you need to focus on the overall situation of the ghosting, you can get the overall position of the ghosting according to the position of the ghosting distribution on the detection line; if you also need to focus on the overall grayscale value of the ghosting, you can take the average grayscale value of all the ghosting distribution on the detection line.
[0068] In one embodiment, the detection method further comprises:
[0069] The intensity of the ghost image is obtained according to the ratio of the overall grayscale value of the ghost image to the grayscale value of the display screen of the optical module to be measured.
[0070] In this specific example, the ratio of the overall grayscale value of the ghost image to the grayscale value of the display screen of the optical module to be tested is calculated and multiplied by 100%, so that the percentage value of the overall grayscale value of the ghost image relative to the grayscale value of the display screen of the optical module to be tested can be obtained. This percentage value is helpful in evaluating whether the optical module is qualified; for example, an optical module with a percentage value greater than 10% can be specified as a defective product.
[0071] In one embodiment, obtaining the grayscale value of the ghost image further includes:
[0072] Performing flat field correction on the camera and obtaining a flat field correction coefficient, and correcting the grayscale value of the ghost according to the flat field correction coefficient; and / or,
[0073] Perform noise reduction on the grayscale values of ghost images.
[0074] In this specific example, in order to improve the accuracy of detection, the camera used for shooting can be further flat-field corrected; and / or the grayscale value of the ghost image can be denoised. When the above flat-field correction and denoising are both introduced into the detection method, a more accurate result can be obtained.
[0075] The reason why the camera needs to be flat-field corrected is that, ideally, when the camera captures an object with uniform brightness, the grayscale values of all pixels in the image should be the same in theory. However, in reality, the grayscale values of each pixel in the image often vary greatly, and the image appears bright in the center and dark around, so the camera lens needs to be flat-field corrected. The flat-field correction method is to use the camera to capture an integrating sphere light source with a brightness uniformity greater than 95%, and then correct the image captured by the camera so that the uniformity of the corrected image reaches more than 99%.
[0076] The reason why the grayscale value of ghost images needs to be denoised is that: taking the VR Pancake module as an example, its display module includes an LCD and a lens, where the LCD includes a backlight panel and a liquid crystal. The backlight panel is always on, and the brightness of the projected image can be controlled by the on / off degree of the liquid crystal. In theory, when the liquid crystal is completely turned off, the brightness of the projected image should be 0. However, due to the characteristics of the LCD, the projected image is slightly bright. In the ghost image test, we call this part of the brightness that cannot be eliminated the background noise. The existence of background noise will greatly reduce the accuracy of the test, so it is necessary to perform background noise removal.
[0077] In one embodiment, the noise removal process includes:
[0078] The optical module to be tested is controlled to play a black picture and the camera is controlled to shoot the black picture. For a position of ghost distribution on the detection line, the background noise value of the black picture at the position is calculated, and the difference between the grayscale value of the ghost at the position and the background noise value is taken.
[0079] In this specific example, for a position of the ghost distribution on one of the detection lines, the difference between the grayscale value of the ghost at the position and the background noise value is the real grayscale value of the ghost after the background noise is removed.
[0080] <Device Example>
[0081] Reference Figure 3 As shown, according to another embodiment of the present application, a detection device 200 for detecting ghost images of an optical module is provided, and the detection device 200 includes:
[0082] The control module 201 is used to control the optical module to be tested to play a test picture and control the camera to take a picture of the test picture when the optical axis of the camera is adjusted to coincide with the optical axis of the optical module to be tested; the test picture includes a black background and a white pattern on the black background;
[0083] The optical module detected in the embodiment of the present application can be, for example, a VR Pancake module; for the control module 201, first adjust the optical axis of the camera to coincide with the optical axis of the optical module to be tested. When adjusting the optical axis, for example, the position of the product tooling 10 can be moved by the displacement table 14, thereby realizing the movement of the position of the optical module placed on the product tooling 10; and the position of the camera 11 can also be moved by the six-axis adjustment table 12, so as to achieve the coincidence of the optical axis of the camera 11 with the optical axis of the optical module to be tested. In addition, the vertical distance between the camera 11 and the optical module to be tested can also be adjusted by the lifting platform 13, so that the vertical distance between the two meets the working requirements. After the optical axis of the camera is adjusted to coincide with the optical axis of the optical module to be tested, the position of the ghost can be accurately measured; then the optical module to be tested is controlled to play the test picture, and the camera is controlled to take a picture of the test picture; the test picture presents a pattern of a black background and a white pattern. Optionally, refer to Figure 5a-5d As shown, the white pattern can be, for example, a white ring; it can also be a white rectangular frame; it can also be a plurality of discretely distributed white dots, and the plurality of white dots are distributed on the same circumference; it can also be a white line. Generally speaking, for an optical module, such as a VR Pancake module, when the VR Pancake module performs product simulation, it is roughly known which position area of the product is the location where the ghost is the strongest, and the white pattern is designed at the location where the ghost is the strongest, which can improve the test efficiency.
[0084] A first acquisition module 202, used to acquire the geometric center of the white pattern and to acquire multiple detection lines;
[0085] For the first acquisition module 202, the position where the ghost appears and the position where the white pattern is located are centrally symmetrically distributed in the image; for example, when the white pattern is a white ring, the position where the ghost appears and the white ring are distributed in concentric circles. When acquiring the geometric center of the white pattern, the contour position of the white pattern is first acquired, and then the geometric center of the white pattern is obtained by fitting according to the contour position of the white pattern. When acquiring the detection line, the line drawn from the geometric center of the white pattern toward the contour position of the white pattern is used as the detection line; optionally, multiple detection lines are evenly distributed, for example, referring to Figure 6 As shown, when the white pattern is a white circle, a horizontal line of 0° is first drawn from the center of the white circle to the outline of the white circle, and then other detection lines are made at intervals of a predetermined angle, such as 20°, so that these detection lines divide the white circle into 18 equal parts. The above predetermined angle can be adjusted according to actual needs.
[0086] A second acquisition module 203 is used to acquire the grayscale values of the pixels included in the detection line;
[0087] For the second acquisition module 203, taking the detection line of the 0° horizontal line taken above as an example, the grayscale value of each pixel on the 0° horizontal line, that is, the brightness value of each pixel is read; in order to make the grayscale value of the pixel read more accurate, the grayscale value reading method described below is adopted: for example, for the point A pixel on the 0° horizontal line, the grayscale value of the point A pixel itself is read, and then the grayscale values of at least three reference pixels around the point A pixel are read. Optionally, four pixels in the up, down, left and right directions around the point A pixel are taken as reference pixels. Then, the grayscale value of the point A pixel finally read = (the grayscale value of the point A pixel itself + the grayscale values of the above four reference pixels) / 5, that is, the average of the grayscale values of the point A pixel and the four reference pixels is taken as the final grayscale value of the point A pixel.
[0088] The third acquisition module 204 is used to acquire the position of the ghost image on the detection line and the grayscale value of the ghost image according to the grayscale value of the pixels included in the detection line.
[0089] For the third acquisition module 204, when determining whether a certain pixel on a detection line belongs to a ghost, a threshold value can be pre-defined. When the grayscale value of a certain pixel is greater than or equal to the threshold value, the pixel is determined to belong to a ghost; then, according to the distribution position of pixels whose grayscale values are greater than or equal to the threshold value on the detection line, the distribution position of the ghost on the detection line can be obtained. At the same time, the grayscale value of the pixel determined to be a ghost is the grayscale value of the ghost; optionally, in order to improve the accuracy of detection, the following method is used when obtaining the grayscale value of the ghost: for a position of the ghost distribution on a detection line, take the average grayscale value of a preset area with the position as the center as the grayscale value of the ghost at the position; optionally, the preset area can be, for example, an area of 5*5 pixels.
[0090] According to another embodiment of the present application, referring to Figure 4 As shown, an electronic device 300 is provided, and the electronic device 300 includes:
[0091] Memory 301, used to store executable computer instructions;
[0092] The processor 302 is used to execute the above-mentioned method for detecting ghost images of the optical module according to the control of the executable computer instructions.
[0093] <Computer Readable Storage Medium>
[0094] According to another embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the method for detecting ghost images of an optical module as described above is executed.
[0095] The embodiments of the present disclosure may be systems, methods and / or computer program products. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the embodiments of the present disclosure.
[0096] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0097] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0098] The computer program instructions for performing the operation of the disclosed embodiment can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to personalize and customize electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs) or programmable logic arrays (PLAs), the electronic circuits can execute computer-readable program instructions, thereby realizing various aspects of the disclosed embodiment.
[0099] Various aspects of the disclosed embodiments are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to the disclosed embodiments. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0100] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0101] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0102] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and the module, a program segment or a part of an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
[0103] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present application is defined by the appended claims.
Claims
1. A method for detecting ghost images of an optical module, It is characterized in that The test is performed using a test mechanism, wherein the test mechanism includes a camera, and the optical module to be tested is placed on the test mechanism; The detection method comprises: When adjusting the optical axis of the camera to coincide with the optical axis of the optical module to be tested, controlling the optical module to be tested to play a test picture, and controlling the camera to take a picture of the test picture; the test picture includes a black background and a white pattern on the black background; Acquire the geometric center of the white pattern, radiate toward the outline of the white pattern from the geometric center as the starting point and acquire a plurality of detection lines; Obtaining grayscale values of pixels included in the detection line; Obtaining the positions of ghost images distributed on the detection line and the grayscale values of the ghost images according to the grayscale values of the pixels included on the detection line; The obtaining of the grayscale values of the pixels on the detection line includes: For one of the pixels on one of the detection lines, at least three reference pixels are taken around the pixel, and an average value of the grayscale value of the pixel itself and the grayscale value of the reference pixel is taken as the grayscale value of the pixel on the detection line; The step of obtaining the distribution position of the ghost on the detection line according to the grayscale values of the pixels on the detection line includes: Pixels with grayscale values greater than or equal to the threshold are determined as ghosts, and positions of the ghosts on the detection line are obtained according to positions of the pixels with grayscale values greater than or equal to the threshold on the detection line.
2. The method for detecting ghost images of an optical module according to claim 1, It is characterized in that The obtaining the geometric center of the white pattern comprises: The contour position of the white pattern is acquired, and the geometric center is obtained by fitting according to the contour position.
3. The method for detecting ghost images of an optical module according to claim 1 or 2, It is characterized in that The plurality of detection lines divide the white pattern into equal parts according to preset angles.
4. The method for detecting ghost images of an optical module according to claim 1, It is characterized in that The step of obtaining the grayscale value of the ghost image includes: For a position of ghost distribution on one of the detection lines, the average grayscale value of a preset area is taken as the grayscale value of the ghost at the position, with the position as the center.
5. The method for detecting ghost images of an optical module according to claim 1 or 4, It is characterized in that The step of obtaining the grayscale value of the ghost image further includes: Performing flat field correction on the camera and obtaining a flat field correction coefficient, and correcting the grayscale value of the ghost according to the flat field correction coefficient; and / or, Perform noise reduction on the grayscale values of ghost images.
6. The method for detecting ghost images of an optical module according to claim 5, It is characterized in that The noise removal process includes: The optical module to be tested is controlled to play a black picture and the camera is controlled to shoot the black picture. For a position of ghost distribution on the detection line, the background noise value of the black picture at the position is calculated, and the difference between the grayscale value of the ghost at the position and the background noise value is taken.
7. The method for detecting ghost images of an optical module according to claim 1, It is characterized in that The detection method further comprises: The overall position of the ghost is obtained according to the position of the ghost distributed on each of the detection lines, and / or the overall grayscale value of the ghost is obtained according to the grayscale value of the ghost distributed on each of the detection lines.
8. The method for detecting ghost images of an optical module according to claim 7, It is characterized in that The detection method further comprises: The intensity of the ghost image is obtained according to the ratio of the overall grayscale value of the ghost image to the grayscale value of the display screen of the optical module to be measured.
9. A device for detecting ghost images of an optical module, It is characterized in that The test is performed using a test mechanism, wherein the test mechanism includes a camera, and the optical module to be tested is placed on the test mechanism; The detection device comprises: A control module, which is used to control the optical module to be tested to play a test picture when the optical axis of the camera is adjusted to coincide with the optical axis of the optical module to be tested, and is used to control the camera to take a picture of the test picture; the test picture includes a black background and a white pattern on the black background; A first acquisition module, used for acquiring the geometric center of the white pattern and for acquiring a plurality of detection lines; A second acquisition module, used to acquire the grayscale value of the pixels included in the detection line; The second acquisition module is specifically used to: for a pixel included in one of the detection lines, take at least three reference pixels around the pixel, and take the average of the grayscale value of the pixel itself and the grayscale value of the reference pixel as the grayscale value of the pixel on the detection line; A third acquisition module, used for acquiring the position of the ghost image on the detection line and the grayscale value of the ghost image according to the grayscale value of the pixels included on the detection line; The third acquisition module is specifically used to: determine pixels with grayscale values greater than or equal to the threshold as ghosts, and obtain the distribution positions of ghosts on the detection line according to the distribution positions of pixels with grayscale values greater than or equal to the threshold on the detection line.
10. A computer-readable storage medium, It is characterized in that Computer instructions are stored thereon, and when the computer instructions are executed by a processor, the method for detecting ghost images of an optical module as described in any one of claims 1-8 is executed.
