Non-abrupt change adjusting method for LED brightness

The method stabilizes LED brightness by adjusting current input based on environmental factors and preset databases, reducing sudden changes and user interactions.

CN119212148APending Publication Date: 2024-12-27广州市斯得电子有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411526689.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

LED brightness adjustment methods cause sudden changes due to current fluctuations, leading to customer discomfort from electromagnetic interference and external noise.

Method used

A method that adjusts LED brightness by obtaining illumination images, removing highlights, calculating illumination, and setting a preset brightness database using a BP neural network, controlling current changes to prevent sudden fluctuations.

Benefits of technology

Stabilizes LED brightness by reducing user adjustments and minimizing sudden changes through controlled current input, ensuring stable illumination based on environmental factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119212148A_ABST
    Figure CN119212148A_ABST
Patent Text Reader

Abstract

The invention relates to the field of LED control, in particular to an abrupt-change-free adjustment method for LED brightness. According to the method, the illumination image is subjected to highlight removal to obtain a highlight-removed image, so that the illuminance of the surface of the object can be better calculated according to the corresponding relation between the pixel value of the surface of the reference object and the illuminance, and the illuminance of the surface of the object can be obtained according to the corresponding relation between a plurality of influence factors containing the illuminance and the preset brightness of the LED. The brightness of the LED is conveniently and directly adjusted to a proper value according to the generated brightness database subsequently when the lamp is turned on, so that the brightness adjustment times of a user are reduced, and when the brightness needs to be adjusted, the maximum current input to the LED in the circuit can be controlled through the current step pitch, so that the current in the circuit is prevented from abrupt change due to noise, and the brightness adjustment efficiency is improved. The probability of keeping the brightness of the LED stable is further improved; the problem that when the LED brightness is changed by changing the current at present, the current in a circuit may be suddenly changed, so that the LED brightness is suddenly changed is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of LED control, and in particular to a method for adjusting LED brightness without sudden changes. Background Art

[0002] At present, LED is widely used for lighting in various scenarios. However, with the improvement of living environment and the increase of market competition pressure, LED also needs to have more humanized functions. When LED is used for indoor lighting, its brightness is often fixed in several levels, and the brightness can be adjusted according to customer needs. One way to adjust the brightness of LED is to change the current entering the LED, which can be adjusted by changing the resistance value of the resistor in parallel with the LED. Therefore, in the process of LED brightness adjustment, the current will change. Under the interference of noise from the external environment, this interference may be electromagnetic interference caused by changes in current in other parts of the circuit, or it may be external environmental factors, which may cause the current in the circuit to mutate, thereby causing a mutation in the brightness of the LED, causing discomfort to customers. Summary of the invention

[0003] In view of the deficiencies of the prior art, the present invention provides a method for adjusting LED brightness without sudden changes, which solves the problem that when changing the current to change the LED brightness, the current in the circuit may suddenly change, thereby causing a sudden change in the LED brightness.

[0004] To achieve the above object, the present invention provides the following technical solutions:

[0005] A method for adjusting LED brightness without sudden changes, the method comprising the following steps:

[0006] S1, obtaining basic data including an illumination image of a non-white object in any area of ​​a room illuminated by LED, the brightness of the LED and the LED driving current, and the corresponding relationship between the illumination of the illumination image and the brightness of the LED and the LED driving current;

[0007] S2, removing highlights from a specific object in the illumination image to obtain a de-highlighted image, and calculating the illumination of an area in the illumination image corresponding to the de-highlighted image according to the basic data;

[0008] S3, setting a number of influencing factors affecting LED brightness including standard object area illumination, and setting a corresponding relationship between the influencing factors and the preset brightness of the LED to generate a preset brightness database;

[0009] S4, determining whether the received control instruction is a light-on instruction or a brightness adjustment instruction;

[0010] If the received control command is a light-on command, the LED brightness is adjusted to the preset brightness according to the preset brightness database, and the process ends;

[0011] If the received control instruction is a brightness adjustment instruction, proceed to step S5;

[0012] S5. According to the brightness adjustment instruction, the LED driving current is controlled to increase or decrease at a certain current step until the brightness adjustment instruction ends, and the LED preset brightness in the current scene in the preset brightness database is updated according to the LED brightness at this time.

[0013] Preferably, in step S2, the following steps are specifically included:

[0014] S21, converting the illumination image into the HSV color space and obtaining the initial object region by setting the HSV threshold of the non-white object and filtering;

[0015] S22, removing highlights from a specific object in the illumination image to obtain a de-highlighted image, and calculating the illumination of an area in the illumination image corresponding to the de-highlighted image according to the basic data;

[0016] S23, calculating the average pixel values ​​of the areas corresponding to the initial object area in the de-highlighted image in the RGB three channels respectively, and obtaining the pixel points whose pixel differences are less than a certain multiple of the sum of the average pixel values ​​of the RGB three channels according to the pixel differences between each pixel point in the de-highlighted image and the average pixel value, so as to obtain the standard object area;

[0017] S24, calculating the grayscale ratio of any pixel in the illumination image corresponding to the standard object area, and removing a number of pixels with the largest grayscale ratio in the quasi-object area; the grayscale ratio calculation formula is:

[0018]

[0019] In the above formula, R(x, y) represents the grayscale ratio of the pixel (x, y), I min (x, y) and I max (x, y) represents the minimum and maximum values ​​of the RGB three-channel pixel values ​​at the pixel point (x, y), and ε is a non-zero positive number;

[0020] S25, calculating the brightness of the standard object area according to the pixel values ​​of the pixel points in the illumination image corresponding to the standard object area;

[0021] S26. Calculate the illumination of the standard object area according to the brightness of the standard object area. The calculation formula of the illumination is:

