Equipment detection method, equipment detection device, electronic equipment and storage medium

By using a light-blocking material to shield the camera module lens, the image difference between the on and off states of the supplementary lighting component is obtained, solving the problems of low detection efficiency and unintuitive results in the existing technology, and achieving efficient light leakage detection.

CN121644792APending Publication Date: 2026-03-10BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

During the assembly of camera modules in electronic devices, the light from the supplementary lighting component may enter the camera module through gaps, affecting the imaging effect. Existing technologies have low detection efficiency and the results are not intuitive enough.

Method used

By using a light-blocking material to block light at the camera module lens, the image difference between the on and off states of the supplementary lighting component is obtained, and image processing technology is used to determine whether the camera module leaks light.

Benefits of technology

It improves the efficiency and intuitiveness of light leakage detection, avoids the use of additional hardware equipment, and directly judges the light leakage situation from the imaging angle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644792A_ABST
    Figure CN121644792A_ABST
Patent Text Reader

Abstract

The invention relates to an equipment detection method, an equipment detection device, electronic equipment and a storage medium. The equipment detection method comprises the following steps: acquiring a first image acquired when the light supplementing assembly is in a closed state, and acquiring a second image acquired when the light supplementing assembly is in an open state; according to the difference degree between the first image and the second image, the light leakage condition of a camera module of the to-be-detected equipment is determined, a lens of the camera module is shielded by a first preset material, the first preset material has the light shielding characteristic, and the light leakage condition comprises light leakage of the camera module and light-tight light leakage of the camera module; the camera module light leakage represents that the emergent light of the light supplementing assembly enters the camera module, and the camera module non-light leakage represents that the emergent light of the light supplementing assembly does not enter the camera module. According to the method and the device, whether the camera module leaks light or not is judged from the imaging angle of the camera module, the detection result can be visually determined, other hardware equipment is not needed for light leakage judgment of the camera module, and the detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of camera equipment testing, and in particular to equipment testing methods, equipment testing apparatus, electronic equipment and storage media. Background Technology

[0002] As the imaging capabilities of electronic devices continue to improve, users are using camera-enabled devices to take photos in various scenarios. However, when shooting night scenes or in low-light environments, it's necessary to activate the electronic device's lighting components (such as a flash).

[0003] During the manufacturing and assembly of camera modules for electronic devices, gaps that are difficult to detect with the naked eye are inevitable. Furthermore, camera modules are typically placed close to lighting components. When an electronic device uses its lighting component at night, if the light from the lighting component enters the camera module through these gaps, it will affect the image quality. Therefore, it is necessary to perform light leakage detection on the camera module after assembly. If light leakage is detected, the assembly of the camera module should be optimized. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides a device testing method, a device testing apparatus, an electronic device, and a storage medium.

[0005] According to a first aspect of the present disclosure, a device detection method is provided, comprising: acquiring a first image captured when the supplementary lighting component is in a closed state, and acquiring a second image captured when the supplementary lighting component is in an open state; determining the light leakage condition of a camera module of a device under test based on the difference between the first image and the second image, wherein the lens of the camera module is blocked by a first preset material, the first preset material having light-shielding properties, and the light leakage condition includes camera module light leakage and camera module no light leakage, wherein camera module light leakage indicates that the emitted light from the supplementary lighting component enters the interior of the camera module, and camera module no light leakage indicates that the emitted light from the supplementary lighting component does not enter the interior of the camera module.

[0006] In one embodiment, determining the light leakage of the camera module of the device under test based on the difference between the first image and the second image includes: converting the first image to a grayscale space to obtain a first grayscale image corresponding to the first image, and converting the second image to a grayscale space to obtain a second grayscale image corresponding to the second image; determining the average grayscale value of all pixels in the first grayscale image as a first grayscale average value, and determining the average grayscale value of all pixels in the second grayscale image as a second grayscale average value; and determining the light leakage of the camera module based on the difference between the first grayscale average value and the second grayscale average value and a first threshold.

[0007] In one embodiment, determining the light leakage of the camera module based on the difference between the first grayscale mean and the second grayscale mean and a first threshold includes: determining the light leakage of the camera module in response to the difference between the first grayscale mean and the second grayscale mean being greater than or equal to the first threshold.

[0008] In one embodiment, determining the light leakage of the camera module based on the difference between the first grayscale mean and the second grayscale mean and a first threshold includes: responding to a situation where the difference between the first grayscale mean and the second grayscale mean is less than the first threshold, dividing the first image into multiple first image regions and the second image into multiple second image regions according to preset length and width dimensions, wherein the multiple first image regions and the multiple second image regions correspond one-to-one; and determining the light leakage of the camera module based on the color channel values ​​of the multiple first image regions and the color channel values ​​of the multiple second image regions.

[0009] In one embodiment, determining the light leakage of the camera module based on the color channel values ​​of the plurality of first image regions and the plurality of second image regions includes: for each of the plurality of first image regions, obtaining the average color channel value of all pixels in the first image region for each color channel; and for each of the plurality of second image regions, obtaining the average color channel value of all pixels in the second image region for each color channel; for multiple pairs of corresponding first image regions and second image regions, determining the difference between the average color channel values ​​for each color channel, and determining the maximum difference among the differences corresponding to the multiple color channels as the target difference; and determining the light leakage of the camera module based on the target difference corresponding to the multiple pairs of corresponding first image regions and second image regions and a second threshold.

[0010] In one embodiment, determining the light leakage of the camera module based on the target differences corresponding to multiple pairs of corresponding first image regions and second image regions and a second threshold includes: determining that the camera module does not leak light in response to the fact that the target differences corresponding to multiple pairs of corresponding first image regions and second image regions are all less than the second threshold; and determining that the camera module leaks light in response to the fact that there are corresponding first image regions and second image regions in multiple pairs of corresponding first image regions and second image regions with target differences greater than or equal to the second threshold.

[0011] In one embodiment, the area outside the device under test, except for the area corresponding to the supplementary lighting component and the lens, is shielded by a second preset material, which has the property of shielding light.

[0012] In one embodiment, the camera module and the fill light component are located on the same side of the device under test, and the fill light component is the flash, soft light, or screen of the device under test.

[0013] In one embodiment, when the supplementary lighting component is in the on state, the supplementary lighting component emits light at the highest supported brightness.

