Screen brightness control method and device based on vending machine camera

By capturing images in real time through the vending machine's camera and establishing a linear regression model using the average brightness or contrast of the images, the screen brightness is dynamically adjusted, solving the problem of brightness adjustment in vending machines when the light changes, thus improving user experience and energy efficiency.

CN121122160APending Publication Date: 2025-12-12SHANGHAI QUZHI NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511426469.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

In existing technologies, vending machines cannot accurately adjust to changes in light, resulting in poor visibility in bright light, high power consumption and poor user experience in dim light. Furthermore, existing light sensors cannot adapt to environmental changes in a timely manner.

Method used

By using vending machine cameras to collect environmental images in real time, light characteristic parameters are extracted through image brightness mean or contrast analysis, and a linear regression model is established to adjust screen brightness, dynamically adapting to changes in ambient light and optimizing the acquisition frequency to reduce energy consumption.

Benefits of technology

It achieves automatic brightness adjustment without manual user operation, ensuring clear screen visibility under various lighting conditions, reducing energy consumption, and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121122160A_ABST
    Figure CN121122160A_ABST
Patent Text Reader

Abstract

The invention discloses a screen brightness control method and device based on a camera of a vending machine, and the method comprises the steps: continuously collecting the image information of the environment around the vending machine in real time through the camera, and enabling the image information of the environment to comprise visual data reflecting the brightness degree of surrounding light; the collected environment image information is preprocessed, characteristic parameters related to the environment light intensity are extracted from the environment image information, and the characteristic parameters quantitatively represent the intensity of the environment light; establishing a corresponding relation model between the ambient light intensity characteristic parameter and the screen brightness, and determining the screen brightness corresponding to the specified characteristic parameter value through the corresponding relation model; according to the environment light intensity characteristic parameters obtained through real-time analysis, the brightness of the screen of the vending machine is adjusted according to the corresponding relation model, and the brightness of the screen of the vending machine is made to adapt to the real-time environment light condition. The problems that an existing intelligent vending machine cannot be adjusted along with the change of ambient light, manual adjustment needs user operation, real-time adaptation cannot be achieved, and the use effect is affected are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent vending machine technology, specifically relating to a screen brightness control method and device based on a vending machine camera. Background Technology

[0002] With the rapid development of the smart retail industry, vending machines, as convenient retail terminals, have been widely distributed in various scenarios such as shopping malls, office buildings, campuses, and communities. To enhance the user interaction experience, modern vending machines are generally equipped with touch screens for displaying product information and receiving user operation commands. However, the ambient lighting conditions in which vending machines operate are often complex and variable, such as strong direct sunlight outdoors during the day, weak indoor lighting at night, or unstable lighting conditions like cloudy days. This places high demands on the adaptability of the screen brightness.

[0003] Currently, some vending machines use fixed brightness settings. In bright light, the screen display can easily be obscured, making it difficult for users to clearly see product information or complete operations. In low light, excessively high screen brightness not only wastes energy but can also negatively impact user experience due to glare. While some vending machines incorporate light sensors to adjust brightness, traditional light sensors often use single-point sampling, only sensing local light intensity and failing to comprehensively reflect the actual lighting conditions in the user's operating area, leading to inaccurate brightness adjustments.

[0004] Furthermore, existing brightness adjustment solutions typically use a fixed light sampling frequency. In scenarios with rapidly changing light conditions (such as clouds blocking sunlight or sudden light switching), this fixed frequency can lead to delayed brightness adjustments, failing to adapt to environmental changes promptly. Conversely, in stable lighting conditions, an excessively high sampling frequency increases device power consumption and computational burden. Therefore, leveraging the vending machine's existing camera resources to achieve comprehensive perception, accurate analysis, and dynamic brightness adjustment of ambient light has become a key issue in improving the vending machine's user experience and reducing energy consumption. Summary of the Invention

[0005] To address this issue, the present invention provides a screen brightness control method and device based on a vending machine camera, solving the problems of existing smart vending machines being unable to adjust to changes in ambient light, resulting in poor visibility in strong light and excessive power consumption and eye strain in dim light; manual adjustment requires user operation and cannot adapt in real time, thus affecting the user experience.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a screen brightness control method based on a vending machine camera, comprising the following steps:

[0007] The vending machine continuously collects environmental image information around it in real time via a camera. The environmental image information includes visual data reflecting the brightness of the surrounding light.

[0008] The acquired environmental image information is preprocessed to extract feature parameters related to ambient light intensity from the environmental image information. These feature parameters quantify the intensity of ambient light.

[0009] Establish a correspondence model between ambient light intensity characteristic parameters and screen brightness, and determine the screen brightness corresponding to a specified characteristic parameter value through the correspondence model;

[0010] Based on the ambient light intensity characteristic parameters obtained from real-time analysis, and according to the corresponding relationship model, the brightness of the vending machine screen is adjusted so that the screen brightness adapts to the real-time ambient light conditions.

[0011] As a preferred embodiment of the screen brightness control method based on a vending machine camera, during the continuous real-time acquisition of environmental image information around the vending machine by the camera, the acquisition frequency of the camera is dynamically adjusted according to the rate of change of ambient light. The formula for calculating the rate of change of ambient light is as follows:

[0012]

[0013] In the formula, V is the rate of change of ambient light, and F t F represents the ambient light intensity feature parameter extracted at the current moment. t-1 Here, t represents the ambient light intensity feature parameters extracted at the previous moment, and t represents the current moment. t-1 The previous moment is defined as follows: when V > V0, V0 is the preset rate threshold, and the camera's acquisition frequency is increased to f1; when V ≤ V0, the camera's acquisition frequency is decreased to f2, where f1 > f2.

[0014] As a preferred embodiment of the screen brightness control method based on a vending machine camera, the method for extracting feature parameters related to ambient light intensity from the environmental image information is as follows:

[0015] The average image brightness is used for calculation, and the formula is as follows:

[0016]

[0017] In the formula, L is the average brightness of the image, M and N are the number of rows and columns of the image, respectively, and I(i,j) is the brightness value of the pixel at position (i,j) in the image;

[0018] Alternatively, contrast analysis can be used, with the following formula:

[0019]

[0020] In the formula, C represents the contrast ratio.

[0021] As a preferred method for screen brightness control based on vending machine cameras, the correspondence model is obtained through training on sample data. The correspondence model is constructed using a linear regression model, and the formula is:

[0022] B = k × F + b

[0023] In the formula, B is the screen brightness value, F is the ambient light intensity characteristic parameter, k is the regression coefficient, b is a constant term, and the sample data includes the characteristic parameters under different ambient light intensities and the corresponding optimal screen brightness values.

[0024] As a preferred embodiment of the screen brightness control method based on a vending machine camera, according to the aforementioned correspondence model, when adjusting the brightness of the vending machine screen, if the ambient light intensity characteristic parameter F > F1, where F1 is a first preset threshold, then the screen brightness is adjusted to the first brightness range [B]. 1min B 1max ];

[0025] If the ambient light intensity characteristic parameter F < F2, where F2 is the second preset threshold, and F1 > F2, then the screen brightness is adjusted to the second brightness range [B]. 2min B 2max ], and B 1min >B 2max The threshold satisfies F1-F2≥ΔF, where ΔF is a preset difference.

[0026] The present invention also provides a screen brightness control device based on a vending machine camera, comprising:

[0027] An environmental image acquisition module is used to continuously and in real-time acquire environmental image information around the vending machine via a camera. The environmental image information includes visual data reflecting the brightness of the surrounding light.

[0028] The feature parameter extraction module is used to preprocess the acquired environmental image information and extract feature parameters related to the ambient light intensity from the environmental image information. The feature parameters quantify the intensity of the ambient light.

[0029] The correspondence model construction module is used to establish a correspondence model between ambient light intensity feature parameters and screen brightness, and to determine the screen brightness corresponding to a specified feature parameter value through the correspondence model.

[0030] The brightness adjustment module is used to adjust the brightness of the vending machine screen according to the ambient light intensity characteristic parameters obtained from real-time analysis and the corresponding relationship model, so that the brightness of the vending machine screen adapts to the real-time ambient light conditions.

[0031] As a preferred embodiment of the screen brightness control device based on a vending machine camera, in the environmental image acquisition module, the camera's acquisition frequency is dynamically adjusted according to the rate of change of ambient light, and the formula for calculating the rate of change of ambient light is:

[0032]

[0033] In the formula, V is the rate of change of ambient light, and F t F represents the ambient light intensity feature parameter extracted at the current moment. t-1 Here, t represents the ambient light intensity feature parameters extracted at the previous moment, and t represents the current moment. t-1 The previous moment is defined as follows: when V > V0, V0 is the preset rate threshold, and the camera's acquisition frequency is increased to f1; when V ≤ V0, the camera's acquisition frequency is decreased to f2, where f1 > f2.

[0034] As a preferred embodiment of the screen brightness control device based on a vending machine camera, the feature parameter extraction module extracts feature parameters related to ambient light intensity in the following way:

[0035] The average image brightness is used for calculation, and the formula is as follows:

[0036]

[0037] In the formula, L is the average brightness of the image, M and N are the number of rows and columns of the image, respectively, and I(i,j) is the brightness value of the pixel at position (i,j) in the image;

[0038] Alternatively, contrast analysis can be used, with the following formula:

[0039]

[0040] In the formula, C represents the contrast ratio.

[0041] As a preferred embodiment of the screen brightness control device based on a vending machine camera, in the correspondence model construction module, the correspondence model is obtained through training on sample data, and the correspondence model is constructed using a linear regression model, with the following formula:

[0042] B = k × F + b

[0043] In the formula, B is the screen brightness value, F is the ambient light intensity characteristic parameter, k is the regression coefficient, b is a constant term, and the sample data includes the characteristic parameters under different ambient light intensities and the corresponding optimal screen brightness values.

[0044] As a preferred embodiment of the screen brightness control device based on a vending machine camera, in the brightness adjustment module, when adjusting the brightness of the vending machine screen according to the corresponding relationship model, if the ambient light intensity characteristic parameter F > F1, where F1 is a first preset threshold, then the screen brightness is adjusted to the first brightness range [B]. 1min B 1max ];

[0045] If the ambient light intensity characteristic parameter F < F2, where F2 is the second preset threshold, and F1 > F2, then the screen brightness is adjusted to the second brightness range [B]. 2min B 2max ], and B 1min >B 2max The threshold satisfies F1-F2≥ΔF, where ΔF is a preset difference.

[0046] The beneficial effects of this invention are as follows:

[0047] First, it eliminates the need for manual operation by using a camera to monitor ambient light in real time and automatically adjust the screen brightness, reducing user steps, improving ease of use, and optimizing the user experience.

[0048] Secondly, it can adjust in real time according to changes in ambient light. When the light is strong, it brightens the screen to ensure that users can clearly see the content; when the light is dim, it lowers the brightness, which reduces energy consumption while ensuring visibility and also prevents the screen from being too bright and causing discomfort to the user's eyes.

[0049] Third, the camera continuously collects and processes environmental images, keeping the screen brightness at a suitable level. Regardless of changes in ambient light, it provides users with a good visual experience, improving the vending machine's usability. Attached Figure Description

[0050] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.

[0051] Figure 1 A schematic diagram of the technical route for a screen brightness control method based on a vending machine camera provided in an embodiment of the present invention;

[0052] Figure 2 A flowchart of a screen brightness control method based on a vending machine camera provided in an embodiment of the present invention;

[0053] Figure 3This is an architectural diagram of a screen brightness control device based on a vending machine camera, provided in an embodiment of the present invention. Detailed Implementation

[0054] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0055] Example 1

[0056] See Figure 1 and Figure 2 This invention provides a screen brightness control method based on a vending machine camera, comprising the following steps:

[0057] S1. The system continuously collects real-time environmental image information around the vending machine using a camera. This environmental image information includes visual data reflecting the brightness of the surrounding light. The camera, as an image acquisition device, captures optical signals from the environment around the vending machine and converts them into digital images. The brightness of the light in the environment directly affects the brightness values ​​of pixels in the image; for example, the overall pixel brightness value is higher in strong light and lower in low light. Continuous real-time acquisition allows for dynamic tracking of changes in ambient light, providing continuous raw data support for subsequent light intensity analysis and ensuring timely response to changes in ambient light.

[0058] S2. The acquired environmental image information is preprocessed to extract feature parameters related to ambient light intensity. These feature parameters quantify the strength of the ambient light. Preprocessing steps (such as noise reduction and deblurring) eliminate interference factors in the image (such as camera noise and motion blur), ensuring image quality and preventing irrelevant information from affecting the accuracy of feature parameter extraction. Extracting feature parameters converts visual information reflecting light intensity in the image into quantifiable numerical indicators. Since the intensity of ambient light is directly related to visual attributes such as image brightness and contrast, calculating the quantified values ​​of these attributes (i.e., feature parameters) allows for an objective and accurate representation of the actual intensity of ambient light, providing data for subsequent brightness adjustment.

[0059] S3. Establish a correspondence model between ambient light intensity characteristic parameters and screen brightness. This model determines the screen brightness corresponding to a specified characteristic parameter value. The model is built upon a large amount of sample data, covering characteristic parameters under different lighting conditions and their corresponding optimal screen brightness (i.e., brightness that provides a good user visual experience while consuming reasonable energy). Through training on the sample data (e.g., using linear regression algorithms), the model learns the inherent relationship between the characteristic parameters and screen brightness. When a new characteristic parameter is input, the model can quickly output the corresponding suitable screen brightness based on the learned pattern, thus realizing the conversion from ambient light information to screen brightness adjustment instructions.

[0060] S4. Based on the ambient light intensity characteristic parameters obtained from real-time analysis, and according to the aforementioned correspondence model, the brightness of the vending machine screen is adjusted to adapt to the real-time ambient light conditions. In real-time applications, the system continuously acquires new ambient light intensity characteristic parameters and inputs them into the established correspondence model. The correspondence model outputs the target screen brightness for the current environment. Subsequently, the system controls components such as the screen's drive circuitry to adjust the screen brightness to the target value. This process forms a closed loop, ensuring that the screen brightness dynamically adjusts to changes in ambient light, thereby providing users with a clear and comfortable visual experience under various lighting conditions while avoiding energy waste.

[0061] In this embodiment, during the continuous real-time acquisition of environmental image information around the vending machine by the camera, the camera's acquisition frequency is dynamically adjusted according to the rate of change of ambient light. The formula for calculating the rate of change of ambient light is:

[0062]

[0063] In the formula, V is the rate of change of ambient light, and F t F represents the ambient light intensity feature parameter extracted at the current moment. t-1 Here, t represents the ambient light intensity feature parameters extracted at the previous moment, and t represents the current moment. t-1 The previous moment is defined as follows: when V > V0, V0 is the preset rate threshold, and the camera's acquisition frequency is increased to f1; when V ≤ V0, the camera's acquisition frequency is decreased to f2, where f1 > f2.

[0064] Specifically, the rate of change of ambient light reflects how quickly light intensity changes over time. When light changes rapidly, such as suddenly entering a shadow or bright light area, a higher acquisition frequency (f1) can acquire image information more densely, ensuring timely capture of light changes and enabling faster screen brightness adjustment without lag. Conversely, when light changes gradually, such as in a stable indoor environment, a lower acquisition frequency (f2) can reduce unnecessary image acquisition and processing operations, lowering the device's energy consumption and computational burden, thus optimizing resource utilization while ensuring adjustment effectiveness. The formula quantifies the rate of change by dividing the absolute value of the difference between the current and previous feature parameters by the time difference, and then compares it with a preset threshold to achieve dynamic switching of the acquisition frequency.

[0065] In this embodiment, the method for extracting feature parameters related to ambient light intensity from the environmental image information is as follows:

[0066] The average image brightness is used for calculation, and the formula is as follows:

[0067]

[0068] In the formula, L is the average brightness of the image, M and N are the number of rows and columns of the image, respectively, and I(i,j) is the brightness value of the pixel at position (i,j) in the image;

[0069] Alternatively, contrast analysis can be used, with the following formula:

[0070]

[0071] In the formula, C represents the contrast ratio.