[0022]

[0023] In the above formula, E inIt represents the incident light illumination received by the object, p is the diffuse reflectance of the object surface, and L is the brightness of the standard object area.

[0024] Preferably, in step S22, the following steps are specifically included:

[0025] S221, calculate the minimum value of the RGB three-channel grayscale value of any pixel point in the illumination image; the calculation formula for the minimum value of the RGB three-channel grayscale value of any pixel point is:

[0026] I min (x,y)=min(R(x,y),G(x,y),B(x,y))

[0027] In the above formula, I min (x, y) represents the minimum grayscale value of the RGB three channels of any pixel with coordinates (x, y), R(x, y), G(x, y) and B(x, y) represent the grayscale value of the RGB three channels of any pixel in the illumination image, and min(·) represents the minimum value;

[0028] S222, calculating the average value of the minimum three-channel grayscale values ​​of all pixels according to the minimum three-channel grayscale values; the calculation formula for the average value of the minimum three-channel grayscale values ​​is:

[0029]

[0030] In the above formula, It represents the average value of the minimum grayscale value of the three channels of all pixels in the illumination image, N represents the number of pixels, and I min (x, y) represents the minimum grayscale value of the RGB channels of any pixel with coordinates (x, y);

[0031] S223, calculating the first pixel value of each pixel point according to the average value of the minimum grayscale value of the three channels; the calculation formula of the first pixel value is:

[0032]

[0033] In the above formula, Indicates the first pixel value of the pixel point (x, y) in any RGB channel, I C (x, y) represents the pixel value of the pixel point (x, y) in any channel in the illumination image, C represents any channel among the R channel, G channel and B channel, I min (x, y) represents the minimum grayscale value of the RGB three channels of any pixel point (x, y). It represents the average value of the minimum grayscale values ​​of the three channels of all pixels in the illumination image;

[0034] S224 , calculating the pixel value of each pixel in the de-highlighted image according to the first pixel value of each pixel.

[0035] Preferably, in step S23, the following steps are specifically included:

[0036] S231, calculating the average pixel value of the area corresponding to the initial object area in the de-highlighted image in the three RGB channels respectively; the calculation formula of the average pixel value is:

[0037]

[0038] In the above formula, It represents the average pixel value of the RGB three channels in the area corresponding to the initial object area in the de-highlighted image, C represents any channel among the R channel, G channel and B channel, and M represents the number of pixels in the area corresponding to the initial object area in the de-highlighted image. Represents the pixel value of the pixel point (x, y) in any RGB channel in the de-highlighted image;

[0039] S232, calculating the pixel difference between the pixel value of any pixel point and the average pixel value; the calculation formula of the pixel difference is:

[0040]

[0041] In the above formula, ΔI(x, y) represents the pixel difference between the pixel value of any pixel and the average pixel value. and They represent the average pixel values ​​of the R channel, G channel, and B channel in the area corresponding to the initial object area in the de-highlighted image, respectively. and Respectively represent the pixel value of any pixel point (x, y) in the area corresponding to the initial object area in the de-highlighted image in the R channel, G channel and B channel;

[0042] S233, calculating the pixel segmentation threshold according to the average pixel values ​​of the area corresponding to the initial object area in the de-highlighted image in the three channels of RGB; the calculation formula of the pixel segmentation threshold is:

[0043]

[0044] In the above formula, ΔI 0 represents the pixel segmentation threshold, τ represents the segmentation coefficient, and its value range is 0.05~0.1. and They represent the average pixel values ​​of the R channel, G channel, and B channel of the area corresponding to the initial object area in the de-highlighted image;

[0045] S234 , selecting pixels whose pixel difference in an area corresponding to the initial object area in the highlight image is less than a pixel segmentation threshold to generate a standard object area.

[0046] Preferably, in step S25, the following steps are specifically included:

[0047] S251, setting up a closed laboratory for experiments, and experimental pictures containing various pixel values;

[0048] S252. Calculate the standard number of camera shots according to the brightness range of the laboratory during the experiment and the effective dynamic range of the camera. The calculation formula for the standard number of camera shots is:

[0049]

[0050] In the above formula, n represents the standard number of camera shots, N actual is the brightness range of the closed laboratory during the experiment, N camera is the effective dynamic range of the camera;

[0051] S253, setting a brightness gradient of the light source, and sequentially irradiating the experimental picture with a light source of a certain brightness for a certain time, and collecting experimental images when the light source irradiates the experimental picture at different irradiation times under the light source of the same brightness, so as to obtain the experimental images in a number not less than the standard shooting number of the camera;

[0052] S254, calculating the brightness values ​​of several groups of experimental images at the same pixel point;

[0053] S255, draw a curve of the relationship between any pixel value on the experimental image and the brightness of the light source;

[0054] S256. The expression for calculating brightness and pixel value obtained by fitting the relationship curve is:

[0055] L=f(I)

[0056] In the above formula, L represents brightness and I is the pixel value of the object;

[0057] S257, calculating the brightness of the standard object area according to the pixel values ​​of the pixel points in the illumination image corresponding to the standard object area.

[0058] Preferably, in step S3, the following steps are specifically included:

[0059] S31. Set several groups of samples, each group of samples including several factors affecting LED brightness of the standard object area illumination, and a first preset brightness of the corresponding LED.

[0060] S32, constructing a BP neural network model to train the samples to generate a preset brightness database.

[0061] Preferably, in step S5, the following steps are specifically included:

[0062] S51, setting a number of amplitude modulation levels and setting corresponding current step sizes;

[0063] S52, obtaining the duration of the brightness adjustment instruction input by the user and the amplitude modulation level selected by the user;

[0064] S53, calculating the current LED driving current according to the duration and current step of the brightness adjustment instruction input by the user; the calculation formula of the current LED driving current is:

