CN114500830A - Camera adjusting method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN114500830A
CN114500830A CN202111624216.1A CN202111624216A CN114500830A CN 114500830 A CN114500830 A CN 114500830A CN 202111624216 A CN202111624216 A CN 202111624216A CN 114500830 A CN114500830 A CN 114500830A
Authority
CN
China
Prior art keywords
block
camera
image
luminance
parameter
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.)
Granted
Application number
CN202111624216.1A
Other languages
Chinese (zh)
Other versions
CN114500830B (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

Images

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

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 a brightness dynamic parameter 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 adjusting at least one of the exposure ratio of the camera and the state of the camera.

Description

Camera adjusting 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 an apparatus for adjusting a camera, an electronic device, and a storage medium.
Background
With the extensive application of degree of depth study to the video monitoring field, people are more and more high to imaging device's image quality requirement, and image quality has decisive effect to the promotion of final intelligent detection rate, and it is significant to match intelligent algorithm promotion target detection through automatically regulated image quality. The backlight modes of the camera are linear, digital wide dynamic, real wide dynamic and the like, but in the existing image acquisition system, the same backlight mode cannot effectively cover all scenes, and unnecessary waste of human resources cannot be avoided by 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 above technical problems, a first technical solution provided by the present invention is: provided is a camera adjusting method, including: acquiring a current backlight mode of a camera and a brightness dynamic parameter 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 adjusting at least one of 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 the average brightness of the 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; determining a first associated block corresponding to an image block in the first block set, and determining a second associated block corresponding to an image block in the second block set; and determining a brightness dynamic parameter based on the brightness parameters of the first associated block, the image block in the first block set, the second associated block and the image block in the second block set.
The step of determining a first associated block corresponding to an image block in the first block set includes: determining a first adjacent block corresponding to an image block in the first block set; determining a first adjacent block as a first associated block in response to that a difference value between a luminance parameter of the first adjacent block and a luminance parameter of an image block in the first block set is within a preset range; the step of determining a second associated block corresponding to an image block in the second block set includes: 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 value 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.
Wherein the step of determining the first neighboring block as the first associated block further comprises: determining the adjacent block corresponding to the first adjacent block as 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 the 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 luminance parameter of the adjacent block corresponding to the second adjacent block and the luminance parameter of the second adjacent block being within a preset range.
The step of determining the luminance dynamic parameter based on the luminance 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 includes: 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; in the first area and the second area, all the image blocks are communicated, and the number of the communicated image blocks in the first area and the second area is the largest; determining an average brightness of the first region and determining an average brightness 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 blocks into a first set of blocks and a second set of blocks based on the average luminance comprises: determining image blocks with brightness parameters larger than or equal to the average brightness 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 brightness 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.
Wherein, the step of adjusting the camera based on the current backlight mode and the dynamic brightness parameter comprises: and switching the current backlight mode of the camera to be a real wide dynamic state in response to the fact that the current backlight mode is in a linear state and in response to the fact that the brightness dynamic parameter is larger than a first preset value, the number of image blocks in the first area is larger than a second preset value and the number of image blocks in the second area is larger than a third preset value.
Wherein, the step of adjusting the camera based on the current backlight mode and the dynamic brightness parameter comprises: and switching the current backlight mode of the camera to digital wide dynamic in response to that the current backlight mode is in a linear state and in response to that the brightness dynamic parameter is greater than a first preset value, the number of image blocks in the first area is not greater than a second preset value and the number of image blocks in the second area is greater than a third preset value.
Wherein, the step of adjusting the camera based on the current backlight mode and the dynamic brightness parameter comprises: and switching the current backlight mode of the camera to be the real wide dynamic mode in response to the fact that the current backlight mode is the digital wide dynamic mode and in response to the fact that the brightness dynamic parameter is larger than the fourth preset value, the number of the image blocks in the first area is larger than the fifth preset value and the number of the image blocks in the second area is larger than the sixth preset value.
Wherein, the step of adjusting the camera based on the current backlight mode and the dynamic brightness parameter comprises: and switching the current backlight mode of the camera to a linear state in response to the fact that the current backlight mode is digital wide dynamic and in response to the fact that the brightness dynamic parameter is larger than a fourth preset value, the number of the image blocks in the first area is smaller than a fifth preset value and the number of the image blocks in the second area is larger than a sixth preset value.
Wherein, the step of adjusting the camera based on the current backlight mode and the dynamic brightness parameter comprises: and switching the current backlight mode of the camera to a linear state in response to the fact that the current backlight mode is real and wide dynamic and in response to the fact that the brightness dynamic parameter is smaller than a seventh preset value, the number of the image blocks in the first area is smaller than an eighth preset value and the number of the image blocks in the second area is smaller than a ninth preset value.
Wherein, the step of adjusting the camera based on the current backlight mode and the dynamic brightness parameter comprises: and in response to that the current backlight mode is real wide dynamic, and in response to that the brightness 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 not smaller than a ninth preset value, keeping the current backlight mode of the camera to be real wide dynamic.
Wherein, after the step of switching the current backlight mode of the camera to be real wide dynamic, the method further comprises the following steps: constructing a mapping function of a luminance dynamic parameter and an exposure ratio based on the luminance dynamic parameter range, wherein the luminance dynamic parameter and the exposure ratio are in positive correlation; 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 a mapping function in response to the fact that the brightness dynamic parameter is not in the brightness dynamic range.
In order to solve the above technical problems, a second technical solution provided by the present invention is: 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; and the adjusting module is used for adjusting the camera based on the current backlight mode and the brightness dynamic parameter, and the adjusting comprises adjusting at least one of the exposure ratio of the camera and the state of the camera.
In order to solve the above technical problems, a third technical solution provided by the present invention is: provided is an electronic device including: a memory storing program instructions and a processor retrieving the program instructions from the memory to perform any of the above methods.
In order to solve the above technical problems, a fourth technical solution provided by the present invention is: there is provided a computer readable storage medium storing a program file executable to implement the method of any of the above.
The method has the advantages that the method is different from the prior art, the camera is adjusted based on the current backlight mode and the brightness dynamic parameter, and the adjustment comprises at least one of adjustment of the exposure ratio of the camera and adjustment of the state of the camera. The method can adaptively switch the backlight mode in combination with the environment background, and has high efficiency.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without inventive efforts, wherein:
fig. 1 is a schematic flow chart of a camera adjustment method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of step S11 in FIG. 1;
FIG. 3 is a flowchart illustrating a first embodiment of step S12 in FIG. 1;
FIG. 4 is a flowchart illustrating a second embodiment of step S12 in FIG. 1;
FIG. 5 is a flowchart illustrating a third embodiment of step S12 in FIG. 1;
FIG. 6 is a schematic structural diagram of an embodiment of a camera adjustment device according to the present invention;
FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
FIG. 8 is a structural diagram of an embodiment of a computer-readable storage medium according to the invention.
Detailed Description
The prior art provides a method and a device for switching a shooting state, which are implemented by acquiring a shooting state, a histogram of a frame image and the number of total pixel points in a current scene, obtaining a first target parameter according to the histogram of the frame image and the data of the total pixel points of the frame image if the shooting state is a linear state, and switching the linear state into a wide dynamic shooting state if the first target parameter meets 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 the total pixel points of the frame image, and if the second target parameter accords with a preset linear preset value, switching the wide dynamic state into the shooting state in a 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 the invalid information on the frame image may generate misjudgment, for example, the indoor lamp tube is brighter and misjudged as an overexposed area, which cannot completely reflect the actual situation of the scene, and the method has more preset value judgments and is slightly complex.
The prior art also provides a method and a device for implementing automatic HDR (High-Dynamic Range). The design point is that the HDR mode is automatically switched according to various judgment conditions through the current environment, and when the HDR mode is automatically switched, different HDR modes can be automatically judged to be used differently. In addition, the method adopts a mode of confirming the HDR mode by using a flag value on the switching condition, and can intelligently judge whether the switching between the HDR modes can be carried out according to different types of camera chip sensors by considering the characteristics of different types of camera chip sensors when the HDR mode is switched. The main disadvantage of the design is that only automatic HDR is adopted, automatic linear or digital wide dynamic mode switching is not adopted, and when the dynamic range of the current scene is small, the HDR has negative effects such as unnatural image effect and oily painting feeling.
The application provides a camera adjusting method which can be combined with an environment background to adaptively switch a backlight mode and is high in efficiency. The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a schematic flow chart of a camera adjustment method according to a first embodiment of 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 luminance dynamic parameter of the image corresponding to the camera includes:
step S21: an average luminance of an image block is determined, and the image block is divided into a first block set and a second block set based on the average luminance.
Specifically, the image is divided into a plurality of image blocks, for example, the image is divided into m × n image blocks, and the average luminance of the m × n image blocks is calculated. And setting image blocks with the brightness parameter larger than or equal to the average brightness as a first block set, and setting image blocks with the brightness parameter smaller than the average brightness as a second block set. That is, the first set of blocks are light blocks and the second set of blocks are 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, based on the luminance parameter, the image blocks in the first block combination and the second block combination are sorted, so that the image blocks in the first block combination and the second block combination are sorted from large to small in luminance parameter. And selecting a preset number I of image blocks from the first block combination as a first block set, and selecting a preset number I of image blocks from the second block combination as a second block set.
Specifically, the coordinates and luminance 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 block set is determined, and a second associated block corresponding to an image block in the second block set is determined.
Specifically, a graph search is performed to determine a first adjacent block corresponding to an image block in the first block set. The pattern search mode comprises breadth first search or depth advantage search. Taking an image block in the first block set as a root node, and searching four adjacent domain blocks (including adjacent blocks in an upper, lower, left and right direction) adjacent to the root node according to the coordinates to determine a first adjacent block of the image block. And in response to that the difference value between the brightness parameter of the first adjacent block and the brightness parameter of the image block in the first block set is within a preset range, determining that the first adjacent block is the first associated block. Specifically, if the first neighboring block of the image block X in the first block set includes X1, X2, X3, and X4, where a difference value 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 image block X.
Further, determining the first association block further comprises: and determining whether 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 in a preset range. For example, the neighboring blocks corresponding to the first neighboring block X1 include M1, M2, M3, and M4, and then differences between the luminance parameters of M1, M2, M3, M4, and X1 are further calculated, and if the differences are within a preset range, the first associated block is determined. For example, if the difference between the luminance parameters of M1 and X1 is within a preset range, M1 is determined as the first association block.
Further, the associated block of the image block in the second block combination is determined in the same manner. 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 value 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. Assuming that the first neighboring blocks of the image block Y in the second block combination include Y1, Y2, Y3, and Y4, wherein the difference value between the luminance parameter of Y1 and the 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 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, if the neighboring blocks corresponding to the second neighboring block Y1 include N1, N2, N3, and N4, the difference between the luminance parameters of N1, N2, N3, N4, and Y1 is further calculated, and if the difference is within a preset range, it is determined that the second neighboring block is the second associated block. For example, if the difference between the luminance parameters of N1 and Y1 is within a preset range, N1 is determined as the second association block.
It can be understood that the smaller the difference value of the luminance parameters is, the closer the luminance of the image block representing the neighboring block and serving as the root node is, the higher the confidence is, the higher the probability of the reference is.
Step S23: and determining a brightness dynamic parameter based on the brightness parameters of the first associated block, the image block in the first block set, the second associated block and the image block in the second block set.
Specifically, the first area is determined based on the first associated block and the image blocks in the first block set, and the second area is determined based on the second associated block and the image blocks in the second block set. After all the first associated blocks and the second associated blocks are determined, at least one connected region is formed by the first associated blocks and the image blocks in the first block set, the connected region with the largest number of image blocks is selected from the at least one connected region to serve as the first region, at least one connected region is formed by the second associated blocks and the image blocks in the second block set, and the connected region with the largest number of image blocks is selected from the connected regions to serve as the second region.
In the understood first area and the second area, the image blocks are communicated, and the number of the communicated image blocks in the first area and the second area is the largest.
In one embodiment, the first area is denoted as B1, the number of image blocks in the first area B1 is denoted as T1, the second area is denoted as B2, and the number of image blocks in the second area B2 is denoted as T2. The average luminance C1 of the first area B1 is determined based on the luminance parameters of all the image blocks in the first area B1, and the average luminance C2 of the second area B2 is determined based on the luminance parameters of all the image blocks in the second area 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 α is 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, where fig. 3 is a schematic flowchart illustrating the first embodiment of step S12, including:
step S31: the current backlight mode is linear.
Step S32: the dynamic brightness parameter is greater than a first preset value, the number of image blocks in the first area is greater than a second preset value, and the number of image blocks in the second area is greater than a third preset value.
Step S33: and switching the current backlight mode of the camera to be real wide dynamic.
Specifically, if the current backlight mode is in a linear state, the luminance 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, it indicates that the current luminance dynamic parameter range of the camera is large, the ratio of a bright area to a dark area is large, 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.
If the current backlight mode is in a linear state, the luminance dynamic parameter α is greater than a first preset value, the number T1 of image blocks in the first area B1 is not 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, it indicates that the current luminance dynamic parameter range of the camera is large, and only the dark area ratio is large, and at this time, the current backlight mode of the camera is switched to a digital wide dynamic mode. Wherein the second preset value is the same as or different from the third preset value.
It is understood that, except for the cases shown in the above step S32 and step S34, the current backlight mode of the camera is kept in a linear state.
In another embodiment, please refer to fig. 4, in which fig. 4 is a schematic flowchart illustrating a second embodiment of step S12, including:
step S41: the current backlight mode is digital wide dynamic.
Step S42: the luminance dynamic parameter is larger than a fourth preset value, the number of the image blocks in the first area is larger than a fifth preset value, and the number of the image blocks in the second area is larger than a sixth preset value.
Step S43: and switching the current backlight mode of the camera to be real wide dynamic.
If the current backlight mode is digital wide dynamic, the luminance dynamic parameter α is greater than a fourth preset value, the number T1 of image blocks in the first area B1 is greater than a fifth preset value, and the number T2 of image blocks in the second area B2 is greater 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 larger than a fourth preset value, the number of the image blocks in the first area is smaller than a fifth preset value, and the number of the image blocks in the second area is larger than a sixth preset value.
Step S45: and switching the current backlight mode of the camera to a linear state.
If the current backlight mode is digital wide dynamic, the luminance dynamic parameter α is greater than a fourth preset value, the number T1 of image blocks in the first area B1 is less than a fifth preset value, and the number T2 of image blocks in the second area B2 is greater than a sixth preset value, the current backlight mode of the camera is switched to a linear state.
It is understood that, except for the cases shown in the above step S42 and step S44, the current backlight mode of the camera is kept as digital wide dynamic.
Optionally, the fourth preset value in this embodiment is the same as or different from the first preset value shown in fig. 3, and is not limited herein, taking the actual situation as the standard.
In another embodiment, please refer to fig. 5, wherein fig. 5 is a schematic flowchart illustrating a third embodiment of step S12, including:
step S51: the current backlight mode is truly 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 real wide dynamic, the luminance dynamic parameter α is smaller than a seventh preset value, the number T1 of image blocks in the first area B1 is smaller than an eighth preset value, and the number T2 of image blocks in the second area B2 is smaller than a ninth preset value, 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.
If the current backlight mode is real wide dynamic, the luminance dynamic parameter α is smaller than a seventh preset value, the number T1 of image blocks in the first area B1 is smaller than an eighth preset value, and the number T2 of image blocks in the second area B2 is larger than a ninth preset value, the current backlight mode of the camera is switched to digital wide dynamic. 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 is based on practical situations and is not limited herein.
It can be understood that, except for the cases shown in step S52 and step S54, the current backlight mode of the camera is kept as a real wide dynamic state.
In the present application, if the backlight mode of the camera is real and wide dynamic, the exposure ratio of the camera needs to be further adjusted. Specifically, a mapping function of a luminance dynamic parameter alpha and an exposure ratio is constructed based on the luminance dynamic parameter range, and the luminance dynamic parameter alpha and the exposure ratio are in positive correlation. 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 a mapping function in response to the fact that the brightness dynamic parameter is not in the brightness dynamic range. Specifically, the larger the luminance dynamic parameter α is, the larger the exposure ratio is, and the smaller the luminance dynamic parameter α is, the smaller the exposure ratio is. In establishing the mapping function, it is also necessary to set upper and lower thresholds for the exposure ratio adjustment. And judging whether the current brightness dynamic parameter alpha is in the brightness dynamic parameter range corresponding to the current exposure ratio, if not, adjusting the exposure ratio to ensure that whether the previous brightness dynamic parameter alpha is in the brightness dynamic parameter range corresponding to the adjusted exposure ratio.
The dynamic range value of the current frame image is calculated by searching the maximum bright and dark connected region 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 through the calculated dynamic range value and the number of blocks of the bright and dark connected areas. And adjusting the exposure proportion of the actual scene under the real wide dynamic state through the calculated dynamic range value, thereby adaptively adapting to the actual scene. The backlight mode can be adaptively switched in combination with the environment background, and the efficiency is high.
Fig. 6 is a schematic structural diagram of an embodiment of a camera adjustment device according to the present invention, 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 luminance dynamic parameter of an image corresponding to the camera.
In an embodiment, the obtaining module 61 is configured to determine an average luminance of an image block, and divide the image block into a first block set and a second block set based on the average luminance; the image comprises a plurality of image blocks; determining a first associated block corresponding to an image block in the first block set, and determining a second associated block corresponding to an image block in the second block set; and determining a brightness dynamic parameter based on the brightness parameters of the first associated block, the image block in the first block set, the second associated block and the image block in the second block set. The obtaining module 61 is configured to determine a first adjacent block corresponding to an image block in the first block set; and in response to that the difference value between the brightness parameter of the first adjacent block and the brightness parameter of the image block in the first block set is within a preset range, determining that the first adjacent block is the first associated block. The obtaining module 61 is further configured to determine a second adjacent block corresponding to an image block in the second block set; and determining the second adjacent block as a second associated block in response to the difference value 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. Specifically, in response to that the difference value between the luminance parameter of the adjacent block corresponding to the first adjacent block and the luminance parameter of the first adjacent block is within a preset range, determining that the adjacent block corresponding to the first adjacent block is the 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 luminance parameter of the adjacent block corresponding to the second adjacent block and the luminance 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 block set, and determine a second area based on the second associated block and the image blocks in the second block set; in the first area and the second area, all the image blocks are communicated, and the number of the communicated image blocks in the first area and the second area is the largest; determining an average brightness of the first region and determining an average brightness 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 adjusting module 62 is configured to adjust the camera based on the current backlight mode and the luminance dynamic parameter, where the adjusting includes adjusting at least one of an exposure ratio of the camera and a state of the camera.
In an embodiment, in response to that the current backlight mode is in a linear state, and in response to that the luminance dynamic parameter is greater than a first preset value, the number of image blocks in the first area is greater than a second preset value, and the number of image blocks in the second area is greater than a third preset value, the adjusting module 62 switches the current backlight mode of the camera to a real wide dynamic state.
In an embodiment, in response to that the current backlight mode is in a linear state, and in response to that the luminance dynamic parameter is greater than a first preset value, the number of image blocks in the first area is not greater than a second preset value, and the number of image blocks in the second area is greater than a third preset value, the adjusting module 62 switches the current backlight mode of the camera to a digital wide dynamic state.
In an embodiment, in response to that the current backlight mode is digital wide dynamic, and in response to that the luminance dynamic parameter is greater than the fourth preset value, the number of image blocks in the first area is greater than the fifth preset value, and the number of image blocks in the second area is greater than the sixth preset value, the adjusting module 62 switches the current backlight mode of the camera to real wide dynamic.
In an embodiment, in response to that the current backlight mode is digital wide dynamic, and in response to that the luminance dynamic parameter is greater than the fourth preset value, the number of image blocks in the first area is less than the fifth preset value, and the number of image blocks in the second area is greater than the sixth preset value, the adjusting module 62 switches the current backlight mode of the camera to the linear state.
In an embodiment, in response to that the current backlight mode is a real wide dynamic state, and in response to that the luminance dynamic parameter is less than a seventh preset value, the number of image blocks in the first area is less than an eighth preset value, and the number of image blocks in the second area is less than a ninth preset value, the adjusting module 62 switches the current backlight mode of the camera to a linear state.
In an embodiment, in response to the current backlight mode being a real 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 area being less than the eighth preset value, and the number of image blocks in the second area being not less than the ninth preset value, the adjusting module 62 maintains the current backlight mode of the camera as a real wide dynamic.
In an embodiment, if the current backlight mode of the camera is real and wide dynamic, the adjusting module 62 is further configured to construct a mapping function of a luminance dynamic parameter and an exposure ratio based on the luminance dynamic parameter range, where the luminance dynamic parameter and the exposure ratio are in positive correlation; 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 a mapping function in response to the fact that the brightness dynamic parameter is not in the brightness dynamic range.
The dynamic range value of the current frame image is calculated by searching the maximum bright and dark connected region on the basis of the block statistical information of the frame image. And automatically switching the backlight mode including linearity, 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 regions. And adjusting the exposure proportion of the actual scene under the real wide dynamic state through the calculated dynamic range value, thereby adaptively adapting to the actual scene. The backlight mode can be adaptively switched in combination 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 present invention is shown, where the electronic device includes a memory 202 and a processor 201 that are 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 used to execute program instructions stored by 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 having signal processing capabilities. The 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 storage 202 may be a memory bank, a TF card, etc., and may store all information in the electronic device of the device, including the input raw data, the computer program, the intermediate motion results, and the final motion results. It stores and retrieves information based on the location specified by the controller. With the memory, the electronic device can only have the memory function to ensure the normal operation. The memories of electronic devices are classified into a main memory (internal memory) and an auxiliary memory (external memory) according to their purposes, and also into an external memory and an internal memory. 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 main board, which is used for storing data and programs currently being executed, but is only used for temporarily storing the programs and the data, and the data is lost when the power is turned off or the power is cut 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 ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a system server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method of the embodiments of the present application.
Please refer to fig. 8, which is a schematic structural diagram of a computer-readable storage medium according to the present invention. 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 in the form of a software product, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. The aforementioned storage device includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (16)

1. A camera adjustment method is characterized by comprising the following steps:
acquiring a current backlight mode of a camera and a brightness dynamic parameter of an image corresponding to the camera;
and adjusting the camera based on the current backlight mode and the dynamic brightness parameter, wherein the adjustment comprises adjusting at least one of the exposure ratio of the camera and the state of the camera.
2. The adjusting method according to claim 1, wherein the method for obtaining the luminance dynamic parameter comprises:
determining an average luminance of an image block, the image block being divided into a first block set and a second block set based on the average luminance; the image comprises a plurality of the 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;
determining the luminance dynamic parameter based on luminance parameters of the first associated block, the image block of the first set of blocks, the second associated block, and the image block of the second set of blocks.
3. The adjusting method according to claim 2, wherein the step of determining a first associated block corresponding to the image block in the first block set comprises:
determining a first neighboring block corresponding to the image block in the first block set;
determining the first neighboring block as the first associated block in response to a difference between the luminance parameter of the first neighboring block and the luminance parameter of the image block in the first set of blocks 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 neighboring block corresponding to the image block in the second set of blocks;
determining the second neighboring block as the second associated block in response to a difference value between the luminance parameter of the second neighboring block and the luminance parameter of the image block in the second set of blocks being within a preset range.
4. The adjusting method according to claim 3, wherein the step of determining the first neighboring block as the first associated block further comprises:
determining the neighboring block corresponding to the first neighboring block as the first associated block in response to a difference value between the luminance parameter of the neighboring block corresponding to the first neighboring block and the luminance parameter of the first neighboring block being within a preset range;
the step of determining the second neighboring block as the second associated block further comprises:
and determining the adjacent block corresponding to the second adjacent block as the second associated block in response to that the difference value between the luma parameter of the adjacent block corresponding to the second adjacent block and the luma parameter of the second adjacent block is within a preset range.
5. The adjusting method according to claim 2, wherein the step of determining the luminance dynamic parameter based on the luminance parameters of the first associated block, the image block in the first set of blocks, the second associated block, and the image block in the second set of blocks comprises:
determining a first area based on the first associated block, the image block in the first set of blocks, and a second area based on the second associated block, the image block in the second set of blocks; in the first area and the second area, all the image blocks are communicated, and the number of the communicated image blocks in the first area and the second area is the largest;
determining an average brightness of the first region and determining an average brightness of the second region;
determining the luminance dynamic parameter based on the average luminance of the first region and the average luminance of the second region.
6. The adjusting method according to claim 2, wherein 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 brightness parameters larger than or equal to the average brightness 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 brightness 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.
7. The adjusting method according to any one of claims 1 to 6, wherein the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter comprises:
and switching the current backlight mode of the camera to be a real wide dynamic state in response to the fact that the current backlight mode is in a linear state and in response to the fact that the brightness dynamic parameter is larger than a first preset value, the number of image blocks in the first area is larger than a second preset value and the number of image blocks in the second area is larger than a third preset value.
8. The adjusting method according to any one of claims 1 to 6, wherein the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter comprises:
and in response to the fact that the current backlight mode is in a linear state and in response to the fact that the brightness 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, the current backlight mode of the camera is switched into a digital wide dynamic mode.
9. The adjusting method according to any one of claims 1 to 6, wherein the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter comprises:
and switching the current backlight mode of the camera to be the real wide dynamic state in response to the fact that the current backlight mode is the digital wide dynamic state and in response to the fact that the brightness dynamic parameter is larger than a fourth preset value, the number of the image blocks in the first area is larger than a fifth preset value and the number of the image blocks in the second area is larger than a sixth preset value.
10. The adjusting method according to any one of claims 1 to 6, wherein the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter comprises:
and switching the current backlight mode of the camera to a linear state in response to the fact that the current backlight mode is digital wide dynamic and in response to the fact that the brightness dynamic parameter is larger than a fourth preset value, the number of image blocks in the first area is smaller than a fifth preset value and the number of image blocks in the second area is larger than a sixth preset value.
11. The adjusting method according to any one of claims 1 to 6, wherein the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter comprises:
and switching the current backlight mode of the camera to 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 less than a seventh preset value, the number of image blocks in the first area being less than an eighth preset value and the number of image blocks in the second area being less than a ninth preset value.
12. The adjusting method according to any one of claims 1 to 6, wherein the step of adjusting the camera based on the current backlight mode and the luminance dynamic parameter comprises:
and in response to that the current backlight mode is real wide dynamic, and in response to that the brightness 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 not smaller than a ninth preset value, keeping the current backlight mode of the camera to be real wide dynamic.
13. The adjusting method according to claim 7, wherein after the step of switching the current backlight mode of the camera to the true wide dynamic state, the method further comprises:
constructing a mapping function of a luminance dynamic parameter and an exposure ratio based on a luminance dynamic parameter range, wherein the luminance dynamic parameter and the exposure ratio are in positive correlation;
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 fact that the brightness dynamic parameter is not in the brightness dynamic range.
14. A camera adjustment device, comprising:
the device comprises an acquisition module, a display module and a control module, wherein the acquisition module is used for acquiring a current backlight mode of a camera and a brightness dynamic parameter of an image corresponding to the camera;
and the adjusting module is used for adjusting the camera based on the current backlight mode and the brightness dynamic parameter, wherein the adjusting comprises adjusting at least one of an exposure ratio of the camera and a state of the camera.
15. An electronic device, comprising: a memory storing program instructions and a processor retrieving the program instructions from the memory to perform the method of any of claims 1-13.
16. A computer-readable storage medium, characterized in that a program file is stored, which program file can be executed to implement the method according to any one of claims 1-13.
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 true CN114500830A (en) 2022-05-13
CN114500830B 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)