[0072] Specifically, the image brightness mean L is calculated by averaging the brightness values ​​of all pixels in the image, comprehensively reflecting the overall brightness level of the image. A higher average value indicates stronger ambient light, and vice versa. Contrast ratio C is calculated by averaging the squared deviations of each pixel's brightness value from the average brightness value, reflecting the degree of difference between bright and dark areas in the image. In bright light environments, there may be highlight areas in the image, and the contrast ratio may exhibit specific changes; while in low light environments, the image is generally darker, and the contrast ratio will change accordingly. These two methods quantify image features related to ambient light intensity from different perspectives, providing a basis for accurately judging ambient light conditions.

[0073] In this embodiment, the correspondence model is trained using sample data, and the correspondence model is constructed using a linear regression model, with the following formula:

[0074] B = k × F + b

[0075] In the formula, B is the screen brightness value, F is the ambient light intensity characteristic parameter, k is the regression coefficient, b is a constant term, and the sample data includes the characteristic parameters under different ambient light intensities and the corresponding optimal screen brightness values.

[0076] Specifically, the linear regression model assumes a linear relationship between screen brightness (B) and ambient light intensity (F). By fitting a large amount of sample data (including different F values ​​and their corresponding optimal B values), the regression coefficient (k) and constant term (b) can be calculated, thus determining the linear equation. When k is positive, it indicates that the stronger the ambient light (the larger F), the higher the screen brightness (B) should be, which meets the requirement of increasing screen brightness to ensure visibility under strong light. The constant term (b) is the baseline brightness value when F is 0. This model is simple and efficient, and can quickly calculate the corresponding B value based on the real-time F value, meeting the requirements for real-time screen brightness adjustment.

[0077] In this embodiment, when adjusting the brightness of the vending machine screen according to the correspondence model, if the ambient light intensity characteristic parameter F > F1, where F1 is a first preset threshold, then the screen brightness is adjusted to the first brightness range [B]. 1min B 1max ];

[0078] If the ambient light intensity characteristic parameter F < F2, where F2 is the second preset threshold, and F1 > F2, then the screen brightness is adjusted to the second brightness range [B]. 2min B 2max ], and B 1min >B 2max The threshold satisfies F1-F2≥ΔF, where ΔF is a preset difference.

[0079] Specifically, by setting a first preset threshold F1 and a second preset threshold F2, the ambient light intensity is divided into different ranges (strong light, weak light, etc.). When F exceeds F1, it is determined to be a strong light environment, and the screen brightness is adjusted to the higher first brightness range to ensure that the user can see the screen content clearly. When F is lower than F2, it is determined to be a weak light environment, and the screen brightness is adjusted to the lower second brightness range, saving energy while maintaining visibility. Setting a preset difference ΔF between F1 and F2 can avoid frequent switching of screen brightness due to small fluctuations in light around the threshold, improving the stability of adjustment. The minimum value B of the first brightness range. 1min Greater than the maximum value B in the second brightness range 2max This clarifies the differences in brightness range corresponding to different light intervals, ensuring the correctness of the adjustment direction.

[0080] The following data were obtained from experiments based on the method of this invention, used to verify its effectiveness in controlling the brightness of vending machine screens:

[0081] Table 1 Comparison of the screen brightness adjustment effects of the method of the present invention and traditional methods.

[0082]

[0083] Referring to Table 1, in environments with strong direct sunlight (such as outdoor lighting at noon), using a traditional fixed brightness (300 cd / m²) 2 At that time, the user's ability to clearly recognize the screen content was only 65%; however, after adjustment using this invention, the screen brightness increased to 550 cd / m². 2 The user recognition rate has been improved to 98%, effectively solving the problem of screen content not being visible under strong light.

[0084] In a cloudy indoor natural light environment, the traditional fixed brightness (300 cd / m²) 2 The user recognition rate is 80%, and the energy consumption is at a normal level; the brightness of this invention is adjusted to 320 cd / m². 2 It achieves a recognition rate of 95% while reducing energy consumption by 8%, thus saving energy while ensuring clarity.

[0085] In a low-light indoor environment at dusk, a traditional fixed brightness (300 cd / m²) 2 This not only causes visual discomfort for users and results in a recognition rate of only 75%, but also leads to energy waste; the adjusted brightness of this invention is 180 cd / m². 2 The recognition rate has been increased to 96%, and energy consumption has been reduced by 40%, balancing user experience and energy saving.