[0014] According to a second aspect of the present disclosure, a device detection apparatus is provided, comprising: an acquisition unit, configured to acquire a first image captured when the supplementary lighting component is in a closed state, and to acquire a second image captured when the supplementary lighting component is in an open state; and a processing unit, configured to determine the light leakage condition of a camera module of a device under test based on the difference between the first image and the second image, wherein the lens of the camera module is blocked by a first preset material, the first preset material having light-shielding properties, and the light leakage condition includes camera module light leakage and camera module no light leakage, wherein camera module light leakage indicates that the emitted light from the supplementary lighting component enters the interior of the camera module, and camera module no light leakage indicates that the emitted light from the supplementary lighting component does not enter the interior of the camera module.

[0015] In one embodiment, the processing unit determines the light leakage of the camera module of the device under test based on the difference between the first image and the second image in the following manner: converting the first image to grayscale space to obtain a first grayscale image corresponding to the first image, and converting the second image to grayscale space to obtain a second grayscale image corresponding to the second image; determining the average grayscale value of all pixels in the first grayscale image as the first grayscale average value, and determining the average grayscale value of all pixels in the second grayscale image as the second grayscale average value; determining the light leakage of the camera module based on the difference between the first grayscale average value and the second grayscale average value and a first threshold.

[0016] In one embodiment, the processing unit determines the light leakage of the camera module based on the difference between the first gray-scale mean and the second gray-scale mean and a first threshold as follows: in response to the difference between the first gray-scale mean and the second gray-scale mean being greater than or equal to the first threshold, the light leakage of the camera module is determined.

[0017] In one embodiment, the processing unit determines the light leakage of the camera module based on the difference between the first grayscale mean and the second grayscale mean and a first threshold as follows: In response to the difference between the first grayscale mean and the second grayscale mean being less than the first threshold, the first image is divided into multiple first image regions and the second image is divided into multiple second image regions according to preset length and width dimensions, wherein the multiple first image regions and the multiple second image regions correspond one-to-one; the light leakage of the camera module is determined based on the color channel values ​​of the multiple first image regions and the color channel values ​​of the multiple second image regions.

[0018] In one embodiment, the processing unit determines the light leakage of the camera module based on the color channel values ​​of the plurality of first image regions and the plurality of second image regions in the following manner: for each of the plurality of first image regions, the average color channel value of all pixels in the first image region is obtained for each color channel; for each of the plurality of second image regions, the average color channel value of all pixels in the second image region is obtained for each color channel; for multiple pairs of corresponding first image regions and second image regions, the difference between the average color channel values ​​of each color channel is determined, and the maximum difference among the differences corresponding to the multiple color channels is determined as the target difference; the light leakage of the camera module is determined based on the target difference corresponding to the multiple pairs of corresponding first image regions and second image regions and a second threshold.

[0019] In one embodiment, the processing unit determines the light leakage of the camera module based on the target differences corresponding to multiple pairs of corresponding first image regions and second image regions and a second threshold as follows: in response to the target differences corresponding to multiple pairs of corresponding first image regions and second image regions being less than the second threshold, it is determined that the camera module does not leak light; in response to the existence of first image regions and second image regions in multiple pairs of corresponding first image regions and second image regions with corresponding target differences greater than or equal to the second threshold, it is determined that the camera module leaks light.

[0020] In one embodiment, the area outside the device under test, except for the area corresponding to the supplementary lighting component and the lens, is shielded by a second preset material, which has the property of shielding light.

[0021] In one embodiment, the area outside the device under test, except for the area corresponding to the supplementary lighting component and the lens, is shielded by a second preset material, which has the property of shielding light.

[0022] In one embodiment, when the supplementary lighting component is in the on state, the supplementary lighting component emits light at the highest supported brightness.

[0023] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: execute the device detection method described in the first aspect or any embodiment of the first aspect.

[0024] According to a fourth aspect of the present disclosure, a storage medium is provided, the storage medium storing instructions that, when executed by a processor, enable the processor to perform the device detection method described in the first aspect or any embodiment of the first aspect.

[0025] The technical solution provided by the embodiments of this disclosure can include the following beneficial effects: when the lens of the camera module of the device under test is blocked by a first preset material with light-shielding properties, a first image is acquired when the supplementary lighting component is in a closed state, and a second image is acquired when the supplementary lighting component is in a turned-on state. Based on the difference between the first image and the second image, the light leakage condition of the camera module of the device under test is determined. The light leakage condition includes light leakage and no light leakage. Light leakage indicates that the emitted light from the supplementary lighting component enters the camera module, while no light leakage indicates that the emitted light from the supplementary lighting component does not enter the camera module. Through this disclosure, determining whether the camera module leaks light from the imaging angle of the camera module provides a direct and definitive detection result, and eliminates the need for additional hardware devices to determine light leakage, thus improving detection efficiency.

[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0027] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0028] Figure 1 This is a flowchart illustrating a device testing method according to an exemplary embodiment.

[0029] Figure 2 This is a flowchart illustrating a method for determining light leakage of a camera module of a device under test based on the difference between a first image and a second image, according to an exemplary embodiment.

[0030] Figure 3This is a flowchart illustrating a method for determining light leakage of a camera module of a device under test based on the difference between a first grayscale mean and a second grayscale mean and a first threshold, according to an exemplary embodiment.

[0031] Figure 4 This is a flowchart illustrating a method for determining light leakage of a camera module of a device under test based on the difference between a first grayscale mean and a second grayscale mean and a first threshold, according to an exemplary embodiment.

[0032] Figure 5 This is a flowchart illustrating a method for determining light leakage of a camera module of a device under test based on color channel values ​​of a plurality of first image regions and color channel values ​​of a plurality of second image regions, according to an exemplary embodiment.

[0033] Figure 6 This is a flowchart illustrating a method for determining light leakage of a camera module of a device under test based on the target difference between multiple pairs of corresponding first and second image regions and a second threshold, according to an exemplary embodiment.

[0034] Figure 7 This is a flowchart illustrating a device testing method according to an exemplary embodiment of the present disclosure.

[0035] Figure 8 This is a block diagram illustrating a device testing apparatus according to an exemplary embodiment.

[0036] Figure 9 This is a block diagram illustrating an apparatus for device detection according to an exemplary embodiment. Detailed Implementation

[0037] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure.

[0038] The device detection method provided in this disclosure is applied to scenarios where light leakage is detected in the camera module of an electronic device.