[0065] I A =I′ A +ΔI A t

[0066] In the above formula, I A Represents the current LED drive current, I′ A is the LED drive current before the input brightness adjustment command, ΔI A is the current step size, t is the duration of the brightness adjustment command input by the user;

[0067] S54, determining whether a stop instruction of the brightness adjustment instruction is received;

[0068] If yes, the current LED driving current is output and the process goes to step S55;

[0069] If not, return to step S53;

[0070] S55, saving the LED brightness corresponding to the current LED driving current, and calculating the LED update brightness according to the LED preset brightness in the current scene in the preset brightness database and the current LED brightness, so as to replace the LED preset brightness in the current scene in the preset brightness database.

[0071] Preferably, in step S55, the following steps are specifically included:

[0072] S551, obtaining historical data of LED preset brightness in the current scene and LED brightness corresponding to the current LED driving current to obtain scene brightness data of the LED;

[0073] S552, setting an initial metering radius and an initial number of iterations to 1 according to the range of the scene brightness data, and setting the initial statistical data range to the scene brightness data;

[0074] S553. Calculate the metering radius according to the number of iterations; the calculation formula of the metering radius is:

[0075]

[0076] In the above formula, R p represents the measurement radius at the pth iteration, p represents the number of iterations, which is 1 in the initial case, and R 0 Indicates the initial measurement radius, which is the range of the scene brightness data, that is, the difference between the maximum and minimum values ​​in the scene brightness data;

[0077] S554, calculating the brightness density of any preset brightness in the scene brightness data according to the measurement radius; the calculation formula of the brightness density is:

[0078]

[0079] in,

[0080]

[0081] In the above formula, ρ i represents the brightness density of the i-th preset brightness, L i and L j Represent the values ​​of the i-th and j-th preset brightness respectively. The total number of data in the scene brightness data is A, R p represents the measurement radius at the pth iteration, μ(·) is the sign function;

[0082] S555, taking the data within the measurement radius corresponding to the preset brightness with the largest brightness density as the statistical data range;

[0083] S556, determine whether the current number of iterations is less than 2;

[0084] If yes, return to step S553;

[0085] If not, proceed to step S557;

[0086] S557, determining whether the current statistical data range is the same as the statistical data range in the previous iteration;

[0087] If yes, proceed to step S558;

[0088] If not, return to step S553;

[0089] S558. Calculate the average value of the preset brightness within the current statistical data range as the LED update brightness, and replace the LED preset brightness in the current scene in the preset brightness database.

[0090] Preferably, in step S254, the calculation formula for the brightness of several groups of experimental images at the same pixel point is:

[0091]

[0092] In the above formula, L(x, y) represents the brightness at the pixel point (x, y) calculated based on several sets of experimental images, and L i represents the brightness of the i-th image at the pixel point (x, y), and I′(x, y) represents the pixel value of the i-th image at the pixel point (x, y).

[0093] Preferably, in step S224, the calculation formula for the pixel value of each pixel in the de-highlighted image is:

[0094]

[0095] In the above formula, Represents the pixel value of the pixel point (x, y) in any RGB channel in the de-highlighted image. Indicates the first pixel value of the pixel point (x, y) in any RGB channel. and Represents the first pixel value of the pixel point (x, y) in the R channel, G channel, and B channel respectively.

[0096] Compared with the prior art, the present invention provides a method for adjusting LED brightness without sudden changes, which has the following beneficial effects:

[0097] 1. The present invention first removes highlights from the illumination image to obtain a de-highlighted image, and can obtain the corresponding reference object, remove noise, and remove specular reflection points at the same time, so as to better calculate the illumination of the object surface based on the correspondence between the pixel value on the reference object surface and the illumination, and based on the correspondence between several influencing factors including the illumination and the preset brightness of the LED, it is convenient to directly adjust the brightness of the LED to an appropriate value when turning on the light according to the generated brightness database, so as to reduce the number of brightness adjustments by the user. When the brightness needs to be adjusted, the maximum current input to the LED in the current step control circuit can be used to prevent the current in the circuit from suddenly changing due to noise, thereby further improving the probability of the LED brightness remaining stable.

[0098] 2. The present invention calculates the minimum value, the average value of the minimum value and the first pixel value of the grayscale value of the three RGB channels of any pixel point in the illumination image in sequence to finally obtain a de-highlighted image, thereby being able to obtain a de-highlighted image more simply and greatly reducing the amount of calculation, so as to be more suitable for controlling the LED.

[0099] 3. The present invention calculates the average pixel value, pixel difference and pixel segmentation threshold in sequence to more accurately obtain a standard object image containing a specific object, thereby removing the interference of noise and ensuring the accuracy of the pixel value of the pixel point, so that the subsequent calculation of illumination is more accurate.

[0100] 4. The present invention sets the amplitude modulation level and the current step size, so that the maximum current allowed to enter the LED in the circuit can be calculated according to the duration of the user's brightness adjustment instruction, thereby achieving the purpose of controlling the maximum current in the circuit and preventing the current entering the LED in the circuit from changing suddenly, so as to improve the stability of the LED brightness.

[0101] 5. The present invention saves the LED brightness each time the user adjusts it, and sets the LED preset brightness in the current scene in the preset brightness database accordingly, so that it can set a more accurate LED preset brightness in a more personalized way according to the customer's adjustment rules, thereby greatly reducing the frequency of users adjusting the LED brightness, thereby reducing the probability of sudden changes in LED brightness. BRIEF DESCRIPTION OF THE DRAWINGS

[0102] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0103] Figure 1 The flowchart of the method for adjusting LED brightness without sudden change of the present invention is shown in FIG. DETAILED DESCRIPTION