[0086] In low-light environments without artificial illumination at night, traditional fixed brightness (300 cd / m²) 2 The light is glaring and has a recognition rate of only 60%; this invention reduces the brightness to 80 cd / m². 2 With a recognition rate of 92% and a 73% reduction in energy consumption, it significantly optimizes the user experience in low-light conditions.

[0087] In scenes with rapidly changing light (such as sudden changes in brightness), traditional fixed brightness (300 cd / m²) is insufficient. 2 Because adjustments cannot be made in a timely manner, the recognition rate fluctuates between 50% and 85%; this invention dynamically adjusts the brightness (150-500 cd / m²). 2 The recognition rate remained stable at 94%, and energy consumption was reduced by 25%, demonstrating a rapid adaptability to changes in lighting conditions.

[0088] Test data shows that the present invention can accurately adjust the screen brightness according to different ambient light conditions, maintain a high user recognition rate in various scenarios, significantly reduce energy consumption in non-strong light environments, and dynamically adapt to rapid changes in light, verifying its effect of improving user experience and saving energy.

[0089] The application scenarios of this invention are as follows:

[0090] Vending machines in outdoor public places, such as those in parks and along streets, often face environments with drastic changes in light, such as direct sunlight, cloudy days, and nighttime. This invention allows the camera to capture environmental images in real time, extract light characteristic parameters, and adjust screen brightness to ensure clear visibility under strong midday light and moderate, non-glaring brightness in low-light conditions at night.

[0091] Vending machines in complex indoor lighting environments: For example, vending machines near windows in shopping malls are subject to fluctuations in ambient light due to changes in external light (such as cloud cover, sunrise and sunset) and the switching of indoor lights. This invention can dynamically adapt to these changes, ensuring that the screen brightness is always within a comfortable visual range for the user.

[0092] Vending machines in environments with rapidly changing lighting conditions, such as those in subway stations, can be protected by cameras that can adjust their capture frequency based on the rate of light change, quickly responding to these changes and avoiding lag in screen brightness adjustments.

[0093] Vending machines in low-light environments: such as underground parking garages and stairwells at night, where the light is dim and stable. This invention extracts image feature parameters from low-light environments and adjusts the screen brightness to an appropriate range, ensuring that users can see the content clearly without wasting energy due to excessive brightness.

[0094] Example 2

[0095] See Figure 3 Embodiment 2 of the present invention also provides a screen brightness control device based on a vending machine camera, comprising:

[0096] The environmental image acquisition module 100 is used to continuously and in real time acquire environmental image information around the vending machine through a camera. The environmental image information includes visual data reflecting the brightness of the surrounding light.

[0097] The feature parameter extraction module 200 is used to preprocess the acquired environmental image information and extract feature parameters related to the ambient light intensity from the environmental image information. The feature parameters quantify the intensity of the ambient light.

[0098] The correspondence model construction module 300 is used to establish a correspondence model between ambient light intensity feature parameters and screen brightness, and to determine the screen brightness corresponding to a specified feature parameter value through the correspondence model.

[0099] The brightness adjustment module 400 is used to adjust the brightness of the vending machine screen according to the ambient light intensity characteristic parameters obtained from real-time analysis and the corresponding relationship model, so that the brightness of the vending machine screen adapts to the real-time ambient light conditions.

[0100] In this embodiment, the camera's acquisition frequency in the environmental image acquisition module 100 is dynamically adjusted according to the rate of change of ambient light. The formula for calculating the rate of change of ambient light is:

[0101]

[0102] In the formula, V is the rate of change of ambient light, and F t F represents the ambient light intensity feature parameter extracted at the current moment. t-1 Here, t represents the ambient light intensity feature parameters extracted at the previous moment, and t represents the current moment. t-1 The previous moment is defined as follows: when V > V0, V0 is the preset rate threshold, and the camera's acquisition frequency is increased to f1; when V ≤ V0, the camera's acquisition frequency is decreased to f2, where f1 > f2.

[0103] In this embodiment, the feature parameter extraction module 200 extracts feature parameters related to ambient light intensity in the following way:

[0104] The average image brightness is used for calculation, and the formula is as follows:

[0105]

[0106] In the formula, L is the average brightness of the image, M and N are the number of rows and columns of the image, respectively, and I(i,j) is the brightness value of the pixel at position (i,j) in the image;

