System and method capable of simultaneously detecting black spots of camera and light supplement lamp
By using a dark box and image processing algorithm to synchronously detect camera black spots and fill light, the problems of low efficiency and unstable accuracy of manual visual inspection are solved, and efficient and stable automated inspection is achieved.
Patent Information
- Application Number
- CN202510890377.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-19
AI Technical Summary
In the existing camera production process, the detection of sensor bad points and fill light status relies on manual visual inspection, resulting in low detection efficiency, unstable accuracy and high missed detection rate.
A system and method are designed to realize the automatic and synchronous detection of camera black spots and fill lights by using a dark box, a light source module, a transparent glass component and an image processing algorithm. Combined with manual confirmation, it reduces the missed detection rate and improves the detection efficiency and accuracy.
It realizes the synchronous automatic detection of camera black spots and fill lights, reduces the missed detection rate, improves the detection efficiency and stability, reduces the false positive rate, and ensures that the detection results are not affected by ambient light.
Smart Images

Figure CN120676137A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer vision and optical detection, and in particular to a system and method for simultaneously detecting camera black spots and fill lights. Background Art
[0002] As the demand for social security and intelligent surveillance continues to expand, cameras, as core visual perception devices, face higher standards for production quality control. During the camera manufacturing process, "black spot" defects caused by sensor failure, lens stains, and other factors, as well as the proper functioning of the fill light, are key indicators affecting image quality and nighttime surveillance effectiveness.
[0003] The current mainstream inspection solution in the industry still relies on manual visual inspection, which relies on operators observing camera images or the illumination of fill lights with their naked eyes. This method has the advantage of being able to adapt to varying product specifications and handle complex module anomalies. However, it also has limitations such as limited inspection efficiency and the human eye's susceptibility to fatigue, resulting in unstable inspection accuracy. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a system and method for simultaneously detecting camera black spots and fill light, thereby reducing the missed detection rate and improving detection efficiency, accuracy and stability.
[0005] The technical solution adopted by the present invention to solve the above technical problems is: In one aspect, the present invention provides a system for simultaneously detecting camera black spots and fill lights, comprising: Dark box, used to create a light-proof detection environment, with light-absorbing materials set on the inner wall; The light source module is installed in the dark box and can control the switch and brightness to provide the detection light source; The transparent glass component is set inside the dark box and located in front of the light source module, with adjustable angle and position; The camera to be tested is placed in a dark box during testing, with its lens facing the transparent glass component, for receiving light transmitted through or reflected from the transparent glass and generating image data; Parameter configuration module, which stores detection parameters and is used to provide control parameters for black spot detection and fill light detection to the image acquisition and processing module; An image acquisition and processing module is electrically connected to the camera under test and is used to control the exposure time of the camera under test and the switch / brightness of the light source module based on the parameters of the parameter configuration module; and to acquire images returned by the camera under test and analyze defects; The human-computer interaction module communicates with the image acquisition and processing module to display the test result image, receive manual confirmation instructions, and record product information and test data.
[0006] Furthermore, the dark box adopts a modular frame design, the inner wall of which is covered with a multi-layer light-absorbing material of black non-woven fabric and matte coating, and heat dissipation holes and dust filter are set on the top.
[0007] Furthermore, the light source module, the transparent glass assembly and the camera to be tested are arranged in a straight light path in the dark box, and the distance between the lens and the light source is adjusted according to the depth of field and the field angle of the camera.
[0008] Furthermore, the light source module includes an LED surface light source lamp board with remotely controlled switch and brightness, and a diffusion plate with an anti-glare coating is installed on the surface of the lamp board.
[0009] Furthermore, the thickness of the transparent glass component is 3 mm, the transmittance is ≥91%, the reflectivity is ≥85%, and the angle and front and rear position can be adjusted by a vertical fixture with a step accuracy of 1 cm.
[0010] On the other hand, based on the above system, the present invention also provides a method for simultaneously detecting camera black spots and fill lights, comprising the following steps: S1. Initialize detection parameters: store black spot detection parameters and fill light detection parameters through the parameter configuration module; The black spot detection parameters include: flat field image template, adaptive threshold block size, background interference constant and defect area critical value; the fill light detection parameters include: exposure threshold, brightness threshold and contour area threshold; S2. Camera image acquisition and defect detection: Black spot detection steps: Control the light source module to emit light at maximum brightness, project uniform light through the glass to the camera, and set the camera exposure time so that the image grayscale value is in the range of 100-255; Acquire images and perform flat-field correction using a flat-field image template; The image is divided into small blocks according to the adaptive threshold block size, the window size is set according to the background interference constant, the background is extracted by local mean filtering, and the black area whose area is not within the critical value range is extracted using the contour detection algorithm, and the black point defects are marked; Fill light detection steps: Turn off the ambient light, set the camera exposure time to 1ms, and only turn on the fill light; The image of the reflected light of the fill light on the glass is collected, and the global threshold algorithm is used to set the brightness threshold to 100 to segment the fill light cluster area; The noise is eliminated by the opening operation of first erosion and then expansion, and the internal holes of the light group are filled by the closing operation of first expansion and then erosion. The contour detection algorithm is used to extract the contour and filter out the contours whose area is not within the threshold range to determine whether the fill light is working properly. S3. Manual confirmation and marking of test results: The image acquisition and processing module transmits the original image and the marked image to the human-computer interaction module for display, and the test results are manually compared and confirmed; S4. Record the product serial number, test type, and corresponding test results of this test through the human-computer interaction module, and save the storage paths of the original image and the processed image to form a traceable test data archive.
[0011] The beneficial effects of the present invention are: (1) Synchronous detection mechanism: By utilizing the light transmission and reflection characteristics of glass, black spot and fill light detection can be completed simultaneously at the same workstation. Compared with the traditional manual visual inspection mode that requires step-by-step detection, it can greatly improve the detection efficiency.
[0012] (2) Automated process drive: Automatically perform inspections through parameter configuration and image algorithms to avoid fluctuations in inspection speed due to experience differences during manual visual inspections, achieve streamlined standardized operations, and improve inspection efficiency and stability.
[0013] (3) Reduce missed detection and false detection rates: Black spot detection can identify subtle defects through flat field correction, local mean filtering and contour area quantification, which reduces the missed detection rate compared to manual visual inspection; fill light detection can quantify the integrity of light cluster contours through threshold segmentation and morphological operations, reducing the false detection rate.
[0014] (4) Environmental interference suppression: All detection operations are carried out in a dark box. The multi-layer light-absorbing material on the inner wall of the dark box combined with the anti-glare light source can eliminate the interference of ambient light reflection, ensure that the detection results are not affected by external lighting changes, and greatly improve the detection stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 Schematic diagram of the framework for simultaneously detecting camera black spots and fill light in the present invention. DETAILED DESCRIPTION
[0016] This invention aims to provide a system and method for simultaneously detecting camera black spots and fill light, reducing missed detection rates and improving detection efficiency, accuracy, and stability. Its core concept is to utilize the light-transmitting and light-reflecting properties of glass during camera production testing. By configuring darkroom fixtures and detection threshold parameters at the same workstation, the system controls the light panel switch and camera exposure time, reads and analyzes the image information returned by the camera, and simultaneously completes automated detection of camera black spots (sensor failures or lens stains) and the normal working state of the fill light. This is combined with manual image verification and data recording of the test results to reduce product false detection and missed detection rates and improve production efficiency. The detection framework is described in [1]. Figure 1 .
[0017] Example: This embodiment first provides a system that can simultaneously detect camera black spots and fill lights. The system includes the following parts: A dark box, used to create a light-proof testing environment, features light-absorbing material on its inner walls. In one exemplary embodiment, the dark box utilizes a modular frame design for easy disassembly and maintenance, with internal dimensions of 800mm × 700mm × 500mm (length × width × height). Cooling vents and a dust filter are included on the top to ensure long-term operational stability. The inner walls are covered with multiple layers of light-absorbing material, including black non-woven fabric with a matte coating, to eliminate interference from ambient light reflections.
[0018] The light source module is installed in the dark box, which can control the switch and brightness and is used to provide the detection light source. In an exemplary embodiment, the light source module adopts a high-uniformity LED surface light source lamp board, which can remotely control the switch and brightness (brightness range: 0-5000cd / m²) through the serial port. A diffuser plate with an anti-glare coating is installed on the surface of the lamp board to eliminate light spots and reduce glare.
[0019] The transparent glass assembly is arranged inside the dark box and in front of the light source module, with adjustable angle and position. In an exemplary embodiment, the specific parameters of the transparent glass are thickness 3mm, transmittance ≥91%, reflectivity ≥85%, and a clean and smooth surface. It is installed with a vertical fixture, with adjustable angle (0-45°), movable back and forth, and step accuracy (1cm). The optimal reflection efficiency is determined through reflection experiments to avoid distortion of the fill light spot caused by mirror reflection.
[0020] During testing, the camera under test is placed in a darkroom, with its lens facing the transparent glass assembly, for receiving light transmitted through or reflected from the transparent glass and generating image data. In an exemplary embodiment, the entire testing process is performed in a darkroom environment. A light-emitting panel is placed at the rear of the darkroom, with glass in front of the panel. The lens of the camera under test faces the plane of the transparent glass and the light-emitting panel, and the entire process is calibrated in a linear manner. The lens-light source distance is adjusted according to the camera's depth of field (DOF) and field of view (FOV).
[0021] The parameter configuration module stores detection parameters and is used to provide control parameters for black spot detection and fill light detection to the image acquisition and processing module.
[0022] The image acquisition and processing module is electrically connected to the camera to be tested and is used to control the exposure time of the camera to be tested and the switch / brightness of the light source module based on the parameters of the parameter configuration module; and to collect images returned by the camera to be tested and analyze defects.
[0023] The human-computer interaction module communicates with the image acquisition and processing module to display the test result image, receive manual confirmation instructions, and record product information and test data.
[0024] Based on the above system, when performing black dot and fill light tests on the camera to be tested, the following execution process is included: 1. Parameter configuration: (1) The specific parameter configuration of black spot detection is as follows: { flat_field_image: numpy.ndarray, block_size: int, C: int, critical_area: tuple } The parameters are explained as follows: flat_field_image: Use a certified defect-free camera module to collect 10 sets of flat-field images in transmission mode and use the median filter results as the reference template.
[0025] block_size: Adaptive threshold segmentation is used for the target image block size. A larger value will miss some black spot defects, while a smaller value will capture more noise. Test different cameras to adjust the parameter.
[0026] C: Constant C is used to eliminate background interference in the image. A too large value will remove black dot defects, while a too small value will capture more noise. Adjust the value according to the test environment and test equipment.
[0027] critical_area: The critical area value for quantifying defect features. The areas marked within this area are defined as black dots. The calculation method is: cv2.contourArea(contour).
[0028] (2) The specific configuration of abnormal detection of fill light is as follows: { exposure_time: int, brightness_threshold: int, contour_area: int, } The parameters are explained as follows: exposure_time: Exposure time setting, used to adjust image brightness.
[0029] brightness_threshold: Brightness threshold used to distinguish foreground from background.
[0030] contour_area: Contour area threshold, used to filter out small irrelevant contours.
[0031] 2. Camera image acquisition and defect detection: (1) Detection of camera black spots: Set the exposure time of the camera under test to the standard exposure mode (such as experimental values or automatically calculated using a preset algorithm). Ensure that the image brightness is within the grayscale range of 100-255 (8-bit image) and that the brightness of the light-emitting board appears as a uniform gray-white in the image (average brightness value ≥ 200). Avoid loss of detail due to overexposure or underexposure.
[0032] The light-emitting panel (brightness 5000cd / m²) projects light toward the camera through high-transmittance glass (transmittance ≥91%), utilizing the glass's uniform light transmission properties to ensure distortion-free light spot distribution.
[0033] The camera lens faces the glass plane, and by adjusting the distance between the lens and the glass (according to the depth of field DOF setting), ensure that the imaging area covers the entire light-emitting board screen (accounting for more than 80% of the image width).
[0034] The image is collected by a camera, and the original image is flat-field corrected using the defect-free standard image flat_field_image to eliminate illumination unevenness.
[0035] The corrected image is divided into small blocks of block_size×block_size (e.g., block_size=32), and the background value is extracted through local mean filtering (window size = C, e.g., C=10) to eliminate background interference.
[0036] Through cv2.findContours contour extraction, the black area outside the critical_area range is filtered out and the results are marked and output.
[0037] (2) Check whether the camera fill light is working properly: The camera under test sets the exposure time (exposure_time=1ms) and turns off the ambient light.
[0038] Turn on only the camera's fill light, making the entire image dark (average brightness value ≤ 50), ensuring that only the light reflected from the fill light on the glass is captured.
[0039] The image is captured by the camera and the global threshold algorithm (brightness_threshold=100) is applied to segment the image into the fill light area and the dark background.
[0040] Use the opening operation to erode first and then expand to eliminate small area noise, and use the closing operation to expand first and then erode to fill the internal holes of the light group to ensure the integrity of the outline.
[0041] Through cv2.findContours contour extraction, the black area outside the contour_area range is filtered out and the result is judged and output.
[0042] 3. Combined labeling of image results with manual confirmation: To prevent overkill, where some products that are actually fine are judged to have defects, resulting in unnecessary rework or scrap and increased production costs, manual comparison and confirmation of the original image returned to the display screen and the image with the processed marks is required. Continuous monitoring of the performance of this method can effectively detect real defects and minimize false alarms.
[0043] 4. Test result record: The test results are recorded and saved, including the specific sequence of the current product, such as the SN, the test type (camera black spot or fill light), the test results and failure information, the returned original image, and the image path of the processed mark.
[0044] Although the embodiments of the present invention have been described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations may be made to these embodiments without departing from the principles and spirit of the present invention, all without departing from the scope of protection of the present invention.
Claims
1. A system capable of simultaneously detecting camera black spots and fill light, characterized in that: include: Dark box, used to create a light-proof detection environment, with light-absorbing materials set on the inner wall; The light source module is installed in the dark box and can control the switch and brightness to provide the detection light source; The transparent glass component is set inside the dark box and located in front of the light source module, with adjustable angle and position; The camera to be tested is placed in a dark box during testing, with its lens facing the transparent glass component, for receiving light transmitted through or reflected from the transparent glass and generating image data; Parameter configuration module, which stores detection parameters and is used to provide control parameters for black spot detection and fill light detection to the image acquisition and processing module; An image acquisition and processing module is electrically connected to the camera under test and is used to control the exposure time of the camera under test and the switch / brightness of the light source module based on the parameters of the parameter configuration module; and to acquire images returned by the camera under test and analyze defects; The human-computer interaction module communicates with the image acquisition and processing module to display the test result image, receive manual confirmation instructions, and record product information and test data.
2. A system capable of simultaneously detecting camera black spots and fill light according to claim 1, characterized in that: The dark box adopts a modular frame design, the inner wall of which is covered with a multi-layer light-absorbing material of black non-woven fabric and matte coating, and heat dissipation holes and dust filter are set on the top.
3. The system for simultaneously detecting camera black spots and fill light according to claim 1, wherein: The light source module, the transparent glass component and the camera to be tested are arranged in a dark box according to a straight light path, and the distance between the lens and the light source is adjusted according to the depth of field and the field angle of the camera.
4. The system for simultaneously detecting camera black spots and fill light according to claim 1, wherein: The light source module includes an LED surface light source lamp board with remote control switch and brightness, and a diffusion plate with anti-glare coating is installed on the surface of the lamp board.
5. The system for simultaneously detecting camera black spots and fill light according to claim 1, wherein: The transparent glass component has a thickness of 3 mm, a transmittance of ≥91%, and a reflectivity of ≥85%. The angle and front and rear position can be adjusted by a vertical fixture, and the step accuracy is 1 cm.
6. A method for simultaneously detecting camera black spots and fill light, applied to the system for simultaneously detecting camera black spots and fill light according to any one of claims 1 to 5, characterized in that: The method comprises the following steps: S1. Initialize detection parameters: store black spot detection parameters and fill light detection parameters through the parameter configuration module; The black spot detection parameters include: flat field image template, adaptive threshold block size, background interference constant and defect area critical value; the fill light detection parameters include: exposure threshold, brightness threshold and contour area threshold; S2. Camera image acquisition and defect detection: Black spot detection steps: Control the light source module to emit light at maximum brightness, project uniform light through the glass to the camera, and set the camera exposure time so that the image grayscale value is in the range of 100-255; Acquire images and perform flat-field correction using a flat-field image template; The image is divided into small blocks according to the adaptive threshold block size, the window size is set according to the background interference constant, the background is extracted by local mean filtering, and the black area whose area is not within the critical value range is extracted using the contour detection algorithm, and the black point defects are marked; Fill light detection steps: Turn off the ambient light, set the camera exposure time to 1ms, and only turn on the fill light; The image of the reflected light of the fill light on the glass is collected, and the global threshold algorithm is used to set the brightness threshold to 100 to segment the fill light cluster area; The noise is eliminated by the opening operation of first erosion and then expansion, and the internal holes of the light group are filled by the closing operation of first expansion and then erosion. The contour detection algorithm is used to extract the contour and filter out the contours whose area is not within the threshold range to determine whether the fill light is working properly. S3. Manual confirmation and marking of test results: The image acquisition and processing module transmits the original image and the marked image to the human-computer interaction module for display, and the test results are manually compared and confirmed; S4. Record the product serial number, test type, and corresponding test results of this test through the human-computer interaction module, and save the storage paths of the original image and the processed image to form a traceable test data archive.