[0104] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods, so that the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.

[0105] Those skilled in the art can understand that all or part of the steps in the following embodiments can be completed by instructing the relevant hardware through a program, so the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0106] By detecting the currents at various locations in the LED control circuit and finding the reasons for the sudden changes in the LED brightness, it is found through statistics that the sudden change in the current in the circuit is the main reason. As the monitoring time increases, it is also found that the sudden change in the LED brightness is often accompanied by active brightness adjustment instructions. Therefore, a method for adjusting the brightness of an LED is provided from the perspective of reducing the input of the brightness adjustment instruction and dynamically limiting the maximum current in the circuit.

[0107] In order to solve the problem that when the current is changed to change the brightness of the LED, the current in the circuit may suddenly change, thereby causing a sudden change in the brightness of the LED, the present invention provides a method for adjusting the brightness of the LED without sudden changes. The method can directly adjust the brightness to a suitable level when the LED is turned on according to the environmental factors of the LED, so as to reduce the number of adjustments of the LED and reduce the possibility of sudden changes in the current. On the other hand, when adjusting the current in the circuit, the maximum current in the circuit is dynamically limited to prevent the sudden change in the brightness caused by the current surge under the influence of noise. The adjustment method comprises the following steps:

[0108] S1. Obtaining basic data including an illumination image of a non-white object in any area of ​​a room illuminated by LEDs, the brightness of the LEDs, the LED driving current, and the corresponding relationship between the illumination of the illumination image and the brightness of the LEDs and the LED driving current. The objects selected for the illumination image are generally non-white walls, large non-white decorations on the walls such as paintings, or areas where the color is not easily changed, such as non-white floors;

[0109] S2, calculate the illumination of the area corresponding to the illumination image according to the basic data; there is a certain correspondence between the pixel value and the illumination of the object surface, but before that, it is necessary to find an object with a stable pixel value in the illumination image as the basis for selecting the pixel value, and under the illumination of the light, some areas may have mirror reflection points, where the pixel value is inaccurate and close to white, so this part needs to be removed, and finally the illumination of the object surface is calculated according to the relationship between the pixel value and the illumination of the object surface. In step S2, the following steps are specifically included:

[0110] S21. Convert the illumination image into HSV color space and obtain the initial object area by setting the HSV threshold of non-white objects and filtering. The HSV threshold can be set according to the color of the corresponding object to filter out the objects of the corresponding color. There may be a large number of noise points in the acquired image, which can be removed by the opening operation in morphological filtering. The opening operation mainly includes corrosion and dilation. The role of corrosion is to eliminate irrelevant details from the image, while the role of dilation is to bridge the cracks between regions.

[0111] S22, removing highlights from a specific object in the illumination image to obtain a de-highlighted image, and calculating the illumination of an area in the illumination image corresponding to the de-highlighted image based on the basic data; there are many methods for obtaining the de-highlighted image, but here, limited by the simplicity and cost of the LED control system, it is necessary to reduce the amount of calculation for obtaining the de-highlighted image, so a new method is used to start obtaining the de-highlighted image, and in step S22, the following steps are specifically included:

[0112] S221, calculate the minimum value of the RGB three-channel grayscale value of any pixel point in the illumination image; the calculation formula for the minimum value of the RGB three-channel grayscale value of any pixel point is:

[0113] I min (x,y)=min(R(x,y),G(x,y),B(x,y))

[0114] In the above formula, I min (x, y) represents the minimum grayscale value of the RGB three channels of any pixel with coordinates (x, y), R(x, y), G(x, y) and B(x, y) represent the grayscale value of the RGB three channels of any pixel in the illumination image, and min(·) represents the minimum value;

[0115] S222, calculating the average value of the minimum three-channel grayscale values ​​of all pixels according to the minimum three-channel grayscale values; the calculation formula for the average value of the minimum three-channel grayscale values ​​is:

[0116]

[0117] In the above formula, It represents the average value of the minimum grayscale value of the three channels of all pixels in the illumination image, N represents the number of pixels, and I min (x, y) represents the minimum grayscale value of the RGB channels of any pixel with coordinates (x, y);

[0118] S223, calculating the first pixel value of each pixel point according to the average value of the minimum grayscale value of the three channels, the calculation formula of the first pixel value is:

[0119]

[0120] In the above formula, Indicates the first pixel value of the pixel point (x, y) in any RGB channel, I C (x, y) represents the pixel value of the pixel point (x, y) in any channel in the illumination image, C represents any channel among the R channel, G channel and B channel, I min (x, y) represents the minimum grayscale value of the RGB three channels of any pixel point (x, y). It represents the average value of the minimum grayscale values ​​of the three channels of all pixels in the illumination image;

[0121] S224, calculating the pixel value of each pixel in the de-highlighted image according to the first pixel value of each pixel; the calculation formula of the pixel value of each pixel in the de-highlighted image is:

[0122]

[0123] In the above formula, Represents the pixel value of the pixel point (x, y) in any RGB channel in the de-highlighted image. Indicates the first pixel value of the pixel point (x, y) in any RGB channel. and Represent the first pixel value of the pixel point (x, y) in the R channel, G channel and B channel respectively;

[0124] S23, calculate the average pixel values ​​of the RGB channels of the area corresponding to the initial object area in the de-highlighted image, and obtain the pixel points whose pixel difference is less than a certain multiple of the sum of the average pixel values ​​of the RGB channels according to the pixel difference between each pixel point in the de-highlighted image and the average pixel value, so as to obtain the standard object area; in step S21, the method of obtaining the initial object area by the HSV threshold value sometimes finds it difficult to determine the most reasonable threshold value, so in step S21, a larger range is set for the HSV threshold value to perform preliminary extraction of the object image, and on this basis, further process the de-highlighted image obtained in step S22 to obtain a more accurate object image, and in step S23, specifically includes the following steps:

[0125] S231, calculating the average pixel value of the area corresponding to the initial object area in the de-highlighted image in the three RGB channels respectively; the calculation formula of the average pixel value is:

[0126]

[0127] In the above formula, It represents the average pixel value of the RGB three channels in the area corresponding to the initial object area in the de-highlighted image, C represents any channel among the R channel, G channel and B channel, and M represents the number of pixels in the area corresponding to the initial object area in the de-highlighted image. Represents the pixel value of the pixel point (x, y) in any RGB channel in the de-highlighted image;

[0128] S232, calculating the pixel difference between the pixel value of any pixel point and the average pixel value; the calculation formula of the pixel difference is:

[0129]

[0130] In the above formula, ΔI(x, y) represents the pixel difference between the pixel value of any pixel and the average pixel value. and They represent the average pixel values ​​of the R channel, G channel, and B channel in the area corresponding to the initial object area in the de-highlighted image, respectively. and Respectively represent the pixel value of any pixel point (x, y) in the area corresponding to the initial object area in the de-highlighted image in the R channel, G channel and B channel;

[0131] S233, calculating the pixel segmentation threshold according to the average pixel values ​​of the area corresponding to the initial object area in the de-highlighted image in the three channels of RGB; the calculation formula of the pixel segmentation threshold is:

[0132]

[0133] In the above formula, ΔI 0 represents the pixel segmentation threshold, τ represents the segmentation coefficient, and its value range is 0.05~0.1. and They represent the average pixel values ​​of the R channel, G channel, and B channel of the area corresponding to the initial object area in the de-highlighted image;

[0134] S234 , selecting pixels whose pixel difference in an area corresponding to the initial object area in the highlight image is less than a pixel segmentation threshold to generate a standard object area.

[0135] S24, calculating the grayscale ratio of any pixel in the illumination image corresponding to the standard object area, and removing a number of pixels with the largest grayscale ratio in the quasi-object area; the grayscale ratio calculation formula is:

[0136]

[0137] In the above formula, R(x, y) represents the grayscale ratio of the pixel (x, y), I min (x, y) and I max (x, y) represents the minimum and maximum values ​​of the RGB three-channel pixel values ​​at the pixel point (x, y), and ε is a non-zero positive number;

[0138] S25, calculating the brightness of the standard object area according to the pixel value of the pixel point in the illumination image corresponding to the standard object area; when an image is illuminated by light sources of different brightness, the brightness of the image surface is also different, so it needs to be calibrated here. In order to improve the accuracy of calibration, several groups of experimental images are obtained under the illumination of light sources of the same brightness. There are differences in the exposure time during illumination. In step S25, the following steps are specifically included:

[0139] S251, setting up a closed laboratory for experiments, and experimental pictures containing various pixel values;

[0140] S252. Calculate the standard number of camera shots according to the brightness range of the laboratory during the experiment and the effective dynamic range of the camera. The calculation formula for the standard number of camera shots is:

[0141]

[0142] In the above formula, n represents the standard number of camera shots, N actual is the brightness range of the closed laboratory during the experiment, N camera is the effective dynamic range of the camera;

[0143] S253, setting a brightness gradient of the light source, and sequentially irradiating the experimental picture with a light source of a certain brightness for a certain time, and collecting experimental images when the light source irradiates the experimental picture at different irradiation times under the light source of the same brightness, so as to obtain the experimental images in a number not less than the standard shooting number of the camera;

[0144] S254, calculating the brightness value of a plurality of experimental images at the same pixel point; the calculation formula for the brightness of a plurality of experimental images at the same pixel point is:

[0145]

[0146] In the above formula, L(x, y) represents the brightness at the pixel point (x, y) calculated based on several sets of experimental images, and L i represents the brightness of the i-th image at the pixel point (x, y), and I′(x, y) represents the pixel value of the i-th image at the pixel point (x, y);

[0147] S255, draw a curve of the relationship between any pixel value on the experimental image and the brightness of the light source;

[0148] S256. The expression for calculating brightness and pixel value obtained by fitting the relationship curve is:

[0149] L=f(I)

[0150] In the above formula, L represents brightness and I is the pixel value of the object;

[0151] S257, calculating the brightness of the standard object area according to the pixel values ​​of the pixel points in the illumination image corresponding to the standard object area.

[0152] S26. Calculate the illumination of the standard object area according to the brightness of the standard object area. The calculation formula of the illumination is:

[0153]

[0154] In the above formula, E in It represents the incident light illumination received by the object, ρ is the diffuse reflectance of the object surface, and L is the brightness of the standard object area.

[0155] S3, setting a number of influencing factors affecting LED brightness including the illumination of the standard object area, and setting the corresponding relationship between the influencing factors and the preset brightness of the LED to generate a preset brightness database; the brightness database is constructed and generated using a BP neural network model, which is further described herein. In step S3, the following steps are specifically included:

[0156] S31, setting several groups of samples, each group of samples includes several influencing factors of the standard object area illumination that affect the LED brightness, and the first preset brightness of the corresponding LED. During the experiment, the set influencing factors include the standard object area illumination, room type, number of people, room usage scenarios (such as eating, resting and reading, etc.), season, weather and current time, etc.;

[0157] S32, constructing a BP neural network model to train the samples to generate a preset brightness database.

[0158] S4, determining whether the received control instruction is a light-on instruction or a brightness adjustment instruction;

[0159] If the received control command is a light-on command, the LED brightness is adjusted to the preset brightness according to the preset brightness database, and the process ends; thus, the LED brightness can be directly adjusted to a suitable brightness, thereby reducing the number of times the customer repeatedly adjusts the LED brightness, thereby greatly reducing the probability of sudden changes in the LED brightness during the adjustment process;