[0039] As the imaging capabilities of electronic devices continue to improve, users are using camera-equipped devices to take photos in various scenarios. When shooting night scenes or in low-light environments, it's necessary to activate the device's lighting components (such as a flash). During the manufacturing and assembly of camera modules in electronic devices, gaps often appear, invisible to the naked eye. Furthermore, the camera module is typically located near the lighting components. Given this assembly method and placement, when the device takes photos at night and uses the lighting components, the light emitted by these components can illuminate the camera module. If this light leaks through gaps in the camera module, light leakage occurs. Consequently, the camera module receives both ambient light and direct light from the lighting components, affecting the final image quality. Therefore, considering the adverse effects of light leakage from the camera module of electronic devices on the imaging of the device, it is necessary to perform light leakage detection on the camera module after it is assembled. When light leakage is detected, the assembly of the camera module should be optimized to reduce or eliminate the impact of light leakage on the imaging of the camera module.

[0040] Currently, most tests for camera light leakage are triggered directly by hardware. By designing a light leakage detector and simulating signals to capture light leakage signals, the light leakage of the module is determined. This method has low testing efficiency and the results are not intuitive enough.

[0041] In one example, the related technology mainly determines the presence of light leakage by configuring a light leakage detection module on the mobile phone camera and receiving signals. In another example, the related technology proposes a camera light leakage detection device including a detection fixture, a circuit board, and a light emitter. The detection fixture has a flat surface with circuit board receiving slots, camera positioning slots, and light emitter positioning slots. The light emitter is electrically connected to the circuit board via wires. The module is then placed in the detection device for light leakage detection. The hardware-based camera light leakage detection schemes in the above-mentioned related technologies are relatively complex, requiring the development and use of dedicated light leakage detection devices. Furthermore, the two methods in the above-mentioned related technologies require hardware analysis during light leakage testing, resulting in low detection efficiency. Moreover, the two methods in the above-mentioned related technologies do not directly determine the camera's light leakage situation from the imaging aspect, and the imaging detection results are not intuitive enough.

[0042] In view of this, this disclosure proposes a camera module detection method. When the lens of the camera module of the device under test is blocked by a first preset material with light-shielding properties, a first image is acquired with the supplementary lighting component in a closed state, and a second image is acquired with the supplementary lighting component in an open state. Based on the difference between the first and second images, the light leakage condition of the camera module of the device under test is determined. Light leakage includes both light leakage and no light leakage. Light leakage indicates that the emitted light from the supplementary lighting component enters the camera module, while no light leakage indicates that the emitted light from the supplementary lighting component does not enter the camera module. This disclosure allows for a direct and definitive determination of whether a camera module leaks light from its imaging angle, eliminating the need for additional hardware devices and improving detection efficiency.

[0043] Figure 1 This is a flowchart illustrating a device testing method according to an exemplary embodiment. Figure 1 As shown, the method includes steps S101 to S102.

[0044] In step S101, a first image is acquired when the supplementary light component is in the off state, and a second image is acquired when the supplementary light component is in the on state.

[0045] In step S102, the light leakage of the camera module of the device under test is determined based on the difference between the first image and the second image. The lens of the camera module is blocked by a first preset material. The first preset material has the property of shielding light. The light leakage includes light leakage of the camera module and no light leakage of the camera module. Light leakage of the camera module indicates that the light emitted by the supplementary light component enters the camera module. No light leakage of the camera module indicates that the light emitted by the supplementary light component does not enter the camera module.

[0046] In this embodiment, the proposed camera module detection method is used to detect whether the camera module of an electronic device leaks light, allowing relevant personnel to optimize the camera module based on the detection results. The camera module and supplementary lighting components (such as flash) of an electronic device are generally arranged adjacent to each other. The light leakage of the camera module described in this disclosure refers to the light emitted by the supplementary lighting component entering the camera module through gaps inside the camera module when the supplementary lighting component is turned on.

[0047] In this embodiment of the disclosure, the first preset material has light-shielding properties to prevent ambient light from entering the camera module through the lens of the camera module. The first preset material can be a black light-absorbing cloth, a black light-absorbing plate, or other materials with light-shielding properties.

[0048] In this embodiment of the present disclosure, when the lens of the camera module of the device under test is blocked by a first preset material (such as a black light-absorbing material) with light-shielding properties, the camera module cannot receive ambient light through the lens. If there is no light leakage in the camera module, the image obtained by the camera module with the supplementary lighting component on and the image obtained by the camera module with the supplementary lighting component off should have the same image appearance, that is, a pure black image in which the pixel channel value of each pixel in the image is 0. If there is light leakage in the camera module, when the camera module obtains an image with the supplementary lighting component on, the light emitted by the supplementary lighting component enters the camera module through the gaps in the camera module inside the device, interfering with the photosensitive components inside the camera module. This causes the pixel channel value of some pixels in the obtained image to be non-zero. The image obtained by the camera module with the supplementary lighting component on (the second image) and the image obtained by the camera module with the supplementary lighting component off (the first image) will have different image appearances. Based on this, this disclosure involves covering all modules of the device under test, except for the supplementary lighting component, with black light-absorbing material. Images are acquired with the supplementary lighting component turned on and off. By comparing the difference between the images acquired with the flash on and the images acquired with the supplementary lighting component off, it is determined whether the camera module of the electronic device exhibits light leakage. In this disclosure, the difference between the first image and the second image can be the difference in pixel values ​​between the first image and the second image.

[0049] In this embodiment, when the lens of the camera module of the device under test is blocked by a first preset material with light-shielding properties, the device under test is controlled to acquire a first image when the supplementary lighting component is off, and to acquire a second image when the supplementary lighting component is on. Based on the difference between the first image and the second image, it is determined whether the camera module of the device under test leaks light. This disclosure allows for a direct and definitive determination of whether the camera module leaks light from its imaging angle, eliminating the need for additional hardware devices and improving detection efficiency.

[0050] In this embodiment, a first image is acquired with the supplementary lighting component off, and a second image is acquired with the supplementary lighting component on. The first and second images are then compared and analyzed from a holistic perspective to determine whether the camera module of the device under test exhibits light leakage. The following embodiments further illustrate the method for determining light leakage in the camera module of the device under test.

[0051] Figure 2 This is a flowchart illustrating a method for determining light leakage of a camera module of a device under test based on the difference between a first image and a second image, according to an exemplary embodiment. Figure 2 As shown, the method includes steps S201 to S203.

[0052] In step S201, the first image is converted to grayscale space to obtain the first grayscale image corresponding to the first image, and the second image is converted to grayscale space to obtain the second grayscale image corresponding to the second image.

[0053] In step S202, the average gray value of all pixels in the first grayscale image is determined as the first grayscale average, and the average gray value of all pixels in the second grayscale image is determined as the second grayscale average.

