Lens module light leakage detection method and device, electronic equipment and storage medium
By setting a light shielding baffle and detection light source on the lens module, using the photosensitive chip to collect images and calculate the light leakage value, the problem of low light leakage detection sensitivity of the lens module in the prior art is solved, fast and accurate detection efficiency is achieved, and the detection standards for different photosensitive chips are suitable.
Patent Information
- Application Number
- CN202411874246.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-21
AI Technical Summary
The prior art detects light leakage in lens modules, and is difficult to meet the high efficiency needs of large-scale production.
By setting a light shielding baffle on the light-inlet surface of the lens module and setting a detection light source on the side, the image to be detected is collected using the photosensitive chip, the image to be detected is divided into square blocks, the noise floor value and light leakage value are calculated, and whether the lens module is a bad product is determined based on the preset threshold.
It realizes fast and accurate detection of light leakage in lens modules, improves detection efficiency, and decouples the two parameters of noise floor and light leakage degree, which is suitable for detection standards of different photosensitive chips and is standardized and unified.
Smart Images

Figure CN119676582A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of lens module detection, and in particular to a lens module light leakage detection method, device, electronic device and storage medium. Background Art
[0002] Lens modules are usually composed of lenses, apertures, photosensitive elements, circuit boards and other components, and can be widely used in imaging fields such as mobile phones, cameras, car cameras, monitoring equipment and medical equipment. As one of the factors affecting imaging quality, light leakage refers to the ambient light entering the photosensitive element through the gaps or gaps in the lens module, resulting in unnecessary light or bright spots in the image. For example, the lens module is not assembled accurately during the manufacturing and assembly process, resulting in tiny gaps, and the seal fails due to aging or physical damage during use.
[0003] At present, the relevant technology mainly uses optical instruments to detect and combines manual judgment to determine whether there is light leakage in the lens module. However, this method has low sensitivity for detecting extremely weak light leakage and relies on manual operation, which makes it difficult to meet the high efficiency requirements of large-scale production. Summary of the invention
[0004] In view of the above-mentioned defects or deficiencies in the related art, it is desired to provide a lens module light leakage detection method, device, electronic device and storage medium, which can accurately detect whether there is light leakage in the lens module and improve processing efficiency.
[0005] In a first aspect, the present application provides a lens module light leakage detection method, wherein a light-incoming surface of the lens module is provided with a light shielding baffle, a side surface of the lens module is provided with at least one detection light source, the lens module includes a photosensitive chip, and the lens module light leakage detection method includes:
[0006] Acquire the image to be detected collected by the photosensitive chip;
[0007] Divide the image to be detected into a plurality of square blocks, and calculate the background noise value of the image to be detected according to the brightness value of each square block;
[0008] When the background noise value of the image to be detected is less than or equal to the preset background noise threshold, the light leakage values of the square blocks are calculated in sequence. If the light leakage values of the square blocks are greater than or equal to the preset light leakage threshold, the lens module is determined to be a defective product.
[0009] Optionally, in some embodiments of the present application, the side length of the square block is equal to the common divisor of the length and width of the image to be detected, wherein the side length of the square block is greater than or equal to one thirtieth of the width of the image to be detected, and less than or equal to one fifteenth of the width of the image to be detected.
[0010] Optionally, in some embodiments of the present application, if the side length of the square block is not equal to the common divisor of the length and width of the image to be detected, the square block is merged with the last row of adjacent blocks or the last column of adjacent blocks.
[0011] Optionally, in some embodiments of the present application, the brightness value of the square block is the first quartile of the brightness values of all pixels in the square block.
[0012] Optionally, in some embodiments of the present application, the background noise value of the image to be detected is the median of the brightness values of all square blocks in the image to be detected.
[0013] Optionally, in some embodiments of the present application, the light leakage value of the square block is the brightness value of the square block minus the background noise value of the image to be detected, wherein if the light leakage value of the square block is less than zero, the light leakage value of the square block is set to zero.
[0014] Optionally, in some embodiments of the present application, when the background noise value of the image to be detected is greater than the preset background noise threshold, the lens module is determined to be a defective product.
[0015] In a second aspect, the present application provides a lens module light leakage detection device, wherein a light-incoming surface of the lens module is provided with a light shielding baffle, a side surface of the lens module is provided with at least one detection light source, the lens module includes a photosensitive chip, and the lens module light leakage detection device includes:
[0016] An acquisition module, configured to acquire the image to be detected collected by the photosensitive chip;
[0017] A calculation module, configured to divide the image to be detected into a plurality of square blocks, and calculate the background noise value of the image to be detected according to the brightness value of each square block;
[0018] The judgment module is configured to calculate the light leakage values of the square blocks in sequence when the background noise value of the image to be detected is less than or equal to a preset background noise threshold, and if the light leakage value of the square block is greater than or equal to the preset light leakage threshold, the lens module is judged to be a defective product.
[0019] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the instruction, the program, the code set or the instruction set is loaded and executed by the processor to implement the steps of the lens module light leakage detection method described in any one of the first aspects.
[0020] In a fourth aspect, the present application provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the lens module light leakage detection method described in any one of the first aspects.
[0021] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0022] The embodiments of the present application provide a lens module light leakage detection method, device, electronic device and storage medium. By setting a light shielding baffle on the light incident surface of the lens module and at least one detection light source on the side of the lens module, the lens module includes a photosensitive chip, and then directly obtains the image to be detected collected by the photosensitive chip without human intervention. Then, based on the brightness value of each square block in the detection image, the background noise value of the image to be detected can be calculated, and when the background noise value of the image to be detected is less than or equal to a preset background noise threshold, the light leakage values of the square blocks are calculated in turn. If the light leakage value of the square block is greater than or equal to the preset light leakage threshold, the lens module can be quickly and accurately determined to be a defective product. At the same time, this process decouples the two parameters of background noise and light leakage degree. For different photosensitive chips, only the background noise threshold needs to be modified, which greatly improves the adaptation efficiency of the new photosensitive chip. In addition, photosensitive chips with different background noise performance can use the same light leakage threshold as the detection standard, which is standardized, unified, convenient and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. 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 creative work.
[0024] Figure 1 A schematic diagram of a process for detecting light leakage of a lens module provided in an embodiment of the present application;
[0025] Figure 2 A schematic diagram of the structure of a light leakage detection system provided in an embodiment of the present application;
[0026] Figure 3 A schematic diagram of segmentation of an image to be detected provided in an embodiment of the present application;
[0027] Figure 4 A structural block diagram of a lens module light leakage detection device provided in an embodiment of the present application;
[0028] Figure 5 A structural block diagram of an electronic device provided in an embodiment of the present application.
[0029] Reference numerals:
[0030] 100 - light leakage detection system, 101 - lens module, 102 - light shielding baffle, 103 - detection light source; 200 - lens module light leakage detection device, 201 - acquisition module, 202 - calculation module, 203 - determination module; 300 - electronic device, 301 - processor, 302 - memory. DETAILED DESCRIPTION
[0031] 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.
[0032] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0033] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. Figures 1 to 5 The lens module light leakage detection method, device, electronic device and storage medium provided in the embodiments of the present application are described in detail.
[0034] Please refer to Figure 1 , which is a flow chart of a lens module light leakage detection method provided in an embodiment of the present application, and the lens module light leakage detection method specifically comprises the following steps:
[0035] S101, obtaining an image to be detected collected by a photosensitive chip.
[0036] It should be noted that if Figure 2As shown, the light leakage detection system 100 of the embodiment of the present application includes a lens module 101, a light shielding baffle 102 and at least one detection light source 103, wherein the light-incoming surface of the lens module 101 is provided with the light shielding baffle 102, and at least one detection light source 103 is provided on the side of the lens module 101, and the lens module 101 includes a photosensitive chip, and the photosensitive chip includes but is not limited to a charge coupled device (CCD) and a complementary metal oxide semiconductor (CMOS) device. In actual use, the light-incoming surface of the lens module 101 is covered by the light shielding baffle 102, and then the side of the lens module 101 is illuminated by the detection light source 103, and then the image to be detected is collected while the detection light source 103 is kept irradiated and the light shielding baffle 102 completely shields the light-incoming surface of the lens.
[0037] S102, dividing the image to be detected into a plurality of square blocks, and calculating the background noise value of the image to be detected according to the brightness value of each square block.
[0038] For example, Figure 3 As shown, in the embodiment of the present application, the side length of the square block (i.e., Block) can be equal to the common divisor of the length and width of the image to be detected, wherein the side length of the square block is greater than or equal to one-thirtieth of the width of the image to be detected, and less than or equal to one-fifteenth of the width of the image to be detected. In the case where the length or width of the image to be detected cannot be divided into square blocks, that is, if the side length of the square block (corresponding to the dotted box in the figure) is not equal to the common divisor of the length and width of the image to be detected, the square block is merged with the adjacent blocks in the last row or the adjacent blocks in the last column.
[0039] For another example, in the embodiment of the present application, the brightness value of the square block can be the first quartile of the brightness values of all pixels in the square block. The advantage of such a setting is that the quartile is not easily affected by outliers and is more stable than the average value. It should be noted that the first quartile refers to the brightness value at the first split point position when all pixel brightness values are arranged from small to large and divided into four equal parts.
[0040] For example, the background noise value of the image to be detected in the embodiment of the present application can be the median of the brightness values of all square blocks in the image to be detected. The advantage of this setting is that even if one-third of the pixels in the image to be detected are affected by light leakage, the median can still remain stable, ensuring subsequent accurate judgment.
[0041] S103, when the background noise value of the image to be detected is less than or equal to the preset background noise threshold, the light leakage values of the square blocks are calculated in sequence. If the light leakage value of the square blocks is greater than or equal to the preset light leakage threshold, the lens module is determined to be a defective product.
[0042] Exemplarily, for example, the embodiment of the present application can calculate the light leakage value of the square blocks one by one. If the light leakage value of the square block is greater than or equal to the preset light leakage threshold, the calculation is stopped and the lens module is determined to be a defective product, thereby saving computing power and improving processing efficiency, or the light leakage values of all square blocks can be calculated and determined. The light leakage value of the square block can be the brightness value of the square block minus the background noise value of the image to be detected, wherein if the light leakage value of the square block is less than zero, the light leakage value of the square block is set to zero. Since the background noise effect has been eliminated at this time, the photosensitive chip can apply the same light leakage threshold as the detection standard in the same usage scenario, and the specifications are unified. In addition, if the light leakage value of the square block is less than the preset light leakage threshold, the lens module is determined to be a qualified product.
[0043] For another example, the embodiment of the present application can also directly determine that the lens module is a defective product when the background noise value of the image to be detected is greater than the preset background noise threshold, without the need for subsequent testing. It should be noted that the background noise threshold can be obtained by querying the data table of the photosensitive chip or testing under extreme conditions within the working environment. The advantage of such a setting is that the existence of the background noise threshold can prevent the light leakage throughout the entire image to be detected from being out of control, and can also detect some image anomalies caused by abnormal operation of the photosensitive chip. In short, the embodiment of the present application only needs to collect one image to instantly detect the light leakage of the lens module, which is suitable for mass production and testing.
[0044] The lens module light leakage detection method provided in the embodiment of the present application is provided by setting a light shielding baffle on the light incident surface of the lens module and at least one detection light source on the side of the lens module. The lens module includes a photosensitive chip, and then directly obtains the image to be detected collected by the photosensitive chip without human intervention. Then, based on the brightness value of each square block in the detection image, the background noise value of the image to be detected can be calculated, and when the background noise value of the image to be detected is less than or equal to a preset background noise threshold, the light leakage values of the square blocks are calculated in turn. If the light leakage value of the square block is greater than or equal to the preset light leakage threshold, the lens module can be quickly and accurately determined to be a defective product. At the same time, this process decouples the two parameters of background noise and light leakage degree. For different photosensitive chips, only the background noise threshold needs to be modified, which greatly improves the adaptation efficiency of the new photosensitive chip, and photosensitive chips with different background noise performance can use the same light leakage threshold as the detection standard, which is standardized, unified, convenient and efficient.
[0045] Based on the above embodiments, the present application provides a lens module light leakage detection device. The light-incoming surface of the lens module 101 is provided with a light shielding baffle 102, and the side of the lens module 101 is provided with at least one detection light source 103, and the lens module 101 includes a photosensitive chip. The lens module light leakage detection device 200 can be applied to Figure 1 to Figure 3 In the lens module light leakage detection method of the corresponding embodiment. Please refer to Figure 4 , the lens module light leakage detection device 200 comprises:
[0046] An acquisition module 201 is configured to acquire an image to be detected collected by a photosensitive chip;
[0047] The calculation module 202 is configured to divide the image to be detected into a plurality of square blocks, and calculate the background noise value of the image to be detected according to the brightness value of each square block;
[0048] The determination module 203 is configured to calculate the light leakage values of the square blocks in sequence when the background noise value of the image to be detected is less than or equal to the preset background noise threshold. If the light leakage value of the square block is greater than or equal to the preset light leakage threshold, the lens module is determined to be defective.
[0049] Optionally, in some embodiments of the present application, the side length of the square block is equal to the common divisor of the length and width of the image to be detected, wherein the side length of the square block is greater than or equal to one thirtieth of the width of the image to be detected, and less than or equal to one fifteenth of the width of the image to be detected.
[0050] Optionally, in some embodiments of the present application, if the side length of the square block is not equal to the common divisor of the length and width of the image to be detected, the calculation module 202 is further configured to merge the square block with the last row of adjacent blocks or the last column of adjacent blocks.
[0051] Optionally, in some embodiments of the present application, the brightness value of the square block is the first quartile of the brightness values of all pixels in the square block.
[0052] Optionally, in some embodiments of the present application, the background noise value of the image to be detected is the median of the brightness values of all square blocks in the image to be detected.
[0053] Optionally, in some embodiments of the present application, the light leakage value of the square block is the brightness value of the square block minus the background noise value of the image to be detected, wherein if the light leakage value of the square block is less than zero, the determination module 203 is further configured to set the light leakage value of the square block to zero.
[0054] Optionally, in some embodiments of the present application, when the background noise value of the image to be detected is greater than a preset background noise threshold, the determination module 203 is further configured to determine that the lens module is a defective product.
[0055] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
[0056] The lens module light leakage detection device provided in the embodiment of the present application directly obtains the image to be detected collected by the photosensitive chip without human intervention, and can calculate the background noise value of the image to be detected based on the brightness value of each square block in the detection image, and when the background noise value of the image to be detected is less than or equal to the preset background noise threshold, the light leakage values of the square blocks are calculated in turn. If the light leakage value of the square block is greater than or equal to the preset light leakage threshold, the lens module can be quickly and accurately determined to be a defective product. At the same time, this process decouples the two parameters of background noise and light leakage degree. For different photosensitive chips, only the background noise threshold needs to be modified, which greatly improves the adaptation efficiency of the new photosensitive chip, and photosensitive chips with different background noise performance can use the same light leakage threshold as the detection standard, which is standardized, unified, convenient and efficient.
[0057] Based on the above embodiments, the present application provides an electronic device. Figure 5 The electronic device 300 may include a processor 301 and a memory 302. The memory 302 stores at least one instruction, at least one program, code set or instruction set, which is loaded and executed by the processor 301 to implement Figure 1 to Figure 3 The steps of the lens module light leakage detection method of the corresponding embodiment.
[0058] As another aspect, the present invention provides a computer-readable storage medium for storing program code for executing the aforementioned Figure 1 to Figure 3 Any implementation of the lens module light leakage detection method in the corresponding embodiment.
[0059] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0060] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms. The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0061] In addition, each functional module in each embodiment of the present application may be integrated into a processing unit, or each module may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
[0062] Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the whole or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the lens module light leakage detection method of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0063] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0064] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A lens module light leakage detection method, characterized in that: The light-incoming surface of the lens module is provided with a light shielding baffle, the side of the lens module is provided with at least one detection light source, the lens module includes a photosensitive chip, and the lens module light leakage detection method includes: Acquire the image to be detected collected by the photosensitive chip; Divide the image to be detected into a plurality of square blocks, and calculate the background noise value of the image to be detected according to the brightness value of each square block; When the background noise value of the image to be detected is less than or equal to the preset background noise threshold, the light leakage values of the square blocks are calculated in sequence. If the light leakage values of the square blocks are greater than or equal to the preset light leakage threshold, the lens module is determined to be a defective product.
2. The lens module light leakage detection method according to claim 1, characterized in that: The side length of the square block is equal to the common divisor of the length and width of the image to be detected, wherein the side length of the square block is greater than or equal to one thirtieth of the width of the image to be detected, and less than or equal to one fifteenth of the width of the image to be detected.
3. The lens module light leakage detection method according to claim 2, characterized in that: If the side length of the square block is not equal to the common divisor of the length and width of the image to be detected, the square block is merged with the adjacent blocks in the last row or the adjacent blocks in the last column.
4. The lens module light leakage detection method according to claim 1, characterized in that: The brightness value of the square block is the first quartile of the brightness values of all pixels in the square block.
5. The lens module light leakage detection method according to any one of claims 1 to 4, characterized in that: The background noise value of the image to be detected is the median of the brightness values of all square blocks in the image to be detected.
6. The lens module light leakage detection method according to claim 5, characterized in that: The light leakage value of the square block is the brightness value of the square block minus the background noise value of the image to be detected, wherein if the light leakage value of the square block is less than zero, the light leakage value of the square block is set to zero.
7. The lens module light leakage detection method according to claim 5, characterized in that: When the background noise value of the image to be detected is greater than the preset background noise threshold, the lens module is determined to be a defective product.
8. A lens module light leakage detection device, characterized in that: The light-incoming surface of the lens module is provided with a light shielding baffle, the side of the lens module is provided with at least one detection light source, the lens module includes a photosensitive chip, and the lens module light leakage detection device includes: An acquisition module, configured to acquire the image to be detected collected by the photosensitive chip; A calculation module, configured to divide the image to be detected into a plurality of square blocks, and calculate the background noise value of the image to be detected according to the brightness value of each square block; The judgment module is configured to calculate the light leakage values of the square blocks in sequence when the background noise value of the image to be detected is less than or equal to a preset background noise threshold, and if the light leakage value of the square block is greater than or equal to the preset light leakage threshold, the lens module is judged to be a defective product.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the instruction, the program, the code set or the instruction set is loaded and executed by the processor to implement the steps of the lens module light leakage detection method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the lens module light leakage detection method described in any one of claims 1 to 7.