[0160] If the received control instruction is a brightness adjustment instruction, proceed to step S5;

[0161] S5, according to the brightness adjustment instruction, control the LED driving current to increase or decrease at a certain current step until the brightness adjustment instruction ends, and update the LED preset brightness in the current scene in the preset brightness database according to the LED brightness at this time; the LED driving current is no longer directly adjusted to the corresponding value by the customer, but according to the customer's input instruction, the maximum current in the circuit is controlled to increase or decrease at a certain speed, thereby achieving the purpose of controlling the maximum current in the circuit. The method of controlling the maximum current in the circuit can be implemented by components such as comparators. The current input to the LED needs to pass through the comparator first. If the current passing through the comparator is greater than the maximum current allowed by the circuit obtained by calculation, that is, the current LED driving current calculated below, only the current equal to the LED driving current value is output to the LED. If the current passing through the comparator is less than the maximum current allowed by the circuit obtained by calculation, it is directly output or limited to a minimum value. The following is a further description of this process. In step S5, it specifically includes the following steps:

[0162] S51, setting several amplitude modulation levels and corresponding current step sizes; for example, setting two amplitude modulation levels, and setting the current step sizes to 0.1 mA / S and 0.3 mA / S, that is, increasing by 0.1 mA and 0.3 mA per second respectively;

[0163] S52, obtaining the duration of the brightness adjustment instruction input by the user and the amplitude modulation level selected by the user;

[0164] S53, calculating the current LED driving current according to the duration and current step of the brightness adjustment instruction input by the user; the calculation formula of the current LED driving current is:

[0165] I A =I′ A +ΔI A t

[0166] In the above formula, I A Represents the current LED drive current, I′ A is the LED drive current before the input brightness adjustment command, ΔI A is the current step size, and t is the duration of the brightness adjustment command input by the user.

[0167] S54, determining whether a stop instruction of the brightness adjustment instruction is received;

[0168] If yes, the current LED driving current is output and the process goes to step S55;

[0169] If not, return to step S53;

[0170] S55, save the LED brightness corresponding to the current LED driving current, and calculate the LED update brightness according to the LED preset brightness in the current scene in the preset brightness database and the current LED brightness, so as to replace the LED preset brightness in the current scene in the preset brightness database; each user may have his own personalized needs for LED brightness, so the LED preset brightness corresponding to the scene in the preset brightness database may not be suitable for everyone, so it is necessary to perform personalized setting of the LED preset brightness through this step to make it more humane and intelligent. In step S55, the following steps are specifically included:

[0171] S551, obtaining historical data of LED preset brightness in the current scene and LED brightness corresponding to the current LED driving current to obtain scene brightness data of the LED;

[0172] S552, setting an initial metering radius and an initial number of iterations to 1 according to the range of the scene brightness data, and setting the initial statistical data range to the scene brightness data;

[0173] S553. Calculate the metering radius according to the number of iterations; the calculation formula of the metering radius is:

[0174]

[0175] In the above formula, R p represents the measurement radius at the pth iteration, p represents the number of iterations, which is 1 in the initial case, and R 0 Indicates the initial measurement radius, which is the range of the scene brightness data, that is, the difference between the maximum and minimum values ​​in the scene brightness data;

[0176] S554, calculating the brightness density of any preset brightness in the scene brightness data according to the measurement radius; the calculation formula of the brightness density is:

[0177]

[0178] in,

[0179]

[0180] In the above formula, ρ i represents the brightness density of the i-th preset brightness, L i and L j Represent the values ​​of the i-th and j-th preset brightness respectively. The total number of data in the scene brightness data is A, R p represents the measurement radius at the pth iteration, μ(·) is the sign function;

[0181] S555, taking the data within the measurement radius corresponding to the preset brightness with the largest brightness density as the statistical data range;

[0182] S556, determine whether the current number of iterations is less than 2;

[0183] If yes, return to step S553;

[0184] If not, proceed to step S557;

[0185] S557, determining whether the current statistical data range is the same as the statistical data range in the previous iteration;

[0186] If yes, proceed to step S558;

[0187] If not, return to step S553;

[0188] S558, calculate the average value of the preset brightness within the current statistical data range as the LED update brightness, and replace the LED preset brightness in the current scene in the preset brightness database. In steps S551-S558, since some users may have fluctuations in their requirements for LED brightness within a certain range, in order to reduce the user's adjustment frequency, based on the LED brightness of the corresponding scene adjusted by the user in the past, that is, the LED scene brightness data, the LED preset brightness is set to the area with the most concentrated data density in the scene brightness data, and the average value of the data in the area is calculated as the LED update brightness, and the LED preset brightness in the current scene in the preset brightness database is replaced.

[0189] The present invention first removes highlights from an illumination image to obtain a removed highlight image, and calculates the illuminance of an area in the illumination image corresponding to the removed highlight image, so as to obtain a corresponding reference object, remove noise, and simultaneously remove specular reflection points, thereby being able to better calculate the illuminance of the object surface based on the correspondence between the pixel value on the reference object surface and the illuminance, and based on the correspondence between a number of influencing factors including the illuminance and the preset brightness of the LED, it is convenient to subsequently directly adjust the brightness of the LED to an appropriate value when turning on the light based on the generated brightness database, so as to reduce the number of brightness adjustments by the user, and when the brightness needs to be adjusted, the maximum current input to the LED in the current step control circuit can be controlled, so as to prevent the current in the circuit from suddenly changing due to noise, thereby further improving the probability of the LED brightness remaining stable.