[0054] In step S203, the light leakage of the camera module is determined based on the difference between the first grayscale mean and the second grayscale mean and the first threshold.

[0055] In this embodiment, the device under test acquires a first image when the supplementary lighting component is off, and acquires a second image when the supplementary lighting component is on. A grayscale image (first grayscale image) corresponding to the first image and a grayscale image (second grayscale image) corresponding to the second image are acquired respectively. For the first grayscale image, the grayscale value of each pixel in the first grayscale image is acquired, and the average grayscale value of all pixels in the first grayscale image is acquired (first grayscale average). Similarly, for the second grayscale image, the grayscale value of each pixel in the second grayscale image is acquired, and the average grayscale value of all pixels in the second grayscale image is acquired (second grayscale average). If the camera module of the electronic device does not have light leakage, the first image and the second image should have the same or similar image performance, and the first grayscale image and the second grayscale image should also have the same or similar image performance. This disclosure uses the first grayscale average to characterize the overall image features of the first grayscale image and the second grayscale average to characterize the overall grayscale features of the second grayscale image. If the camera module of the electronic device does not have light leakage, the first grayscale mean and the second grayscale mean will have a small difference. Based on this, the present disclosure sets a first threshold. After determining the difference between the first grayscale mean and the second grayscale mean, the difference is compared with the first threshold to determine whether the camera module of the device under test has light leakage.

[0056] It is understandable that different degrees of light leakage in the camera module of the device under test will have varying degrees of impact on the imaging of the camera module, affecting either the overall image or a local area of ​​the imaging. If the light leakage in the camera module of the device under test is low, only affecting a local area of ​​the imaging, it is difficult to determine whether light leakage exists in the camera module of the device under test from the perspective of the whole image. Based on this, this disclosure determines that light leakage exists in the camera module of the device under test when the obtained difference is greater than or equal to a first threshold, and when the obtained difference is less than the first threshold, further analysis is required from the perspective of the local image. The following embodiments of this disclosure illustrate the method of determining the light leakage of the camera module of the device under test based on the difference between the first grayscale mean and the second grayscale mean and the first threshold.

[0057] Figure 3 This is a flowchart illustrating a method for determining light leakage of a camera module of a device under test based on the difference between a first grayscale mean and a second grayscale mean and a first threshold, according to an exemplary embodiment. Figure 3 As shown, the method includes steps S301 and S302.

[0058] In step S301, the average gray value of all pixels in the first grayscale image is determined as the first grayscale average, and the average gray value of all pixels in the second grayscale image is determined as the second grayscale average.

[0059] In step S302, in response to the difference between the first grayscale mean and the second grayscale mean being greater than or equal to the first threshold, it is determined that the camera module is leaking light.

[0060] Figure 4 This is a flowchart illustrating a method for determining light leakage of a camera module of a device under test based on the difference between a first grayscale mean and a second grayscale mean and a first threshold, according to an exemplary embodiment. Figure 4 As shown, the method includes steps S401 and S402.

[0061] In step S401, in response to the difference between the first grayscale mean and the second grayscale mean being less than a first threshold, the first image is divided into multiple first image regions and the second image is divided into multiple second image regions according to the preset length and width dimensions, with the multiple first image regions and multiple second image regions corresponding one-to-one.

[0062] In step S402, the light leakage of the camera module is determined based on the color channel values ​​of multiple first image regions and multiple second image regions.

[0063] In this embodiment, after acquiring the first image and the second image, a preliminary analysis is performed on the first and second images from the perspective of the entire image to determine whether there is light leakage in the camera module: the first image and the second image are converted to grayscale space respectively to obtain a first grayscale image and a second grayscale image; the average grayscale value of all pixels in the first grayscale image (first grayscale average value) is obtained, and the average grayscale value of all pixels in the second image (second grayscale average value) is obtained. The first grayscale average value characterizes the overall image performance of the first image, the second grayscale average value characterizes the overall image performance of the second grayscale image, and the difference between the first grayscale average value and the second grayscale average value characterizes the overall difference between the first image and the second image (corresponding to the difference between the first image and the second image mentioned above). The first threshold in this disclosure is the critical value used to determine whether there is light leakage in the camera module when analyzing from the perspective of the entire image.

[0064] In this embodiment of the present disclosure, when the difference between the first grayscale mean and the second grayscale mean is greater than or equal to the first threshold, it is considered that there is a large difference between the first image obtained with the fill light component turned off and the second image obtained with the fill light component turned on from the overall image angle, and it is determined that there is light leakage in the camera module of the device under test, and further analysis is stopped.

[0065] In this embodiment, when the difference between the first grayscale mean and the second grayscale mean is less than a first threshold, further analysis from the perspective of local images is required. The first and second images are segmented according to the same image segmentation principle (preset length and width dimensions) to obtain multiple first image regions and multiple second image regions that correspond one-to-one. Whether the camera module leaks light is determined by comparing each image individually. Specifically, for each pair of corresponding first and second image regions, local feature comparisons are performed based on the color channel values ​​of the first and second image regions to determine whether the camera module of the device under test leaks light.

[0066] In this embodiment of the disclosure, the camera module of the device under test can acquire images (including a first image and a second image) with different aspect ratios and sizes. Based on this, the image segmentation principle used in this disclosure can be adaptively adjusted according to requirements. In one example, this disclosure divides the first image and the second image into multiple 16*16 image regions respectively.

[0067] It is understood that both the first and second images obtained in this disclosure contain multiple color channels (R, G, B). For each pixel in the image, different color channels will have different color channel values. Based on this, when analyzing the difference between the first and second images from a local perspective, this disclosure needs to consider the differences between different color channel values ​​in each paired region image area. The following embodiments of this disclosure further illustrate the method for determining the light leakage of the camera module of the device under test.

[0068] Figure 5 This is a flowchart illustrating a method for determining light leakage of a camera module of a device under test based on color channel values ​​of a plurality of first image regions and color channel values ​​of a plurality of second image regions, according to an exemplary embodiment. Figure 5 As shown, the method includes steps S501 to S503.

[0069] In step S501, for each of the multiple first image regions, the average color channel value of all pixels in the first image region is obtained for each color channel, and for each of the multiple second image regions, the average color channel value of all pixels in the second image region is obtained for each color channel.

[0070] In step S502, for multiple pairs of corresponding first image regions and second image regions, the difference between the mean values ​​of the corresponding color channels is determined for each color channel, and the maximum difference among the differences corresponding to the multiple color channels is determined as the target difference.

