Intelligent regulation and control method and device for camera flash lamp
By combining distance sensors and ambient light sensors and using neural network models to optimize the flash gear, the problems of inaccurate exposure and poor scene adaptability in the prior art are solved, and more accurate exposure control and energy consumption reduction are achieved.
Patent Information
- Application Number
- CN202510838298.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-07-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing automatic flash technology has inaccurate exposure, poor scene adaptability, weak anti-interference ability, and fails to comprehensively consider image, distance and ambient light, resulting in overexposed or underexposed exposure, and fails to effectively adjust the flash intensity.
The distance sensor and ambient light sensor are combined with a convolutional neural network model to dynamically adjust the flash gear, and the start and intensity of the flash are optimized through the recognition of high-reflection zones and high-brightness zones, and comprehensive decision-making is made by combining multi-sensor data.
It improves the accuracy of exposure and scene adaptability, reduces misjudgment of high reflector or backlight scenes, and reduces energy consumption.
Smart Images

Figure CN120378752A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence, and in particular relates to a method and device for intelligent regulation of a camera flash. Background Art
[0002] Automatic flash technology is a technology widely used in photography and videography, aiming to automatically adjust the intensity and triggering timing of the flash according to environmental light conditions to ensure that the photographed object can obtain a good exposure effect under different lighting conditions.
[0003] Existing automatic flash technologies mostly rely on a single sensor (such as an ambient light sensor) or simple logic control. Currently, the following defects exist in automatic flash technologies: inaccurate exposure, without comprehensively considering the image, distance, and ambient light, resulting in overexposure or underexposure; poor scene adaptability, without comprehensively considering the image, distance, and ambient light, unable to more flexibly dynamically adjust the flash intensity; weak anti-interference ability, without judging high-reflective objects; multiple sensors do not make a weighted comprehensive decision on the flash brightness. For example: Limitations of the ambient light sensor: Only judge whether to turn on the flash based on the ambient light intensity, without considering the exposure difference caused by the distance of the photographed object (such as overexposure at close range and ineffective lighting at long range) and the difference in the brightness of the image itself.
[0004] Lack of scene perception ability: Without combining distance and image information, it is difficult to more accurately dynamically adjust the flash intensity.
[0005] Weak anti-interference ability: Prone to misjudgment of high-reflective objects (glass, mirror) or backlight scenes, resulting in incorrect triggering or turning off of the flash.
[0006] No multi-sensor data conflict resolution mechanism is established; the light brightness is not adjusted in combination with the image. Most existing technology solutions do not achieve brightness gradient adjustment. Summary of the Invention
[0007] The present invention proposes a method and device for intelligent regulation of a camera flash to solve the problems of existing automatic flash technologies.
[0008] In the first aspect of the present invention, a method for intelligent regulation of a camera flash is proposed, and the method includes: Step S1: A distance sensor and an ambient light sensor are deployed on the camera; when the ambient light intensity sensed by the ambient light sensor is less than the first threshold, go to step S2; otherwise, go to step S7; Step S2: When the distance between the object to be photographed sensed by the distance sensor and the camera is less than the second threshold, go to step S3; otherwise, do not start the flash, and the method ends; where the second threshold is a threshold indicating the maximum distance between the object to be photographed and the camera; Step S3: When the distance between the object to be photographed and the camera is less than the third threshold, proceed to step S7; otherwise, proceed to step S4; wherein, the third threshold is a threshold that identifies the minimum distance between the object to be photographed and the camera; Step S4: Determine the light output intensity of the image corresponding to the current flash gear by the first neural network model; determine the target flash brightness based on the light output intensity, and adjust the flash gear based on the target flash brightness; determine the proportion of the highly reflective area in the image corresponding to the current flash gear; Step S5: Determine whether the proportion of the highly reflective area is greater than the fourth threshold; if so, lower the flash gear by one gear and proceed to step S6; if not, end the method; Step S6: When the flash gear after lowering the gear is the lowest gear, end the method; otherwise, determine the proportion of the highly reflective area in the image corresponding to the current flash gear and proceed to step S5; wherein, the highly reflective area is a connected area where the local exposure exceeds the exposure threshold, and / or the detail loss exceeds the preset standard, and / or the brightness of each pixel is higher than the brightness of each pixel in the surrounding area; Step S7: When the proportion of the high-brightness area in the image corresponding to the current flash gear is less than the fifth threshold, set the flash gear to the lowest gear, turn on the flash, and end the method; otherwise, do not turn on the flash and end the method; wherein, the high-brightness area is a connected area where the pixel value of each pixel exceeds the brightness threshold.
[0009] Preferably, the distance sensor is coaxially installed with the camera lens, and the ambient light sensor is integrated on the top of the camera.
[0010] Preferably, before comparing the ambient light intensity sensed by the ambient light sensor with the first threshold, determine whether the shooting scene is a museum; if so, do not turn on the flash and end the method; otherwise, determine whether the ambient light intensity sensed by the ambient light sensor is less than the first threshold.
[0011] Preferably, the first threshold is 50Lus, the second threshold is 20m, the third threshold is 0.1m, the fourth threshold is 20%, and the fifth threshold is 50%.
[0012] Preferably, the first neural network model includes an input module, a feature fusion module, a fully connected layer, and an output layer; wherein: The output module includes an image branch and a sensor branch. The image branch uses a convolutional neural network to extract the features of the input image; The sensor branch is used to extract: The ambient light intensity feature corresponding to the ambient light intensity sensed by the distance sensor; The distance feature corresponding to the distance between the object to be photographed and the camera sensed by the distance sensor; The feature fusion module fuses the features of the input image, the ambient light intensity feature, and the distance feature to obtain the fused feature; The fused feature is input to the output layer after being normalized by the fully connected layer to obtain the light output intensity corresponding to the input image.
[0013] In the second aspect of the present invention, a camera flash intelligent control device is proposed, and the device includes: Initialization module: A distance sensor and an ambient light sensor are deployed on the camera; when the ambient light intensity sensed by the ambient light sensor is less than the first threshold, the first judgment module is triggered; otherwise, the second adjustment module is triggered; First judgment module: When the distance between the object to be photographed sensed by the distance sensor and the camera is less than the second threshold, the second judgment module is triggered; otherwise, the flash is not activated; where the second threshold is the threshold indicating the maximum distance between the object to be photographed and the camera; Second judgment module: When the distance between the object to be photographed and the camera is less than the third threshold, the second adjustment module is triggered; otherwise, the first adjustment module is triggered; where the third threshold is the threshold indicating the minimum distance between the object to be photographed and the camera; First adjustment module: Determine the light output intensity of the image corresponding to the current flash gear by the first neural network model; determine the target brightness of the flash based on the light output intensity, and adjust the flash gear based on the target brightness of the flash; determine the proportion of the highly reflective area in the image corresponding to the current flash gear; Third judgment module: Determine whether the proportion of the highly reflective area is greater than the fourth threshold; if so, lower the flash gear by 1 gear and trigger the fourth judgment module; Fourth judgment module: When the flash gear after lowering the gear is not the lowest gear, determine the proportion of the highly reflective area in the image corresponding to the current flash gear and trigger the third judgment module; where the highly reflective area is a connected area where the local exposure exceeds the exposure threshold, and / or the detail loss exceeds the preset standard, and / or the brightness of each pixel is higher than the brightness of each pixel in the surrounding area; Second adjustment module: When the proportion of the high-brightness area in the image corresponding to the current flash gear is less than the fifth threshold, set the flash gear to the lowest gear and activate the flash; otherwise, do not activate the flash; where the high-brightness area is a connected area where the pixel value of each pixel exceeds the brightness threshold.
[0014] In the third aspect of the present invention, an electronic device is provided, and the electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; where, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method as described above.
[0015] A fourth aspect of the present invention provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method as described above.
[0016] The present invention has the following technical effects: (1) The present invention reduces image overexposure or underexposure and improves scene adaptability; it can reduce the misjudgment of the flash for high-reflectivity objects or backlight scenes and reduce image overexposure.
[0017] (2) The present invention can dynamically calculate the required light intensity, reduce unnecessary brightness, and thus reduce energy consumption.
[0018] (3) The present invention can automatically learn, is more suitable for complex scenes, and has high calculation accuracy. Description of the Drawings
[0019] Figure 1 It is a schematic flow chart of the intelligent flash control method for the camera of the present invention. Detailed Embodiments
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0021] As Figure 1 shown, the present invention provides an intelligent flash control method for a camera, and the method includes: Step S1: A distance sensor and an ambient light sensor are deployed on the camera; when the ambient light intensity sensed by the ambient light sensor is less than a first threshold, go to Step S2; otherwise, go to Step S7; Step S2: When the distance between the object to be photographed and the camera sensed by the distance sensor is less than a second threshold, go to Step S3; otherwise, do not turn on the flash and the method ends; wherein, the second threshold is a threshold indicating the maximum distance between the object to be photographed and the camera; Step S3: When the distance between the object to be photographed and the camera is less than a third threshold, go to Step S7; otherwise, go to Step S4; wherein, the third threshold is a threshold indicating the minimum distance between the object to be photographed and the camera; Step S4: Determine the light output intensity of the image corresponding to the current flash gear by the first neural network model; determine the target brightness of the flash based on the light output intensity, and adjust the flash gear based on the target brightness of the flash; determine the proportion of the highly reflective area in the image corresponding to the current flash gear; Step S5: Determine whether the proportion of the highly reflective area is greater than the fourth threshold; if so, lower the flash gear by one gear and enter Step S6; if not, end the method; Step S6: When the flash gear after lowering the gear is the lowest gear, end the method; otherwise, determine the proportion of the highly reflective area in the image corresponding to the current flash gear and enter Step S5; where the highly reflective area is a connected area where the local exposure exceeds the exposure threshold, and / or the detail loss exceeds the preset standard, and / or the brightness of each pixel is higher than the brightness of each pixel in the surrounding area; Step S7: When the proportion of the high-brightness area in the image corresponding to the current flash gear is less than the fifth threshold, set the flash gear to the lowest gear, turn on the flash, and end the method; otherwise, do not turn on the flash and end the method; where the high-brightness area is a connected area where the pixel value of each pixel exceeds the brightness threshold.
[0022] Further, the distance sensor is coaxially installed with the camera lens, and the ambient light sensor is integrated on the top of the camera.
[0023] Further, before comparing the ambient light intensity sensed by the ambient light sensor with the first threshold, determine whether the shooting scene is a museum; if so, do not turn on the flash and end the method; otherwise, determine whether the ambient light intensity sensed by the ambient light sensor is less than the first threshold.
[0024] Further, the first threshold is 50Lus, the second threshold is 20m, the third threshold is 0.1m, the fourth threshold is 20%, and the fifth threshold is 50%.
[0025] Further, the first neural network model includes an input module, a feature fusion module, a fully connected layer, and an output layer; the output module includes an image branch and a sensor branch. The image branch uses a convolutional neural network to extract the features of the input image; the sensor branch extracts the ambient light intensity features corresponding to the ambient light intensity sensed by the distance sensor and the distance features corresponding to the distance between the object to be photographed sensed by the distance sensor and the camera; the feature fusion module fuses the features of the input image, the ambient light intensity features, and the distance features to obtain fused features; the fused features are input into the output layer after being normalized by the fully connected layer to obtain the light output intensity corresponding to the input image.
[0026] The training process of the first neural network model includes: (1) Data collection and annotation.
[0027] Data collection: Include image data, ambient light data, distance data, and ideal brightness values (such as measured by professional brightness measurement equipment (e.g., luminance meter) or manual calibration). During data collection, different lighting conditions (strong light, weak light, backlight), materials (glass, metal, liquid surface), indoor and outdoor, macro and far distance, day and night are covered.
[0028] Data annotation: Record the optimal brightness value for the corresponding scene.
[0029] Data division into training set, validation set, and test set: Randomly divide the annotated images into a training set, a validation set, and a test set according to a certain ratio (e.g., 70% for training, 20% for validation, 10% for testing).
[0030] (2) Data preprocessing.
[0031] Image normalization and sensor data normalization can unify the brightness target scales for different scenes (such as macro, night scene, backlight); perform enhancement operations on the images (such as rotation, flipping, scaling, brightness adjustment, etc.) to improve the generalization ability of the model.
[0032] (3) Build a deep learning model.
[0033] Use a multi-modal fusion method to build the model.
[0034] Input layer: Include images and sensors. (1) Image branch: Use a convolutional neural network (such as ResNet, MobileNet, MobileNetV3) to extract image feature vectors (such as texture, object contour, brightness), such as a 512-dimensional feature vector. (2) Sensor branch: Convert the distance and ambient light data into sensor feature vectors through a fully connected layer, such as a 16-dimensional feature vector.
[0035] Feature fusion: Concatenate the image features and sensor features, or use an attention mechanism for dynamic fusion. One of the following methods can be selected: (a) Simple concatenation, directly concatenate the image features and sensor features, such as Fimage = [0.1, 0.5,..., 0.2]; Fsensor = [0.4, 0.3,..., 0.8]; after concatenation, Ffused = [0.1, 0.5,..., 0.2, 0.4, 0.3,..., 0.8], where Fimage is the image feature, Fsensor is the sensor feature, and Ffused is the fused feature. (b) Weighted fusion, dynamically allocate importance through learnable weight coefficients, such as , where a and b are generated by a small network such as an MLP. (c) Attention mechanism, using Transformer or Cross-Attention to establish cross-modal associations. The sensor features are used as Query, and the image features are used as Key / Value, and the attention weights are calculated.
[0036] The fused features are input into a fully connected network, and the dimension is gradually reduced to the final output normalized brightness value Inorm ∈ [0, 1].
[0037] Denormalization: , where Imax is the maximum brightness of the device and Iraw is the brightness. For example, lumens.
[0038] Output layer: Output the light output intensity.
[0039] (4) Train the model.
[0040] The training set is passed into the constructed first neural network model for training to obtain the trained first neural network model. The optimization objective of the first neural network model is to minimize the difference between the predicted brightness and the true brightness, and at the same time suppress the overexposed area.
[0041] (5) Model evaluation.
[0042] The performance of the first neural network model is evaluated using the validation set, and the validation metrics. The metrics include the overexposure rate and the brightness error. The overexposure rate refers to the proportion of the brightness in the image that exceeds a certain brightness. The brightness error refers to the mean square error (MSE) between the predicted brightness and the true value.
[0043] The first neural network model infers the optimal scheduling strategy through the following steps: using an optimizer, such as using the Adam optimizer. Using an early stopping mechanism, such as terminating the training when the validation set loss does not decrease for 3 consecutive times, to prevent overfitting.
[0044] Test the generalization ability of the model on the test set.
[0045] In the present invention, a mapping table between the light output intensity calculated according to the brightness adjustment algorithm formula and the flash light level. As shown in Table 1. There are 10 flash light levels in total, and 1 is the lowest level.
[0046]
[0047] In step S6, the proportion of the highly reflective area in the image corresponding to the current flash light level is determined based on the second neural network model, where the training process of the second neural network model includes: (1)Data preparation and annotation. Data preparation includes collecting images containing highly reflective areas, covering different lighting conditions (strong light, low light, backlight) and materials (glass, metal, liquid surface). For data annotation, a semi-automatic annotation tool is used to generate an initial mask by combining traditional algorithms (such as HSV channel threshold segmentation), and the misdetected areas are manually corrected to generate a binary label (0 for normal area and 1 for highly reflective area). The annotated images are randomly divided into a training set, a validation set and a test set according to a certain quantity ratio (such as 70% for training, 20% for validation, and 10% for testing). Image enhancement operations (such as rotation, flipping, scaling, brightness adjustment, etc.) are performed to improve the generalization ability of the model.
[0048] (2)Build a model. For example, use the U-Net model.
[0049] Input layer: Input RGB image.
[0050] Output layer: A binary mask of the same size as the input (0 for normal area and 1 for highly reflective area).
[0051] Train the model. The training set is passed into the deep learning model for training to obtain the deep learning model. Loss function: Use, for example, binary cross-entropy loss (BCE Loss); Optimizer: Use, for example, Adam optimizer; Training process: Iterate, for example, 100 times; Early stopping mechanism: Terminate if there is no improvement in the validation set loss function for 3 consecutive epochs.
[0052] (4)Model evaluation. Use the validation set to evaluate the model performance, and calculate metrics such as IoU (Intersection over Union) to reach over 90%. Test the generalization ability of the model on the test set.
[0053] In step S7: When the proportion of the high-brightness area in the image corresponding to the current flash gear is less than the fifth threshold, where Convert the image corresponding to the current flash gear to a grayscale image, and the image grayscale range is from 0 to 255; Set the fifth threshold and extract the pixel area higher than this value; For example, set the fifth threshold to 100, then extract the pixels higher than 100.
[0054] Calculate the area of the high-brightness area; Calculate the total area of the image. The total area of the image is the width of the image multiplied by the height (i.e., the total number of pixels), using the formula: Total image area = Image width x Image height; Calculate the proportion of the high-brightness area. The formula for calculating the proportion of the highly reflective area is: Proportion of highly reflective area = Area of highly reflective area / Total image area x 100%.
[0055] The present invention flexibly adjusts the flash intensity dynamically, reducing the overexposure rate and energy consumption. When the ambient light is judged to be greater than the ambient light threshold, but local underexposure is detected, the micro flash mode is activated, such as at level 1. When the distance is too close and local underexposure is detected, the micro flash mode is activated, such as at level 1.
[0056] In the present invention, the distance sensor can be replaced by structured light or binocular vision ranging; the ambient light sensor can be replaced by image estimation of ambient light. The method for identifying the proportion of high-reflectance areas can be replaced by a threshold method.
[0057] The present invention provides a security authentication device based on biometric recognition and data synchronization, and the device includes: Initialization module: A distance sensor and an ambient light sensor are deployed on the camera; when the ambient light intensity sensed by the ambient light sensor is less than the first threshold, the first judgment module is triggered; otherwise, the second adjustment module is triggered; First judgment module: When the distance between the object to be photographed sensed by the distance sensor and the camera is less than the second threshold, the second judgment module is triggered; otherwise, the flash is not activated; where the second threshold is the threshold indicating the maximum distance between the object to be photographed and the camera; Second judgment module: When the distance between the object to be photographed and the camera is less than the third threshold, the second adjustment module is triggered; otherwise, the first adjustment module is triggered; where the third threshold is the threshold indicating the minimum distance between the object to be photographed and the camera; First adjustment module: Determine the light output intensity of the image corresponding to the current flash level by the first neural network model; determine the target brightness of the flash based on the light output intensity, adjust the flash level based on the target brightness of the flash; determine the proportion of high-reflectance areas in the image corresponding to the current flash level; Third judgment module: Determine whether the proportion of high-reflectance areas is greater than the fourth threshold; if so, lower the flash level by 1 level and trigger the fourth judgment module; Fourth judgment module: When the flash level after lowering the level is not the lowest level, determine the proportion of high-reflectance areas in the image corresponding to the current flash level and trigger the third judgment module; where the high-reflectance area is a connected area where the local exposure exceeds the exposure threshold, and / or the detail loss exceeds the preset standard, and / or the brightness of each pixel is higher than the brightness of each pixel in the surrounding area; Second adjustment module: When the proportion of high-brightness areas in the image corresponding to the current flash level is less than the fifth threshold, set the flash level to the lowest level and activate the flash; otherwise, do not activate the flash; where the high-brightness area is a connected area where the pixel value of each pixel exceeds the brightness threshold.
[0058] The above-mentioned modules may be one or more integrated circuits configured to implement the above methods. For example: one or more Application Specific Integrated Circuits (ASICs), or one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), etc. Again, when a certain module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code. Again, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0059] The above-mentioned modules may be connected or communicate with each other via a wired connection or a wireless connection. The wired connection may include metal wires, optical fibers, hybrid wires, etc., or any combination thereof. The wireless connection may include connections in the forms of LAN, WAN, Bluetooth, ZigBee, or NFC, etc., or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems and devices described above may refer to the corresponding processes in the method embodiments, and will not be elaborated in this invention.
[0060] It should be noted that the above-mentioned modules may be one or more integrated circuits configured to implement the above methods. For example: one or more Application Specific Integrated Circuits (ASICs), or one or more Digital Singnal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), etc. Again, when a certain module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code. Again, these modules may be integrated together and implemented in the form of a System-on-a-chip (SOC).
[0061] The electronic device includes a processor, a memory, a communication interface, a display screen, and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be achieved through WIFI, a carrier network, near field communication (NFC), or other technologies. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the electronic device, or an external keyboard, touchpad, or mouse, etc.
[0062] The present invention also provides a program product, such as a computer-readable storage medium, including a program that is used to execute the above method embodiments when executed by a processor.
[0063] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.
[0064] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0065] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.
[0066] The integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (English: Read-Only Memory, abbreviated as: ROM), random access memories (English: Random Access Memory, abbreviated as: RAM), magnetic disks, or optical discs.
Claims
1. A method for intelligent regulation of a camera flash, characterized in that, The method includes: Step S1: A distance sensor and an ambient light sensor are deployed on the camera; when the ambient light intensity sensed by the ambient light sensor is less than the first threshold, step S2 is entered; otherwise, step S7 is entered. Step S2: When the distance between the object to be photographed and the camera sensed by the distance sensor is less than the second threshold, step S3 is entered; otherwise, the flash is not activated and the method ends; where the second threshold is the threshold indicating the maximum distance between the object to be photographed and the camera. Step S3: When the distance between the object to be photographed and the camera is less than the third threshold, step S7 is entered; otherwise, step S4 is entered; where the third threshold is the threshold indicating the minimum distance between the object to be photographed and the camera. Step S4: Determine the light output intensity of the image corresponding to the current flash gear by the first neural network model; determine the target brightness of the flash based on the light output intensity, adjust the flash gear based on the target brightness of the flash; determine the proportion of the high-reflectance area in the image corresponding to the current flash gear. Step S5: Determine whether the proportion of the high-reflectance area is greater than the fourth threshold; if so, lower the flash gear by one gear and enter step S6; if not, the method ends. Step S6: When the lowered flash gear is the lowest gear, the method ends; otherwise, determine the proportion of the high-reflectance area in the image corresponding to the current flash gear and enter step S5; where the high-reflectance area is a connected area where the local exposure exceeds the exposure threshold, and / or the detail loss exceeds the preset standard, and / or the brightness of each pixel is higher than the brightness of each pixel in the surrounding area. Step S7: When the proportion of the high-brightness area in the image corresponding to the current flash gear is less than the fifth threshold, set the flash gear to the lowest gear, activate the flash, and the method ends; otherwise, do not activate the flash and the method ends; where the high-brightness area is a connected area where the pixel value of each pixel exceeds the brightness threshold.
2. The method according to claim 1, wherein, The distance sensor is coaxially installed with the camera lens, and the ambient light sensor is integrated on the top of the camera.
3. The method according to claim 1, characterized in that, Before comparing the ambient light intensity sensed by the ambient light sensor with the first threshold, determine whether the shooting scene is a museum; if so, do not activate the flash and the method ends; otherwise, determine whether the ambient light intensity sensed by the ambient light sensor is less than the first threshold.
4. The method according to claim 1, characterized in that The first threshold is 50Lus, the second threshold is 20m, the third threshold is 0.1m, the fourth threshold is 20%, and the fifth threshold is 50%.
5. The method according to claim 1, characterized in that, The first neural network model includes an input module, a feature fusion module, a fully connected layer, and an output layer; where: The output module includes an image branch and a sensor branch, and the image branch uses a convolutional neural network to extract the features of the input image. The sensor branch is used to extract: The ambient light intensity feature corresponding to the ambient light intensity sensed by the distance sensor. The distance feature corresponding to the distance between the object to be photographed and the camera sensed by the distance sensor. The feature fusion module fuses the features of the input image, the ambient light intensity feature, and the distance feature to obtain a fused feature. The fused feature is input to the output layer after being normalized by the fully connected layer to obtain the light output intensity corresponding to the input image.
6. An intelligent control device for a camera flash, characterized in that, The device includes: Initialization module: A distance sensor and an ambient light sensor are deployed on the camera; when the ambient light intensity sensed by the ambient light sensor is less than the first threshold, the first judgment module is triggered; otherwise, the second adjustment module is triggered; First judgment module: When the distance between the object to be photographed sensed by the distance sensor and the camera is less than the second threshold, the second judgment module is triggered; otherwise, the flash is not activated; wherein, the second threshold is a threshold indicating the maximum distance between the object to be photographed and the camera; Second judgment module: When the distance between the object to be photographed and the camera is less than the third threshold, the second adjustment module is triggered; otherwise, the first adjustment module is triggered; wherein, the third threshold is a threshold indicating the minimum distance between the object to be photographed and the camera; First adjustment module: Determine the light output intensity of the image corresponding to the current flash gear by the first neural network model; determine the target brightness of the flash based on the light output intensity, and adjust the flash gear based on the target brightness of the flash; determine the proportion of the high-reflectance area in the image corresponding to the current flash gear; Third judgment module: Determine whether the proportion of the high-reflectance area is greater than the fourth threshold; if so, lower the flash gear by 1 gear and trigger the fourth judgment module; Fourth judgment module: When the flash gear after lowering the gear is not the lowest gear, determine the proportion of the high-reflectance area in the image corresponding to the current flash gear and trigger the third judgment module; wherein, the high-reflectance area is a connected area where the local exposure exceeds the exposure threshold, and / or the detail loss exceeds the preset standard, and / or the brightness of each pixel is higher than the brightness of each pixel in the surrounding area; Second adjustment module: When the proportion of the high-brightness area in the image corresponding to the current flash gear is less than the fifth threshold, set the flash gear to the lowest gear and activate the flash; otherwise, do not activate the flash; wherein, the high-brightness area is a connected area where the pixel value of each pixel exceeds the brightness threshold.
7. An electronic device, characterized in that, The device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1-5.
8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.
Citation Information
Patent Citations
System and method of controlling camera flash lamp shooting
CN104834152A
Electronic device having dynamically controlled flashlight for image capturing and related control method
CN105959581A
Graphic code scanning method and mobile terminal
CN107844730A
Supplementary lighting light source control method and device, camera component, electronic equipment and medium
CN109510950A
Camera light supplement lamp parameter control system
CN118890553A