CN111654640B - Exposure adjusting method and device and electronic equipment - Google Patents

Exposure adjusting method and device and electronic equipment Download PDF

Info

Publication number
CN111654640B
CN111654640B CN202010463606.4A CN202010463606A CN111654640B CN 111654640 B CN111654640 B CN 111654640B CN 202010463606 A CN202010463606 A CN 202010463606A CN 111654640 B CN111654640 B CN 111654640B
Authority
CN
China
Prior art keywords
preview image
target
area
preset
light source
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
CN202010463606.4A
Other languages
Chinese (zh)
Other versions
CN111654640A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202010463606.4A priority Critical patent/CN111654640B/en
Publication of CN111654640A publication Critical patent/CN111654640A/en
Application granted granted Critical
Publication of CN111654640B publication Critical patent/CN111654640B/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/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/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces

Abstract

The application discloses an exposure adjusting method, an exposure adjusting device and electronic equipment, and belongs to the technical field of communication. The exposure adjustment method includes: the method comprises the steps of obtaining a current preview image collected by a camera, obtaining a first area of the current preview image, obtaining first attribute information of a first artificial light source area in the current preview image, wherein the first attribute information comprises the first area of the first artificial light source area, and adjusting an exposure value when the camera collects a target preview image according to the first area and the first area. The method comprises the steps of identifying the first area of a first artificial light source in a current preview image under an artificial light source scene, and adjusting an exposure value when a camera collects a target preview image according to the first area of the preview image and the first area of a first artificial light source area, so that the brightness value of the target preview image collected by the camera can be improved.

Description

Exposure adjusting method and device and electronic equipment
Technical Field
The application belongs to the technical field of communication, and particularly relates to an exposure adjustment method and device and electronic equipment.
Background
Along with the promotion of the software and hardware technology of the camera module of electronic equipment, more and more people like to use the camera module of electronic equipment oneself to shoot, as non-professional photographic user, all can use the automatic exposure mode to shoot the photo.
In the process of implementing the present application, the inventor finds that at least the following problems exist in the prior art: in the prior art, an automatic exposure scheme is adopted to adjust the overall average brightness of a preview image to a preset target brightness value, which is generally the brightness of neutral gray. However, this solution cannot be applied to all scenes, for example, in an indoor bright scene with a large area of artificial light source, because the brightness of the image in the scene with the artificial light source is greater than the neutral gray brightness, the preview image exposed by the automatic exposure solution has a problem of being darker.
Content of application
An object of the embodiments of the present application is to provide an exposure adjustment method and apparatus, and an electronic device, which can solve the problem in the prior art that a preview image exposed by an automatic exposure scheme is darker in an indoor bright scene with a large-area artificial light source.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides an exposure adjustment method, where the method includes:
acquiring a current preview image acquired by a camera, and acquiring a first area of the current preview image;
acquiring first attribute information of a first artificial light source region in the current preview image, wherein the first attribute information comprises a first region area of the first artificial light source region;
and adjusting an exposure value when the camera collects a target preview image according to the first area and the first region area, wherein the target preview image is an image behind the current preview image in time sequence.
In a second aspect, an embodiment of the present application provides an exposure adjustment apparatus, including:
the first acquisition module is used for acquiring a current preview image acquired by a camera and determining a first area of the current preview image;
a second obtaining module, configured to obtain first attribute information of a first artificial light source region in the current preview image, where the first attribute information includes a first region area of the first artificial light source region;
and the adjusting module is used for adjusting an exposure value of a target preview image acquired by the camera according to the first area and the first region area, wherein the target preview image is an image behind the current preview image in time sequence.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In the embodiment of the application, a current preview image acquired by a camera is acquired, a first area of the current preview image is acquired, and first attribute information of a first artificial light source area in the current preview image is acquired, wherein the first attribute information includes the first area of the first artificial light source area, and an exposure value when the camera acquires a target preview image is adjusted according to the first area and the first area. The exposure adjustment method provided by this embodiment, instead of adjusting the exposure brightness of the preview image to the preset target brightness in any scene as in the prior art, which causes a problem that the brightness of the preview image output by the camera is too dark in the artificial light source scene, can identify the first area of the first artificial light source in the current preview image in the artificial light source scene, and adjust the exposure value when the camera captures the target preview image according to the first area of the preview image and the first area of the first artificial light source region, so as to improve the brightness value of the target preview image captured by the camera.
Drawings
Fig. 1 is a flowchart illustrating the steps of an exposure adjustment method provided in an embodiment of the present application;
FIG. 2 is a flow chart of steps of another exposure adjustment method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an exposure adjustment apparatus provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of another exposure adjustment apparatus provided in the embodiments of the present application;
fig. 5 is a schematic hardware structure diagram of an electronic device implementing an embodiment of the present application;
fig. 6 is a schematic hardware structure diagram of another electronic device for implementing the embodiment of the present application.
Detailed Description
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 some, but not all, embodiments of the present application. 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.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or described herein. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The exposure adjustment method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of an exposure adjustment method provided in an embodiment of the present application, where the method may include the following steps:
step 101, acquiring a current preview image acquired by a camera, and acquiring a first area of the current preview image.
The current preview image is a preview image currently acquired by the camera, and the current preview image can be determined according to a preset time length and a frame rate, for example, when the frame rate is equal to 30 and the preset time length is equal to 1 second, the 31 th frame of preview image can be used as the current preview image, and the preset time length is within a time length counted from the time corresponding to when the camera is opened and the preview image is acquired. The first area is the whole area of the current preview image, namely the first area is equal to the product of the width and the height of the current preview image.
Step 102, obtaining first attribute information of a first artificial light source area in a current preview image, wherein the first attribute information comprises a first area of the first artificial light source area.
The preset model can be trained by various artificial light source pictures, such as pictures taken under artificial light source environments including various shapes of light tubes, bulbs, billboards and the like. After the preset model is trained by adopting various artificial light source pictures, the trained preset model is adopted to detect first attribute information of an artificial light source area in the current preview image, and therefore the first attribute information is obtained.
And 103, adjusting an exposure value when the camera collects a target preview image according to the first area and the first region area, wherein the target preview image is positioned behind the current preview image in time sequence.
According to the first area and the first region area, adjusting an exposure value when the camera collects a target preview image can be realized in the following two ways:
the first method is as follows: obtaining the ratio of the area of the first region to the first area;
under the condition that the exposure value when the camera acquires the target preview image is determined to be adjusted according to the ratio, adjusting the preset brightness weight corresponding to the first artificial light source region according to a first preset weight corresponding to the first preset ratio, a second preset weight corresponding to the second preset ratio, a third preset weight corresponding to the third preset ratio and the ratio to obtain a first target brightness weight;
and adjusting an exposure value when the camera collects a target preview image according to the first target brightness weight and a preset target brightness value.
It should be noted that, the preset luminance weight corresponding to the first artificial light source region is adjusted according to the first preset weight corresponding to the first preset ratio, the second preset weight corresponding to the second preset ratio, the third preset weight corresponding to the third preset ratio, and the ratio, so as to obtain the first target luminance weight, which may be implemented as follows:
if the preset luminance weight is set to 1, if the first preset ratio (the first preset ratio is equal to 1, for example) corresponds to the first preset weight (the first preset weight is equal to 0.25, for example), the second preset ratio (the second preset ratio is equal to 0.5, for example) corresponds to the second preset weight (the second preset weight is equal to 0.5, for example), and the third preset ratio (the third preset ratio is equal to 0, for example) corresponds to the third preset weight (the third preset weight is equal to 1, for example). Adjusting the preset brightness weight to 0.25 under the condition that the ratio is equal to 1, namely, when the ratio is equal to 1, obtaining a first target brightness weight equal to 0.25; under the condition that the ratio is equal to 0.5, the obtained first target brightness weight is equal to 0.5; in the case that the ratio is equal to 0, the preset luminance weight is kept still at 1. With specific reference to table 1 below:
Figure GDA0003304263220000051
TABLE 1
Referring to table 1, when the ratio is any one of the values in the interval greater than zero and less than 0.5, the preset luminance weight corresponding to the first artificial light source region may be adjusted by using a linear difference interpolation method to obtain the first target luminance weight. For example, when the ratio is equal to 0.2, a linear interpolation method is used to calculate and obtain the first target brightness weight
Figure GDA0003304263220000052
Equal to 0.8, if the preset ratio is taken as x on the horizontal axis and the preset weight corresponding to the preset ratio is taken as y on the vertical axis, then since x is 0.2 is greater than 0 and less than 0.5, it can be determined that y is equal to 0.8 when x is 0.2 according to coordinates (0.5 ) and (0.1); when the ratio is equal to 0.3, a linear interpolation method is adopted to calculate and obtain a first target brightness weight which is equal to 0.7. Similarly, in the case where any one of the values in the interval where the ratio is greater than 0.5 and less than 1 can be determined by using the linear difference interpolation method, for example, when the ratio is equal to 0.8, the first target luminance weight is calculated by using the linear interpolation method
Figure GDA0003304263220000053
Equal to 0.35. Other ratios are not described by way of example.
After the first target brightness weight is obtained, the exposure value of the camera in acquiring the target preview image can be adjusted according to the first target brightness weight and the preset target brightness value, so that the brightness value of the target preview image acquired by the camera can be adjusted. Since the exposure value is proportional to the brightness value of the target preview image, after determining that the brightness value of the target preview image should be adjusted to a target value according to the first target brightness weight and the preset target brightness value, the exposure value can be determined according to the target value, so as to adjust the exposure value, and after adjusting the exposure value, the brightness value of the target preview image can be adjusted to the target value. For example, when the preset target brightness value is 50, the ratio is equal to 0.5, and the first target brightness weight is 0.5, according to the formula: the preset target brightness value is the target value × the first target brightness weight, and it may be determined that the brightness value of the target preview image needs to be adjusted to 100, where 100 is the target value; when the ratio is equal to 0.2 and the first target luminance weight is equal to 0.8, it may be determined that the luminance value of the target preview image needs to be adjusted to 62.5, that is, 50 is 62.5 × 0.8.
It should be noted that, in the first mode, a scheme of reducing the preset brightness weight and keeping the preset target brightness value unchanged is adopted, so that the brightness value of the target preview image is increased, and the problem that the brightness of the obtained preview image is dark under an artificial light source scene in the prior art is avoided.
The second method comprises the following steps: obtaining the ratio of the area of the first region to the first area;
determining that the brightness value of the target preview image is increased to a first multiple of a preset target brightness value according to a first preset multiple corresponding to the first preset ratio, a second preset multiple corresponding to the second preset ratio, a third preset multiple corresponding to the third preset ratio and the ratio;
and adjusting an exposure value when the camera collects a target preview image according to the first multiple and a preset target brightness value.
It should be noted that, determining to increase the brightness value of the target preview image to the first multiple of the preset target brightness value according to the first preset multiple corresponding to the first preset ratio, the second preset multiple corresponding to the second preset ratio, the third preset multiple corresponding to the third preset ratio, and the ratio may be implemented in the following manner:
in this implementation, the ratio in this implementation is a ratio of the first area to the first area, and if the first preset ratio (the first preset ratio is, for example, equal to 1) corresponds to a first preset multiple (the first preset multiple is, for example, equal to 4), the second preset ratio (the second preset ratio is, for example, equal to 0.5) corresponds to a second preset multiple (the second preset multiple is, for example, equal to 2), and the third preset ratio (the third preset ratio is, for example, equal to 0) corresponds to a third preset multiple (the third preset multiple is, for example, equal to 1). Then the first multiple equals 4 in case the ratio equals 1; in the case of a ratio equal to 0.5, the first multiple is equal to 2; in the case that the ratio is equal to 0, the first multiple is equal to 1, i.e. the preset target brightness value is kept unchanged, i.e. the corresponding first multiple is equal to 1 when the ratio is equal to 0. With specific reference to table 2 below:
first multiple of 4 2 1
Ratio of 1 0.5 0
TABLE 2
Referring to table 2, in the case where the ratio is any one value within the interval greater than 0.5 and less than 1, a linear difference interpolation method may be employedDetermining a first multiple of the ratio equal to the value, e.g. when the ratio is equal to 0.2, using linear interpolation, the first multiple is equal to 1.4, i.e. it is calculated
Figure GDA0003304263220000071
Equal to 1.4; when the ratio is equal to 0.3, the first multiple equal to 1.6 can be calculated by adopting a linear interpolation method, namely
Figure GDA0003304263220000072
Equal to 1.6. Also, the first multiple of the ratio at any value in the interval greater than 0.5 and less than 1 may be determined by using a linear interpolation method, for example, when the ratio is equal to 0.8, the first target luminance weight is calculated by using a linear interpolation method
Figure GDA0003304263220000073
Equal to 3.2. Other ratios are not described by way of example.
After the first multiple is obtained, the exposure value of the camera in acquiring the target preview image can be adjusted according to the first multiple and the preset target brightness value, so that the brightness value of the target preview image acquired by the camera is adjusted according to the exposure value. Since the exposure value is proportional to the brightness value of the target preview image, after determining that the brightness value of the target preview image should be adjusted to a target value according to the first multiple and the preset target brightness value, the exposure value can be determined according to the target value, so that the exposure value is adjusted, and after the exposure value is adjusted, the brightness value of the target preview image can be adjusted to the target value. For example, when the first multiple is equal to 2, according to the formula: the brightness value of the adjusted target preview image is equal to a preset target brightness value multiplied by a first multiple, namely the brightness value of the adjusted target preview image is equal to 100; when the ratio is equal to 0.2 and the first multiple is equal to 1.4, the brightness value of the adjusted target preview image is equal to 50 × 1.4, i.e., equal to 70.
In summary, according to the first area and the first region area, the exposure value of the camera when acquiring the target preview image can be adjusted, so as to improve the brightness value of the target preview image.
In the exposure adjustment method provided in this embodiment, a current preview image acquired by a camera is obtained, a first area of the current preview image is determined, and first attribute information of a first artificial light source area in the current preview image is obtained, where the first attribute information includes the first area of the first artificial light source area, and an exposure value when the camera acquires a target preview image is adjusted according to the first area and the first area. The exposure adjustment method provided by this embodiment, instead of adjusting the exposure brightness of the preview image to the preset target brightness in any scene as in the prior art, which causes the problem of the brightness of the preview image output by the camera being too dark in the artificial light source scene, can identify the first area of the first artificial light source in the current preview image in the artificial light source scene, and adjust the exposure value when the camera acquires the target preview image according to the first area of the preview image and the first area of the first artificial light source region, thereby adjusting the exposure value when the camera acquires the target preview image in the artificial light source scene, and thus improving the brightness value of the target preview image.
Optionally, before the step in the first mode adjusts the exposure value of the target preview image acquired by the camera according to the first target brightness weight and the preset target brightness value, the method may further include the following steps:
determining a second distance between a first central point of the first artificial light source region and a second central point of the current preview image;
converting the second distance into a target distance within a preset interval range;
determining a second target brightness weight according to the target distance and the first target brightness weight;
through the steps, after the first target brightness weight is obtained according to the ratio of the area of the first region to the area of the first region, the first target brightness weight is adjusted again on the basis of the first target brightness weight, namely, the first target brightness weight is adjusted back, so that the problem that when the artificial light source region is located at the edge of the current preview image, the preset brightness weight is reduced too much according to the ratio of the area of the first region to the area of the first region, and the central region of the subsequently output preview image is too bright is solved.
Correspondingly, the step in the first mode may be implemented by adjusting an exposure value when the camera collects the target preview image according to the first target brightness weight and the preset target brightness value in the following manner:
and adjusting an exposure value when the camera collects the target preview image according to the second target brightness weight and the preset target brightness value.
The preset range is, for example, a range greater than or equal to 0 and less than or equal to 1 (0 represents that the first center point is closest to the second center point, and 1 represents that the first center point is farthest from the second center point), and the second distance is divided by a distance between the first center point and a vertex angle of the current preview image, so that the second distance can be converted into a target distance within the preset range. For example, if the distance between the first center point and the right top corner of the current preview image is equal to 3 and the second distance is equal to 1.5, the target distance is equal to the ratio of 1.5 to 3, i.e., the target distance is equal to 0.5.
It should be noted that, in the case that the target distance is equal to 0, the first target brightness weight is kept unchanged, for example, if the ratio of the first region area to the first area is equal to 0.5, in the case that the target distance is equal to 0, the first target brightness weight is kept unchanged, that is, the determined second target brightness weight is still equal to 0.5, and then the exposure value when the camera captures the target preview image is adjusted according to the second target brightness weight equal to 0.5 and the preset target brightness value. And if the target distance is equal to 1, restoring the first target brightness weight to a preset brightness weight, namely the determined second target brightness weight is equal to 1, and then adjusting the exposure value when the camera collects a target preview image according to the second brightness weight equal to 1 and the preset target brightness value, for example, if the target distance is equal to 1 and the first target brightness weight is equal to 0.5, restoring the first target brightness weight of 0.5 to 1, namely if the ratio of the area of the first region to the first area is equal to 0.5, and if the target distance is equal to 1, restoring the first target brightness weight of 0.5 to 1, namely the determined second target brightness weight is equal to 1.
Wherein, according to the target distance and the first target brightness weight, the process of determining the second target brightness weight refers to the following table 3:
if the ratio of the first area to the first area is equal to 0.5, the first target brightness weight is equal to 0.5 before the second target brightness weight is determined according to the target distance and the first target brightness weight, and the target distance is equal to 0, the finally determined second target brightness weight is still equal to 0.5 according to the target distance and the first target brightness weight; when the target distance is equal to 1, the first target brightness weight 0.5 is restored to the preset brightness weight 1, that is, according to the target distance and the first target brightness weight, the finally determined second target brightness weight is equal to 1, specifically referring to the following table 3:
second target luminance weight 0.5 1
Target distance 0 1
TABLE 3
In the case where the target distance is greater than 0 and less than 1, a linear interpolation method may be used to calculate a second target luminance weight that is finally determined when, for example, the ratio of the area of the first region to the first area is equal to 0.5 and the target distance is within an interval greater than 0 and less than 1, as shown in table 3.
For example, if the ratio of the first area to the first area is equal to 0.5, and when the target distance is equal to 0.5, the linear interpolation method can be used to calculate the target distance according to the data in table 3
Figure GDA0003304263220000101
Figure GDA0003304263220000102
When the target distance is equal to 0.8, the target distance can be calculated by adopting a linear interpolation method
Figure GDA0003304263220000103
Therefore, the first target brightness weight can be adjusted back according to the target distance and the first target brightness weight to obtain the second target brightness weight, and the problem that when the artificial light source area is located at the edge of the current preview image, the preset brightness weight is reduced more according to the ratio of the first area to the first area, so that the central area of the subsequently output preview image is relatively bright is avoided. In summary, after the first target brightness weight is obtained according to the ratio of the first area to the first area, the second target brightness weight is determined according to the target distance and the first target brightness weight, so that the exposure result of the target preview image can be improved to a certain extent.
Likewise, if the ratio of the area of the first region to said first area is equal to 0.8, the result is
Figure GDA0003304263220000104
Figure GDA0003304263220000105
Equal to 0.35, and the target distance is equal to 0, the finally determined luminance weight is still equal to 0.35; when the target distance is equal to 1, the first target brightness weight 0.35 is restored to the preset brightness weight 1, that is, the finally determined brightness weight is equal to 1, and the following table 4 is specifically referred to:
finally determined brightness weight 0.35 1
Target distance 0 1
TABLE 4
If the ratio of the first area to the first area is equal to 0.8 and the target distance is equal to 0.5, the linear interpolation method can be used for calculation
Figure GDA0003304263220000106
Figure GDA0003304263220000107
When the target distance is equal to 0.8, the target distance can be calculated by adopting a linear interpolation method
Figure GDA0003304263220000108
Figure GDA0003304263220000109
Similarly, when the ratio of the area of the first region to the first area is equal to other values, the second target luminance weight may be calculated by using a linear interpolation method according to the target distance, which is not illustrated here.
Optionally, when the ratio of the first area to the first area is equal to zero, the adjustment of the preset brightness weight corresponding to the first artificial light source area is prohibited, and an exposure value when the camera acquires the target preview image is determined according to the preset brightness weight and the preset target brightness value.
It should be noted that, under the condition that the ratio of the first area to the first area is equal to zero, that is, no artificial light source area exists in the current preview image, it may be determined that the current scene is not an artificial light source scene, and therefore, under this condition, the preset brightness weight is not adjusted, and according to the preset brightness weight and the preset target brightness value, the exposure value when the camera acquires the target preview image is determined, so that the brightness value of the target preview image acquired by the camera is approximately equal to or equal to the preset target brightness value, thereby avoiding the problem that the target preview image is too violent and is too bright due to the reduction of the preset brightness weight in the non-artificial light source scene. Especially for a non-artificial light source scene, if the area ratio of a dark object included in a shot object is large, if the preset brightness weight is reduced, the problem that the whole preview image is brighter and over-bright is caused.
Optionally, in the second mode, before adjusting an exposure value when the camera collects a target preview image according to the first multiple and the preset target brightness value, the method may further include the following steps:
determining a second distance between a first central point of the first artificial light source region and a second central point of the current preview image;
converting the second distance into a target distance within a preset interval range;
determining a second multiple according to the target distance and the first multiple;
correspondingly, according to the first multiple and the preset target brightness value, adjusting the exposure value when the camera collects the target preview image can be realized in the following way:
and adjusting an exposure value when the camera collects the target preview image according to the second multiple and a preset target brightness value.
The process of obtaining the second multiplier in this embodiment is similar to the process of obtaining the second target brightness weight in the above embodiment, and details are not repeated here.
It should be noted that, in the case that the target distance is equal to zero, the first multiple is kept unchanged, that is, in the case that the target distance is equal to zero, a second multiple determined according to the target distance and the first multiple is equal to the first multiple; correspondingly, the exposure value of the camera when the camera collects the target preview image can still be adjusted according to the first multiple and the preset target brightness value.
In the case where the target distance is equal to 1, the first multiple is restored to one. I.e. in case the target distance is equal to 1, the second multiple of determinations is equal to 1. For example, when the ratio of the first area to the first area is equal to 0.5, the obtained first multiple is equal to 2, and then if the calculated target distance is equal to 1, the first multiple 2 is restored to 1, so that the problem that the central area of the subsequently obtained target preview image is slightly bright due to the fact that the multiple is increased more when the first artificial light source area is located at the edge of the current preview image is avoided, and the exposure effect of the output target preview image can be improved.
It should be noted that, in the case that the ratio of the first area to the first area is equal to zero, that is, no artificial light source area exists in the current preview image, it may be determined that the current scene is not an artificial light source scene, and therefore, in this case, the second multiple of the determination is still equal to 1, so that the problem that the target preview image is too violent and too bright due to the increase of the preset target brightness value in the non-artificial light source scene may be avoided. Especially in a scene without artificial light sources, if the area ratio of dark objects included in a shot object is large, the whole preview image is brighter and too bright.
In this embodiment, in an artificial light source scene, the brightness of the target preview image is increased by determining that the brightness value of the target preview image is increased to a multiple of the preset target brightness value by keeping the preset brightness weight unchanged, so that the problem that the preview image in the artificial light source scene is darker due to an automatic exposure scheme in the prior art can be solved.
Referring to fig. 2, fig. 2 is a flowchart of steps of another exposure adjustment method provided in the embodiment of the present application, which may include the following steps:
and step 201, obtaining second attribute information of a second artificial light source area in the history preview image.
The second attribute information comprises a second area and second position information of a second artificial light source area, the historical preview image is an image which is positioned before the current preview image in time sequence, and the second artificial light source area and the first artificial light source area correspond to the same artificial light source object, namely correspond to the same light source scene. For example, the second artificial light source region and the first artificial light source region both correspond to a same shaped lamp tube.
For example, after a frame of history preview image acquired by the camera is obtained, the history preview image is input into the trained preset model, and the second area and the second position information of the second artificial light source area in the history preview image are output through the trained preset model.
After the second area and the second position information of the second artificial light source area of the m +1 th frame history preview image are obtained, an absolute value of a difference between the second area of the second artificial light source area of the m +1 th frame history preview image and a distance between a position corresponding to the second position information of the second artificial light source area of the m +1 th frame history preview image and a position corresponding to the second position information of the second artificial light source area of the m +1 th frame history preview image may be calculated, and when the absolute value of the difference is equal to or less than a first preset threshold and the distance is equal to or less than a second preset threshold (that is, the second area of the second artificial light source area of the m +1 th frame history preview image is stable, And the second position information of the second artificial light source region of both is stable), the number of frames is added up by 1. It should be noted that, when the absolute value of the difference determined for the first time is smaller than or equal to the first preset threshold and the distance is smaller than or equal to the second preset threshold, the number of frames is equal to 2 after being accumulated by 1, that is, the initial value of the number of frames may be set to 1.
After the number of frames is accumulated to the preset value N, the attribute information of the artificial light source region output by the trained preset model is stable, and then the attribute information of the next frame of preview image output by the trained preset model (for example, the next frame of preview image is the current preview image in step 202) can be obtained, that is, the region area of the artificial light source in the next frame of preview image is obtained, or the region area and the position information of the artificial light source in the next frame of preview image are obtained, and the exposure value when the camera collects the target preview image is adjusted according to the region area of the artificial light source in the next frame of preview image and the region area of the next frame of preview image.
Step 202, acquiring a current preview image acquired by a camera, and acquiring a first area of the current preview image.
Step 203, obtaining first attribute information of a first artificial light source area in the current preview image.
And 204, under the condition that the second attribute information of the second artificial light source region in the N continuous frames of historical preview images is determined to be stable, adjusting the exposure value when the camera acquires the target preview image according to the first area and the first region area.
Wherein, whether the second attribute information of the second artificial light source area in the N consecutive frames of history preview images is stable or not can be judged according to the second attribute information of the second artificial light source area in the (m + 1) th frame of history preview image and the second attribute information of the second artificial light source area in at least one frame of history preview image before the (m + 1) th frame of history preview image. For example, by calculating an absolute value of a difference between a second region area of the second artificial light source region of the m +1 th frame history preview image and a second region area of the second artificial light source region of the mth frame history preview image, and calculating a distance between a position corresponding to the second position information of the second artificial light source region of the m +1 th frame history preview image and a position corresponding to the second position information of the second artificial light source region of the mth frame history preview image, in the case where the absolute value of the difference is equal to or less than a first preset threshold value, and the distance is equal to or less than a second preset threshold value, the number of frames is added up by 1; and determining that the second attribute information of the second artificial light source area in the continuous N frames of historical preview images is stable under the condition that the number of frames after 1 accumulation is equal to a preset value N. Alternatively, the first and second electrodes may be,
for example, when N is 10, if m is 1, calculating an absolute value of a difference between a second region area of a second artificial light source region of the (m + 1) th frame history preview image and a second region area of a second artificial light source region of the 1 st frame history preview image, and calculating a distance between a position corresponding to second position information of the second artificial light source region of the (m + 1) th frame history preview image and a position corresponding to second position information of the second artificial light source region of the m th frame history preview image, and if the absolute value of the difference is equal to or less than a first preset threshold and the distance is equal to or less than a second preset threshold, adding 1 to the number of frames; the number of frames after 1 is added is equal to 2 (the initial value of the number of frames is equal to 1); calculating a difference value between a second area of a second artificial light source area of the 3 rd frame history preview image and an average value of second area of the second artificial light source area of the 1 st frame history preview image and the 2 nd frame history preview image, determining an absolute value of the difference value, calculating a distance between a position corresponding to second position information of the second artificial light source area of the 3 rd frame history preview image and a position corresponding to an average value of second position information of the second artificial light source area of the 1 st frame history preview image and the 2 nd frame history preview image, and accumulating the number of frames by 1 when the absolute value of the difference value is less than or equal to a first preset threshold value and the distance is less than or equal to a second preset threshold value; the number of frames after 1 accumulation is equal to 3; according to the method, whether the second attribute information of the second artificial light source area in the N continuous frames of history preview images is stable or not can be determined under the condition that the frame number is equal to 10.
Under the condition that the second attribute information of the second artificial light source region in the N continuous frames of historical preview images is determined to be stable, the exposure value of the camera in the process of collecting the target preview image can be adjusted according to the first area and the first region area. In other words, when it is determined that the second attribute information of the second artificial light source region in the N consecutive frames of history preview images is stable, the exposure value of the camera when the camera captures the target preview image is adjusted directly according to the first area and the first region area of the next frame of preview image (the next frame of preview image is the current preview image) located after the N frames of history preview images and adjacent to the last frame of image in the N frames of history preview images, so that the accuracy and stability of the brightness value of the target preview image captured by the camera can be ensured. Alternatively, the first and second electrodes may be,
under the condition that the second attribute information of the second artificial light source region in the N continuous frames of historical preview images is determined to be stable, calculating a first average value of all second region areas and a second average value of all second position information;
and under the condition that the absolute value of the difference value between the first area and the first average value is smaller than or equal to a first preset threshold value and the first distance is smaller than or equal to a second preset threshold value, adjusting the exposure value when the camera acquires the target preview image according to the first area and the first area.
And the first distance is the distance between a first position corresponding to the first position information and a second position corresponding to the second average value. The first preset threshold may be set to 1%, and the first preset threshold and the second preset threshold may be the same or different, which is not limited in the present application.
As explained in connection with step 201, after the number of frames is added to N, that is, in the case where it is determined that the second attribute information of the second artificial light source region in the consecutive N frames of history preview images is stable, the first average value of all the second region areas and the second average value of all the second position information may be calculated. And all the second region areas are the second region areas of the second artificial light source regions in the N continuous frames of history preview images, and all the second position information is the second position information of the second artificial light source regions in the N continuous frames of history preview images. N is a preset number, for example, N is preset to 10. If N is equal to 10, in a case where the second attribute information of the second artificial light source region in the 10 consecutive frame history preview images is obtained to be stable, the first average value of the areas of the 10 second regions and the second average value of the 10 second position information are calculated. After the area and the position information of the artificial light source area in the next frame of preview image (the next frame of preview image is the current preview image in this embodiment) are obtained next, an absolute value of a difference between the area of the artificial light source area in the next frame of preview image and the first average value is calculated, and a distance between a position corresponding to the position information of the artificial light source area in the next frame of preview image and a position corresponding to the second average value is calculated, and under the condition that the absolute value is less than or equal to a first preset threshold value and the distance is less than or equal to a second preset threshold value, the brightness value of the preview image subsequently acquired by the camera is adjusted according to the area of the artificial light source area in the next frame of preview image and the area of the next frame of preview image. The second position information may be coordinates of a center point of the second artificial light source area, an average value of abscissa and an average value of ordinate of the center point of the 10 second artificial light source areas may be calculated, and the average value of the abscissa and the average value of the ordinate are used as the second average value of the 10 second position information.
Under the condition that the absolute value of the difference value between the first area and the first average value is smaller than or equal to a first preset threshold value and the first distance is smaller than or equal to a second preset threshold value, the exposure value of the camera when the camera acquires the target preview image is adjusted according to the first area and the first area, namely, under the condition that the first attribute information of the current preview image is stable, the exposure value of the camera when the camera acquires the target preview image is adjusted according to the first area and the first area, so that the accuracy and the stability of the brightness value of the adjusted target preview image can be improved to a certain extent, and the problem that the exposure effect of the adjusted target preview image is not ideal under the condition that the attribute information of the current preview image is unstable is solved.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an exposure adjustment apparatus provided in an embodiment of the present application, where the exposure adjustment apparatus 300 includes:
a first obtaining module 301, configured to obtain a current preview image acquired by a camera, and obtain a first area of the current preview image;
a second obtaining module 302, configured to obtain first attribute information of a first artificial light source region in the current preview image, where the first attribute information includes a first region area of the first artificial light source region;
an adjusting module 303, configured to adjust an exposure value when the camera acquires a target preview image according to the first area and the first region area, where the target preview image is an image located after the current preview image in time sequence.
Optionally, the first attribute information further includes first position information of a first artificial light source region, and the second obtaining module 302 is further configured to obtain second attribute information of a second artificial light source region in a history preview image, where the second attribute information includes a second region area and second position information of the second artificial light source region, the history preview image is an image located before the current preview image in time sequence, and the second artificial light source region and the first artificial light source region correspond to the same artificial light source object;
the adjusting module 303 is specifically configured to, when it is determined that second attribute information of a second artificial light source region in consecutive N frames of history preview images is stable, adjust an exposure value when the camera acquires a target preview image according to the first area and the first region area.
Optionally, the adjusting module 303 is specifically configured to calculate a first average value of areas of all second regions and a second average value of all second position information when it is determined that second attribute information of a second artificial light source region in the N consecutive frames of history preview images is stable;
and under the condition that the absolute value of the difference value between the first area and the first average value is smaller than or equal to a first preset threshold value and the first distance is smaller than or equal to a second preset threshold value, adjusting an exposure value when the camera acquires a target preview image according to the first area and the first area, wherein the first distance is the distance between a first position corresponding to the first position information and a second position corresponding to the second average value.
Optionally, referring to fig. 4, fig. 4 is a schematic structural diagram of another exposure adjustment apparatus provided in this embodiment, where the adjustment module 303 of the exposure adjustment apparatus 400 includes:
a first obtaining unit 3031, configured to obtain a ratio of the first region area to the first area;
a first adjusting unit 3032, configured to, when determining to adjust an exposure value when the camera acquires a target preview image according to the ratio, adjust a preset luminance weight corresponding to the first artificial light source region according to a first preset weight corresponding to the first preset ratio, a second preset weight corresponding to the second preset ratio, a third preset weight corresponding to the third preset ratio, and the ratio, so as to obtain a first target luminance weight;
the second adjusting unit 3033 is further configured to adjust an exposure value when the camera acquires the target preview image according to the first target brightness weight and the preset target brightness value.
Optionally, the adjusting module 303 further includes:
a first calculation unit 3034, configured to determine a second distance between the first central point of the first artificial light source region and the second central point of the current preview image;
a first conversion unit 3035, configured to convert the second distance into a target distance within a preset interval range;
a first determining unit 3036, configured to determine a second target brightness weight according to the target distance and the first target brightness weight;
the second adjusting unit 3033 is specifically configured to adjust an exposure value when the camera acquires the target preview image according to the second target brightness weight and the preset target brightness value.
Optionally, the first adjusting unit 3032 is further configured to prohibit, when the ratio is equal to zero, adjusting the preset brightness weight corresponding to the first artificial light source region, and determine, according to the preset brightness weight and the preset target brightness value, an exposure value when the camera acquires the target preview image.
Optionally, the adjusting module 303 includes:
a second obtaining unit 3041 for obtaining a ratio of the first region area to the first area;
a multiple determining unit 3042, configured to determine, when determining to adjust the exposure value when the camera acquires the target preview image according to the ratio, to increase the exposure value when the target preview image is acquired to a first multiple of a preset target brightness value according to a first preset multiple corresponding to the first preset ratio, a second preset multiple corresponding to the second preset ratio, a third preset multiple corresponding to the third preset ratio, and the ratio;
and a third adjusting unit 3043, configured to adjust an exposure value when the camera acquires the target preview image according to the first multiple and a preset target brightness value.
Optionally, the adjusting module 303 further includes:
a second calculation unit 3044 determining a second distance between the first center point of the first artificial light source region and the second center point of the current preview image;
a second converting unit 3045, configured to convert the second distance into a target distance within a preset interval range;
a second determining unit 3056, configured to determine a second multiple according to the target distance and the first multiple;
the third adjusting unit 3043 is specifically configured to adjust an exposure value when the camera acquires the target preview image according to the second multiple and the preset target brightness value.
The exposure adjustment device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The exposure adjustment device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The exposure adjustment device provided in the embodiment of the present application can implement each process implemented by the exposure adjustment device in the method embodiments of fig. 1 and fig. 2, and is not described here again to avoid repetition.
Optionally, an electronic device is further provided in an embodiment of the present application, as shown in fig. 5, fig. 5 is a schematic diagram of a hardware structure of an electronic device implementing the embodiment of the present application. The electronic device 500 includes a processor 501, a memory 502, and a program or an instruction stored in the memory 502 and executable on the processor 501, where the program or the instruction implements the processes of the exposure adjustment method embodiment when executed by the processor 501, and can achieve the same technical effects, and the details are not repeated here to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
Fig. 6 is a schematic hardware structure diagram of another electronic device for implementing the embodiment of the present application.
The electronic device 600 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and the like.
Those skilled in the art will appreciate that the electronic device 600 may further comprise a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to the processor 610 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 6 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 610 is configured to obtain a current preview image acquired by a camera, and determine a first area of the current preview image;
obtaining first attribute information of a first artificial light source region in the current preview image, wherein the first attribute information comprises a first region area of the first artificial light source region;
and adjusting an exposure value of a target preview image acquired by the camera according to the first area and the first region area, wherein the target preview image is an image behind the current preview image in time sequence.
The method comprises the steps of obtaining a current preview image collected by a camera, determining a first area of the current preview image, and obtaining first attribute information of a first artificial light source area in the current preview image, wherein the first attribute information comprises the first area of the first artificial light source area, and adjusting an exposure value of a target preview image collected by the camera according to the first area and the first area, wherein the target preview image is an image behind the current preview image in time sequence. The exposure value of the target preview image collected by the camera can be adjusted according to the first area of the preview image and the first area of the first artificial light source area, so that the exposure value of the target preview image collected by the camera can be improved.
The first attribute information further includes first position information of the first artificial light source region, and the processor 610 is further configured to obtain second attribute information of a second artificial light source region in a history preview image, where the second attribute information includes a second region area and second position information of the second artificial light source region, and the history preview image is an image chronologically before the current preview image;
and under the condition that second attribute information of a second artificial light source region in N continuous frames of historical preview images is determined to be stable, adjusting an exposure value of a target preview image acquired by the camera according to the first area and the first region area, wherein the last frame of image in the N frames of historical preview images is an image adjacent to the current preview image.
Under the condition that second attribute information of a second artificial light source region in the N continuous frames of history preview images is determined to be stable, the exposure value of the camera in the process of acquiring the target preview image is adjusted directly according to the first area and the first region area of a next frame of preview image (the next frame of preview image is the current preview image) which is positioned behind the N frames of history preview images and is adjacent to the last frame of image in the N frames of history preview images, so that the accuracy and stability of the exposure value of the adjusted camera in the process of acquiring the target preview image can be ensured
A processor 610, configured to calculate a first average value of all second region areas and a second average value of all second position information in a case that it is determined that second attribute information of a second artificial light source region in consecutive N frames of history preview images is stable;
and under the condition that the absolute value of the difference value between the first area and the first average value is smaller than or equal to a first preset threshold value and the first distance is smaller than or equal to a second preset threshold value, adjusting an exposure value of a target preview image acquired by the camera according to the first area and the first area, wherein the first distance is the distance between a first position corresponding to the first position information and a second position corresponding to the second average value.
Under the condition that the absolute value of the difference value between the first area and the first average value is smaller than or equal to a first preset threshold value and the first distance is smaller than or equal to a second preset threshold value, the exposure value of the target preview image acquired by the camera is adjusted according to the first area and the first area, namely, under the condition that the first attribute information of the current preview image is stable, the exposure value of the target preview image acquired by the camera is adjusted according to the first area and the first area, so that the accuracy and the stability of the exposure value of the adjusted target preview image can be improved to a certain extent, and the problem that the exposure effect of the adjusted target preview image is not ideal under the condition that the attribute information of the current preview image is not stable is avoided.
A processor 610 further configured to obtain a ratio of the first region area to the first area;
under the condition that the exposure value of the target preview image acquired by the camera is determined to be adjusted according to the ratio, adjusting a preset brightness weight corresponding to the first artificial light source region according to a first preset weight corresponding to a first preset ratio, a second preset weight corresponding to a second preset ratio, a third preset weight corresponding to a third preset ratio and the ratio to obtain a first target brightness weight;
and adjusting the exposure value of the target preview image according to the first target brightness weight and a preset target brightness value.
A processor 610 further configured to determine a second distance between a first center point of the first artificial light source region and a second center point of the current preview image;
converting the second distance into a target distance within a preset interval range;
determining a second target brightness weight according to the target distance and the first target brightness weight;
adjusting an exposure value of the target preview image according to the first target brightness weight and a preset target brightness value, including:
and adjusting the exposure value of the target preview image according to the second target brightness weight and the preset target brightness value.
The processor 610 is further configured to prohibit adjustment of a preset brightness weight corresponding to the first artificial light source region when the ratio is equal to zero, and determine an exposure value in the target preview image according to the preset brightness weight and the preset target brightness value.
A processor 610 further configured to obtain a ratio of the first region area to the first area;
under the condition that the exposure value of the target preview image acquired by the camera is determined to be adjusted according to the ratio, determining to increase the exposure value of the target preview image to a first multiple of a preset target brightness value according to a first preset multiple corresponding to a first preset ratio, a second preset multiple corresponding to a second preset ratio, a third preset multiple corresponding to a third preset ratio and the ratio;
and adjusting the exposure value of the target preview image according to the first multiple and the preset target brightness value.
A processor 610 further configured to determine a second distance between a first center point of the first artificial light source region and a second center point of the current preview image;
converting the second distance into a target distance within a preset interval range;
determining a second multiple according to the target distance and the first multiple;
the adjusting the exposure value of the target preview image according to the first multiple and the preset target brightness value comprises:
and adjusting the exposure value of the target preview image according to the second multiple and the preset target brightness value.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the foregoing exposure adjustment method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device in the above embodiment. Readable storage media, including computer-readable storage media, such as Read-Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, etc.
It is to be understood that, in the embodiment of the present application, the input Unit 604 may include a Graphics Processing Unit (GPU) 6041 and a microphone 6042, and the Graphics Processing Unit 6041 processes image data of a still picture or a video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 607 includes a touch panel 6071 and other input devices 6072. A touch panel 6071, also referred to as a touch screen. The touch panel 6071 may include two parts of a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. The memory 609 may be used to store software programs as well as various data including, but not limited to, application programs and an operating system. The processor 610 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 610.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the exposure adjustment method embodiment, and the same technical effect can be achieved.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (16)