[0071] In step S503, the light leakage of the camera module is determined based on the target difference between multiple pairs of corresponding first and second image regions and the second threshold.

[0072] In this embodiment of the disclosure, for each of the plurality of first image regions, the average color channel value of all pixels in the first image region for each color channel (R, G, B) is obtained. The average value of the multiple color channel values ​​corresponding to the first image region is used to characterize the image performance of the first image region, that is, the image performance of each local part in the first image. Similarly, for each of the plurality of second image regions, the average color channel value of all pixels in the second image region is obtained for each color channel. The average value of the multiple color channel values ​​corresponding to the second image region is used to characterize the image performance of the second image region, that is, the image performance of each local part in the second image.

[0073] In this embodiment of the disclosure, for multiple pairs of corresponding first image regions and second image regions, for each color channel (R, G, B), the difference between the mean values ​​of the corresponding color channels is determined, and the maximum difference among the differences corresponding to the multiple color channels is determined as the target difference. The target difference is used to characterize the degree of difference between the corresponding first image regions and second image regions, that is, to characterize the degree of difference between the first image and the second image locally.

[0074] In this embodiment, if the camera module of the electronic device does not have light leakage, the corresponding local regions (corresponding to the first image region and the second image region) in the first image and the second image should have the same or similar image performance. This disclosure characterizes the local image features of the first image by the average of multiple channel values ​​corresponding to each first image region, and characterizes the local image features of the second image by the average of multiple channel values ​​corresponding to each second image region. The target difference between the first image and the second image in the local image region is characterized by the target difference between each pair of corresponding first image regions and the second image region. If the camera module of the electronic device does not have light leakage, the target difference between each pair of corresponding first image regions and the second image region should be small. Based on this, this disclosure sets a second threshold (a critical value used to determine whether the camera module has light leakage when analyzed from a local perspective). The target difference between each pair of corresponding first image regions and the second image region is compared with the obtained target difference and the second threshold to determine the difference between the first image and the second image in the local image region, and to determine whether the camera module of the device under test has light leakage.

[0075] The following embodiments of this disclosure illustrate the method for determining the light leakage of a camera module of a device under test based on the target difference between multiple pairs of corresponding first and second image regions and a second threshold.

[0076] Figure 6 This is a flowchart illustrating a method for determining light leakage of a camera module of a device under test based on target differences corresponding to multiple pairs of corresponding first and second image regions and a second threshold, according to an exemplary embodiment. Figure 6 As shown, the method includes steps S601, S602A, and S602B.

[0077] In step S601, for multiple pairs of corresponding first image regions and second image regions, the target difference between the mean value of the first channel value and the mean value of the second channel value is determined respectively.

[0078] In step S602A, in response to the fact that the target differences corresponding to multiple pairs of corresponding first image regions and second image regions are all less than the second threshold, it is determined that the camera module does not leak light.

[0079] In step S602B, in response to the existence of a first image region and a second image region with a corresponding target difference greater than or equal to a second threshold among multiple pairs of corresponding first image regions and second image regions, camera module light leakage is determined.

[0080] Among them, steps S602A and S602B are optional steps to be executed.

[0081] In this embodiment of the disclosure, for all corresponding first image regions and second image regions, if the target difference between each pair of corresponding first image regions and second image regions is less than the second threshold, it is considered that the difference between the first image and the second image in each corresponding local region is small, and it is determined that the camera module of the device under test does not have light leakage.

[0082] In this embodiment of the disclosure, for all corresponding first image regions and second image regions, if there are some corresponding first image regions and second image regions whose corresponding target differences are all greater than or equal to the second threshold, it is considered that there is a large difference between the first image and the second image in the corresponding local area, and it is determined that the camera module of the device under test has light leakage.

[0083] The following embodiments further illustrate the device under test in this disclosure.

[0084] In one embodiment of this disclosure, the area outside the device under test, except for the area corresponding to the supplementary lighting component and the lens, is covered by a second preset material, which has the property of shielding light.

[0085] In this embodiment of the disclosure, in order to avoid light leakage from other modules of the electronic device interfering with the test results and causing the test results to deviate from the actual situation, this disclosure covers all modules of the device under test except for the flash lamp with a material that has light-shielding properties when testing the device under test, so as to ensure the accuracy of the test results.

[0086] In this embodiment of the disclosure, the second preset material has light-shielding properties to prevent ambient light from entering the electronic device through gaps or light-transmitting structures outside the device under test. The second preset material can be a material with light-shielding properties, such as black light-absorbing cloth or black light-absorbing plate.

[0087] In this embodiment, all areas of the device under test, except for the area corresponding to the supplementary lighting component, are covered with preset materials (first preset material and second preset material) that have light-shielding properties. Under these conditions, the camera module cannot receive ambient light through its lens, and the gaps on the device surface are also blocked by the preset materials, preventing ambient light from entering the device under test. If the camera module does not leak light, the image obtained by the camera module with the supplementary lighting component on and the image obtained by the camera module with the supplementary lighting component off should have the same image appearance, i.e., a pure black image where the pixel channel value of each pixel is 0. If the camera module has light leakage, when the camera module acquires an image with the supplementary lighting component on, the light emitted from the supplementary lighting component enters the camera module through gaps inside the device, interfering with the photosensitive components within the camera module. This causes some pixels in the acquired image to have non-zero pixel channel values, resulting in different image appearances for the image acquired with the supplementary lighting component on (the second image) and the image acquired with the supplementary lighting component off (the first image). Therefore, this disclosure involves covering all modules of the device under test, except for the supplementary lighting component, with black light-absorbing material. Images are acquired with and without the supplementary lighting component on. By comparing the differences between the images acquired with the flash on and those acquired with the supplementary lighting component off, it is determined whether the camera module of the electronic device has light leakage. In this disclosure, the difference between the first image and the second image is the difference in pixel values ​​between the two images.

[0088] In this embodiment, after pre-blocking all areas of the device under test (DUT) except for the area corresponding to the supplementary lighting component with a preset material, the DUT acquires a first image when the supplementary lighting component is off, and acquires a second image when the supplementary lighting component is on. Based on the difference between the first and second images, it is determined whether the camera module of the DUT is leaking light. This disclosure allows for a direct and definitive determination of whether the camera module is leaking light from its imaging angle, eliminating the need for additional hardware devices and improving detection efficiency.

[0089] It is understandable that electronic devices with shooting capabilities, such as mobile phones and tablets, generally have multiple camera modules, including a main camera and secondary cameras, and can also have multiple fill light components for supplementary lighting. The following embodiments further illustrate the camera modules and fill light components in this disclosure.