[0107] Alternatively, contrast analysis can be used, with the following formula:

[0108]

[0109] In the formula, C represents the contrast ratio.

[0110] In this embodiment, the correspondence model construction module 300 obtains the correspondence model through training on sample data. The correspondence model is constructed using a linear regression model, and the formula is:

[0111] B = k × F + b

[0112] In the formula, B is the screen brightness value, F is the ambient light intensity characteristic parameter, k is the regression coefficient, b is a constant term, and the sample data includes the characteristic parameters under different ambient light intensities and the corresponding optimal screen brightness values.

[0113] In this embodiment, when the brightness adjustment module 400 adjusts the brightness of the vending machine screen according to the corresponding relationship model, if the ambient light intensity characteristic parameter F > F1, where F1 is a first preset threshold, then the screen brightness is adjusted to the first brightness range [B]. 1min B 1max ];

[0114] If the ambient light intensity characteristic parameter F < F2, where F2 is the second preset threshold, and F1 > F2, then the screen brightness is adjusted to the second brightness range [B]. 2min B 2max ], and B 1min >B 2max The threshold satisfies F1-F2≥ΔF, where ΔF is a preset difference.

[0115] It should be noted that the information interaction and execution process between the modules of the above-mentioned device are based on the same concept as the method embodiment in Embodiment 1 of this application, and the resulting technical effects are the same as those in the method embodiment of this application. For details, please refer to the description in the method embodiment shown above in this application, and it will not be repeated here.

[0116] Example 3

[0117] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium storing program code for a screen brightness control method based on a vending machine camera. The program code includes instructions for executing a screen brightness control method based on a vending machine camera as described in Embodiment 1 or any possible implementation thereof.

[0118] Computer-readable storage media can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives, SSDs).

[0119] Example 4

[0120] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;

[0121] The processor and the memory communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, and the processor can execute the screen brightness control method based on the vending machine camera in Embodiment 1 or any possible implementation thereof by calling the program instructions.

[0122] Specifically, a processor can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. This memory can be integrated into the processor or located outside the processor and exist independently.

[0123] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0124] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0125] Although the present invention has been described in detail above with general descriptions and specific embodiments, modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of the present invention fall within the scope of protection claimed by the present invention.

Claims

1. A screen brightness control method based on a vending machine camera, characterized in that, Includes the following steps: The vending machine continuously collects environmental image information around it in real time via a camera. The environmental image information includes visual data reflecting the brightness of the surrounding light. The acquired environmental image information is preprocessed to extract feature parameters related to ambient light intensity from the environmental image information. These feature parameters quantify the intensity of ambient light. Establish a correspondence model between ambient light intensity characteristic parameters and screen brightness, and determine the screen brightness corresponding to a specified characteristic parameter value through the correspondence model; Based on the ambient light intensity characteristic parameters obtained from real-time analysis, and according to the corresponding relationship model, the brightness of the vending machine screen is adjusted so that the screen brightness adapts to the real-time ambient light conditions.

2. The screen brightness control method based on a vending machine camera according to claim 1, characterized in that, During the continuous real-time acquisition of environmental image information around the vending machine by the camera, the camera's acquisition frequency is dynamically adjusted according to the rate of change of ambient light. The formula for calculating the rate of change of ambient light is as follows: In the formula, V is the rate of change of ambient light, and F t F represents the ambient light intensity feature parameter extracted at the current moment. t-1 Here, t represents the ambient light intensity feature parameters extracted at the previous moment, and t represents the current moment. t-1 The previous moment is defined as follows: when V > V0, V0 is the preset rate threshold, and the camera's acquisition frequency is increased to f1; when V ≤ V0, the camera's acquisition frequency is decreased to f2, where f1 > f2.

3. The screen brightness control method based on a vending machine camera according to claim 1, characterized in that, The method for extracting feature parameters related to ambient light intensity from the environmental image information is as follows: The average image brightness is used for calculation, and the formula is as follows: In the formula, L is the average brightness of the image, M and N are the number of rows and columns of the image, respectively, and I(i,j) is the brightness value of the pixel at position (i,j) in the image; Alternatively, contrast analysis can be used, with the following formula: In the formula, C represents the contrast ratio.

