CN114500830B - Camera adjustment method and device, electronic equipment and storage medium - Google Patents

Camera adjustment method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114500830B
CN114500830B CN202111624216.1A CN202111624216A CN114500830B CN 114500830 B CN114500830 B CN 114500830B CN 202111624216 A CN202111624216 A CN 202111624216A CN 114500830 B CN114500830 B CN 114500830B
Authority
CN
China
Prior art keywords
block
brightness
image
camera
image blocks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111624216.1A
Other languages
Chinese (zh)
Other versions
CN114500830A (en
Inventor
韩勇浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202111624216.1A priority Critical patent/CN114500830B/en
Publication of CN114500830A publication Critical patent/CN114500830A/en
Application granted granted Critical
Publication of CN114500830B publication Critical patent/CN114500830B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/74Circuitry for compensating brightness variation in the scene by influencing the scene brightness using illuminating means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/741Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The invention provides a camera adjusting method, a camera adjusting device, electronic equipment and a storage medium, wherein the camera adjusting method comprises the following steps: acquiring a current backlight mode of a camera and brightness dynamic parameters of an image corresponding to the camera; and adjusting the camera based on the current backlight mode and the brightness dynamic parameter, wherein the adjustment comprises at least one of adjusting the exposure ratio of the camera and the state of the camera.

Description

Camera adjustment method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and apparatus for adjusting a camera, an electronic device, and a storage medium.
Background
Along with the wide application of deep learning to the video monitoring field, the image quality requirement of people on imaging equipment is higher and higher, the image quality has a decisive effect on the improvement of the final intelligent detection rate, and the improvement of the target detection significance through an automatic adjustment image quality matching intelligent algorithm is great. The backlight mode of the camera is divided into linearity, digital wide dynamic state, real wide dynamic state and the like, but in the existing image acquisition system, the same backlight mode cannot effectively cover all scenes, and unnecessary human resource waste is avoided due to manual switching.
Disclosure of Invention
The invention provides a camera adjusting method, a camera adjusting device, electronic equipment and a storage medium.
In order to solve the technical problems, the first technical scheme provided by the invention is as follows: the camera adjusting method comprises the following steps: acquiring a current backlight mode of a camera and brightness dynamic parameters of an image corresponding to the camera; and adjusting the camera based on the current backlight mode and the brightness dynamic parameter, wherein the adjustment comprises at least one of adjusting the exposure ratio of the camera and the state of the camera.
The method for acquiring the brightness dynamic parameters comprises the following steps: determining an average luminance of the image block, dividing the image block into a first block set and a second block set based on the average luminance; the image includes a plurality of image blocks; determining a first associated block corresponding to the image block in the first block set, and determining a second associated block corresponding to the image block in the second block set; a luminance dynamic parameter is determined based on luminance parameters of the first associated block, the image blocks in the first set of blocks, the second associated block, and the image blocks in the second set of blocks.
The step of determining a first associated block corresponding to the image block in the first block set includes: determining a first adjacent block corresponding to the image block in the first block set; determining the first adjacent block as a first associated block in response to the difference between the luminance parameter of the first adjacent block and the luminance parameter of the image block in the first block set being within a preset range; the step of determining a second associated block corresponding to the image block in the second set of blocks comprises: determining a second adjacent block corresponding to the image block in the second block set; and determining the second adjacent block as a second associated block in response to the difference between the brightness parameter of the second adjacent block and the brightness parameter of the image block in the second block set being within a preset range.
Wherein the step of determining the first neighboring block as a first associated block further comprises: determining that the adjacent block corresponding to the first adjacent block is a first associated block in response to the difference value between the brightness parameter of the adjacent block corresponding to the first adjacent block and the brightness parameter of the first adjacent block being within a preset range; the step of determining the second neighboring block as a second associated block further comprises: and determining the adjacent block corresponding to the second adjacent block as a second associated block in response to the difference value between the brightness parameter of the adjacent block corresponding to the second adjacent block and the brightness parameter of the second adjacent block being within a preset range.
Wherein the step of determining the luminance dynamic parameter based on the luminance parameters of the first associated block, the image blocks in the first set of blocks, the second associated block, the image blocks in the second set of blocks comprises: determining a first area based on the first associated block and the image blocks in the first block set, and determining a second area based on the second associated block and the image blocks in the second block set; the first area and the second area are communicated with each other, and the number of the communicated image blocks is the largest in the first area and the second area; determining an average luminance of the first region and determining an average luminance of the second region; a luminance dynamic parameter is determined based on the average luminance of the first region and the average luminance of the second region.
Wherein the step of dividing the image block into a first set of blocks and a second set of blocks based on the average luminance comprises: determining image blocks with luminance parameters larger than or equal to average luminance as a first block combination, and selecting a preset number of image blocks from the first block combination as a first block set based on the luminance parameters; and determining the image blocks with the brightness parameters smaller than the average brightness as a second block combination, and selecting a preset number of image blocks from the second block combination as a second block set based on the brightness parameters.
The method for adjusting the camera based on the current backlight mode and the brightness dynamic parameter comprises the following steps: and switching the current backlight mode of the camera into a real wide dynamic state in response to the current backlight mode being in a linear state and in response to the brightness dynamic parameter being greater than a first preset value, the number of image blocks in the first area being greater than a second preset value and the number of image blocks in the second area being greater than a third preset value.
The method for adjusting the camera based on the current backlight mode and the brightness dynamic parameter comprises the following steps: and switching the current backlight mode of the camera into digital wide dynamic state in response to the current backlight mode being in a linear state and in response to the brightness dynamic parameter being greater than a first preset value, the number of image blocks in the first area being not greater than a second preset value, and the number of image blocks in the second area being greater than a third preset value.
The method for adjusting the camera based on the current backlight mode and the brightness dynamic parameter comprises the following steps: and switching the current backlight mode of the camera to the real wide dynamic state in response to the current backlight mode being the digital wide dynamic state and in response to the brightness dynamic parameter being greater than a fourth preset value, the number of image blocks in the first area being greater than a fifth preset value and the number of image blocks in the second area being greater than a sixth preset value.
The method for adjusting the camera based on the current backlight mode and the brightness dynamic parameter comprises the following steps: and switching the current backlight mode of the camera into a linear state in response to the current backlight mode being digital wide dynamic, and in response to the brightness dynamic parameter being greater than a fourth preset value, the number of image blocks in the first region being less than a fifth preset value, and the number of image blocks in the second region being greater than a sixth preset value.
The method for adjusting the camera based on the current backlight mode and the brightness dynamic parameter comprises the following steps: and switching the current backlight mode of the camera into a linear state in response to the current backlight mode being a real wide dynamic state, and in response to the brightness dynamic parameter being smaller than a seventh preset value, the number of image blocks in the first area being smaller than an eighth preset value, and the number of image blocks in the second area being smaller than a ninth preset value.
The method for adjusting the camera based on the current backlight mode and the brightness dynamic parameter comprises the following steps: and responding to the current backlight mode as the real wide dynamic state, and responding to the brightness dynamic parameter being smaller than a seventh preset value, the number of the image blocks in the first area being smaller than an eighth preset value and the number of the image blocks in the second area being not smaller than a ninth preset value, and keeping the current backlight mode of the camera as the real wide dynamic state.
After the step of switching the current backlight mode of the camera to the real wide dynamic state, the method further comprises the following steps: constructing a mapping function of the brightness dynamic parameter and the exposure ratio based on the brightness dynamic parameter range, wherein the brightness dynamic parameter and the exposure ratio are positively correlated; and determining a corresponding brightness dynamic range based on the current exposure ratio of the camera, and adjusting the exposure ratio of the camera based on the mapping function in response to the brightness dynamic parameter not being in the brightness dynamic range.
In order to solve the technical problems, a second technical scheme provided by the invention is as follows: provided is a camera adjustment device including: the acquisition module is used for acquiring the current backlight mode of the camera and the brightness dynamic parameters of the image corresponding to the camera; the adjusting module is used for adjusting the camera based on the current backlight mode and the brightness dynamic parameter, and the adjustment comprises at least one of adjusting the exposure ratio of the camera and the state of the camera.
In order to solve the technical problems, a third technical scheme provided by the invention is as follows: there is provided an electronic device including: a memory and a processor, wherein the memory stores program instructions, and the processor invokes the program instructions from the memory to perform the method of any of the above.
In order to solve the technical problems, a fourth technical scheme provided by the invention is as follows: there is provided a computer readable storage medium storing a program file executable to implement the method of any one of the above.
The invention has the beneficial effects that, unlike the prior art, the invention adjusts the camera based on the current backlight mode and the brightness dynamic parameter, and the adjustment comprises at least one of adjusting the exposure ratio of the camera and the state of the camera. The method can be combined with the environmental background to adaptively switch the backlight mode, and has high efficiency.
Drawings
For a clearer description of the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the description below are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art, wherein:
FIG. 1 is a flowchart illustrating an embodiment of a camera adjustment method according to the present invention;
FIG. 2 is a flowchart illustrating an embodiment of the step S11 in FIG. 1;
FIG. 3 is a flowchart of the first embodiment of step S12 in FIG. 1;
FIG. 4 is a flowchart of a second embodiment of the step S12 in FIG. 1;
FIG. 5 is a flowchart of a third embodiment of the step S12 in FIG. 1;
FIG. 6 is a schematic diagram illustrating an embodiment of a camera adjustment device according to the present invention;
FIG. 7 is a schematic diagram of an electronic device according to an embodiment of the present invention;
FIG. 8 is a schematic diagram illustrating the structure of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
The prior art provides a method and a device for switching an imaging state, wherein the method and the device are used for obtaining the imaging state, a histogram of a frame image and the number of total pixels in a current scene, obtaining a first target parameter according to the histogram of the frame image and the data of the total pixels of the frame image when the imaging state is a linear state, and switching the linear state into the wide dynamic imaging state when the first target parameter accords with a preset wide dynamic preset value; and if the shooting state is wide dynamic, obtaining a second target parameter according to the histogram of the frame image and the number of total pixel points of the frame image, and if the second target parameter accords with a preset linear preset value, switching the wide dynamic into the shooting state of the linear state. The main disadvantage of the design is that the histogram of the frame image is obtained as the statistical information of the switching method, the frame histogram information can reflect the current pixel distribution to a certain extent, but invalid information on the frame image may generate erroneous judgment, for example, the indoor lamp tube is brighter and is erroneously judged as an overexposure area, the actual situation of a scene cannot be completely reflected, and the preset value judgment set by the method is more, and the method is slightly complicated.
The prior art also provides a method and apparatus for implementing automatic HDR (High-Dynamic Range). The design key point is that the HDR mode is automatically switched according to various judging conditions through the current environment, and when the HDR mode is automatically switched, different HDR modes can be automatically judged how to be used. In addition, the method uses the flag bit value to confirm the HDR mode on the switching condition, and considers the characteristics of the camera chip sensors of different types when the HDR mode is switched, and can intelligently judge whether the mode can be switched among various HDR modes according to the different types of the camera chip sensors. The main disadvantage of the design is that the mode switching such as automatic HDR is only carried out, automatic linearity or digital wide dynamic is not carried out, and when the dynamic range of the current scene is smaller, the HDR has the negative effects such as unnatural image effect, oil painting feeling and the like.
The application provides a camera adjusting method which can be combined with an environmental background to adaptively switch backlight modes and has high efficiency. The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, fig. 1 is a flowchart of a first embodiment of a camera adjustment method according to the present invention, which specifically includes:
step S11: and acquiring the current backlight mode of the camera and the brightness dynamic parameters of the image corresponding to the camera.
Specifically, referring to fig. 2, the method for obtaining the brightness dynamic parameter of the image corresponding to the camera includes:
step S21: the average luminance of the image block is determined, and the image block is divided into a first set of blocks and a second set of blocks based on the average luminance.
Specifically, an image is divided into a plurality of image blocks, for example, an image is divided into m×n image blocks, and the average luminance of the m×n image blocks is calculated. Image blocks with luminance parameters greater than or equal to the average luminance are set as a first block set, and image blocks with luminance parameters less than the average luminance are set as a second block set. That is, the first set of blocks is bright blocks and the second set of blocks is dark blocks.
Further, in an embodiment, image blocks with luminance parameters greater than or equal to the average luminance are determined as a first block combination, and a preset number of image blocks are selected from the first block combination as a first block set based on the luminance parameters; and determining the image blocks with the brightness parameters smaller than the average brightness as a second block combination, and selecting a preset number of image blocks from the second block combination as a second block set based on the brightness parameters. Specifically, the image blocks in the first block combination and the second block combination are ordered based on the luminance parameter, such that the image blocks in the first block combination and the second block combination are ordered in a manner from large to small of the luminance parameter. The method comprises the steps of selecting a preset number I of image blocks from a first block combination to serve as a first block set, and selecting a preset number I of image blocks from a second block combination to serve as a second block set.
Specifically, the coordinates and brightness parameters of each image block in the first block set and the second block set are recorded.
Step S22: a first associated block corresponding to an image block in the first set of blocks is determined, and a second associated block corresponding to an image block in the second set of blocks is determined.
Specifically, graphic searching is performed to determine a first adjacent block corresponding to the image block in the first block set. The pattern search mode comprises breadth first search or depth advantage search. And searching four adjacent neighborhood blocks (including upper, lower, left and right adjacent blocks) adjacent to the root node according to coordinates by taking the image blocks in the first block set as the root node so as to determine a first adjacent block of the image blocks. And determining the first adjacent block as a first associated block in response to the difference between the brightness parameter of the first adjacent block and the brightness parameter of the image block in the first block set being within a preset range. Specifically, if a first neighboring block of the image block X in the first block set includes X1, X2, X3, and X4, where a difference between the luminance parameter of X1 and the luminance parameter of X is within a preset range, X1 is a first associated block of the image block X. If the difference between the luminance parameter of X2 and the luminance parameter of X is not within the preset range, X2 is not the first associated block of the image block X.
Further, determining the first association block further includes: determining whether a difference value between the brightness parameter of the adjacent block corresponding to the first adjacent block and the brightness parameter of the first adjacent block is within a preset range. For example, the neighboring blocks corresponding to the first neighboring block X1 include M1, M2, M3, and M4, and then the difference between the luminance parameters of M1, M2, M3, and M4 and X1 is further calculated, and if the difference is within the preset range, it is determined to be the first associated block. For example, if the difference between the luminance parameters of M1 and X1 is within the preset range, it is determined that M1 is the first associated block.
Further, associated blocks of the image blocks in the second block combination are determined in the same way. Determining a second adjacent block corresponding to the image block in the second block set; and determining the second adjacent block as a second associated block in response to the difference between the brightness parameter of the second adjacent block and the brightness parameter of the image block in the second block set being within a preset range. Assuming that a first neighboring block of the image block Y in the second block combination includes Y1, Y2, Y3, and Y4, wherein a difference value between a luminance parameter of Y1 and a luminance parameter of Y is within a preset range, Y1 is a first associated block of the image block Y. If the difference between the luminance parameter of Y2 and the luminance parameter of Y is not within the preset range, Y2 is not the first associated block of the image block Y.
Further, determining the second association block further includes: and determining whether the difference value between the brightness parameter of the adjacent block corresponding to the second adjacent block and the brightness parameter of the second adjacent block is in a preset range. For example, the neighboring block corresponding to the second neighboring block Y1 includes N1, N2, N3, and N4, and then further calculates the difference between the luminance parameters of N1, N2, N3, N4, and Y1, and if the difference is within the preset range, determines that the difference is the second associated block. For example, if the difference between the luminance parameters of N1 and Y1 is within the preset range, N1 is determined as the second associated block.
It will be appreciated that the smaller the difference in luminance parameters, the closer the luminance representing the neighboring block to the image block as the root node, the higher the confidence, and the greater the probability of referencing.
Step S23: a luminance dynamic parameter is determined based on luminance parameters of the first associated block, the image blocks in the first set of blocks, the second associated block, and the image blocks in the second set of blocks.
Specifically, a first region is determined based on the first associated block, the image blocks in the first set of blocks, and a second region is determined based on the second associated block, the image blocks in the second set of blocks. After all the first associated blocks and the second associated blocks are determined, at least one communication area is formed between the first associated blocks and the image blocks in the first block set, the communication area with the largest image block number is selected from the at least one communication area to serve as the first area, at least one communication area is formed between the second associated blocks and the image blocks in the second block set, and the communication area with the largest image block number is selected from the communication areas to serve as the second area.
It is understood that the first area and the second area are communicated with each other, and the number of the communicated image blocks is the largest in the first area and the second area.
In one embodiment, the first region is denoted B1, the number of image blocks in the first region B1 is denoted T1, the second region is denoted B2, and the number of image blocks in the second region B2 is denoted T2. The average luminance C1 of the first region B1 is determined based on the luminance parameters of all the image blocks in the first region B1, and the average luminance C2 of the second region B2 is determined based on the luminance parameters of all the image blocks in the second region B2.
The luminance dynamic parameter is determined based on the average luminance C1 of the first region B1 and the average luminance C2 of the second region B2. Specifically, the luminance dynamic parameter α=c1/C2.
Step S12: and adjusting the camera based on the current backlight mode and the brightness dynamic parameter.
In an embodiment, please refer to fig. 3, fig. 3 is a flowchart of a first embodiment of step S12, which includes:
step S31: the current backlight mode is in a linear state.
Step S32: the luminance dynamic parameter is greater than a first preset value, the number of image blocks in the first region is greater than a second preset value, and the number of image blocks in the second region is greater than a third preset value.
Step S33: and switching the current backlight mode of the camera to a real wide dynamic state.
Specifically, if the current backlight mode is in a linear state, the brightness dynamic parameter is greater than a first preset value, the number T1 of image blocks in the first area B1 is greater than a second preset value, and the number T2 of image blocks in the second area B2 is greater than a third preset value, this indicates that the current brightness dynamic parameter range of the camera is greater, the occupation ratio of a bright area and a dark area is greater, and at this time, the current backlight mode of the camera is switched to a real wide dynamic state. Wherein the second preset value is the same as or different from the third preset value.
Step S34: the luminance dynamic parameter is larger than a first preset value, the number of image blocks in the first area is not larger than a second preset value, and the number of image blocks in the second area is larger than a third preset value.
Step S35: and switching the current backlight mode of the camera to digital wide dynamic state.
If the current backlight mode is in a linear state, the brightness dynamic parameter alpha is larger than a first preset value, the number T1 of image blocks in the first area B1 is not larger than a second preset value, the number T2 of image blocks in the second area B2 is larger than a third preset value, the current brightness dynamic parameter range of the camera is larger, the dark area occupation ratio is larger only, and at the moment, the current backlight mode of the camera is switched into digital wide dynamic. Wherein the second preset value is the same as or different from the third preset value.
It can be understood that, in addition to the cases shown in the above step S32 and step S34, the current backlight mode of the camera is maintained in a linear state.
In another embodiment, please refer to fig. 4, fig. 4 is a flowchart of a second embodiment of step S12, which includes:
step S41: the current backlight mode is digital wide dynamic.
Step S42: the luminance dynamic parameter is greater than a fourth preset value, the number of image blocks in the first region is greater than a fifth preset value, and the number of image blocks in the second region is greater than a sixth preset value.
Step S43: and switching the current backlight mode of the camera to a real wide dynamic state.
If the current backlight mode is digital wide dynamic, and the brightness dynamic parameter alpha is larger than a fourth preset value, the number T1 of the image blocks in the first area B1 is larger than a fifth preset value, and the number T2 of the image blocks in the second area B2 is larger than a sixth preset value, the current backlight mode of the camera is switched to real wide dynamic. Wherein the fifth preset value is the same as or different from the sixth preset value.
Step S44: the luminance dynamic parameter is greater than a fourth preset value, the number of image blocks in the first region is less than a fifth preset value, and the number of image blocks in the second region is greater than a sixth preset value.
Step S45: and switching the current backlight mode of the camera to a linear state.
And if the current backlight mode is digital wide dynamic, switching the current backlight mode of the camera into a linear state, wherein the brightness dynamic parameter alpha is larger than a fourth preset value, the number T1 of the image blocks in the first area B1 is smaller than a fifth preset value, and the number T2 of the image blocks in the second area B2 is larger than a sixth preset value.
It will be appreciated that, in addition to the cases shown in the above step S42 and step S44, the current backlight mode of the camera is kept as a digital wide dynamic state.
Optionally, the fourth preset value in this embodiment is the same as or different from the first preset value shown in fig. 3, which is not limited herein.
In another embodiment, please refer to fig. 5, fig. 5 is a flowchart of a third embodiment of step S12, which includes:
step S51: the current backlight mode is true wide dynamic.
Step S52: the luminance dynamic parameter is smaller than a seventh preset value, the number of image blocks in the first area is smaller than an eighth preset value, and the number of image blocks in the second area is smaller than a ninth preset value.
Step S53: and switching the current backlight mode of the camera to a linear state.
If the current backlight mode is a real wide dynamic state, the brightness dynamic parameter alpha is smaller than a seventh preset value, the number T1 of the image blocks in the first area B1 is smaller than an eighth preset value, and the number T2 of the image blocks in the second area B2 is smaller than a ninth preset value, and the current backlight mode of the camera is switched to a linear state.
Step S54: the luminance dynamic parameter is smaller than a seventh preset value, the number of image blocks in the first area is smaller than an eighth preset value, and the number of image blocks in the second area is larger than a ninth preset value.
Step S55: and switching the current backlight mode of the camera to digital wide dynamic state.
If the current backlight mode is the real wide dynamic state, the brightness dynamic parameter alpha is smaller than a seventh preset value, the number T1 of the image blocks in the first area B1 is smaller than an eighth preset value, and the number T2 of the image blocks in the second area B2 is larger than a ninth preset value, and the current backlight mode of the camera is switched to the digital wide dynamic state. Wherein the eighth preset value is the same as or different from the ninth preset value.
Optionally, the seventh preset value in this embodiment is the same as or different from the first preset value shown in fig. 3 and the fourth preset value shown in fig. 4, which are not limited herein.
It can be understood that, in addition to the cases shown in the above step S52 and step S54, the current backlight mode of the camera is kept to be a true wide dynamic state.
In the application, if the backlight mode of the camera is real wide dynamic, the exposure ratio of the camera needs to be further adjusted. Specifically, a mapping function of the brightness dynamic parameter alpha and the exposure ratio is constructed based on the brightness dynamic parameter range, and the brightness dynamic parameter alpha and the exposure ratio are positively correlated. And determining a corresponding brightness dynamic range based on the current exposure ratio of the camera, and adjusting the exposure ratio of the camera based on the mapping function in response to the brightness dynamic parameter not being in the brightness dynamic range. Specifically, the larger the luminance dynamic parameter α, the larger the exposure ratio, and the smaller the luminance dynamic parameter α, the smaller the exposure ratio. In establishing the mapping function, it is also necessary to set upper and lower thresholds for the exposure ratio adjustment. Judging whether the current brightness dynamic parameter alpha is in the brightness dynamic parameter range corresponding to the current exposure ratio, and if not, adjusting the exposure ratio to ensure that the previous brightness dynamic parameter alpha is in the brightness dynamic parameter range corresponding to the adjusted exposure ratio.
The application calculates the dynamic range value of the current frame image by searching the maximum bright and dark connected areas on the basis of the block statistical information of the frame image. And automatically switching backlight modes including linear, digital wide dynamic and real wide dynamic according to the calculated dynamic range value and the number of blocks of the bright and dark connected areas. And simultaneously adjusting the exposure proportion of the actual scene under the real wide dynamic state through the calculated dynamic range value, so as to adapt to the actual scene in a self-adaptive way. The backlight mode can be adaptively switched by combining with the environment background, and the efficiency is high.
Fig. 6 is a schematic structural diagram of an embodiment of a camera adjusting device according to the present application, which specifically includes: an acquisition module 61 and an adjustment module 62.
The obtaining module 61 is configured to obtain a current backlight mode of the camera and a brightness dynamic parameter of an image corresponding to the camera.
In an embodiment, the obtaining module 61 is configured to determine an average brightness of the image block, and divide the image block into a first block set and a second block set based on the average brightness; the image includes a plurality of image blocks; determining a first associated block corresponding to the image block in the first block set, and determining a second associated block corresponding to the image block in the second block set; a luminance dynamic parameter is determined based on luminance parameters of the first associated block, the image blocks in the first set of blocks, the second associated block, and the image blocks in the second set of blocks. The obtaining module 61 is configured to determine a first neighboring block corresponding to an image block in the first block set; and determining the first adjacent block as a first associated block in response to the difference between the brightness parameter of the first adjacent block and the brightness parameter of the image block in the first block set being within a preset range. The obtaining module 61 is further configured to determine a second neighboring block corresponding to the image block in the second block set; and determining the second adjacent block as a second associated block in response to the difference between the brightness parameter of the second adjacent block and the brightness parameter of the image block in the second block set being within a preset range. Specifically, if the difference value between the brightness parameter of the adjacent block corresponding to the first adjacent block and the brightness parameter of the first adjacent block is within a preset range, determining that the adjacent block corresponding to the first adjacent block is a first associated block; and determining the adjacent block corresponding to the second adjacent block as a second associated block in response to the difference value between the brightness parameter of the adjacent block corresponding to the second adjacent block and the brightness parameter of the second adjacent block being within a preset range.
In an embodiment, the obtaining module 61 is further configured to determine a first area based on the first associated block and the image blocks in the first set of blocks, and determine a second area based on the second associated block and the image blocks in the second set of blocks; the first area and the second area are communicated with each other, and the number of the communicated image blocks is the largest in the first area and the second area; determining an average luminance of the first region and determining an average luminance of the second region; a luminance dynamic parameter is determined based on the average luminance of the first region and the average luminance of the second region.
The adjustment module 62 is configured to adjust the camera based on the current backlight mode and the brightness dynamic parameter, where the adjustment includes adjusting at least one of an exposure ratio of the camera and a status of the camera.
In one embodiment, the adjustment module 62 switches the current backlight mode of the camera to the true wide dynamic in response to the current backlight mode being in a linear state and in response to the luminance dynamic parameter being greater than a first preset value, the number of image blocks in the first region being greater than a second preset value, and the number of image blocks in the second region being greater than a third preset value.
In one embodiment, the adjustment module 62 switches the current backlight mode of the camera to the digital wide dynamic in response to the current backlight mode being in a linear state and in response to the luminance dynamic parameter being greater than a first preset value, the number of image blocks in the first region being no greater than a second preset value, and the number of image blocks in the second region being greater than a third preset value.
In one embodiment, the adjustment module 62 switches the current backlight mode of the camera to the true wide dynamic in response to the current backlight mode being the digital wide dynamic and in response to the luminance dynamic parameter being greater than a fourth preset value, the number of image blocks in the first region being greater than a fifth preset value, and the number of image blocks in the second region being greater than a sixth preset value.
In one embodiment, the adjustment module 62 switches the current backlight mode of the camera to the linear state in response to the current backlight mode being a digital wide dynamic and in response to the luminance dynamic parameter being greater than a fourth preset value, the number of image blocks in the first region being less than a fifth preset value, and the number of image blocks in the second region being greater than a sixth preset value.
In one embodiment, the adjustment module 62 switches the current backlight mode of the camera to the linear state in response to the current backlight mode being a true wide dynamic, and in response to the luminance dynamic parameter being less than a seventh preset value, the number of image blocks in the first region being less than an eighth preset value, and the number of image blocks in the second region being less than a ninth preset value.
In one embodiment, the adjustment module 62 maintains the current backlight mode of the camera as the true wide dynamic in response to the current backlight mode being the true wide dynamic, and in response to the luminance dynamic parameter being less than the seventh preset value, the number of image blocks in the first region being less than the eighth preset value, and the number of image blocks in the second region being not less than the ninth preset value.
In an embodiment, if the current backlight mode of the camera is a real wide dynamic state, the adjustment module 62 is further configured to construct a mapping function of a brightness dynamic parameter and an exposure ratio based on the brightness dynamic parameter range, where the brightness dynamic parameter and the exposure ratio are positively correlated; and determining a corresponding brightness dynamic range based on the current exposure ratio of the camera, and adjusting the exposure ratio of the camera based on the mapping function in response to the brightness dynamic parameter not being in the brightness dynamic range.
The application calculates the dynamic range value of the current frame image by searching the maximum bright and dark connected areas on the basis of the block statistical information of the frame image. And automatically switching backlight modes including linear, digital wide dynamic and real wide dynamic according to the calculated dynamic range value and the number of blocks of the bright and dark connected areas. And simultaneously adjusting the exposure proportion of the actual scene under the real wide dynamic state through the calculated dynamic range value, so as to adapt to the actual scene in a self-adaptive way. The backlight mode can be adaptively switched by combining with the environment background, and the efficiency is high.
Referring to fig. 7, a schematic structural diagram of an electronic device according to an embodiment of the application includes a memory 202 and a processor 201 connected to each other.
The memory 202 is used to store program instructions implementing the method of any of the above.
The processor 201 is configured to execute program instructions stored in the memory 202.
The processor 201 may also be referred to as a CPU (Central Processing Unit ). The processor 201 may be an integrated circuit chip with signal processing capabilities. Processor 201 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 202 may be a memory bank, TF card, etc., and may store all information in the electronic device of the device, including input raw data, computer programs, intermediate motion results, and final motion results, stored in the memory. It stores and retrieves information according to the location specified by the controller. With the memory, the electronic equipment has a memory function and can ensure normal operation. The memories of electronic devices can be classified into main memories (memories) and auxiliary memories (external memories) according to the purpose, and there are also classification methods of external memories and internal memories. The external memory is usually a magnetic medium, an optical disk, or the like, and can store information for a long period of time. The memory refers to a storage component on the motherboard for storing data and programs currently being executed, but is only used for temporarily storing programs and data, and the data is lost when the power supply is turned off or the power is turned off.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a system server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the method of the embodiments of the present application.
Referring to FIG. 8, a schematic diagram of a computer readable storage medium according to the present application is shown. The storage medium of the present application stores a program file 203 capable of implementing all the methods described above, wherein the program file 203 may be stored in the storage medium as a software product, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. The aforementioned storage device includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes, or a terminal device such as a computer, a server, a mobile phone, a tablet, or the like.
The foregoing is only the embodiments of the present invention, and therefore, the patent scope of the invention is not limited thereto, and all equivalent structures or equivalent processes using the descriptions of the present invention and the accompanying drawings, or direct or indirect application in other related technical fields, are included in the scope of the invention.

Claims (11)

1. The camera adjusting method is characterized by comprising the following steps of:
acquiring a current backlight mode of a camera and brightness dynamic parameters of an image corresponding to the camera;
adjusting the camera based on the current backlight mode and the brightness dynamic parameter, wherein the adjustment comprises at least one of adjusting the exposure ratio of the camera and the state of the camera;
the method for acquiring the brightness dynamic parameters comprises the following steps:
determining an average brightness of an image block, and dividing the image block into a first block set and a second block set based on the average brightness; the image comprises a plurality of image blocks; the brightness parameter of the image blocks in the first block set is larger than or equal to the average brightness, and the brightness parameter of the image blocks in the second block set is smaller than the average brightness; determining a first associated block corresponding to the image block in the first block set, and determining a second associated block corresponding to the image block in the second block set; determining the luminance dynamic parameter based on luminance parameters of the first associated block, the image blocks in the first set of blocks, the second associated block, the image blocks in the second set of blocks;
The step of determining a first associated block corresponding to the image block in the first block set includes:
determining a first adjacent block corresponding to the image block in the first block set; determining that the first adjacent block is the first associated block in response to a difference between the luminance parameter of the first adjacent block and the luminance parameter of the image block in the first block set being within a preset range;
the step of determining a second associated block corresponding to the image block in the second block set includes:
determining a second adjacent block corresponding to the image block in the second block set; determining that the second adjacent block is the second associated block in response to the difference between the luminance parameter of the second adjacent block and the luminance parameter of the image block in the second block set being within a preset range;
the step of adjusting the camera based on the current backlight mode and the brightness dynamic parameter includes:
switching the current backlight mode of the camera to a true wide dynamic state in response to the current backlight mode being in a linear state and in response to the brightness dynamic parameter being greater than a first preset value, the number of image blocks in a first region being greater than a second preset value, and the number of image blocks in a second region being greater than a third preset value, wherein the first region is determined based on the first associated block and the image blocks in the first block set, and the second region is determined based on the second associated block and the image blocks in the second block set; each image block is communicated in the first area and the second area, and the number of the communicated image blocks is the largest in the first area and the second area;
Wherein the step of determining the luminance dynamic parameter based on luminance parameters of the image blocks in the first associated block, the first set of blocks, the second associated block, the second set of blocks, comprises:
determining an average luminance of the first region, and determining an average luminance of the second region;
the luminance dynamic parameter is determined based on the average luminance of the first region and the average luminance of the second region, wherein the luminance dynamic parameter is equal to a ratio of the average luminance of the first region to the average luminance of the second region.
2. The adjustment method according to claim 1, characterized in that the step of dividing the image block into a first block set and a second block set based on the average luminance comprises:
determining image blocks with luminance parameters larger than or equal to the average luminance as a first block combination, and selecting a preset number of image blocks from the first block combination as the first block set based on the luminance parameters; and determining the image blocks with the brightness parameters smaller than the average brightness as a second block combination, and selecting a preset number of image blocks from the second block combination as the second block set based on the brightness parameters.
3. The adjustment method according to claim 1, characterized in that the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter further comprises:
and switching the current backlight mode of the camera into digital wide dynamic state in response to the current backlight mode being in a linear state and in response to the brightness dynamic parameter being greater than a first preset value, the number of image blocks in the first region not being greater than a second preset value, and the number of image blocks in the second region being greater than a third preset value.
4. The adjustment method according to claim 1, characterized in that the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter further comprises:
and switching the current backlight mode of the camera to a real wide dynamic state in response to the current backlight mode being a digital wide dynamic state and in response to the brightness dynamic parameter being greater than a fourth preset value, the number of image blocks in the first region being greater than a fifth preset value, and the number of image blocks in the second region being greater than a sixth preset value.
5. The adjustment method according to claim 1, characterized in that the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter further comprises:
And switching the current backlight mode of the camera into a linear state in response to the current backlight mode being digital wide dynamic, and in response to the brightness dynamic parameter being greater than a fourth preset value, the number of image blocks in the first region being less than a fifth preset value, and the number of image blocks in the second region being greater than a sixth preset value.
6. The adjustment method according to claim 1, characterized in that the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter further comprises:
and switching the current backlight mode of the camera into a linear state in response to the current backlight mode being a true wide dynamic state and in response to the brightness dynamic parameter being less than a seventh preset value, the number of image blocks in the first region being less than an eighth preset value, and the number of image blocks in the second region being less than a ninth preset value.
7. The adjustment method according to claim 1, characterized in that the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter further comprises:
and responding to the current backlight mode as the real wide dynamic state, and responding to the brightness dynamic parameter being smaller than a seventh preset value, the number of image blocks in the first area being smaller than an eighth preset value and the number of image blocks in the second area being not smaller than a ninth preset value, and keeping the current backlight mode of the camera as the real wide dynamic state.
8. The adjustment method according to claim 1, further comprising, after the step of switching the current backlight mode of the camera to a true wide dynamic state:
constructing a mapping function of a brightness dynamic parameter and an exposure ratio based on a brightness dynamic parameter range, wherein the brightness dynamic parameter and the exposure ratio are positively correlated;
and determining a corresponding brightness dynamic range based on the current exposure ratio of the camera, and adjusting the exposure ratio of the camera based on the mapping function in response to the brightness dynamic parameter not being in the brightness dynamic range.
9. A camera adjustment device, comprising:
the acquisition module is used for acquiring the current backlight mode of the camera and the brightness dynamic parameters of the image corresponding to the camera;
the adjusting module is used for adjusting the camera based on the current backlight mode and the brightness dynamic parameter, and the adjustment comprises at least one of adjusting the exposure ratio of the camera and the state of the camera;
wherein, the acquisition module is further used for: determining an average brightness of an image block, and dividing the image block into a first block set and a second block set based on the average brightness; the image comprises a plurality of image blocks; the brightness parameter of the image blocks in the first block set is larger than or equal to the average brightness, and the brightness parameter of the image blocks in the second block set is smaller than the average brightness; determining a first associated block corresponding to the image block in the first block set, and determining a second associated block corresponding to the image block in the second block set; determining the brightness dynamic parameter based on brightness parameters of the first associated block, the image blocks in the first block set, the second associated block and the image blocks in the second block set, and determining a first adjacent block corresponding to the image blocks in the first block set; determining that the first adjacent block is the first associated block and determining that the second adjacent block corresponding to the image block in the second block set is the second associated block in response to the difference between the brightness parameter of the first adjacent block and the brightness parameter of the image block in the first block set being within a preset range; determining that the second adjacent block is the second associated block in response to the difference between the luminance parameter of the second adjacent block and the luminance parameter of the image block in the second block set being within a preset range;
The adjustment module is also used for: switching the current backlight mode of the camera to a true wide dynamic state in response to the current backlight mode being in a linear state and in response to the brightness dynamic parameter being greater than a first preset value, the number of image blocks in a first region being greater than a second preset value, and the number of image blocks in a second region being greater than a third preset value, wherein the first region is determined based on the first associated block and the image blocks in the first block set, and the second region is determined based on the second associated block and the image blocks in the second block set; each image block is communicated in the first area and the second area, and the number of the communicated image blocks is the largest in the first area and the second area;
the acquisition module is further configured to: determining an average luminance of the first region, and determining an average luminance of the second region; the luminance dynamic parameter is determined based on the average luminance of the first region and the average luminance of the second region, wherein the luminance dynamic parameter is equal to a ratio of the average luminance of the first region to the average luminance of the second region.
10. An electronic device, comprising: a memory and a processor, wherein the memory stores program instructions, the processor retrieving the program instructions from the memory to perform the method of any of claims 1-8.
11. A computer readable storage medium, characterized in that a program file is stored, which program file is executable to implement the method according to any of claims 1-8.
CN202111624216.1A 2021-12-28 2021-12-28 Camera adjustment method and device, electronic equipment and storage medium Active CN114500830B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111624216.1A CN114500830B (en) 2021-12-28 2021-12-28 Camera adjustment method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111624216.1A CN114500830B (en) 2021-12-28 2021-12-28 Camera adjustment method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114500830A CN114500830A (en) 2022-05-13
CN114500830B true CN114500830B (en) 2023-09-01

Family

ID=81496868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111624216.1A Active CN114500830B (en) 2021-12-28 2021-12-28 Camera adjustment method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114500830B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117835053B (en) * 2024-03-04 2024-06-04 杭州海康威视数字技术股份有限公司 Switching method and device of wide dynamic mode

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106961550A (en) * 2017-03-07 2017-07-18 浙江大华技术股份有限公司 A kind of changing method and device of shooting state
CN110049250A (en) * 2019-05-15 2019-07-23 重庆紫光华山智安科技有限公司 Image state switching method and device
CN111586292A (en) * 2020-04-23 2020-08-25 浙江大华技术股份有限公司 Camera shooting state switching method and device and computer equipment
CN112217999A (en) * 2020-09-23 2021-01-12 浙江大华技术股份有限公司 Wide dynamic mode adjusting method and device, electronic equipment and storage medium
CN112738411A (en) * 2020-12-29 2021-04-30 重庆紫光华山智安科技有限公司 Exposure adjusting method, exposure adjusting device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201445454A (en) * 2013-05-22 2014-12-01 Asustek Comp Inc Image processing system and method of promoting human face recognition

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106961550A (en) * 2017-03-07 2017-07-18 浙江大华技术股份有限公司 A kind of changing method and device of shooting state
CN110049250A (en) * 2019-05-15 2019-07-23 重庆紫光华山智安科技有限公司 Image state switching method and device
CN111586292A (en) * 2020-04-23 2020-08-25 浙江大华技术股份有限公司 Camera shooting state switching method and device and computer equipment
CN112217999A (en) * 2020-09-23 2021-01-12 浙江大华技术股份有限公司 Wide dynamic mode adjusting method and device, electronic equipment and storage medium
CN112738411A (en) * 2020-12-29 2021-04-30 重庆紫光华山智安科技有限公司 Exposure adjusting method, exposure adjusting device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114500830A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
CN111028189B (en) Image processing method, device, storage medium and electronic equipment
CN107230182B (en) Image processing method and device and storage medium
US10878543B2 (en) Group management method, terminal, and storage medium
KR101926490B1 (en) Apparatus and method for processing image
CN110602467B (en) Image noise reduction method and device, storage medium and electronic equipment
US11227566B2 (en) Method for reducing brightness of images, a data-processing apparatus, and a display apparatus
CN113299245B (en) Method and device for adjusting local backlight of display equipment, display equipment and storage medium
KR20090067230A (en) Camera control method for vehicle number plate recognition
CN104883504A (en) Method and device for opening HDR (high-dynamic range) function on intelligent terminal
CN111260593A (en) Image processing method, image processing device, electronic equipment and storage medium
CN107465811B (en) Method for reducing temperature rise, computer readable storage medium and electronic equipment
CN114500830B (en) Camera adjustment method and device, electronic equipment and storage medium
EP4328852A1 (en) Method for expanding dynamic range of image and electronic device
CN111028276A (en) Image alignment method and device, storage medium and electronic equipment
CN108495054B (en) Method and device for processing high dynamic range signal and computer storage medium
CN106803920B (en) Image processing method and device and intelligent conference terminal
CN110570370B (en) Image information processing method and device, storage medium and electronic equipment
CN113840095B (en) Light supplement lamp control method and related device
CN111970501A (en) Pure color scene AE color processing method and device, electronic equipment and storage medium
CN103685972A (en) Image optimizing method and system employing same
CN113240590B (en) Image processing method and device
CN114125408A (en) Image processing method and device, terminal and readable storage medium
CN116193248A (en) Mode switching method and device for terminal equipment and storage medium
CN105141857A (en) Image processing method and device
CN115086566B (en) Picture scene detection method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant