Dynamic light source adjustment method, system, and medium based on environmental perception
By sensing ambient light in real time and constructing a reflective modeling network, the LED light source is dynamically adjusted, solving the problems of imaging quality and recognition accuracy of traditional light source systems in complex lighting environments, and achieving efficient light source adjustment and target recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU HUICUI INTELLIGENT TECH CO LTD
- Filing Date
- 2026-03-23
- Publication Date
- 2026-08-04
AI Technical Summary
Traditional fixed light source systems cannot adapt to changing external lighting environments, resulting in a decline in the imaging quality and recognition accuracy of the vision system. They also cannot achieve real-time, dynamic light source adjustment and wavelength control, nor can they optimize lighting strategies by combining the reflective characteristics of the target.
By sensing the ambient light intensity and spectral distribution in real time, a reflective modeling network is constructed to analyze the surface reflection characteristics of the object under test, generate the optimal illumination spectrum, and dynamically adjust the light source environment of the LED array. Combined with deep learning, the illumination strategy is optimized to improve imaging contrast and recognition effect.
It achieves highly sensitive environmental perception, target material perception, and high-dimensional lighting control under complex lighting conditions, improving imaging contrast and recognition accuracy, and adapting to complex and ever-changing production environments.
Smart Images

Figure CN121888451B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of light source adjustment technology, and more specifically, to a dynamic light source adjustment method, system, and medium based on environmental perception. Background Technology
[0002] With the rapid development of artificial intelligence and sensing technologies, modern industrial and robotic systems are increasingly demanding environmental perception and optical control. Particularly in applications such as high-speed production line visual inspection, intelligent mobile robot navigation, and precision medical image acquisition, fluctuations in ambient light directly affect the imaging quality and recognition accuracy of vision systems. Traditional fixed-light-source lighting systems struggle to adapt to changing external lighting environments, thus reducing the overall system's reliability and practicality. Therefore, dynamically adjustable light source systems, especially those capable of responding to environmental changes and incorporating intelligent algorithms for adaptive control, have become a key frontier in optoelectronic sensing technology research.
[0003] Most mainstream lighting systems on the market today rely on passive light-sensing strategies, which use simple photosensitive devices (such as photodiodes or photoresistors) to provide feedback on the current illuminance and then make coarse adjustments using a preset luminance mapping table. These systems have the following main drawbacks: (1) strong feedback lag, which cannot meet the needs of high-frequency dynamic adjustment; (2) lack of ability to analyze and control the incident spectrum distribution, which makes it impossible to achieve wavelength-level adjustment; (3) lack of ability to model the reflective properties of the target, which makes it impossible to optimize the lighting strategy by combining the material and surface properties of the target object.
[0004] For example, in the detection of surface defects in metal parts on high-speed production lines, the surface reflectivity can change drastically with angle and incident light wavelength, while instantaneous fluctuations in ambient light can lead to decreased imaging contrast, thus inducing missed or false detections. In outdoor robot vision, changes in natural light at different times of day (such as dawn, dusk, and cloudy days) significantly affect the recognition accuracy of machine vision modules. Therefore, an intelligent light source system with real-time perception, dynamic adjustment, wavelength control, and reflectivity modeling capabilities is needed to accurately match target detection requirements with changing ambient light trends. Summary of the Invention
[0005] The purpose of this application is to provide a dynamic light source adjustment method, system, and medium based on environmental perception. By sensing the ambient light intensity and spectral distribution in real time and combining it with depth modeling of the reflective properties of the surface of the object being measured, the intensity and wavelength distribution of the lighting source are dynamically adjusted to maximize imaging contrast and recognition effect.
[0006] This application also provides a dynamic light source adjustment method based on environmental perception, including:
[0007] Set the sampling frequency, collect ambient light intensity and spectral data in real time based on the sampling frequency, and acquire target images based on industrial cameras;
[0008] A reflectivity modeling network is constructed, the target image is input into the reflectivity modeling network, and the reflectivity analysis of the object under test is performed based on the reflectivity modeling network to obtain the reflectivity characteristics of the object surface to different wavelengths.
[0009] The illumination strategy network analyzes the reflection characteristics of the surface of the object under test to different wavelengths and outputs the illumination strategy.
[0010] The optimal lighting spectrum is generated based on the lighting strategy, and the light source environment is obtained by driving the LED array to output according to the optimal lighting spectrum.
[0011] The system acquires new images of the object under test based on the light source environment, analyzes the contrast of the object image, and dynamically adjusts the ambient light intensity and wavelength distribution based on the set contrast threshold.
[0012] Optionally, in the dynamic light source adjustment method based on environmental perception described in the embodiments of this application, the real-time acquisition of ambient light intensity and spectral data based on the sampling frequency specifically includes:
[0013] Let the spectral distribution function of ambient light be... ;
[0014] in, Wavelength of light, measured in nm;
[0015] : Time variable, representing the system's running time;
[0016] At any moment Below, wavelength The ambient incident light intensity at the location is expressed in W / m². 2 ;
[0017] The environmental spectral signal is acquired in real time, and the spectral data is obtained by discrete sampling of each channel using a spectral sensor, as shown in the following formula:
[0018] ;
[0019] in, For the first The center wavelength of each spectral channel.
[0020] Optionally, in the dynamic light source adjustment method based on environmental perception described in the embodiments of this application, a reflectivity modeling network is constructed, the target image is input into the reflectivity modeling network, and reflectivity analysis of the object under test is performed based on the reflectivity modeling network to obtain the reflectivity characteristics of the object surface to different wavelengths, specifically including:
[0021] Let the reflectance function of the object being measured at each wavelength be:
[0022]
[0023] Reflectivity is defined as the ratio of the energy reflected by an object's surface to the incident energy of light of a certain wavelength, and its range is... ;
[0024] A neural network model is introduced for nonlinear mapping learning, defined as follows:
[0025] ;
[0026] in,
[0027] : indicates that the parameter Controlled neural network mapping function;
[0028] Current image information from the camera;
[0029] The output is the target area at wavelength The estimated reflectance value under the following conditions;
[0030] The network training objective is to minimize the following loss function:
[0031] .
[0032] Optionally, in the dynamic light source adjustment method based on environmental perception described in the embodiments of this application, the regional contrast is defined as:
[0033] ;
[0034] in, and These represent the grayscale integrals of the target and background regions, respectively.
[0035] Define the optimization objective function as follows:
[0036] subject to: ;
[0037] in, This is the maximum lighting power allowed by the system;
[0038] Indicates time Under these conditions, the lighting source actively controlled by the system has a wavelength of Spectral intensity distribution at;
[0039] Indicates time Below, the contrast between the target area and the background area in the image;
[0040] This indicates the point in time when the system was running.
[0041] Optionally, in the dynamic light source adjustment method based on environmental perception described in the embodiments of this application, the illumination strategy is output based on the analysis of the reflection characteristics of the surface of the object under test to different wavelengths using an illumination strategy network, specifically including:
[0042] Let the optimization variable be the discrete wavelength illumination vector:
[0043] ;
[0044] Discretize the objective function as follows:
[0045] ;
[0046] Assume the lighting strategy is a learnable function:
[0047] ;
[0048] in, This represents a deep neural network used to predict the optimal lighting distribution, with parameters... The inputs include the current ambient spectrum, camera image features, and the target reflectance prediction function. ;
[0049] The network training objective is to minimize the following negative contrast loss:
[0050] ;
[0051] in The weight of the power constraint penalty term.
[0052] Secondly, embodiments of this application provide a dynamic light source adjustment system based on environmental perception. The system includes a memory and a processor. The memory includes a program for a dynamic light source adjustment method based on environmental perception. When the program for the dynamic light source adjustment method based on environmental perception is executed by the processor, it implements the following steps:
[0053] Set the sampling frequency, collect ambient light intensity and spectral data in real time based on the sampling frequency, and acquire target images based on industrial cameras;
[0054] A reflectivity modeling network is constructed, the target image is input into the reflectivity modeling network, and the reflectivity analysis of the object under test is performed based on the reflectivity modeling network to obtain the reflectivity characteristics of the object surface to different wavelengths.
[0055] The illumination strategy network analyzes the reflection characteristics of the surface of the object under test to different wavelengths and outputs the illumination strategy.
[0056] The optimal lighting spectrum is generated based on the lighting strategy, and the light source environment is obtained by driving the LED array to output according to the optimal lighting spectrum.
[0057] The system acquires new images of the object under test based on the light source environment, analyzes the contrast of the object image, and dynamically adjusts the ambient light intensity and wavelength distribution based on the set contrast threshold.
[0058] Optionally, in the dynamic light source adjustment system based on environmental perception described in the embodiments of this application, the ambient light intensity and spectral data are collected in real time based on the sampling frequency, specifically including:
[0059] Let the spectral distribution function of ambient light be... ;
[0060] in, Wavelength of light, measured in nm;
[0061] : Time variable, representing the system's running time;
[0062] At any moment Below, wavelength The ambient incident light intensity at the location is expressed in W / m². 2 ;
[0063] The environmental spectral signal is acquired in real time, and the spectral data is obtained by discrete sampling of each channel using a spectral sensor, as shown in the following formula:
[0064] ;
[0065] in, For the first The center wavelength of each spectral channel.
[0066] Optionally, in the dynamic light source adjustment system based on environmental perception described in this application embodiment, a reflectivity modeling network is constructed. The target image is input into the reflectivity modeling network, and the reflectivity analysis of the object under test is performed based on the reflectivity modeling network to obtain the reflectivity characteristics of the object's surface to different wavelengths. Specifically, this includes:
[0067] Let the reflectance function of the object being measured at each wavelength be:
[0068] ;
[0069] Reflectivity is defined as the ratio of the energy reflected by an object's surface to the incident energy of light of a certain wavelength, and its range is... ;
[0070] A neural network model is introduced for nonlinear mapping learning, defined as follows:
[0071] ;
[0072] in,
[0073] : indicates that the parameter Controlled neural network mapping function;
[0074] Current image information from the camera;
[0075] The output is the target area at wavelength The estimated reflectance value under the following conditions;
[0076] The network training objective is to minimize the following loss function:
[0077] ;
[0078] The loss function of a reflectivity modeling network represents the difference between the network's predictions and the actual values.
[0079] Wavelength of light, measured in nanometers (nm), indicates the wavelength at which the calculation is performed.
[0080] Ground truth reflectance represents the reflectance of the measured object at a wavelength of [wavelength value missing]. The actual reflectivity is obtained by measuring with calibrated equipment (such as a standard reflector).
[0081] The reflectance predicted by the neural network, representing the reflectance modeling network based on the input image. Predicted at wavelength The reflectance value below.
[0082] : indicates that the parameter Controlled neural network mapping function.
[0083] Image information currently captured by the camera.
[0084] For all wavelengths considered Summation represents the total error across multiple wavelengths.
[0085] Thirdly, embodiments of this application also provide a computer-readable storage medium, which includes a dynamic light source adjustment method program based on environment perception. When the dynamic light source adjustment method program based on environment perception is executed by a processor, it implements the steps of the dynamic light source adjustment method based on environment perception as described in any of the above claims.
[0086] As can be seen from the above, the dynamic light source adjustment method, system, and medium based on environmental perception provided in this application embodiment, by setting a sampling frequency, collects ambient light intensity and spectral data in real time based on the sampling frequency, and acquires target images based on an industrial camera; constructs a reflectivity modeling network, inputs the target image into the reflectivity modeling network, performs reflectivity analysis on the object under test based on the reflectivity modeling network, and obtains the reflectivity characteristics of the object surface to different wavelengths; analyzes the reflectivity characteristics of the object surface to different wavelengths based on an illumination strategy network, and outputs an illumination strategy; generates an optimal illumination spectrum based on the illumination strategy, and outputs the light source environment based on the optimal illumination spectrum driven LED array; acquires new images of the object under test based on the light source environment, analyzes the contrast of the object image, and dynamically adjusts the ambient light intensity and wavelength distribution based on a set contrast threshold; by sensing the ambient light intensity and spectral distribution in real time, and combining it with depth modeling of the reflectivity characteristics of the object surface, the intensity and wavelength distribution of the illumination source are dynamically adjusted to maximize imaging contrast and recognition effect. Attached Figure Description
[0087] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0088] Figure 1 A flowchart illustrating the dynamic light source adjustment method based on environmental perception provided in this application embodiment;
[0089] Figure 2 A flowchart illustrating the synchronization of ambient light acquisition and image acquisition in the dynamic light source adjustment method based on environmental perception provided in this application embodiment;
[0090] Figure 3 A structural block diagram of a dynamic light source adjustment system based on environmental perception provided in an embodiment of this application;
[0091] Figure 4 A structural diagram of a deep learning prediction model for a dynamic light source adjustment system based on environmental perception, provided in an embodiment of this application;
[0092] Figure 5A neural network structure diagram for a dynamic light source adjustment system based on environmental perception provided in this application embodiment;
[0093] Figure 6 A schematic diagram of the imaging process response mathematical model of the dynamic light source adjustment system based on environmental perception provided in the embodiments of this application;
[0094] Figure 7 This is a schematic diagram of multi-target area optimization for a dynamic light source adjustment system based on environmental perception, provided in an embodiment of this application. Detailed Implementation
[0095] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0096] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0097] Please refer to Figures 1-2 This environment-aware dynamic light source adjustment method is used in terminal devices and includes the following steps:
[0098] S101: Set the sampling frequency, collect ambient light intensity and spectral data in real time based on the sampling frequency, and collect target images based on the industrial camera;
[0099] S102, Construct a reflectivity modeling network, input the target image into the reflectivity modeling network, perform reflectivity analysis on the object under test based on the reflectivity modeling network, and obtain the reflectivity characteristics of the object surface to different wavelengths.
[0100] S103, based on the illumination strategy network analysis of the reflection characteristics of the surface of the object under test to different wavelengths, outputs the illumination strategy;
[0101] S104: Generate the optimal illumination spectrum based on the illumination strategy, and output the light source environment by driving the LED array according to the optimal illumination spectrum;
[0102] S105: Acquire new images of the object under test based on the light source environment, analyze the contrast of the object under test images, and dynamically adjust the ambient light intensity and wavelength distribution based on the set contrast threshold.
[0103] It should be noted that the reflective modeling network is based on the fusion of convolutional neural network (CNN) and multilayer perceptron (MLP). The optical and sensor architecture is equipped with an adjustable-angle multi-channel LED array (covering the wavelength range of 380–780nm), and each channel has an independent PWM dimming interface.
[0104] Configure a spectral sensor array (such as the AS7265x three-chip architecture) to collect ambient light distribution. And set the sampling period ;
[0105] Install an industrial camera (supporting high frame rate shutter control, paired with a high-resolution lens) to acquire target image information. ;
[0106] All sensors are connected to the edge computing platform (such as Jetson Xavier or OrinNX) via serial / I2C or SPI.
[0107] To train a high-precision reflectivity modeling network With spectral control network A comprehensive dataset needs to be built. The data collection process is as follows:
[0108] Recording environmental spectra at different time periods and under different ambient light conditions ;
[0109] Simultaneously, camera image frames are acquired, and the target region ROI is recorded;
[0110] Each wavelength channel was calibrated using a standard light source reference board (such as a 99% diffuse reflectance material) to obtain the true reflectance of the ground. ;
[0111] Image feature vectors The target ID, timestamp, and environmental spectrum are packaged to construct a sample set:
[0112] ;
[0113] According to an embodiment of the present invention, real-time acquisition of ambient light intensity and spectral data based on sampling frequency specifically includes:
[0114] Let the spectral distribution function of ambient light be... ;
[0115] in, Wavelength of light, measured in nm;
[0116] : Time variable, representing the system's running time;
[0117] At any moment Below, wavelength The ambient incident light intensity at the location is expressed in W / m². 2 ;
[0118] The environmental spectral signal is acquired in real time, and the spectral data is obtained by discrete sampling of each channel using a spectral sensor, as shown in the following formula:
[0119] ;
[0120] in, For the first The center wavelength of each spectral channel.
[0121] According to an embodiment of the present invention, a reflectivity modeling network is constructed, a target image is input into the reflectivity modeling network, and reflectivity analysis of the object under test is performed based on the reflectivity modeling network to obtain the reflectivity characteristics of the object surface to different wavelengths, specifically including:
[0122] Let the reflectance function of the object being measured at each wavelength be:
[0123] ;
[0124] Reflectivity is defined as the ratio of the energy reflected by an object's surface to the incident energy of light of a certain wavelength, and its range is... ;
[0125] A neural network model is introduced for nonlinear mapping learning, defined as follows:
[0126] ;
[0127] in,
[0128] : indicates that the parameter Controlled neural network mapping function;
[0129] Current image information from the camera;
[0130] The output is the target area at wavelength The estimated reflectance value under the following conditions;
[0131] The network training objective is to minimize the following loss function:
[0132] .
[0133] According to an embodiment of the present invention, the region contrast is defined as:
[0134] ;
[0135] in, and These represent the grayscale integrals of the target and background regions, respectively.
[0136] Define the optimization objective function as follows:
[0137] subject to: ;
[0138] in, This represents the maximum allowable lighting power of the system.
[0139] It should be noted that the training of the reflection modeling network ( ):
[0140] Network structure: Image features are extracted based on ResNet-18, followed by two MLP sub-networks for spectral mapping;
[0141] Input: Image patch Output: Reflectance estimate for each wavelength;
[0142] The loss function is:
[0143] ;
[0144] The loss function of a reflectivity modeling network represents the difference between the network's predictions and the actual values.
[0145] Wavelength of light, measured in nanometers (nm), indicates the wavelength at which the calculation is performed.
[0146] Ground truth reflectance represents the reflectance of the measured object at a wavelength of [wavelength value missing]. The actual reflectivity is obtained by measuring with calibrated equipment (such as a standard reflector).
[0147] The reflectance predicted by the neural network, representing the reflectance modeling network based on the input image. Predicted at wavelength The reflectance value below.
[0148] : indicates that the parameter Controlled neural network mapping function.
[0149] Image information currently captured by the camera.
[0150] For all wavelengths considered Summation represents the total error across multiple wavelengths.
[0151] Optimizer: Adam, initial learning rate is The learning rate decays after 100 training rounds.
[0152] Lighting Strategy Network Training ( ):
[0153] Network structure: It integrates multimodal inputs, including spectral features, image features, and inference model output;
[0154] Input combinations are The output is ;
[0155] The loss function includes contrast loss plus lighting power constraint penalty:
[0156] ;
[0157] The training objective is to predict the optimal illumination spectrum, and in actual operation, it supports millisecond-level fast inference.
[0158] According to an embodiment of the present invention, an illumination strategy is output based on the analysis of the reflection characteristics of the surface of the object under test to different wavelengths using an illumination strategy network. Specifically, the strategy includes:
[0159] Let the optimization variable be the discrete wavelength illumination vector:
[0160] ;
[0161] Discretize the objective function as follows:
[0162] ;
[0163] Assume the lighting strategy is a learnable function:
[0164] ;
[0165] in, This represents a deep neural network used to predict the optimal lighting distribution, with parameters... The inputs include the current ambient spectrum, camera image features, and the target reflectance prediction function. ;
[0166] The network training objective is to minimize the following negative contrast loss:
[0167] ;
[0168] in The weight of the power constraint penalty term.
[0169] It should be noted that the lighting control logic is implemented as follows:
[0170] All models are deployed on edge devices, and the master control scheduling script runs as follows:
[0171] Initialize lighting configuration, set ;
[0172] Periodic sampling of environmental spectra Read image frames ;
[0173] Infer the current target reflectivity distribution ;
[0174] according to Output the current optimal lighting vector ;
[0175] Control the PWM duty cycle of the LED array and set the brightness of each wavelength channel;
[0176] Get the next frame image and update accordingly. Repeat the steps.
[0177] This process is time-cycle driven, with its execution cycle controlled within a specified timeframe. This meets the requirements of high-speed vision tasks.
[0178] According to an embodiment of the present invention, with image contrast as the objective function, the formula is as follows:
[0179] ;
[0180] Solve for the spectral control variables under power constraints. The optimal solution:
[0181] ;
[0182] Based on deep neural networks Approximate solution, combined with neural network mapping function Adjust the ambient light intensity and wavelength distribution.
[0183] According to an embodiment of the present invention, the illumination fusion strategy for multiple target objects is as follows:
[0184] In real-world production environments, an image scene often contains multiple targets to be detected, and different materials exhibit significant differences in their response to illumination. Therefore, this invention constructs a target region set. Each target has a reflection model:
[0185] ;
[0186] Correspondingly, its contrast is expressed as:
[0187] ;
[0188] The total target contrast is defined as a weighted sum:
[0189] ;
[0190] in The target weight reflects its detection priority. The system optimization objective is:
[0191] ;
[0192] This mechanism ensures maximum distinguishability of different target areas under a unified light source, and is suitable for multi-station and multi-material production scenarios.
[0193] According to an embodiment of the present invention, the method for verifying image contrast and recognition accuracy is as follows:
[0194] Set a sample set of target test objects, including: matte metal, polished steel parts, PCB boards, reflective plastics, etc.
[0195] Operating the system under different indoor and outdoor lighting conditions (daytime / dusk / strong backlight / flicker interference);
[0196] Compare the image quality under the following three lighting schemes:
[0197] Fixed lighting scheme;
[0198] Single-channel feedback illuminance adaptive;
[0199] Image quality evaluation metrics include contrast. Structural Similarity Index (SSIM) and Target Detection Accuracy (mAP).
[0200] Experimental results show that under complex lighting conditions, the average contrast of the output image of the system of the present invention is improved by 42%, and the target detection accuracy is improved by 27%. Especially in high-speed moving target scenes, its image clarity and AI recognition stability are significantly better than traditional solutions.
[0201] Secondly, embodiments of this application provide a dynamic light source adjustment system based on environmental perception. The system includes a memory and a processor. The memory includes a program for a dynamic light source adjustment method based on environmental perception. When the program for the dynamic light source adjustment method based on environmental perception is executed by the processor, it implements the following steps:
[0202] Set the sampling frequency, collect ambient light intensity and spectral data in real time based on the sampling frequency, and acquire target images based on industrial cameras;
[0203] A reflectivity modeling network is constructed, the target image is input into the reflectivity modeling network, and the reflectivity analysis of the object under test is performed based on the reflectivity modeling network to obtain the reflectivity characteristics of the object surface to different wavelengths.
[0204] The illumination strategy network analyzes the reflection characteristics of the surface of the object under test to different wavelengths and outputs the illumination strategy.
[0205] The optimal lighting spectrum is generated based on the lighting strategy, and the light source environment is obtained by driving the LED array to output according to the optimal lighting spectrum.
[0206] The system acquires new images of the object under test based on the light source environment, analyzes the contrast of the object image, and dynamically adjusts the ambient light intensity and wavelength distribution based on the set contrast threshold.
[0207] It should be noted that the system hardware includes the following modules:
[0208] Multi-channel spectral acquisition devices: such as the Hamamatsu spectrometer, which supports sampling from 350 to 1000 nm;
[0209] Image acquisition module: high frame rate industrial camera (e.g., Basler series);
[0210] AI computing platform: based on GPUs or edge computing devices, such as NVIDIA Jetson;
[0211] Lighting actuator: Multi-wavelength LED matrix array, each LED supports PWM dimming control;
[0212] Main control logic unit: FPGA or MCU is used for timing scheduling and instruction issuance.
[0213] The system architecture supports software and hardware co-optimization, and all algorithms are deployed at the edge for real-time execution, ensuring that the system can still run stably in weak connection scenarios such as factories and the field.
[0214] Through the above system modeling and algorithm derivation, the present invention has the following significant advantages:
[0215] Highly sensitive environmental perception capability: Real-time acquisition of ambient light intensity and spectral distribution;
[0216] Target material perception capability: High-precision reflection modeling is constructed through deep learning;
[0217] High-dimensional lighting control capability: Dynamically adjusts lighting intensity according to wavelength to achieve spectral-level control;
[0218] Automatic optimization and adaptive capabilities: Deep learning drives light source adjustment to adapt to complex and ever-changing environments;
[0219] System stability and real-time performance are guaranteed by introducing delay modeling, control feedback, and energy consumption constraint strategies.
[0220] Multi-objective optimization capability: Simultaneously considers the image quality of multiple detection objects to meet actual production needs.
[0221] like Figure 6 As shown, image response modeling is performed during image acquisition:
[0222] Assume the signal ultimately received by the camera is:
[0223] ;
[0224] in:
[0225] The intensity of the illumination spectrum emitted by the system;
[0226] Camera at wavelength The response sensitivity at that location.
[0227] Considering that image acquisition is an integral process of RGB channel response, the image grayscale intensity is:
[0228] ;
[0229] Substituting this expression, we get:
[0230] ;
[0231] According to an embodiment of the present invention, real-time acquisition of ambient light intensity and spectral data based on sampling frequency specifically includes:
[0232] Let the spectral distribution function of ambient light be... ;
[0233] in, Wavelength of light, measured in nm;
[0234] : Time variable, representing the system's running time;
[0235] At any moment Below, wavelength The ambient incident light intensity at the location is expressed in W / m². 2 ;
[0236] The environmental spectral signal is acquired in real time, and the spectral data is obtained by discrete sampling of each channel using a spectral sensor, as shown in the following formula:
[0237] ;
[0238] in, For the first The center wavelength of each spectral channel.
[0239] According to an embodiment of the present invention, a reflectivity modeling network is constructed, a target image is input into the reflectivity modeling network, and reflectivity analysis of the object under test is performed based on the reflectivity modeling network to obtain the reflectivity characteristics of the object surface to different wavelengths, specifically including:
[0240] Let the reflectance function of the object being measured at each wavelength be:
[0241] ;
[0242] Reflectivity is defined as the ratio of the energy reflected by an object's surface to the incident energy of light of a certain wavelength, and its range is... ;
[0243] A neural network model is introduced for nonlinear mapping learning, defined as follows:
[0244] ;
[0245] in,
[0246] : indicates that the parameter Controlled neural network mapping function;
[0247] Current image information from the camera;
[0248] The output is the target area at wavelength The estimated reflectance value under the following conditions;
[0249] The network training objective is to minimize the following loss function:
[0250] .
[0251] According to an embodiment of the present invention, the region contrast is defined as:
[0252] ;
[0253] in, and These represent the grayscale integrals of the target and background regions, respectively.
[0254] Define the optimization objective function as follows:
[0255] subject to: ;
[0256] in, This represents the maximum allowable lighting power of the system.
[0257] It should be noted that the training of the reflection modeling network ( ):
[0258] Network structure: Image features are extracted based on ResNet-18, followed by two MLP sub-networks for spectral mapping;
[0259] Input: Image patch Output: Reflectance estimate for each wavelength;
[0260] The loss function is:
[0261] ;
[0262] Optimizer: Adam, initial learning rate is The learning rate decays after 100 training rounds.
[0263] Lighting Strategy Network Training ( ):
[0264] Network structure: It integrates multimodal inputs, including spectral features, image features, and inference model output;
[0265] Input combinations are The output is ;
[0266] The loss function includes contrast loss plus lighting power constraint penalty:
[0267] ;
[0268] The training objective is to predict the optimal illumination spectrum, and in actual operation, it supports millisecond-level fast inference.
[0269] According to an embodiment of the present invention, an illumination strategy is output based on the analysis of the reflection characteristics of the surface of the object under test to different wavelengths using an illumination strategy network. Specifically, the strategy includes:
[0270] Let the optimization variable be the discrete wavelength illumination vector:
[0271] ;
[0272] Discretize the objective function as follows:
[0273] ;
[0274] Assume the lighting strategy is a learnable function:
[0275] ;
[0276] in, This represents a deep neural network used to predict the optimal lighting distribution, with parameters... The inputs include the current ambient spectrum, camera image features, and the target reflectance prediction function. ;
[0277] The network training objective is to minimize the following negative contrast loss:
[0278] ;
[0279] in The weight of the power constraint penalty term.
[0280] It should be noted that the lighting control logic is implemented as follows:
[0281] All models are deployed on edge devices, and the master control scheduling script runs as follows:
[0282] Initialize lighting configuration, set ;
[0283] Periodic sampling of environmental spectra Read image frames ;
[0284] Infer the current target reflectivity distribution ;
[0285] according to Output the current optimal lighting vector ;
[0286] Control the PWM duty cycle of the LED array and set the brightness of each wavelength channel;
[0287] Get the next frame image and update accordingly. Repeat the steps.
[0288] This process is time-cycle driven, with its execution cycle controlled within a specified timeframe. This meets the requirements of high-speed vision tasks.
[0289] According to an embodiment of the present invention, with image contrast as the objective function, the formula is as follows:
[0290] ;
[0291] Solve for the spectral control variables under power constraints. The optimal solution:
[0292] ;
[0293] Based on deep neural networks Approximate solution, combined with neural network mapping function Adjust the ambient light intensity and wavelength distribution.
[0294] According to an embodiment of the present invention, the illumination fusion strategy for multiple target objects is as follows:
[0295] In real-world production environments, an image scene often contains multiple targets to be detected, and different materials exhibit significant differences in their response to illumination. Therefore, this invention constructs a target region set. Each target has a reflection model:
[0296] ;
[0297] Correspondingly, its contrast is expressed as:
[0298] ;
[0299] The total target contrast is defined as a weighted sum:
[0300] ;
[0301] in The target weight reflects its detection priority. The system optimization objective is:
[0302] ;
[0303] This mechanism ensures maximum distinguishability of different target areas under a unified light source, and is suitable for multi-station and multi-material production scenarios.
[0304] According to an embodiment of the present invention, the method for verifying image contrast and recognition accuracy is as follows:
[0305] Set a sample set of target test objects, including: matte metal, polished steel parts, PCB boards, reflective plastics, etc.
[0306] Operating the system under different indoor and outdoor lighting conditions (daytime / dusk / strong backlight / flicker interference);
[0307] Compare the image quality under the following three lighting schemes:
[0308] Fixed lighting scheme;
[0309] Single-channel feedback illuminance adaptive;
[0310] Image quality evaluation metrics include contrast. Structural Similarity Index (SSIM) and Target Detection Accuracy (mAP).
[0311] Experimental results show that under complex lighting conditions, the average contrast of the output image of the system of the present invention is improved by 42%, and the target detection accuracy is improved by 27%. Especially in high-speed moving target scenes, its image clarity and AI recognition stability are significantly better than traditional solutions.
[0312] A third aspect of the present invention provides a computer-readable storage medium including a dynamic light source adjustment method program based on environment perception, wherein when the dynamic light source adjustment method program based on environment perception is executed by a processor, it implements the steps of the dynamic light source adjustment method based on environment perception as described in any of the above claims.
[0313] This invention discloses a dynamic light source adjustment method, system, and medium based on environmental perception. By setting a sampling frequency, ambient light intensity and spectral data are collected in real time, and a target image is acquired using an industrial camera. A reflectivity modeling network is constructed, and the target image is input into the network. Based on this network, reflectivity analysis is performed on the object under test to obtain the reflection characteristics of the object's surface to different wavelengths. An illumination strategy network is used to analyze the reflection characteristics of the object's surface to different wavelengths and output an illumination strategy. An optimal illumination spectrum is generated based on the illumination strategy, and an LED array is driven to output the optimal illumination spectrum to obtain the light source environment. New images of the object under test are acquired based on the light source environment, and the contrast of these images is analyzed. Based on a set contrast threshold, the ambient light intensity and wavelength distribution are dynamically adjusted. By real-time perception of ambient light intensity and spectral distribution, combined with deep modeling of the reflectivity characteristics of the object's surface, the intensity and wavelength distribution of the illumination source are dynamically adjusted to maximize imaging contrast and recognition performance.
[0314] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0315] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0316] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0317] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0318] Alternatively, if the integrated units of the present invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
Claims
1. A dynamic light source adjustment method based on environmental perception, characterized in that, include: Set the sampling frequency, collect ambient light intensity and spectral data in real time based on the sampling frequency, and acquire target images based on industrial cameras; A reflectivity modeling network is constructed, the target image is input into the reflectivity modeling network, and the reflectivity analysis of the object under test is performed based on the reflectivity modeling network to obtain the reflectivity characteristics of the object surface to different wavelengths. The illumination strategy network analyzes the reflection characteristics of the surface of the object under test to different wavelengths and outputs the illumination strategy. The optimal lighting spectrum is generated based on the lighting strategy, and the light source environment is obtained by driving the LED array to output according to the optimal lighting spectrum. Acquire new images of the object under test based on the light source environment, analyze the contrast of the object under test images, and dynamically adjust the ambient light intensity and wavelength distribution based on the set contrast threshold. This involves constructing a reflectivity modeling network, inputting the target image into the network, and performing reflectivity analysis on the object under test based on the network to obtain the reflectivity characteristics of the object's surface for different wavelengths. Specifically, this includes: Let the reflectivity function of the object being measured at each wavelength be: ; Reflectivity is defined as the ratio of the energy reflected by an object's surface to the incident energy of light of a certain wavelength, and its range is... ; A neural network model is introduced for nonlinear mapping learning, defined as follows: ; in, : indicates that the parameter Controlled neural network mapping function; Current image information from the camera; The output is the target area at wavelength The estimated reflectance value under the following conditions; The network training objective is to minimize the following loss function: ; The loss function of a reflectivity modeling network represents the difference between the network's predicted values and the actual values. : Wavelength of light; True reflectance indicates the reflectance of the measured object at a wavelength of [wavelength missing]. The actual reflectivity is as follows; The reflectance predicted by the neural network, representing the reflectance modeling network based on the input image. Predicted at wavelength The reflectivity value below; : indicates that the parameter Controlled neural network mapping function; Image information currently captured by the camera; For all wavelengths considered Summation represents the total error across multiple wavelengths.
2. The dynamic light source adjustment method based on environmental perception according to claim 1, characterized in that, Real-time acquisition of ambient light intensity and spectral data based on sampling frequency, specifically including: Let the spectral distribution function of ambient light be... ; in, Wavelength of light, measured in nm; : Time variable, representing the system's running time; At any moment Below, wavelength The ambient incident light intensity at the location is expressed in W / m². 2 ; The environmental spectral signal is acquired in real time, and the spectral data is obtained by discrete sampling of each channel using a spectral sensor, as shown in the following formula: ; in, For the first The center wavelength of each spectral channel.
3. The dynamic light source adjustment method based on environmental perception according to claim 2, characterized in that, Define the region contrast as: ; in, and These represent the grayscale integrals of the target and background regions, respectively. Define the optimization objective function as follows: ; subject to: ; in, This is the maximum lighting power allowed by the system; Indicates time Under these conditions, the lighting source actively controlled by the system has a wavelength of Spectral intensity distribution at; Indicates time Below, the contrast between the target area and the background area in the image; This indicates the point in time when the system was running.
4. The dynamic light source adjustment method based on environmental perception according to claim 3, characterized in that, The illumination strategy is based on network analysis of the reflection characteristics of the surface of the object under test to different wavelengths, and outputs an illumination strategy, which specifically includes: Let the optimization variable be the discrete wavelength illumination vector: ; Discretize the objective function as follows: ; Assume the lighting strategy is a learnable function: ; in, This represents a deep neural network used to predict the optimal lighting distribution, with parameters... The inputs include the current ambient spectrum, camera image features, and the target reflectance prediction function. ; The network training objective is to minimize the following negative contrast loss: ; in The weight of the power constraint penalty term.
5. A dynamic light source adjustment system based on environmental perception, characterized in that, The system includes a memory and a processor. The memory contains a program for a dynamic light source adjustment method based on environment perception. When the program for the dynamic light source adjustment method based on environment perception is executed by the processor, it performs the following steps: Set the sampling frequency, collect ambient light intensity and spectral data in real time based on the sampling frequency, and acquire target images based on industrial cameras; A reflectivity modeling network is constructed, the target image is input into the reflectivity modeling network, and the reflectivity analysis of the object under test is performed based on the reflectivity modeling network to obtain the reflectivity characteristics of the object surface to different wavelengths. The illumination strategy network analyzes the reflection characteristics of the surface of the object under test to different wavelengths and outputs the illumination strategy. The optimal lighting spectrum is generated based on the lighting strategy, and the light source environment is obtained by driving the LED array to output according to the optimal lighting spectrum. Acquire new images of the object under test based on the light source environment, analyze the contrast of the object under test images, and dynamically adjust the ambient light intensity and wavelength distribution based on the set contrast threshold. This involves constructing a reflectivity modeling network, inputting the target image into the network, and performing reflectivity analysis on the object under test based on the network to obtain the reflectivity characteristics of the object's surface for different wavelengths. Specifically, this includes: Let the reflectivity function of the object being measured at each wavelength be: ; Reflectivity is defined as the ratio of the energy reflected by an object's surface to the incident energy of light of a certain wavelength, and its range is... ; A neural network model is introduced for nonlinear mapping learning, defined as follows: ; in, : indicates that the parameter Controlled neural network mapping function; Current image information from the camera; The output is the target area at wavelength The estimated reflectance value under the following conditions; The network training objective is to minimize the following loss function: ; The loss function of a reflectivity modeling network represents the difference between the network's predicted values and the actual values. : Wavelength of light; True reflectance indicates the reflectance of the measured object at a wavelength of [wavelength missing]. The actual reflectivity is as follows; The reflectance predicted by the neural network, representing the reflectance modeling network based on the input image. Predicted at wavelength The reflectivity value below; : indicates that the parameter Controlled neural network mapping function; Image information currently captured by the camera; For all wavelengths considered Summation represents the total error across multiple wavelengths.
6. The dynamic light source adjustment system based on environmental perception according to claim 5, characterized in that, Real-time acquisition of ambient light intensity and spectral data based on sampling frequency, specifically including: Let the spectral distribution function of ambient light be... ; in, Wavelength of light, measured in nm; : Time variable, representing the system's running time; At any moment Below, wavelength The ambient incident light intensity at the location is expressed in W / m². 2 ; The environmental spectral signal is acquired in real time, and the spectral data is obtained by discrete sampling of each channel using a spectral sensor, as shown in the following formula: ; in, For the first The center wavelength of each spectral channel.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a dynamic light source adjustment method program based on environment perception, which, when executed by a processor, implements the steps of the dynamic light source adjustment method based on environment perception as described in any one of claims 1 to 4.