1. An exposure adjustment method, comprising:
acquiring a current preview image acquired by a camera, and acquiring a first area of the current preview image;
acquiring first attribute information of a first artificial light source region in the current preview image, wherein the first attribute information comprises a first region area of the first artificial light source region;
adjusting an exposure value when the camera collects a target preview image according to the first area and the first region area, wherein the target preview image is an image behind the current preview image in time sequence;
wherein, according to the first area and the first region area, adjusting an exposure value when the camera collects a target preview image comprises:
and obtaining the ratio of the area of the first region to the first area, and adjusting the exposure value when the camera acquires the target preview image according to the preset weight or the preset multiple of the ratio.
2. The method of claim 1, wherein the first attribute information further comprises first location information of the first artificial light source region, and wherein the method further comprises, prior to the obtaining a current preview image captured by a camera:
obtaining second attribute information of a second artificial light source region in a history preview image, wherein the second attribute information comprises a second region area and second position information of the second artificial light source region, the history preview image is an image which is positioned in front of the current preview image in time sequence, and the second artificial light source region and the first artificial light source region correspond to the same artificial light source object;
adjusting an exposure value when the camera collects a target preview image according to the first area and the first region area, including:
and under the condition that second attribute information of a second artificial light source region in the N continuous frames of historical preview images is determined to be stable, adjusting an exposure value when the camera acquires a target preview image according to the first area and the first region area.
3. The method of claim 2, wherein the adjusting the exposure value of the camera in acquiring the target preview image according to the first area and the first area in the case that it is determined that the second attribute information of the second artificial light source area in the consecutive N frames of history preview images is stable comprises:
under the condition that second attribute information of a second artificial light source region in N continuous frames of historical preview images is determined to be stable, calculating a first average value of all second region areas and a second average value of all second position information;
and under the condition that the absolute value of the difference value between the first area and the first average value is smaller than or equal to a first preset threshold value and the first distance is smaller than or equal to a second preset threshold value, adjusting an exposure value when the camera acquires a target preview image according to the first area and the first area, wherein the first distance is the distance between a first position corresponding to the first position information and a second position corresponding to the second average value.
4. The method of claim 1, wherein the adjusting the exposure value of the camera in acquiring the preview image of the target according to the first area and the first region area comprises:
obtaining a ratio of the first area to the first area;
adjusting the preset brightness weight corresponding to the first artificial light source region according to a first preset weight corresponding to a first preset ratio, a second preset weight corresponding to a second preset ratio, a third preset weight corresponding to a third preset ratio and the ratio to obtain a first target brightness weight;
and adjusting an exposure value when the camera collects a target preview image according to the first target brightness weight and a preset target brightness value.
5. The method according to claim 4, wherein before the adjusting the exposure value when the camera captures the target preview image according to the first target brightness weight and the preset target brightness value, the method further comprises:
determining a second distance between a first center point of the first artificial light source region and a second center point of the current preview image;
converting the second distance into a target distance within a preset interval range;
determining a second target brightness weight according to the target distance and the first target brightness weight;
adjusting an exposure value when the camera collects a target preview image according to the first target brightness weight and a preset target brightness value, wherein the adjusting comprises the following steps:
and adjusting an exposure value when the camera collects a target preview image according to the second target brightness weight and the preset target brightness value.
6. The method of claim 1, wherein the adjusting the exposure value of the camera in acquiring the preview image of the target according to the first area and the first region area comprises:
obtaining a ratio of the first area to the first area;
determining that the exposure value in the target preview image is increased to a first multiple of a preset target brightness value according to a first preset multiple corresponding to a first preset ratio, a second preset multiple corresponding to a second preset ratio, a third preset multiple corresponding to a third preset ratio and the ratio;
and adjusting an exposure value when the camera collects a target preview image according to the first multiple and the preset target brightness value.
7. The method according to claim 6, wherein before said adjusting an exposure value of said camera when capturing a target preview image according to said first multiple and said preset target brightness value, further comprises:
determining a second distance between a first center point of the first artificial light source region and a second center point of the current preview image;
converting the second distance into a target distance within a preset interval range;
determining a second multiple according to the target distance and the first multiple;
the adjusting the exposure value of the target preview image according to the first multiple and the preset target brightness value comprises:
and adjusting an exposure value when the camera collects a target preview image according to the second multiple and the preset target brightness value.
8. An exposure adjustment apparatus, comprising:
the first acquisition module is used for acquiring a current preview image acquired by a camera and acquiring a first area of the current preview image;
a second obtaining module, configured to obtain first attribute information of a first artificial light source region in the current preview image, where the first attribute information includes a first region area of the first artificial light source region;
the adjusting module is used for adjusting an exposure value when the camera acquires a target preview image according to the first area and the first region area, wherein the target preview image is an image behind the current preview image in time sequence;
wherein, according to the first area and the first region area, adjusting an exposure value when the camera collects a target preview image comprises:
and obtaining the ratio of the area of the first region to the first area, and adjusting the exposure value when the camera acquires the target preview image according to the preset weight or the preset multiple of the ratio.
9. The apparatus of claim 8, wherein the first attribute information further includes first location information of the first artificial light source region, and the second obtaining module is further configured to obtain second attribute information of a second artificial light source region in a history preview image, where the second attribute information includes a second region area and second location information of the second artificial light source region, the history preview image is an image chronologically before the current preview image, and the second artificial light source region corresponds to a same artificial light source object as the first artificial light source region;
the adjusting module is specifically configured to adjust an exposure value of the camera when the camera acquires the target preview image according to the first area and the first area when it is determined that second attribute information of a second artificial light source area in the N consecutive frames of history preview images is stable.
10. The apparatus according to claim 9, wherein the adjusting module is specifically configured to calculate a first average value of all the second region areas and a second average value of all the second position information when it is determined that the second attribute information of the second artificial light source region in the N consecutive frames of history preview images is stable;
and under the condition that the absolute value of the difference value between the first area and the first average value is smaller than or equal to a first preset threshold value and the first distance is smaller than or equal to a second preset threshold value, adjusting an exposure value when the camera acquires a target preview image according to the first area and the first area, wherein the first distance is the distance between a first position corresponding to the first position information and a second position corresponding to the second average value.
11. The apparatus of claim 10, wherein the adjustment module comprises:
a first obtaining unit configured to obtain a ratio of the first region area to the first area;
a first adjusting unit, configured to adjust a preset luminance weight corresponding to the first artificial light source region according to a first preset weight corresponding to a first preset ratio, a second preset weight corresponding to a second preset ratio, a third preset weight corresponding to a third preset ratio, and the ratio, so as to obtain a first target luminance weight;
and the second adjusting unit is used for adjusting the exposure value when the camera acquires the target preview image according to the first target brightness weight and the preset target brightness value.
12. The apparatus of claim 11, wherein the adjustment module further comprises:
a first calculation unit for determining a second distance between a first center point of the first artificial light source region and a second center point of the current preview image;
the first conversion unit is used for converting the second distance into a target distance within a preset interval range;
the first determining unit is used for determining a second target brightness weight according to the target distance and the first target brightness weight;
the second adjusting unit is specifically configured to adjust an exposure value when the camera acquires a target preview image according to the second target brightness weight and the preset target brightness value.
13. The apparatus of claim 8, wherein the adjustment module comprises:
a second obtaining unit configured to obtain a ratio of the first region area to the first area;
the multiple determining unit is used for determining that the exposure value in the target preview image is increased to a first multiple of a preset target brightness value according to a first preset multiple corresponding to a first preset ratio, a second preset multiple corresponding to a second preset ratio, a third preset multiple corresponding to a third preset ratio and the ratio;
and the third adjusting unit is used for adjusting the exposure value when the camera collects the target preview image according to the first multiple and the preset target brightness value.
14. The apparatus of claim 13, wherein the adjustment module further comprises:
a second calculation unit determining a second distance between a first center point of the first artificial light source region and a second center point of the current preview image;
the second conversion unit is used for converting the second distance into a target distance in a preset interval range;
a second determining unit, configured to determine a second multiple according to the target distance and the first multiple;
and the third adjusting unit is specifically configured to adjust an exposure value when the camera acquires a target preview image according to the second multiple and the preset target brightness value.
15. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the exposure adjustment method of claims 1-7.
16. A readable storage medium, on which a program or instructions are stored, which program or instructions, when executed by a processor, carry out the steps of the exposure adjustment method according to claims 1-7.
CN202010463606.4A 2020-05-27 2020-05-27 Exposure adjusting method and device and electronic equipment Active CN111654640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010463606.4A CN111654640B (en) 2020-05-27 2020-05-27 Exposure adjusting method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010463606.4A CN111654640B (en) 2020-05-27 2020-05-27 Exposure adjusting method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111654640A CN111654640A (en) 2020-09-11
CN111654640B true CN111654640B (en) 2021-11-23

Family

ID=72348678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010463606.4A Active CN111654640B (en) 2020-05-27 2020-05-27 Exposure adjusting method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111654640B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113489901B (en) * 2021-06-30 2023-04-28 维沃移动通信(杭州)有限公司 Shooting method and device thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101166240A (en) * 2006-10-19 2008-04-23 索尼株式会社 Image processing device, image forming device and image processing method
CN106210471A (en) * 2016-07-19 2016-12-07 成都百威讯科技有限责任公司 A kind of outdoor face recognition method and system
CN107534737A (en) * 2015-08-31 2018-01-02 华为技术有限公司 A kind of method and device for shooting picture
CN107995436A (en) * 2017-12-19 2018-05-04 浙江大华技术股份有限公司 A kind of light compensation method and device
CN109862282A (en) * 2019-02-18 2019-06-07 Oppo广东移动通信有限公司 Character image treating method and apparatus
CN110708472A (en) * 2019-11-07 2020-01-17 重庆紫光华山智安科技有限公司 Control method, system and equipment for inhibiting exposure of moving bright light source

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5308792B2 (en) * 2008-11-28 2013-10-09 オリンパス株式会社 White balance adjustment device, white balance adjustment method, white balance adjustment program, and imaging device
JP5389274B2 (en) * 2010-11-30 2014-01-15 富士フイルム株式会社 Image processing apparatus, photographing apparatus, image processing method, and white balance adjustment method
JP6466786B2 (en) * 2015-06-12 2019-02-06 オリンパス株式会社 Imaging apparatus, imaging method, and program
CN108307123B (en) * 2018-01-22 2021-10-26 维沃移动通信有限公司 Exposure adjusting method and mobile terminal
KR20200007676A (en) * 2018-07-13 2020-01-22 삼성전자주식회사 Electronic device and operating method for controlling brightness of a light source

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101166240A (en) * 2006-10-19 2008-04-23 索尼株式会社 Image processing device, image forming device and image processing method
CN107534737A (en) * 2015-08-31 2018-01-02 华为技术有限公司 A kind of method and device for shooting picture
CN106210471A (en) * 2016-07-19 2016-12-07 成都百威讯科技有限责任公司 A kind of outdoor face recognition method and system
CN107995436A (en) * 2017-12-19 2018-05-04 浙江大华技术股份有限公司 A kind of light compensation method and device
CN109862282A (en) * 2019-02-18 2019-06-07 Oppo广东移动通信有限公司 Character image treating method and apparatus
CN110708472A (en) * 2019-11-07 2020-01-17 重庆紫光华山智安科技有限公司 Control method, system and equipment for inhibiting exposure of moving bright light source

Also Published As

Publication number Publication date
CN111654640A (en) 2020-09-11

Similar Documents

Publication Publication Date Title
CN108492287B (en) Video jitter detection method, terminal equipment and storage medium
CN112135046B (en) Video shooting method, video shooting device and electronic equipment
CN113141468B (en) Focusing method and device and electronic equipment
CN113596344B (en) Shooting processing method, shooting processing device, electronic equipment and readable storage medium
CN113163128A (en) Image exposure method and electronic device
WO2023006009A1 (en) Photographing parameter determination method and apparatus, and electronic device
CN111654640B (en) Exposure adjusting method and device and electronic equipment
CN112449165B (en) Projection method and device and electronic equipment
CN111835937A (en) Image processing method and device and electronic equipment
CN112437232A (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN112508820A (en) Image processing method and device and electronic equipment
CN112291480A (en) Tracking focusing method, tracking focusing device, electronic device and readable storage medium
CN112153291B (en) Photographing method and electronic equipment
CN112565909A (en) Video playing method and device, electronic equipment and readable storage medium
CN112085002A (en) Portrait segmentation method, portrait segmentation device, storage medium and electronic equipment
CN114143448B (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN112446848A (en) Image processing method and device and electronic equipment
CN114143447B (en) Image processing method and device and electronic equipment
CN112887629B (en) Frequency detection method, frequency detection device, electronic equipment and storage medium
CN112887621B (en) Control method and electronic device
CN112492208B (en) Shooting method and electronic equipment
CN112367470B (en) Image processing method and device and electronic equipment
CN112532879B (en) Image processing method and device
CN113709436B (en) Purple fringing correction method and device based on continuous zooming and electronic equipment
CN116320729A (en) Image processing method, device, electronic equipment and readable storage medium

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