4. The screen brightness control method based on a vending machine camera according to claim 1, characterized in that, The correspondence model is trained using sample data and is constructed using a linear regression model, with the following formula: B = k × F + b In the formula, B is the screen brightness value, F is the ambient light intensity characteristic parameter, k is the regression coefficient, b is a constant term, and the sample data includes the characteristic parameters under different ambient light intensities and the corresponding optimal screen brightness values.

5. The screen brightness control method based on a vending machine camera according to claim 1, characterized in that, According to the aforementioned correspondence model, when adjusting the brightness of the vending machine screen, if the ambient light intensity characteristic parameter F > F1, where F1 is the first preset threshold, then the screen brightness is adjusted to the first brightness range [B]. 1min B 1max ]; If the ambient light intensity characteristic parameter F < F2, where F2 is the second preset threshold, and F1 > F2, then the screen brightness is adjusted to the second brightness range [B]. 2min B 2max ], and B 1min >B 2max The threshold satisfies F1-F2≥ΔF, where ΔF is a preset difference.

6. A screen brightness control device based on a vending machine camera, characterized in that, include: An environmental image acquisition module is used to continuously and in real-time acquire environmental image information around the vending machine via a camera. The environmental image information includes visual data reflecting the brightness of the surrounding light. The feature parameter extraction module is used to preprocess the acquired environmental image information and extract feature parameters related to the ambient light intensity from the environmental image information. The feature parameters quantify the intensity of the ambient light. The correspondence model construction module is used to establish a correspondence model between ambient light intensity feature parameters and screen brightness, and to determine the screen brightness corresponding to a specified feature parameter value through the correspondence model. The brightness adjustment module is used to adjust the brightness of the vending machine screen according to the ambient light intensity characteristic parameters obtained from real-time analysis and the corresponding relationship model, so that the brightness of the vending machine screen adapts to the real-time ambient light conditions.

7. The screen brightness control device based on a vending machine camera according to claim 6, characterized in that, In the environmental image acquisition module, the camera's acquisition frequency is dynamically adjusted according to the rate of change of ambient light. The formula for calculating the rate of change of ambient light is: In the formula, V is the rate of change of ambient light, and F t F represents the ambient light intensity feature parameter extracted at the current moment. t-1 Here, t represents the ambient light intensity feature parameters extracted at the previous moment, and t represents the current moment. t-1 The previous moment is defined as follows: when V > V0, V0 is the preset rate threshold, and the camera's acquisition frequency is increased to f1; when V ≤ V0, the camera's acquisition frequency is decreased to f2, where f1 > f2.

8. The screen brightness control device based on a vending machine camera according to claim 6, characterized in that, In the feature parameter extraction module, the method for extracting feature parameters related to ambient light intensity is as follows: The average image brightness is used for calculation, and the formula is as follows: In the formula, L is the average brightness of the image, M and N are the number of rows and columns of the image, respectively, and I(i,j) is the brightness value of the pixel at position (i,j) in the image; Alternatively, contrast analysis can be used, with the following formula: In the formula, C represents the contrast ratio.

9. The screen brightness control device based on a vending machine camera according to claim 6, characterized in that, In the correspondence model construction module, the correspondence model is trained using sample data and is constructed using a linear regression model, with the following formula: B = k × F + b In the formula, B is the screen brightness value, F is the ambient light intensity characteristic parameter, k is the regression coefficient, b is a constant term, and the sample data includes the characteristic parameters under different ambient light intensities and the corresponding optimal screen brightness values.

10. The screen brightness control device based on a vending machine camera according to claim 6, characterized in that, In the brightness adjustment module, when adjusting the brightness of the vending machine screen according to the corresponding relationship model, if the ambient light intensity characteristic parameter F > F1, where F1 is a first preset threshold, then the screen brightness is adjusted to the first brightness range [B]. 1min B 1max ]; If the ambient light intensity characteristic parameter F < F2, where F2 is the second preset threshold, and F1 > F2, then the screen brightness is adjusted to the second brightness range [B]. 2min B 2max ], and B 1min >B 2max The threshold satisfies F1-F2≥ΔF, where ΔF is a preset difference.