[0190] The above implementation methods have been described in detail. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for adjusting LED brightness without sudden changes, characterized in that: The adjustment method comprises the following steps: S1, obtaining basic data including an illumination image of a non-white object in any area of ​​a room illuminated by LED, the brightness of the LED and the LED driving current, and the corresponding relationship between the illumination of the illumination image and the brightness of the LED and the LED driving current; S2, removing highlights from a specific object in the illumination image to obtain a de-highlighted image, and calculating the illumination of an area in the illumination image corresponding to the de-highlighted image according to the basic data; S3, setting a number of influencing factors affecting LED brightness including standard object area illumination, and setting a corresponding relationship between the influencing factors and the preset brightness of the LED to generate a preset brightness database; S4, determining whether the received control instruction is a light-on instruction or a brightness adjustment instruction; If the received control command is a light-on command, the LED brightness is adjusted to the preset brightness according to the preset brightness database, and the process ends; If the received control instruction is a brightness adjustment instruction, proceed to step S5; S5. According to the brightness adjustment instruction, the LED driving current is controlled to increase or decrease at a certain current step until the brightness adjustment instruction ends, and the LED preset brightness in the current scene in the preset brightness database is updated according to the LED brightness at this time.

2. The method for non-mutation adjustment according to claim 1, characterized in that: In step S2, the following steps are specifically included: S21, converting the illumination image into the HSV color space and obtaining the initial object region by setting the HSV threshold of the non-white object and filtering; S22, removing highlights from a specific object in the illumination image to obtain a de-highlighted image, and calculating the illumination of an area in the illumination image corresponding to the de-highlighted image according to the basic data; S23, calculating the average pixel values ​​of the areas corresponding to the initial object area in the de-highlighted image in the RGB three channels respectively, and obtaining the pixel points whose pixel differences are less than a certain multiple of the sum of the average pixel values ​​of the RGB three channels according to the pixel differences between each pixel point in the de-highlighted image and the average pixel value, so as to obtain the standard object area; S24, calculating the grayscale ratio of any pixel in the illumination image corresponding to the standard object area, and removing a number of pixels with the largest grayscale ratio in the quasi-object area; the grayscale ratio calculation formula is: In the above formula, R(x, y) represents the grayscale ratio of the pixel (x, y), I min (x, y) and I max (x, y) represents the minimum and maximum values ​​of the RGB three-channel pixel values ​​at the pixel point (x, y), and ε is a non-zero positive number; S25, calculating the brightness of the standard object area according to the pixel values ​​of the pixel points in the illumination image corresponding to the standard object area; S26. Calculate the illumination of the standard object area according to the brightness of the standard object area. The calculation formula of the illumination is: In the above formula, E in It represents the incident light illumination received by the object, ρ is the diffuse reflectance of the object surface, and L is the brightness of the standard object area.

3. The method for non-mutation adjustment according to claim 2, characterized in that: In step S22, the following steps are specifically included: S221, calculate the minimum value of the RGB three-channel grayscale value of any pixel point in the illumination image; the calculation formula for the minimum value of the RGB three-channel grayscale value of any pixel point is: I min (x,y)=min(R(x,y),G(x,y),B(x,y)) In the above formula, I min (x, y) represents the minimum grayscale value of the RGB three channels of any pixel with coordinates (x, y), R(x, y), G(x, y) and B(x, y) represent the grayscale value of the RGB three channels of any pixel in the illumination image, and min(·) represents the minimum value; S222, calculating the average value of the minimum three-channel grayscale values ​​of all pixels according to the minimum three-channel grayscale values; the calculation formula for the average value of the minimum three-channel grayscale values ​​is: In the above formula, It represents the average value of the minimum grayscale value of the three channels of all pixels in the illumination image, N represents the number of pixels, and I min (x, y) represents the minimum grayscale value of the RGB channels of any pixel with coordinates (x, y); S223, calculating the first pixel value of each pixel point according to the average value of the minimum grayscale value of the three channels; the calculation formula of the first pixel value is: In the above formula, Indicates the first pixel value of the pixel point (x, y) in any RGB channel, I C (x, y) represents the pixel value of the pixel point (x, y) in any channel in the illumination image, C represents any channel among the R channel, G channel and B channel, I min (x, y) represents the minimum grayscale value of the RGB three channels of any pixel point (x, y). It represents the average value of the minimum grayscale values ​​of the three channels of all pixels in the illumination image; S224 , calculating the pixel value of each pixel in the de-highlighted image according to the first pixel value of each pixel.

4. The method for non-mutation adjustment according to claim 2, characterized in that: In step S23, the following steps are specifically included: S231, calculating the average pixel value of the area corresponding to the initial object area in the de-highlighted image in the three RGB channels respectively; the calculation formula of the average pixel value is: In the above formula, It represents the average pixel value of the RGB three channels in the area corresponding to the initial object area in the de-highlighted image, C represents any channel among the R channel, G channel and B channel, and M represents the number of pixels in the area corresponding to the initial object area in the de-highlighted image. Represents the pixel value of the pixel point (x, y) in any RGB channel in the de-highlighted image; S232, calculating the pixel difference between the pixel value of any pixel point and the average pixel value; The calculation formula for pixel difference is: In the above formula, ΔI(x, y) represents the pixel difference between the pixel value of any pixel and the average pixel value. and They represent the average pixel values ​​of the R channel, G channel, and B channel in the area corresponding to the initial object area in the de-highlighted image, respectively. and Respectively represent the pixel value of any pixel point (x, y) in the area corresponding to the initial object area in the de-highlighted image in the R channel, G channel and B channel; S233, calculating the pixel segmentation threshold according to the average pixel values ​​of the area corresponding to the initial object area in the de-highlighted image in the three channels of RGB; the calculation formula of the pixel segmentation threshold is: In the above formula, ΔI 0 represents the pixel segmentation threshold, τ represents the segmentation coefficient, and its value range is 0.05~0.

1. and They represent the average pixel values ​​of the R channel, G channel, and B channel of the area corresponding to the initial object area in the de-highlighted image; S234 , selecting pixels whose pixel difference in an area corresponding to the initial object area in the highlight image is less than a pixel segmentation threshold to generate a standard object area.

5. The method for non-mutation adjustment according to claim 2, characterized in that: In step S25, the following steps are specifically included: S251, setting up a closed laboratory for experiments, and experimental pictures containing various pixel values; S252. Calculate the standard number of camera shots according to the brightness range of the laboratory during the experiment and the effective dynamic range of the camera. The calculation formula for the standard number of camera shots is: In the above formula, n represents the standard number of camera shots, N actual is the brightness range of the closed laboratory during the experiment, N camera is the effective dynamic range of the camera; S253, setting a brightness gradient of the light source, and sequentially irradiating the experimental picture with a light source of a certain brightness for a certain time, and collecting experimental images when the light source irradiates the experimental picture at different irradiation times under the light source of the same brightness, so as to obtain the experimental images in a number not less than the standard shooting number of the camera; S254, calculating the brightness values ​​of several groups of experimental images at the same pixel point; S255, draw a curve of the relationship between any pixel value on the experimental image and the brightness of the light source; S256. The expression for calculating brightness and pixel value obtained by fitting the relationship curve is: L=f(I) In the above formula, L represents brightness and I is the pixel value of the object; S257, calculating the brightness of the standard object area according to the pixel values ​​of the pixel points in the illumination image corresponding to the standard object area.

6. The method for non-mutation adjustment according to claim 1, characterized in that: In step S3, the following steps are specifically included: S31. Set several groups of samples, each group of samples including several factors affecting LED brightness of the standard object area illumination, and a first preset brightness of the corresponding LED. S32, constructing a BP neural network model to train the samples to generate a preset brightness database.

7. The method for non-mutation adjustment according to claim 1, characterized in that: In step S5, the following steps are specifically included: S51, setting a number of amplitude modulation levels and setting corresponding current step sizes; S52, obtaining the duration of the brightness adjustment instruction input by the user and the amplitude modulation level selected by the user; S53, calculating the current LED driving current according to the duration and current step of the brightness adjustment instruction input by the user; the calculation formula of the current LED driving current is: I A =I′ A +ΔI A t In the above formula, I A Represents the current LED drive current, I′ A is the LED drive current before the input brightness adjustment command, ΔI A is the current step size, t is the duration of the brightness adjustment command input by the user; S54, determining whether a stop instruction of the brightness adjustment instruction is received; If yes, the current LED driving current is output and the process goes to step S55; If not, return to step S53; S55, saving the LED brightness corresponding to the current LED driving current, and calculating the LED update brightness according to the LED preset brightness in the current scene in the preset brightness database and the current LED brightness, so as to replace the LED preset brightness in the current scene in the preset brightness database.

8. The method for non-mutation adjustment according to claim 1, characterized in that: In step S55, the following steps are specifically included: S551, obtaining historical data of LED preset brightness in the current scene and LED brightness corresponding to the current LED driving current to obtain scene brightness data of the LED; S552, setting an initial metering radius and an initial number of iterations to 1 according to the range of the scene brightness data, and setting the initial statistical data range to the scene brightness data; S553. Calculate the metering radius according to the number of iterations; the calculation formula of the metering radius is: In the above formula, R p It represents the measurement radius at the pth iteration, where p represents the number of iterations and is 1 in the initial case. R0 represents the initial measurement radius, which is the range of the scene brightness data, that is, the difference between the maximum and minimum values ​​in the scene brightness data. S554, calculating the brightness density of any preset brightness in the scene brightness data according to the measurement radius; The calculation formula for brightness density is: in, In the above formula, ρ i represents the brightness density of the i-th preset brightness, L i and L j Represent the values ​​of the i-th and j-th preset brightness respectively. The total number of data in the scene brightness data is A, R p represents the measurement radius at the pth iteration, μ(·) is the sign function; S555, taking the data within the measurement radius corresponding to the preset brightness with the largest brightness density as the statistical data range; S556, determine whether the current number of iterations is less than 2; If yes, return to step S553; If not, proceed to step S557; S557, determining whether the current statistical data range is the same as the statistical data range in the previous iteration; If yes, proceed to step S558; If not, return to step S553; S558. Calculate the average value of the preset brightness within the current statistical data range as the LED update brightness, and replace the LED preset brightness in the current scene in the preset brightness database.

9. The method for non-mutation adjustment according to claim 5, characterized in that: In step S254, the calculation formula for the brightness of several groups of experimental images at the same pixel point is: In the above formula, L(x, y) represents the brightness at the pixel point (x, y) calculated based on several sets of experimental images, and L i represents the brightness of the i-th image at the pixel point (x, y), and I′(x, y) represents the pixel value of the i-th image at the pixel point (x, y).

10. The method for non-mutation adjustment according to claim 3, characterized in that: In step S224, the calculation formula for the pixel value of each pixel in the de-highlighted image is: In the above formula, Represents the pixel value of the pixel point (x, y) in any RGB channel in the de-highlighted image. Indicates the first pixel value of the pixel point (x, y) in any RGB channel. and Represents the first pixel value of the pixel point (x, y) in the R channel, G channel, and B channel respectively.

Citation Information

Patent Citations

  • LED surgical shadowless lamp system with full-automatic intelligent constant-light control function

    CN104363676A

  • Scene illuminance calculation method based on image acquisition

    CN110346116A

  • LED brightness gradient control method and system

    CN113301682A

  • Light intensity control of an LED lighting system

    US10292227B1