[0090] In one embodiment of this disclosure, the camera module and the fill light component are located on the same side of the device under test, and the fill light component is the flash, soft light, or screen of the device under test.

[0091] In this embodiment, camera modules are respectively provided on the screen side and the back panel side of the device under test (DUT), for taking pictures of the DUT in the direction of the back panel side and the direction of the screen side, respectively. For the camera module located on the screen side of the DUT, supplementary lighting is provided by the main screen or a fill light during shooting. When the camera module is located on the same side as the screen of the DUT, the main screen or fill light of the DUT can be used as the supplementary lighting component. For the camera module located on the back panel side of the DUT, supplementary lighting can be provided by a supplementary lighting component located on the back panel side of the DUT during shooting. It is understood that the back panel side of the DUT can be equipped with a flash and a soft light, or a flash integrating both soft light and flash functions. Furthermore, a secondary screen for supplementary lighting can also be provided on the back panel side of the electronic device. Therefore, when the camera module is located on the same side as the back panel of the DUT, the supplementary lighting component of the DUT is the flash, soft light, or secondary screen of the DUT.

[0092] In an exemplary embodiment of this disclosure, when the screen of the device under test (DUT) is used as a supplementary lighting component, light leakage from the camera module on the screen side of the DUT is detected as follows: All areas outside the DUT except the corresponding area of ​​the screen are covered with a black light-absorbing material, and the lens of the camera module is blocked with a special shield to prevent screen light and ambient light from entering the camera module. The screen supplementary lighting is turned on, and a first image is captured through the camera module. The screen is then turned off, and a second image is captured through the camera module. Light leakage from the camera module on the screen side of the DUT is determined based on the difference between the first image and the second image.

[0093] In an exemplary embodiment of this disclosure, for a device under test (DUT) equipped with a soft light and a flash, when the soft light of the DUT is used as a fill light component, the following method is employed to detect whether light leakage occurs in the camera module on the back panel side of the DUT: The exterior of the DUT is shielded with a black light-absorbing material, covering all areas except the area corresponding to the soft light, and the flash of the DUT is turned off. The soft light is turned on to provide fill light, and a first image is captured through the camera module. The soft light is then turned off, and a second image is captured through the camera module. Light leakage is determined based on the difference between the first image and the second image.

[0094] In an exemplary embodiment of this disclosure, for an electronic device equipped with a flash and a soft light, when the flash of the device under test (DUT) is used as a fill light component, the following method is employed to detect whether light leakage occurs in the camera module on the back panel side of the DUT: The exterior of the DUT is shielded with a black light-absorbing material, except for the area corresponding to the flash, and the soft light of the DUT is turned off. A first image is captured by the camera module while the flash is turned on for fill light, and a second image is captured by the camera module while the flash is turned off. Whether light leakage occurs in the camera module on the back panel side of the DUT is determined based on the difference between the first image and the second image.

[0095] The following embodiments illustrate the light emission method of the supplementary lighting component.

[0096] In one embodiment of this disclosure, when the supplementary lighting component is in the on state, the supplementary lighting component emits light at the highest supported brightness.

[0097] Understandably, when the camera module of the device under test does not meet the sealing requirements and light leakage occurs, the greater the intensity of the light leaking into the camera module through the gaps, the greater the impact on the camera module's imaging. Similarly, the smaller the intensity of the light leaking into the camera module through the gaps, the smaller the impact on the camera module's imaging. In this disclosure, after acquiring a first image with the supplementary lighting component in a closed state and a second image with the supplementary lighting component in a closed state, when judging the light leakage of the camera module based on the difference between the first and second images, if the camera module leaks light, the lower the brightness of the light emitted by the supplementary lighting component, the smaller the impact on the second image, and the smaller the difference between the first and second images. When the brightness of the light emitted by the supplementary lighting component is less than a certain brightness value, the difference between the first and second images may be too small, leading to the camera module with light leakage being judged as not leaking light. In summary, to avoid misjudgment caused by insufficient light emitted by the supplementary lighting component, this disclosure ensures that the supplementary lighting component emits light at its maximum supported brightness when acquiring the second image with the supplementary lighting component in the on state, thereby guaranteeing the accuracy of the detection results.

[0098] In an exemplary embodiment of this disclosure, such as Figure 7The flowchart of the device testing method shows that the following approach is used to detect whether the camera module of an electronic device has light leakage: With all modules in the electronic device except the flash covered by a black light-absorbing cloth, the grayscale values ​​of the entire image are calculated for both flash-on (forced flash on) and flash-off modes. The electronic device acquires images (first image and second image) under both flash-on and flash-off conditions, and converts each image into a grayscale image (first grayscale image and second grayscale image). The mean grayscale value of all pixels in each of the two converted grayscale images is calculated (i.e., the overall grayscale value). The grayscale difference between the two images is then calculated, i.e., the difference between the mean grayscale values ​​of the two grayscale images. It is then determined whether the overall grayscale difference is less than a set threshold. If the overall grayscale difference is greater than or equal to the set threshold, the flash test is deemed a failure (FAIL), indicating that the camera module of the electronic device has light leakage. If the overall grayscale difference is less than a set threshold, the two photos (images acquired by the electronic device with the flash forcibly turned on and off) are divided into multiple regions, with each region corresponding to the previous one. The differences in the three color channels within each region of the two photos are calculated, and the maximum difference is taken as the result. Specifically, for each region in both photos, the mean value of each color channel (R, G, B) is calculated, and for each corresponding region in the two photos, the difference between the mean values ​​of this color channel is calculated, with the maximum difference taken as the difference for each corresponding region. The difference across all regions of the entire image is then checked against the set threshold. Specifically, for each corresponding region in the two photos, the difference is checked against the set threshold (a set pixel value threshold), and it is determined whether there are corresponding regions with a difference greater than or equal to the set threshold. If the difference across all regions of the entire image is less than the set threshold, meaning the difference for each corresponding region in the two photos is less than the set threshold, then the flash test passes, indicating that the camera module of the electronic device does not have light leakage. If any difference in the total area of ​​the image exceeds or equals the set threshold, the flash test is deemed to have failed (FAIL), indicating that the camera module of the electronic device is experiencing light leakage.

[0099] In this embodiment, a material with light-shielding properties is used to shield the external area of ​​the electronic device, excluding the area corresponding to the supplementary lighting component. Images (a first image and a second image) are acquired when the supplementary lighting component is on and off, respectively. The first and second images are then converted into a first grayscale image and a second grayscale image, respectively. The average grayscale values ​​of all pixels in the first and second grayscale images (first grayscale average and second grayscale average) are obtained. If the difference between the first and second grayscale averages is greater than or equal to a first threshold, light leakage is considered to exist in the camera module of the device under test. If the difference between the first and second grayscale averages is less than the first threshold, the first and second images are segmented based on preset length and width dimensions to obtain multiple first and second image regions with a one-to-one correspondence. For each color channel of each first and second image region, the average channel value of each color channel within the image region is obtained. For each corresponding first and second image region, the difference between the average channel values ​​of each corresponding channel in the two regions is determined, and the maximum difference is determined as the target difference. For each pair of corresponding first image regions and each second image region, the relationship between the target difference and a preset threshold is determined. If the target differences for multiple pairs of corresponding first and second image regions are all less than the second threshold, it is determined that the camera module of the device under test does not have light leakage. If, among multiple pairs of corresponding first and second image regions, there are corresponding first and second image regions with target differences greater than or equal to the second threshold, it is determined that the camera module of the device under test has light leakage. This disclosure allows for a direct and definitive determination of whether a camera module has light leakage from its imaging angle, eliminating the need for additional hardware devices and improving detection efficiency.

[0100] Based on the same concept, this disclosure also provides a device testing apparatus 100.

[0101] It is understood that the device detection apparatus 100 provided in this disclosure includes hardware structures and / or software modules corresponding to each function in order to achieve the above-mentioned functions. In conjunction with the units and algorithm steps of the various examples disclosed in this disclosure, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of this disclosure.

[0102] Figure 8This is a block diagram illustrating a device testing apparatus 100 according to an exemplary embodiment. (Refer to...) Figure 8 The device includes an acquisition unit 101 and a processing unit 102.

[0103] The acquisition unit 101 is used to acquire a first image captured when the supplementary light component is in the off state, and to acquire a second image captured when the supplementary light component is in the on state.

[0104] The processing unit 102 is used to determine the light leakage of the camera module of the device under test based on the difference between the first image and the second image. The lens of the camera module is blocked by a first preset material. The first preset material has the property of shielding light. The light leakage includes light leakage of the camera module and no light leakage of the camera module. Light leakage of the camera module indicates that the light emitted by the supplementary light component enters the camera module. No light leakage of the camera module indicates that the light emitted by the supplementary light component does not enter the camera module.

[0105] In one embodiment, the processing unit 102 determines the light leakage of the camera module of the device under test based on the difference between the first image and the second image in the following manner: converting the first image to grayscale space to obtain a first grayscale image corresponding to the first image, and converting the second image to grayscale space to obtain a second grayscale image corresponding to the second image; determining the average grayscale value of all pixels in the first grayscale image as the first grayscale average value, and determining the average grayscale value of all pixels in the second grayscale image as the second grayscale average value; determining the light leakage of the camera module based on the difference between the first grayscale average value and the second grayscale average value and a first threshold.

[0106] In one embodiment, the processing unit 102 determines the light leakage of the camera module based on the difference between the first gray-scale mean and the second gray-scale mean and a first threshold in the following manner: in response to the difference between the first gray-scale mean and the second gray-scale mean being greater than or equal to the first threshold, it is determined that the camera module is leaking light.

[0107] In one embodiment, the processing unit 102 determines the light leakage of the camera module based on the difference between the first grayscale mean and the second grayscale mean and a first threshold as follows: In response to the difference between the first grayscale mean and the second grayscale mean being less than the first threshold, the first image is divided into multiple first image regions and the second image is divided into multiple second image regions according to preset length and width dimensions, with the multiple first image regions and multiple second image regions corresponding one-to-one; the light leakage of the camera module is determined based on the color channel values ​​of the multiple first image regions and the color channel values ​​of the multiple second image regions.

[0108] In one embodiment, the processing unit 102 determines the light leakage of the camera module based on the color channel values ​​of multiple first image regions and multiple second image regions in the following manner: for each first image region, the average color channel value of all pixels in the first image region is obtained for each color channel; for each second image region, the average color channel value of all pixels in the second image region is obtained for each color channel; for multiple pairs of corresponding first image regions and second image regions, the difference between the average color channel values ​​of each color channel is determined, and the maximum difference among the differences corresponding to the multiple color channels is determined as the target difference; the light leakage of the camera module is determined based on the target difference corresponding to the multiple pairs of corresponding first image regions and second image regions and a second threshold.

[0109] In one embodiment, the processing unit 102 determines the light leakage of the camera module based on the target differences corresponding to multiple pairs of corresponding first image regions and second image regions and a second threshold in the following manner: in response to the target differences corresponding to multiple pairs of corresponding first image regions and second image regions being less than the second threshold, it is determined that the camera module does not leak light; in response to the existence of first image regions and second image regions in multiple pairs of corresponding first image regions and second image regions with corresponding target differences greater than or equal to the second threshold, it is determined that the camera module leaks light.

[0110] In one embodiment, the area outside the device under test, except for the area corresponding to the supplementary lighting component and the lens, is shielded by a second preset material, which has the property of shielding light.

[0111] In one embodiment, the camera module and the fill light assembly are located on the same side of the device under test, and the fill light assembly is the flash, soft light, or screen of the device under test.

[0112] In one embodiment, when the supplementary lighting component is in the on state, the supplementary lighting component emits light at the highest supported brightness.

[0113] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0114] Figure 9 This is a block diagram illustrating an apparatus 200 for device detection according to an exemplary embodiment. The apparatus 200 can be provided as a terminal. For example, the apparatus 200 can be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0115] Reference Figure 9 The device 200 may include one or more of the following components: processing component 202, memory 204, power component 206, multimedia component 208, audio component 210, input / output (I / O) interface 212, sensor component 214, and communication component 216.

[0116] Processing component 202 typically controls the overall operation of device 200, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 202 may include one or more modules to facilitate interaction between processing component 202 and other components. For example, processing component 202 may include a multimedia module to facilitate interaction between multimedia component 208 and processing component 202.

[0117] Memory 204 is configured to store various types of data to support the operation of device 200. Examples of such data include instructions for any application or method operating on device 200, contact data, phonebook data, messages, pictures, videos, etc. Memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0118] The power supply component 206 provides power to the various components of the device 200. The power supply component 206 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 200.