Cited By (1)

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

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140348399A1 (en) * 2013-05-22 2014-11-27 Asustek Computer Inc. Image processing system and method of improving human face recognition
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

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140348399A1 (en) * 2013-05-22 2014-11-27 Asustek Computer Inc. Image processing system and method of improving human face recognition
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

Cited By (1)

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

Also Published As

Publication number Publication date
CN114500830B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
CN111028189B (en) Image processing method, device, storage medium and electronic equipment
US9451173B2 (en) Electronic device and control method of the same
CN108322646B (en) Image processing method, image processing device, storage medium and electronic equipment
US10878543B2 (en) Group management method, terminal, and storage medium
KR101926490B1 (en) Apparatus and method for processing image
CN104883504B (en) Open the method and device of high dynamic range HDR functions on intelligent terminal
CN110266954B (en) Image processing method, image processing device, storage medium and electronic equipment
CN110766621A (en) Image processing method, image processing device, storage medium and electronic equipment
WO2021143300A1 (en) Image processing method and apparatus, electronic device and storage medium
CN112738411B (en) Exposure adjusting method, exposure adjusting device, electronic equipment and storage medium
CN104866191A (en) Photography method and mobile terminal
CN110570370B (en) Image information processing method and device, storage medium and electronic equipment
CN113840095B (en) Light supplement lamp control method and related device
CN114500830B (en) Camera adjustment method and device, electronic equipment and storage medium
CN106803920B (en) Image processing method and device and intelligent conference terminal
CN111182208B (en) Photographing method and device, storage medium and electronic equipment
CN112653845B (en) Exposure control method, exposure control device, electronic equipment and readable storage medium
CN111970501A (en) Pure color scene AE color processing method and device, electronic equipment and storage medium
US11831992B2 (en) Control circuit and control method of image sensor
CN105163040A (en) Image processing method and mobile terminal
CN111630839B (en) Image processing method and device
CN109672829A (en) Method of adjustment, device, storage medium and the terminal of brightness of image
CN114816619A (en) Information processing method and electronic equipment
CN114339028A (en) Photographing method, electronic device and computer-readable storage medium
CN111064897B (en) Exposure evaluation value statistical method and imaging equipment

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