[0119] Multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 208 includes a front-facing camera and / or a rear-facing camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0120] Audio component 210 is configured to output and / or input audio signals. For example, audio component 210 includes a microphone (MIC) configured to receive external audio signals when device 200 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 204 or transmitted via communication component 216. In some embodiments, audio component 210 also includes a speaker for outputting audio signals.

[0121] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0122] Sensor assembly 214 includes one or more sensors for providing status assessments of various aspects of device 200. For example, sensor assembly 214 may detect the on / off state of device 200, the relative positioning of components such as the display and keypad of device 200, changes in the position of device 200 or a component of device 200, the presence or absence of user contact with device 200, the orientation or acceleration / deceleration of device 200, and temperature changes of device 200. Sensor assembly 214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 214 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0123] Communication component 216 is configured to facilitate wired or wireless communication between device 200 and other devices. Device 200 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 216 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 216 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0124] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0125] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, which can be executed by a processor 220 of the device 200 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0126] It is understood that in this disclosure, "multiple" refers to two or more, and other quantifiers are similar. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. The singular forms "a," "the," and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.

[0127] It is further understood that the terms "first," "second," etc., are used to describe various types of information, but this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another, and do not indicate a specific order or degree of importance. In fact, the expressions "first," "second," etc., are completely interchangeable. For example, without departing from the scope of this disclosure, first information can also be referred to as second information, and similarly, second information can also be referred to as first information.

[0128] It is further understood that the terms “center,” “longitudinal,” “lateral,” “front,” “rear,” “up,” “down,” “left,” “right,” “vertical,” “horizontal,” “top,” “bottom,” “inner,” and “outer,” etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this embodiment and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation.

[0129] It can be further understood that, unless otherwise specified, "connection" includes both direct connections where no other components exist between the two parties and indirect connections where other components exist between them.

[0130] It is further understood that although operations are described in a specific order in the accompanying drawings in the embodiments of this disclosure, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all of the shown operations to be performed to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.

[0131] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.

[0132] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A device detection method, characterized by, The method comprises: acquiring a first image collected when the light supplementing assembly is in a closed state, and acquiring a second image collected when the light supplementing assembly is in an open state; determining a light leakage condition of a camera module of the device under test according to a difference between the first image and the second image, a lens of the camera module being shielded by a first preset material having a light shielding property, the light leakage condition including camera module light leakage and camera module no light leakage, the camera module light leakage indicating that the light emitted by the light supplementing assembly enters the camera module, and the camera module no light leakage indicating that the light emitted by the light supplementing assembly does not enter the camera module.

2. The method of claim 1, wherein, The determining of the light leakage condition of the camera module of the device under test according to the difference between the first image and the second image comprises: converting the first image to a gray space to obtain a first gray image corresponding to the first image, and converting the second image to a gray space to obtain a second gray image corresponding to the second image; determining a first gray mean value of the mean value of the gray values of all pixels in the first gray image, and determining a second gray mean value of the mean value of the gray values of all pixels in the second gray image; determining the light leakage condition of the camera module according to the difference between the first gray mean value and the second gray mean value and a first threshold value.

3. The method of claim 2, wherein, The determining of the light leakage condition of the camera module according to the difference between the first gray mean value and the second gray mean value and the first threshold value comprises: in response to the difference between the first gray mean value and the second gray mean value being greater than or equal to the first threshold value, determining that the camera module leaks light.

4. The method of claim 2, wherein, The determining of the light leakage condition of the camera module according to the difference between the first gray mean value and the second gray mean value and the first threshold value comprises: in response to the difference between the first gray mean value and the second gray mean value being less than the first threshold value, dividing the first image into a plurality of first image regions and dividing the second image into a plurality of second image regions according to a preset length-width size, the plurality of first image regions and the plurality of second image regions corresponding to each other in a one-to-one manner; determining the light leakage condition of the camera module according to the color channel values of the plurality of first image regions and the color channel values of the plurality of second image regions.

5. The method of claim 4, wherein, The determining of the light leakage condition of the camera module according to the color channel values of the plurality of first image regions and the color channel values of the plurality of second image regions comprises: for each first image region in the plurality of first image regions, acquiring a mean value of the color channel values of all pixels in the first image region for each color channel, and for each second image region in the plurality of second image regions, acquiring a mean value of the color channel values of all pixels in the second image region for each color channel; for each color channel, determining a difference between the corresponding mean values of the color channel values for each pair of first image region and second image region corresponding to each other, and determining a maximum difference value among the differences corresponding to the plurality of color channels as a target difference value. According to the target difference corresponding to the plurality of pairs of corresponding first image regions and second image regions and the second threshold, the light leakage of the camera module is determined.

6. The method of claim 5, wherein, The light leakage of the camera module is determined according to the target difference corresponding to the plurality of pairs of corresponding first image regions and second image regions and the second threshold, comprising: In response to the target difference corresponding to the plurality of pairs of corresponding first image regions and second image regions being less than the second threshold, it is determined that the camera module does not leak light; In response to the target difference corresponding to the plurality of pairs of corresponding first image regions and second image regions being greater than or equal to the second threshold, it is determined that the camera module leaks light.

7. The method according to any one of claims 1 to 6, characterized in that, The area outside the camera module and the lens corresponding area of the to-be-tested device is shielded by a second preset material, and the second preset material has a light shielding property.

8. The method of claim 1, wherein, The camera module and the light supplement assembly are on the same side of the to-be-tested device, and the light supplement assembly is a flash or a soft light or a screen of the to-be-tested device.

9. The method of any one of claims 1 or 8, wherein, When the light supplement assembly is in an open state, the light supplement assembly emits light at the highest brightness supported.

10. A device detection apparatus, characterized by: Comprising: An acquisition unit is configured to acquire a first image collected when a light supplement assembly is in a closed state, and acquire a second image collected when the light supplement assembly is in an open state; A processing unit is configured to determine a light leakage of a camera module of a to-be-tested device according to a difference between the first image and the second image, wherein a lens of the camera module is shielded by a first preset material, the first preset material has a light shielding property, the light leakage includes camera module light leakage and camera module no light leakage, the camera module light leakage indicates that the light emitted by the light supplement assembly enters the camera module, and the camera module no light leakage indicates that the light emitted by the light supplement assembly does not enter the camera module.

11. An electronic device, comprising: Comprising: A processor: A memory for storing processor-executable instructions; The processor is configured to execute the device detection method of any one of claims 1 to 9.

12. A storage medium, characterized by The storage medium stores instructions, and when the instructions in the storage medium are executed by the processor, the processor can execute the device detection method of any one of claims 1 to 9.