CN113347352A - Shooting parameter adjusting method and device, electronic equipment and computer storage medium - Google Patents

Shooting parameter adjusting method and device, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN113347352A
CN113347352A CN202110560531.6A CN202110560531A CN113347352A CN 113347352 A CN113347352 A CN 113347352A CN 202110560531 A CN202110560531 A CN 202110560531A CN 113347352 A CN113347352 A CN 113347352A
Authority
CN
China
Prior art keywords
parameter
shooting parameters
parameters
shooting
initial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110560531.6A
Other languages
Chinese (zh)
Other versions
CN113347352B (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110560531.6A priority Critical patent/CN113347352B/en
Publication of CN113347352A publication Critical patent/CN113347352A/en
Application granted granted Critical
Publication of CN113347352B publication Critical patent/CN113347352B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations

Abstract

The application provides a shooting parameter adjusting method and device, electronic equipment and a computer storage medium; the method comprises the following steps: in the shooting process, acquiring jitter data of the acquisition device and initial shooting parameters in real time; the jitter data represents the jitter degree of the acquisition device; performing multiple iterative adjustments on the initial shooting parameters based on a preset initial step length, and obtaining multiple loss values obtained by calculating multiple adjusted shooting parameters and jitter data when a preset iteration termination condition is reached; a minimum loss value is determined from the plurality of loss values, and a set of imaging parameters corresponding to the minimum loss value is determined as target imaging parameters. By the method and the device, the optimal shooting parameters corresponding to the shaking data can be obtained, and therefore the quality of the shot image in the shaking state can be improved.

Description

Shooting parameter adjusting method and device, electronic equipment and computer storage medium
Technical Field
The present disclosure relates to image capturing technologies, and in particular, to a method and an apparatus for adjusting shooting parameters, an electronic device, and a computer storage medium.
Background
In the process of shooting the mobile phone, the parameters of the mobile phone are important factors influencing the imaging quality, and meanwhile, because a mobile phone user is often not a professional photographer, the quality of a shot picture is also influenced by external factors, such as the stability of the user holding the mobile phone by hand, in the process of shooting, the selection of the relevant imaging parameters not only needs to consider the parameters under an ideal condition, but also needs to correspondingly adjust the actual shooting level of the user, so as to achieve a good imaging effect.
In contrast, some adjusting methods exist in the related art to improve the influence of external factors on the picture quality, however, the adjusting effect achieved by the method in the related art is limited, and the obtained picture quality is not high.
Disclosure of Invention
The embodiment of the application provides a shooting parameter adjusting method and device, electronic equipment and a computer storage medium, which can obtain the optimal shooting parameters corresponding to jitter data, so that the quality of the shot image in a jitter state can be improved.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a shooting parameter adjusting method, which comprises the following steps: in the shooting process, acquiring jitter data of the acquisition device and initial shooting parameters in real time; the jitter data represents the jitter degree of the acquisition device; performing multiple iterative adjustments on the initial shooting parameters based on a preset initial step length, and obtaining multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached; and determining a minimum loss value from the loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters.
The embodiment of the application provides a shooting parameter adjusting device, includes: the acquisition module is used for acquiring jitter data of the acquisition device and initial shooting parameters in real time in the shooting process; the jitter data represents the jitter degree of the acquisition device; the adjusting module is used for carrying out multiple iterative adjustments on the initial shooting parameters based on a preset initial step length, and obtaining a plurality of loss values obtained by calculating a plurality of adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached; and the determining module is used for determining the minimum loss value from the loss values and determining a group of shooting parameters corresponding to the minimum loss value as the target shooting parameters.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the shooting parameter adjusting method provided by the embodiment of the application when the executable instructions stored in the memory are executed.
An embodiment of the present application provides an electronic device, including:
the acceleration sensor is used for acquiring the shaking data of the image sensor in real time in the shooting process; the shake data characterizes a degree of shake of the image sensor;
the image processor is used for acquiring initial shooting parameters from the image signal processor in real time; performing multiple iterative adjustments on the initial shooting parameters based on a preset initial step length, and obtaining multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached; determining a minimum loss value from the loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters;
and the image sensor is used for shooting by adopting the target shooting parameters to obtain a shot image.
The embodiment of the application provides a computer-readable storage medium, which stores executable instructions for causing a processor to execute the method for adjusting shooting parameters provided by the embodiment of the application.
The embodiment of the application has the following beneficial effects: in the actual shooting process, acquiring jitter data of an acquisition device in real time, acquiring initial shooting parameters in real time, performing multiple iterative adjustments on the acquired initial shooting parameters according to a preset initial step length, and obtaining multiple loss values obtained by calculating the adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached; determining a minimum loss value from the loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters; when the loss value is minimum, the picture quality of the corresponding image is highest, so that the obtained target shooting parameters are also optimal; therefore, the embodiment of the application can obtain the optimal shooting parameters corresponding to the real-time shake data so as to reduce the influence of shake on the picture quality of the image to be acquired by changing the initial shooting parameters, thereby improving the quality of the image shot in a shake state when the image is acquired.
Drawings
Fig. 1, fig. 2A and fig. 2B are schematic diagrams respectively illustrating effects of exemplary different Exp _ time on an acquired image according to an embodiment of the present application;
3A-3I are schematic diagrams illustrating the effect of exemplary different Exp _ time, Again and Dgain parameters on imaging quality provided by embodiments of the present application;
FIG. 3J is an enlarged detail view of FIG. 3D provided by embodiments of the present application;
FIG. 3K is an enlarged detail view of FIG. 3I provided by an embodiment of the present application;
fig. 4 is an alternative flowchart of a shooting parameter adjustment method according to an embodiment of the present disclosure;
fig. 5 is an optional schematic flow chart of a shooting parameter adjustment method according to an embodiment of the present application
Fig. 6 is an alternative flowchart of a shooting parameter adjustment method according to an embodiment of the present disclosure;
fig. 7 is an alternative flowchart of a shooting parameter adjustment method according to an embodiment of the present disclosure;
fig. 8A is a graph illustrating an exemplary relationship between picture quality and a jitter level provided by an embodiment of the present application;
fig. 8B is a graph of exemplary picture quality versus Exp _ time provided by an embodiment of the present application;
fig. 8C is a schematic diagram of a relationship between an exemplary acquisition apparatus and a jitter degree, Exp _ time, and a picture quality reduction amplitude provided in the embodiment of the present application;
fig. 9 is an alternative flowchart of a shooting parameter adjustment method according to an embodiment of the present disclosure;
fig. 10 is an alternative flowchart of a shooting parameter adjustment method according to an embodiment of the present application;
fig. 11 is an alternative structural schematic diagram of a shooting parameter adjustment apparatus provided in an embodiment of the present application;
fig. 12 is an alternative structural schematic diagram of an electronic device provided in an embodiment of the present application;
fig. 13 is an alternative structural schematic diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, so as to enable the embodiments of the application described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) Logic gain: again for short;
2) digital gain: the English is called Digital Gain for short Dgain;
3) exposure time: the time of exposure, Exp _ time for short, is the time during which the shutter is opened to project light onto the photosensitive surface of the photographic photosensitive material. Depending on the sensitivity of the photographic sensitive material and the illumination on the photosensitive surface. If the exposure time is long, more light enters, so that the method is suitable for the condition that the light condition is poor; short exposure times are suitable for better lighting.
4) Sensitivity: english is called International Standard Organization, ISO for short; the method is an international unified index for measuring the film photosensitive speed standard used by the traditional camera, and reflects the speed of the film during photosensitive;
5) the Charge coupling element is a detection element which is called Charge-coupled Device for short CCD and uses Charge quantity to represent signal size and uses coupling mode to transmit signal;
6) complementary metal oxide semiconductor: the English full name of Complementary Metal Oxide Semiconductor, CMOS for short, refers to a technology for manufacturing large-scale integrated circuit chips or chips manufactured by the technology, and is a readable and writable RAM chip on a computer mainboard;
7) an image processor: the digital Image sensor is called as Pre-Image Signal Processor in English, is called as Pre-Isp for short, and mainly aims at digital data (Raw data) transmitted after ADC conversion to carry out Image dead pixel repairing, white balance, gamma correction, sharpness, color interpolation and the like;
8) an image signal processor: generally, the Image Sensor is called an Image Signal Processor, abbreviated as ISP, and is used to process output data of an Image Sensor, such as AEC (automatic exposure control), AGC (automatic gain control), AWB (automatic white balance), color correction, Lens Shading, Gamma correction, and bad pixel removal.
9) An application processor: the English is called Application Processor, AP for short; the operating system, user interface and application program are all executed on the AP;
10) automatic exposure: english is called Automatic Exposure for short AE; the camera automatically adjusts the exposure according to the intensity of light to prevent overexposure or underexposure;
11) automatic focusing: english is called Auto Focus for short AF; the principle of object light reflection is utilized, the reflected light is received by a sensor CCD on a camera, and the reflected light is processed by a computer to drive an electric focusing device to focus, namely, automatic focusing;
12) automatic white balance: the English is called Automatic white balance, AWB; the reason why the images shot in the room of the fluorescent lamp are greenish, the scenes shot under the indoor tungsten filament light are yellowish, and the photos shot at the sunlight shadow are wonderfully bluish is that the white balance is set, and the white balance plays a role in recovering the normal color of the images in the scenes;
13) mobile industry processor interface: the Mobile phone Interface is a alliance established by companies such as ARM, Nokia, ST, TI and the like in 2003, and aims to standardize interfaces inside the Mobile phone, such as a camera, a display screen Interface, a radio frequency/baseband Interface and the like, so that the complexity of Mobile phone design is reduced and the design flexibility is increased. Different WorkGroups exist below the MIPI alliance, and a series of internal interface standards of the mobile phone are respectively defined, such as a camera interface CSI, a display interface DSI, a radio frequency interface DigRF and the like;
14) I2C: english is called Inter-Integrated Circuit;
15) the 3A algorithm: auto Focus (AF), Auto Exposure (AE), and Auto White Balance (AWB); the AF algorithm, the AE algorithm and the AWB algorithm are utilized to realize the maximum image contrast, improve the overexposure or underexposure condition of a subject shot object and compensate the chromatic aberration of a picture under different light irradiation, thereby presenting image information with higher image quality.
Many video borescopes and camera accessories on the market today see gain (gain) and sensitivity (ISO) settings in the camera menu, and adjusting these individual settings can achieve immediate results, both controls essentially adjusting the brightness of the picture. That is, they will cause the resulting image to appear bright under conditions that are not normally allowed, for example, when there is insufficient light. The best way to deal with "low light" conditions is to add more light. This will make the image clearer and less noisy. Of course, it is not always possible to increase the light because gain and ISO become very useful when making a valid inspection. The gain is an electronic amplification of the video signal. This means that the signal will be enhanced electronically, adding more voltage to the pixels on the imager (CCD or CMOS), causing them to amplify the intensity, eventually brightening the image. In general, when a video or image is captured using a large amount of gain, more particles or noise is generated in the video or image file, which means less image detail. In consideration of these factors, it is sufficient to ensure that the operations to be performed when the touch gain is on and off are completely known. In an actual scene, if the scene is dark, the shooting is generally performed according to the following steps:
1. open the aperture (which would allow more light to enter the camera) if possible;
2. if possible, reduce the shutter speed (which increases the amount of light reaching the sensor);
3. adding another light source;
ISO and gain can improve the quality of the image by allowing the image brightness to be increased using ISO or gain or all digitally.
In the process of shooting a mobile phone, Exp _ time, Again and Dgain parameters are important factors influencing imaging quality, and meanwhile, because a mobile phone user is often not a professional photographer and the quality of a shot picture is often influenced by external factors, such as the stability of a user holding the mobile phone by hand, in the process of shooting, the selection of imaging related parameters not only needs to consider the parameters under an ideal condition, but also needs to correspondingly adjust the actual shooting level of the user so as to achieve the optimal imaging effect.
For example, fig. 1 shows the effect of different Exp _ time on the captured image, as shown in fig. 1, when a wind mill is shot, from left to right, the effect of the captured image is high-speed, medium-speed and low-speed shutters respectively, and the quality of the captured image is obviously different for different Exp _ time. For example, fig. 2A and 2B also show the effect of different Exp _ time on the captured image, where the shutter speed in fig. 2A is 1/200s, and the shutter speed in fig. 2B is 1/50s, it can be seen that when the exposure time is longer, the captured image has a blurred image. For the influence of the Exp _ time, Again and Dgain parameters on the imaging quality, the influence can be known through the following fig. 3A-3I, and fig. 3A-3I show the image effect of shooting the same object under different Exp _ time, Again and Dgain parameters, and are acquired by using a sensor of a main camera of a mobile phone of a certain model; wherein, the parameters corresponding to fig. 3A are: exp _ time (ms)43.8, Again100, Dgain 100; the parameters corresponding to fig. 3B are: exp _ time (ms)21.9, Again200, Dgain 100; the parameters corresponding to fig. 3C are: exp _ time (ms)10.95, Again400, Dgain 100; the parameters corresponding to fig. 3D are: exp _ time (ms)5.475, Again800, Dgain 100; the parameters corresponding to fig. 3E are: exp _ time (ms)3.737, Again1600, Dgain 100; the parameters corresponding to fig. 3F are: exp _ time (ms)1.36, Again3300, Dgain 100; the parameters corresponding to fig. 3G are: exp _ time (ms)0.68, Again6400, Dgain 100; the parameters corresponding to fig. 3H are: exp _ time (ms)0.34, Again6400, Dgain 300; the parameters corresponding to fig. 3I are: exp _ time (ms)0.17, Again6400, Dgain 400; fig. 3J is an enlarged detail view of fig. 3D, and fig. 3K is an enlarged detail view of fig. 3I. According to fig. 3A-3K, it can be seen that, on the premise of keeping other factors (for example, parameters such as white balance, focus, overall brightness, etc. the same), the quality of the captured images is different even when Exp _ time, Again, and Dgain are different, wherein the different granularities of the images in fig. 3J and 3K can be obviously known.
In addition, when the handheld device of the user is unstable, the captured image may have a blurred image, and in this case, the unstable image due to the instability of the handheld device is not desirable by the user, and often occurs in children, the elderly, and people with small stature. The existing 3A algorithm at the mobile phone end is often deficient in this respect, and more of the setting of Exp _ time, Again and Dgain of imaging is to consider the situation of the whole picture, and less of the setting is to consider the influence caused by the shaking of the mobile phone. In this case, although the shot image is relatively pure and has a small granular feeling, the shake of the mobile phone causes the shot image to have problems such as blurring and ghosting of the main body of the picture, and the overall quality of the picture is reduced, so that the effect is poor. In contrast, some methods adopted in the related art reduce the influence of the shake of the mobile phone on the quality of the photographed image by directly reducing the exposure time, but directly reducing the exposure time may cause under-exposure of the image, and the photographing brightness and the image quality cannot be balanced, so that the achieved adjustment effect is not good.
In general, the method in the related art cannot improve the quality of the image shot by the camera in the shake state on the premise of improving the shooting brightness, so that the quality of the image shot by the camera in the shake state is low.
The embodiment of the present application provides a shooting parameter adjustment method and apparatus, an electronic device, and a computer-readable storage medium, which can obtain an optimal shooting parameter corresponding to jitter data, so as to improve the quality of an image acquired in a jitter state.
The shooting parameter adjustment method provided in the embodiments of the present application will be described in detail below.
Referring to fig. 4, fig. 4 is an alternative flowchart of a shooting parameter adjustment method provided in the embodiment of the present application, and will be described with reference to the steps shown in fig. 4.
S101, acquiring jitter data of an acquisition device and initial shooting parameters in real time in a shooting process; the jitter data represents the jitter degree of the acquisition device.
In the embodiment of the application, in the process of shooting an image by a self acquisition device, a terminal can acquire shake data representing the shake degree of the acquisition device in real time through a self acceleration sensor, and also acquire self-stored initial shooting parameters so as to determine whether to adjust the initial shooting parameters according to the acquired shake data, and when determining to adjust the initial shooting parameters according to the acquired shake data, adjust the initial shooting parameters by a subsequent method based on the acquired shake data and other data.
In an embodiment of the present application, the initial shooting parameters include: a first gain parameter, a second gain parameter, and an exposure parameter. Illustratively, the first gain parameter may be any one of Again and Dgain, and correspondingly, the second gain parameter is the other one of Again and Dgain; the exposure parameter may then be Exp _ time.
In some embodiments of the present application, the initial shooting parameters may be calculated by a 3A algorithm. In other embodiments of the present application, the initial shooting parameters may be obtained by other methods.
In an embodiment of the present application, the collecting device may be a camera of a terminal, and is configured to collect an image.
And S102, carrying out multiple iterative adjustment on the initial shooting parameters based on a preset initial step length, and obtaining multiple loss values obtained by calculating multiple adjusted shooting parameters and jitter data when a preset iteration termination condition is reached.
In the embodiment of the application, when the terminal obtains the shake data of the acquisition device from the acceleration sensor, a preset algorithm, for example, a preset algorithm such as a genetic algorithm, a differential evolution algorithm, and the like, may be adopted to adjust the obtained initial shooting parameter according to a preset initial step length and a constraint relationship between the shooting parameter, the shake degree, and the picture quality, and calculate the adjusted shooting parameter and the shake data, so that when a preset iteration termination condition is reached, the adjustment of the initial shooting parameter is stopped, a plurality of groups of adjusted shooting parameters may be obtained, and a plurality of loss values corresponding to the plurality of groups of adjusted shooting parameters are obtained. In the embodiment of the present application, the adjustment of the shooting parameter at the n +1 th time is performed on the basis of the adjustment of the shooting parameter at the n th time; and calculating the adjusted shooting parameters and shake data to obtain loss values, wherein the shake data is the same.
In some embodiments of the present application, the constraint relationship between the shooting parameter, the degree of shake, and the picture quality may be expressed as a function. For convenience of description, a picture loss function will be used below to represent a constraint relationship among shooting parameters, a degree of shake, and picture quality. The picture loss function is as follows:
loss_function=D(Again,Dgain)+q*sum(ax,ay,az,Exp_time) (1)
wherein q is a preset weight value, ax,ay,azCorrespondingly representing the shaking data of the acquisition device in the x, y and z directions, wherein Again, Dgain and Exp _ time are shooting parameters; loss _ function represents a picture loss value (the above loss value), D (Again, Dgain) represents a constraint relation between Again, Dgain and picture quality, sum (a)x,ay,azExp _ time) represents a constraint relationship between the degree of jitter, picture quality, and Exp _ time. In the embodiment of the present application, the target shooting parameters are a set of Again, Dgain and Exp _ time corresponding to the minimum loss _ function.
In the embodiment of the present application, the preset initial step may be a numerical value that increases or decreases the initial shooting parameter, and the preset initial step may be set according to actual needs, which is not limited in the embodiment of the present application.
S103, a minimum loss value is determined from the plurality of loss values, and a set of imaging parameters corresponding to the minimum loss value is determined as target imaging parameters.
In the embodiment of the application, after the terminal obtains a plurality of loss values corresponding to a plurality of sets of adjusted shooting parameters, the plurality of losses may be sorted according to the values to determine a minimum loss value, and a set of shooting parameters corresponding to the minimum loss is determined as the target shooting parameters.
In the embodiment of the application, in the actual shooting process, the jitter data of the acquisition device is obtained in real time, the initial shooting parameters are obtained in real time, multiple iteration adjustment is performed on the obtained initial shooting parameters according to a preset initial step length, when a preset iteration termination condition is reached, multiple loss values obtained by calculating the multiple adjusted shooting parameters and the jitter data are obtained, the minimum loss value is determined from the multiple loss values, and a group of shooting parameters corresponding to the minimum loss value is determined as the target shooting parameters. When the loss value corresponding to the picture loss function is minimum, the picture quality of the corresponding image is highest, so that the obtained target shooting parameter is also optimal, the optimal shooting parameter corresponding to the real-time jitter data can be obtained, the influence of jitter on the picture quality of the subsequent image to be acquired is reduced by changing the initial shooting parameter, and the quality of the image shot in a jitter state can be improved during image acquisition.
In some embodiments of the present application, after S103 of fig. 4, S104 may also be performed:
and S104, shooting by adopting the target shooting parameters to obtain a shot image.
When the terminal obtains the target shooting parameters, the shooting parameters of the acquisition device can be updated to the target shooting parameters, and images are shot through the acquisition device under the action of the target shooting parameters, so that high-quality images are obtained.
In the embodiment of the application, in the process of image shooting, according to the real-time obtained jitter degree, the preset step length and the function for restricting the relationship among the picture quality, the jitter degree and the shooting parameters, the preset shooting parameters are adjusted, and finally the target parameters are obtained; therefore, the optimal shooting parameters corresponding to the real-time shake data can be obtained, so that the influence of shake on the picture quality of the image to be acquired can be reduced by changing the initial shooting parameters, and the quality of the image shot in a shake state can be improved.
In some embodiments of the present application, fig. 5 is an optional flowchart of the shooting parameter adjustment method provided in the embodiments of the present application, and S001 to S003 may be executed before S101 in fig. 4, and S101 may be implemented by S1011 to S1012, which will be described with reference to the steps shown in fig. 5.
And S001, determining the real-time jitter degree of the acquisition device according to the multi-frame preview image acquired by the acquisition device.
And S002, when the determined real-time shaking degree is larger than or equal to the preset degree, starting the acceleration sensor, and controlling the acceleration sensor to work at a first detection frequency.
In some embodiments of the application, when the terminal starts the collecting function of the collecting device, the terminal can obtain multiple continuous preview images through the collecting device, determine the current shaking degree of the collecting device according to the obtained multiple continuous preview images, and when the determined shaking degree is greater than or equal to the preset degree, the terminal starts the acceleration sensor of the terminal, and controls the acceleration sensor to work at a first detection frequency so as to detect the shaking degree of the collecting device of the terminal in real time.
It will be appreciated that the first detection frequency is a higher frequency, so that the detected degree of jitter of the acquisition device can be made more accurate.
It should be noted that the jitter degree may represent level information, and correspondingly, the preset degree represents preset level information. The embodiment of the present application does not limit the ranking of the ranking information. Illustratively, the degree of jitter may represent any one of higher, medium, general, and lower level information, or may also represent any one of higher, medium, and lower level information; accordingly, the preset degree may be "high" or "medium", etc.
S003, when the determined real-time jitter degree is smaller than the preset degree, starting the acceleration sensor, and controlling the acceleration sensor to work at a second detection frequency; the first detection frequency is greater than the second detection frequency.
In some embodiments of the application, when the terminal determines that the jitter degree is smaller than the preset degree, the terminal may turn on its own acceleration sensor and control the acceleration sensor to work at the second detection frequency, so as to detect the jitter degree of the terminal in real time.
It can be understood that when the shake degree of the acquisition device is less than the preset degree, it indicates that the influence on the quality of the photographed image is small or almost no influence, and since the second detection frequency is a lower frequency, when the terminal determines that the shake degree is less than the preset degree, the terminal turns on the acceleration sensor of the terminal, but controls the acceleration sensor to operate at the lower detection frequency, so that the power consumption of the terminal can be reduced without influencing the quality of the photographed image.
In an embodiment of the application, the terminal includes an image processor, and the terminal may control the turning on of the acceleration sensor and the detection frequency of the acceleration sensor through its own image processor.
In the embodiment of the present application, the preset degree may be preset according to actual needs, and the embodiment of the present application does not limit this.
S1011, in the shooting process, acquiring initial shooting parameters of the acquisition device, and acquiring the discrete jitter amount of the acquisition device in real time through the acceleration sensor.
S1012, difference processing is performed on the discrete jitter amounts to obtain jitter data.
When the terminal starts the acceleration sensor, the terminal can acquire discrete acceleration components of the acquisition device in x, y and z directions in real time through the acceleration sensor, and since the sensor acquires the discrete components, the terminal needs to perform differential processing on the discrete components so as to acquire raw data of the jitter degree, namely jitter data (a)x,ay,az)。
In other embodiments of the present application, fig. 6 is an optional flowchart of the shooting parameter adjustment method provided in the embodiments of the present application, S101 in fig. 4 may also be implemented by S1013, and S102 may be implemented by S1021, which will be described with reference to the steps shown in fig. 6.
And S1013, in the shooting process, acquiring real-time shaking data of the acquisition device in real time through the acceleration sensor, and acquiring real-time initial shooting parameters.
In the embodiment of the application, the terminal can start the acceleration sensor of the terminal when the acquisition device is started, and real-time jitter data of the acquisition device is acquired in real time through the acceleration sensor.
And S1021, when the jitter data is larger than or equal to the jitter threshold, carrying out multiple iterative adjustment on the initial shooting parameters based on a preset initial step length, and obtaining multiple loss values obtained by calculating multiple adjusted shooting parameters and jitter data when a preset iteration termination condition is reached.
In the embodiment of the application, the terminal may compare jitter data obtained in real time with a preset jitter threshold, and perform multiple iterative adjustments on an initial shooting parameter obtained in real time based on a preset initial step length only when the jitter data is greater than or equal to the jitter threshold, and obtain multiple loss values obtained by calculating the multiple adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached; therefore, unnecessary adjustment of the shooting parameters can be avoided, and the self computing resources of the terminal can be saved.
In the embodiment of the present application, the jitter threshold is preset according to actual needs, and this is not limited in the embodiment of the present application.
In some embodiments of the present application, fig. 7 is an optional flowchart of the shooting parameter adjustment method provided in the embodiments of the present application, and before S102 in fig. 4, S201 to S203 may also be executed, and S102 in fig. 4 may also be implemented through S1022, which will be described with reference to the steps shown in fig. 7.
S201, obtaining a first constraint relation among picture quality, jitter degree and exposure parameters according to first priori knowledge; there is a negative correlation between the picture quality and the jitter level, and a negative correlation between the picture quality and the exposure parameter.
Here, there is a negative correlation between the picture quality of the image and the degree of shake, i.e., the greater the degree of shake, the more the acquisitionThe worse the picture quality of the image of (a), as shown in fig. 8A; as shown in fig. 8B, that is, the picture quality of the image and the Exp _ time are also in negative correlation, and the longer the Exp _ time is, the worse the picture quality of the acquired image is, and accordingly, as shown in fig. 8C, the acquisition apparatus can be regarded as a function, and the input amount is a jitter degree and an Exp _ time, and the output amount is a picture quality reduction range (picture loss degree). Therefore, the first a priori knowledge may be obtained in the following manner: acquiring acceleration components of the acquisition device in the x, y and z directions at different moments of the acquisition device in advance, and acquiring images shot under the exposure parameters at the same time, so as to obtain the acceleration components of the acquisition device in the x, y and z directions at each moment of the preset Exp _ time and obtain a plurality of first images in total; then, the acceleration components in the x, y, and z directions at each time are subjected to difference processing, and jitter data (a) at each time is obtained in correspondence with each otherx,ay,az) (ii) a Finally, jitter data (a) of each time in a plurality of different times corresponding to each preset Exp _ time is obtainedx,ay,az) (ii) a Meanwhile, under a plurality of different preset Exp _ times of the acquisition device, acquiring images when the acquisition device is static, thereby obtaining a plurality of standard images in total; finally, jitter data (a) at each time under different preset Exp _ times is obtainedx,ay,az) And a plurality of first images and a plurality of standard images, thereby obtaining the first priori knowledge.
Under the condition of obtaining the first priori knowledge, the first priori knowledge can be stored in the terminal, so that the terminal can calculate the pixel difference value between a first picture and a standard picture with the same preset Exp _ time according to the stored image, calculate the square sum of the pixel difference value to obtain a plurality of square sums, use the square sums as a plurality of obtained picture quality reduction amplitudes, and further reduce the amplitudes according to the picture quality and the jitter data (a) of the terminal at different moments under different stored preset Exp _ timesx,ay,az) And analyzing to obtain a first constraint relation among the jitter degree, the exposure time and the picture quality, as shown in formula (2):
sum(ax,ay,az,Exp_time) (2)。
s202, obtaining a second constraint relation between the picture quality and the gain parameter according to second priori knowledge; there is a negative correlation between the picture quality and the gain parameter.
In some embodiments of the present application, the second a priori knowledge comprises: a plurality of groups of prior images corresponding to different gain parameters; in the above S202, the convolution of the edge detection operator of each pixel point in the horizontal direction and the vertical direction in each prior image may be determined through the edge detection operator to obtain a horizontal convolution value and a vertical convolution value; obtaining the definition of each pixel point according to the horizontal convolution value and the vertical convolution value; then obtaining the definition of each prior image according to the definition of each pixel point; and finally, obtaining a second constraint relation between the picture quality and the gain parameters according to the definition of each prior image and a plurality of groups of different gain parameters.
Here, for Again, Dgain and picture quality, when Again and Dgain increase, although the brightness of the picture can be improved, the granularity of the picture increases, and thus the picture quality decreases, so that the picture quality is inversely related to Again and Dgain. Thus, the second a priori knowledge may be obtained in advance in the following manner: under the condition that the exposure time of the terminal is constant, multiple groups of different Again and Dgain are adopted to respectively shoot multiple second images, multiple groups of different Again and Dgain and multiple corresponding second images (the prior images) are obtained, and therefore second prior knowledge is obtained.
Under the condition of obtaining the second priori knowledge, the second priori knowledge may be stored in the terminal in advance, so that the terminal may calculate the definition d (f) of each stored second image, and obtain a second constraint relationship among the definitions d (f) (i.e., picture quality) according to the stored multiple groups of Again and Dgain and the multiple correspondingly calculated definitions d (f):
D(Again,Dgain) (3)
in some embodiments of the present application, the terminal may use the edge detection operator described in the following formula (4) to determine the convolution value G of the edge detection operator of each pixel point (x, y) in the horizontal direction in each prior image respectivelyx(x, y), and the convolution value G of the edge detection operator in the vertical directiony(x, y) then by the formula
Figure BDA0003078835740000082
Calculating to obtain the definition G (x, y) of the pixel point (x, y), and finally, obtaining the picture definition of each prior image according to the definitions of all the pixel points in each prior image, as shown in the following formula (5):
Figure BDA0003078835740000081
D(f)=∑yx|G(x,y)| (5)
and S203, determining a constraint relation among the shooting parameters, the shaking degree and the picture quality based on the first constraint relation and the second constraint relation.
In an embodiment of the present application, after obtaining the above formula (2) and formula (3), the terminal may determine a function for measuring the loss degree of the picture according to the above formula (2), formula (3), and a preset weight value, that is, the above formula (1):
loss_function=D(Again,Dgain)+q×sum(ax,ay,az,Exp_time) (1)
in the embodiments of the present application, when the collecting means is not shaken, ax,ay,azThe numerical values of (1) are all 0, and Again, Dgain and Exp _ time are all preset initial shooting parameters; when the collecting device shakes, ax,ay,azThe value of (b) is jitter data obtained by performing differential calculation on component values in the x, y, and z directions acquired from the acceleration sensor.
And S1022, carrying out multiple iterative adjustments on the initial shooting parameters based on the preset initial step length, and obtaining multiple loss values obtained by calculating multiple adjusted shooting parameters and jitter data according to the constraint relation among the shooting parameters, the jitter degree and the picture quality when the preset iteration termination condition is reached.
In the embodiment of the application, after determining the picture loss function, the terminal may substitute the previously obtained jitter data and each obtained group of adjusted shooting parameters into the picture loss function to calculate the loss value, and when a preset iteration termination condition is reached, a plurality of loss values corresponding to a plurality of groups of adjusted shooting parameters may be correspondingly obtained.
It should be noted that S201 to S203 may be executed before S101, or may be executed simultaneously with S101, which is not limited in this embodiment of the present application.
In some embodiments of the present application, S102 in fig. 4 may be implemented by S301, and S103 may be implemented by S302:
s301, carrying out iterative adjustment on the ith group of sub-initial shooting parameters for multiple times by adopting the ith group of sub-initial step length, calculating the adjusted ith group of sub-initial shooting parameters and jitter data, and obtaining the ith group of sub-target shooting parameters and corresponding individual target loss values when a preset iteration termination condition is reached, so as to obtain N groups of sub-target shooting parameters and N individual target loss values corresponding to the N groups of sub-initial shooting parameters; the initial step size includes: n groups of sub-initial step lengths, wherein the initial shooting parameters comprise: n groups of initial shooting parameters; the sub-initial step length corresponds to the sub-initial shooting parameters one by one; the plurality of adjusted shooting parameters include: the adjusted ith group of sub-shooting parameters; the plurality of penalty values includes: n individual target loss values; wherein N is greater than or equal to 1; i is an integer of 1 to N.
S302, determining the minimum individual target loss value from the N individual target loss values, and determining one sub-shooting parameter corresponding to the minimum individual target loss value from the N groups of sub-target shooting parameters as a target shooting parameter.
In S301, the initial step size includes: n groups of sub-initial step lengths, wherein the initial shooting parameters comprise: n groups of initial shooting parameters; the sub-initial step length corresponds to the sub-initial shooting parameters one by one; the plurality of adjusted shooting parameters include: the adjusted ith group of sub-shooting parameters; the plurality of penalty values includes: n individual target loss values. It can be understood that the terminal may perform iterative adjustment on N groups of corresponding sub-initial shooting parameters for multiple times based on N groups of sub-initial step lengths, and for each group of sub-initial shooting parameters, after each iterative adjustment, obtain a group of adjusted shooting parameters, and the terminal may substitute the obtained group of adjusted shooting parameters and the jitter data obtained through the acceleration sensor into the picture loss function to perform loss calculation, to obtain a corresponding loss value, and determine whether the loss value satisfies a preset iteration termination condition, and when the loss value satisfies the preset iteration termination condition, obtain an individual target loss value corresponding to the group of sub-initial shooting parameters, and determine that the adjusted shooting parameters corresponding to the individual target loss value are the sub-target shooting parameters of the group. It should be noted that, because N groups of sub-initial shooting parameters are iteratively adjusted for multiple times at the same time, after the terminal reaches the preset iteration termination condition and stops iterative adjustment, for N groups of sub-initial shooting parameters, N individual target loss values corresponding to one and N groups of sub-target shooting parameters corresponding to the N individual target loss values one to one can be finally obtained. For example, when there are A, B, C, D and E five sub-initial shooting parameters numbered respectively, after the terminal stops iteration, it finally obtains five individual target loss values a, B, C, D and E corresponding to A, B, C, D and E five sub-initial shooting parameters one by one, and obtains five sub-target shooting parameters a1, B1, C1, D1 and E1 corresponding to a, B, C, D and E five individual target loss values one by one, wherein the sub-target shooting parameter numbered a1 corresponds to a sub-initial shooting parameter numbered a and an individual target loss value numbered a respectively, the sub-target shooting parameter numbered B1 corresponds to B and an individual target loss value numbered B respectively, the sub-target shooting parameter numbered C1 corresponds to C and C respectively, the sub-target photographing parameter numbered D1 corresponds to the sub-initial photographing parameter numbered D and the individual target loss value numbered D, respectively, and the sub-target photographing parameter numbered E1 corresponds to the sub-initial photographing parameter numbered E and the individual target loss value numbered E, respectively.
In S302, after the terminal stops iterative adjustment, for N groups of sub-initial shooting parameters, finally N individual target loss values corresponding to one another are obtained, and N groups of sub-target shooting parameters corresponding to the N individual target loss values are obtained; therefore, the terminal may select the minimum individual target loss value from the N individual target loss values as a full group target loss value, and determine a group of sub-target shooting parameters corresponding to the full group target loss value as target shooting parameters to perform subsequent image shooting using the target shooting parameters.
In some embodiments, the terminal may generate a set of initial shooting parameters by using a 3A algorithm, and then perform N times of transformation on the set of initial shooting parameters, thereby obtaining N different sets of sub-initial shooting parameters according to the set of initial parameters; in other embodiments, the terminal may also directly generate N groups of sub-initial shooting parameters by using a 3A algorithm, which is not limited in this embodiment of the present application.
In some embodiments of the present application, fig. 9 is an optional flowchart of the shooting parameter adjustment method provided in the embodiments of the present application, and S301 described above may be implemented by S3011 to S3013, which will be described below with reference to fig. 9.
S3011, based on the ith group of sub-initial step sizes, parameter adjustment is carried out on the ith group of sub-initial shooting parameters, and the current step size and the current shooting parameters are obtained.
In some embodiments, before parameter adjustment is performed on the ith group of sub-initial shooting parameters based on the ith group of sub-initial step sizes to obtain the current step size and the current shooting parameters, the terminal may determine N groups of current optimal shooting parameters.
Here, since the terminal does not adjust the sub-initial shooting parameters before starting to adjust the parameters of the i-th group of sub-initial shooting parameters, there are no shooting parameters after adjustment, and therefore, before performing the first parameter adjustment on the i-th group of sub-initial shooting parameters based on the i-th group of sub-initial step sizes, the terminal may use the i-th group of sub-initial step sizes as the first current optimal shooting parameters of the i-th group, and since N groups of sub-initial shooting parameters are iteratively adjusted at the same time, it is possible to determine N groups of current optimal shooting parameters that are one-to-one corresponding to the N groups of sub-initial shooting parameters.
In some embodiments of the present application, fig. 10 is an optional flowchart of the shooting parameter adjustment method provided in this embodiment of the present application, and S3011 may be implemented by S401 to S402, which will be described below with reference to fig. 10.
S401, determining a current secondary step length corresponding to the ith group of sub-initial step lengths based on the ith group of sub-initial shooting parameters and preset optimization parameters.
S402, adjusting the ith group of sub-initial shooting parameters by adopting the current step length to obtain the current shooting parameters.
In some embodiments of the present application, S401 may be implemented by: respectively carrying out difference processing on the current-time full-group optimal shooting parameters and the ith-time current-time optimal shooting parameters in the N groups of current-time optimal shooting parameters and the ith-time sub-initial shooting parameters; and under the action of preset optimization parameters, weighting the current step length and the ith group of sub-initial step lengths to obtain the current step length. Specifically, the following two steps can be divided:
s11, based on the N groups of current optimal shooting parameters, respectively weighting the full group of optimal parameters and the ith group of optimal parameters corresponding to the target parameters under the action of preset optimal parameters, and weighting the target initial step length corresponding to the target parameters in the ith group of sub-initial step lengths to obtain the target step length corresponding to the target parameters; the target parameter is at least one of a first gain parameter, a second gain parameter and an exposure parameter;
and S12, determining the current step length at least based on the target step length.
In S11, when the first N sets of current optimum shooting parameters are obtained, one-to-one corresponding to the N sets of sub-initial shooting parameters, the sub-initial shooting parameters are determined for each setIn the case that the initial shooting parameters include a first gain parameter, a second gain parameter, and an exposure parameter, for each of the sub-initial shooting parameters, a set of current sub-optimal shooting parameters is composed of one of the optimal first gain parameter of the set, one of the optimal second gain parameter of the set, and one of the optimal exposure parameter of the set. For example, for the A-th group of sub-initial shooting parameters, a group of current sub-optimal shooting parameters corresponding to the A-th group of sub-initial shooting parameters is defined by an A-th group of optimal first gain parameters z1A first group A of optimum second gain parameters z2And an A-th set of optimal exposure parameters z3And (4) forming. When the terminal obtains N groups of current optimal shooting parameters for the first time, the N groups of current optimal shooting parameters and the obtained jitter data can be substituted into a picture loss function to calculate loss values, so that N loss values are correspondingly obtained, after N loss values which are in one-to-one correspondence with N groups of sub-initial shooting parameters are obtained, the terminal can determine the minimum loss value in the N loss values and use the minimum loss value as the current full-group optimal target loss value, and a group of sub-initial shooting parameters corresponding to the current full-group optimal target loss value are used as the current full-group optimal shooting parameters; in the case that each set of sub-initial shooting parameters includes a first gain parameter, a second gain parameter, and an exposure parameter, then for each set of sub-initial shooting parameters, a set of current full-set optimal shooting parameters is composed of a full-set optimal first gain parameter, a full-set optimal second gain parameter, and a full-set optimal shooting parameter. For example, continuing to take A, B, C, D th and E-th groups of sub-initial shooting parameters as examples, the current time full-group optimal shooting parameter corresponding to the A, B, C, D th and E-th groups of sub-initial shooting parameters is a full-group optimal first gain parameter z'1One full set of optimal second gain parameters z'2And one full set of optimal exposure parameters z'3And (4) forming.
When the target parameter is the first gain parameter, after the first iterative adjustment, the full-group optimal parameter corresponding to the target parameter is the full-group optimal first gain parameter in the current full-group optimal shooting parameter corresponding to the first time, and the ith group optimal parameter corresponding to the target parameter is the ith group optimal first gain parameter in the current optimal shooting parameter corresponding to the first time; when the target parameter is the second gain parameter and the exposure parameter, the same process is not repeated here.
In some embodiments of the present application, in S11, the terminal may calculate a target step size corresponding to the target parameter through the following formula (6);
viDj=w×viD0+c1r1(piD-xiD0)+c2r2(pgD-xiD0) (6)
w、c1、c2、r1、r2is a preset optimization parameter, wherein w is a weighted value, c1、c2Is a learning factor or a preset acceleration constant (r)1And r2Is [0,1 ]]A random number within a range; v. ofidjJ is a target step length of a target parameter, and represents the number of iterative adjustments, wherein j is 1 due to the first iterative adjustment; v. ofiD0Is a target initial step size, P, of a target parameteriDIs the ith set of optimal parameters, P, of the target parametergDIs the full set of optimal parameters for the target parameter; x is the number ofiD0And a sub-initial photographing parameter indicating a target parameter.
In S12, the terminal may determine the remaining target step length corresponding to the remaining parameter according to the target step length corresponding to the target parameter and the negative correlation between the first product value and the step length corresponding to the exposure parameter, so as to obtain the current step length; the first product value is a product value between a step length corresponding to the first gain parameter and a step length corresponding to the second gain parameter. The target parameter is at least one of the following parameters: a first gain parameter, a second gain parameter, and an exposure parameter. It should be noted that, when the target parameter is the first gain parameter among the first gain parameter, the second gain parameter and the exposure parameter, the remaining parameters are the second gain parameter and the exposure parameter; and when the target parameter is the first gain parameter and the second gain parameter, then the remaining parameter is the exposure parameter, which is only an exemplary illustration and is not a limitation of the target parameter and the remaining parameter.
In the embodiment of the present application, the first product value is negatively related to the step size corresponding to the exposure parameter, which may be understood as that the adjustment of the exposure parameter is a negative adjustment for reducing the picture blur caused by the jitter, and the product of the first gain parameter and the second gain parameter is a positive adjustment for maintaining the picture brightness, and the product of the step size corresponding to the first gain parameter and the step size corresponding to the second gain parameter and the product of the step size corresponding to the exposure parameter is the second preset constant data 1. That is, for the sub-initial shooting parameters of the exposure parameters, the reduced exposure parameters can be obtained through the target step length of the exposure parameters during each iterative adjustment, and for the sub-initial shooting parameters of the first gain parameter and the second gain parameter, the increased first gain parameter and the increased second gain parameter can be obtained through the target step length of the first gain parameter and the second gain parameter during each iterative adjustment; of course, for the sub-initial shooting parameters of the exposure parameters, there may be a case where when the reduction amplitude of a certain time is too large, increased shooting parameters are obtained when the adjustment is iterated for the next several times; and, for the sub-initial shooting parameters of the first gain parameter and the second gain parameter, there may be a case where, after an excessive increase is made for a certain time, the first gain parameter and the second gain parameter that are decreased are obtained at the time of the latter several iterative adjustments.
It should be noted that data1 can be determined according to actual needs, or can be calculated by a 3A algorithm.
In some embodiments of the present application, when the target parameter is a photographing parameter, for example, a first gain parameter, since the target step size for the first time of the first gain parameter has been obtained according to the above S12, and the product value between the step size corresponding to the first gain parameter and the step size corresponding to the second gain parameter (the above-mentioned first product value), the product between the step sizes corresponding to the exposure parameters is data1, therefore, the product value of the target step size corresponding to the first second gain parameter and the target step size corresponding to the exposure parameter can be obtained according to data1 and the first target step size of the first gain parameter, then, according to the product value of the target step length corresponding to the second gain parameter and the target step length corresponding to the exposure parameter, the target step length corresponding to the second gain parameter and the target step length corresponding to the exposure parameter can be obtained respectively, thereby realizing the determination of the current time step length of the i-th group of sub-initial step lengths. Therefore, the target step length of the second gain parameter and the target step length of the exposure parameter do not need to be calculated again in the mode, so that the calculation amount of the terminal is greatly reduced, and the calculation resource of the terminal is saved; and the iterative adjustment efficiency is greatly improved, so that the determination efficiency of the target shooting parameters is improved.
In other embodiments of the present application, when the target parameter is two shooting parameters, for example, a first gain parameter and a second gain parameter, since the first target step length of the first gain parameter and the first target step length of the second gain parameter have been obtained according to the above S12, and the product value between the step length corresponding to the first gain parameter and the step length corresponding to the second gain parameter and the product value between the step lengths corresponding to the exposure parameters are data1, the target step length of the first exposure parameter can be directly calculated according to data1, the first target step length of the first gain parameter and the first target step length of the second gain parameter, so as to determine the current step length of the i-th group of sub-initial step lengths; therefore, the target step length of the exposure parameter does not need to be calculated again in the manner, so that the calculation amount of the terminal is reduced, and the calculation resource of the terminal is saved; and the iterative adjustment efficiency is also improved, so that the determination efficiency of the target shooting parameters is improved.
In some other embodiments of the present application, the target parameters may also be all the shooting parameters, that is, the first gain parameter, the second gain parameter, and the exposure parameter, so that the target step size for the first time of the first gain parameter, the target step size for the first time of the second gain parameter, and the target step size for the first time of the exposure parameter have been obtained according to the above S12, thereby achieving the determination of the current time step size of the i-th group of sub-initial step sizes. Because the target step length of each shooting parameter is obtained by iterative adjustment, the iterative adjustment of the subsequent sub-initial shooting parameters can be more accurate, and the acquisition of the target shooting parameters is facilitated.
In some embodiments of the present application, for S402 described above, this may be achieved by the following S21-S24:
s21, adjusting a first gain parameter in the ith group of initial shooting parameters by adopting a target step length corresponding to the first gain parameter in the current step length to obtain a first adjustment gain parameter; and/or the presence of a gas in the gas,
s22, adjusting a second gain parameter in the ith group of initial shooting parameters by adopting a target step length corresponding to the second gain parameter in the current step length to obtain a second adjustment gain parameter; and/or the presence of a gas in the gas,
s23, adjusting the exposure parameters in the ith group of initial shooting parameters by adopting the target step length corresponding to the exposure parameters in the current step length to obtain exposure adjustment parameters;
and S24, determining the current shooting parameter based on at least one of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter.
In the embodiment of the present application, each parameter in the ith group of sub-initial shooting parameters may be adjusted by using the following formula (7);
xiDj=xiD0+viDj(7) wherein x isiDjEach adjusted parameter (first adjustment gain parameter, second adjustment gain parameter, or exposure adjustment parameter), x, representing the ith group of sub-initial shooting parametersiD0Each parameter (first gain parameter, second gain parameter or exposure parameter) in the ith group of sub-initial shooting parameters is represented; v. ofiDjA target step length (a target step length of the first gain parameter, a target step length of the second gain parameter or a target step length of the exposure parameter) of a corresponding parameter in a current step length (i.e. the current step length obtained after the ith group of sub-initial step lengths are calculated for the first time); j is the number of iterations, where j is 1 because each parameter in the ith group of sub-initial shooting parameters is adjusted for the first time by using the current step size.
As can be seen from the above formula (7), when the ith group of sub-initial shooting parameters is adjusted, the sum of the first gain parameter in the ith group of sub-initial shooting parameters and the target step length of the first gain parameter may be specifically used as the first adjustment gain parameter; and/or taking the sum of a second gain parameter in the ith group of sub-initial shooting parameters and the target step length of the second gain parameter as a second adjustment gain parameter; and/or taking the sum of the exposure parameter in the ith group of sub-initial shooting parameters and the target step length of the exposure parameter as an exposure adjustment parameter; thereby obtaining at least one of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter, and further obtaining the current shooting parameter according to the at least one.
In some embodiments of the present application, with respect to S402 described above, it may also be implemented by S31:
s31, determining the remaining adjustment parameters of the remaining parameters according to one or two of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter, and according to the fact that the second product value is in negative correlation with the exposure adjustment parameter, and the product of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter is a first preset constant, thereby determining the current shooting parameter; wherein, the rest adjusting parameters are parameters except one or two of the first adjusting gain parameter, the second adjusting gain parameter and the exposure adjusting parameter; the second product value is a product value between the first adjusted gain parameter and the second adjusted gain parameter.
In the embodiment of the present application, when one of the first adjustment gain parameter, the second adjustment gain parameter, and the exposure adjustment parameter is the exposure adjustment parameter, the remaining parameters are the first adjustment gain parameter and the second adjustment gain parameter; it should be noted that this example is only an exemplary illustration and is not used to limit the remaining parameters in the present application.
In an embodiment of the present application, the second product value is negatively correlated to the exposure adjustment parameter, and a product of the first adjustment gain parameter, the second adjustment gain parameter, and the exposure adjustment parameter is a first predetermined constant, which can be expressed as the following formula (8):
data is Exp _ time × Again × Dgain (8), where Data is a first preset constant.
In some embodiments, when determining one of the first adjustment gain parameter, the second adjustment gain parameter, and the exposure adjustment parameter, for example, the exposure adjustment parameter, a product of the first adjustment gain parameter and the second adjustment gain parameter may be determined according to the exposure adjustment parameter and a first preset constant Data, and when the product of the first adjustment gain parameter and the second adjustment gain parameter is obtained, the first adjustment gain parameter and the second adjustment gain parameter may be obtained, so that the first adjustment gain parameter, the second adjustment gain parameter, and the exposure adjustment parameter are obtained, and the determination of the current shooting parameter is achieved. Therefore, the first adjustment gain parameter and the second adjustment gain parameter do not need to be calculated again in the mode, so that the calculation amount of the terminal is greatly reduced, and the calculation resource of the terminal is saved; and the iterative adjustment efficiency is greatly improved, so that the determination efficiency of the target shooting parameters is improved.
In the embodiment of the present application, the first preset constant Data may be calculated according to a 3A algorithm. For example, the product of real-time Exp _ time and Again and Dgain may be used as the standard constant Data after calculating real-time Exp _ time, Again and Dgain by the 3A algorithm.
In other embodiments, when two shooting parameters, for example, the first adjustment gain parameter and the exposure adjustment parameter, of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter are determined, the second adjustment gain parameter may be directly determined according to the first adjustment gain parameter, the exposure adjustment parameter and the first preset constant Data, so as to obtain the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter, thereby determining the current shooting parameter. Therefore, each adjusting parameter is obtained through iterative adjustment, so that the obtained adjusting parameter can be more accurate, and the target shooting parameter can be obtained.
S3012, substituting the jitter data and the current shooting parameter into a picture loss function according to the constraint relation among the shooting parameters, the jitter degree and the picture quality to obtain a current loss value.
In the embodiment of the present application, when the current shooting parameter is obtained through the iterative computation, the obtained shake data and the current shooting parameter may be substituted into the frame loss function, that is, the formula (1) above, because after the parameters are substituted into the formula (1), Again, Dgain, Exp _ time, ax、ay、azSince q is known and is a predetermined value, a corresponding current loss value can be calculated.
S3013, when the loss value does not meet the preset iteration termination condition, continuing to adjust the next parameter based on the current shooting parameter and the current step length until the loss value obtained by the Mth adjustment meets the preset iteration termination condition, and obtaining the shooting parameters of the sub-targets in the ith group and the corresponding individual target loss values; wherein M is a positive integer greater than 1.
In the embodiment of the application, when the loss value of the current time is calculated, the terminal determines whether the loss value of the current time meets a preset iteration termination condition, and when the loss value of the current time does not meet the preset iteration termination condition, the terminal continues to perform the next parameter adjustment according to the current shooting parameter and the current step length obtained this time to obtain the next target step length, and obtains the next shooting parameter by using the next target step length, and continues to perform the next loss value calculation by using the next shooting parameter and the obtained jitter data, and circulates until the loss value obtained corresponding to the adjustment of the mth time meets the preset iteration termination condition, so that each group of sub-target shooting parameters and the corresponding individual target loss value can be obtained.
In an embodiment of the present application, the preset iteration termination condition includes: the loss value is obtained when the adjustment times of the ith group of initial shooting parameters reach the preset times; or the loss value is obtained when the adjustment times of the ith group of sub-initial shooting parameters do not reach the preset times, and the difference value between the loss value and the preset loss threshold value is smaller than or equal to the preset difference value. It should be noted that the preset times corresponding to the N groups of sub-shooting parameters are the same.
Here, for each group of sub-shooting parameters, each time adjustment is performed, the obtained adjusted shooting parameters and the obtained jitter data are substituted into the picture loss function to perform loss value calculation, so that for each group of sub-shooting parameters, after a loss value is calculated, whether the loss value is the loss value calculated when the adjustment times of the group of sub-initial shooting parameters reach the preset times or not is judged; if the loss value obtained at a certain time is obtained when the adjusting times of the group of the initial shooting parameters reach the preset times, determining that the loss value obtained at the certain time meets the preset iteration termination condition; or if the loss value obtained at a certain time is obtained when the adjustment times of the group of sub-initial shooting parameters do not reach the preset times, but the difference value between the loss value obtained at the certain time and the preset loss threshold value is less than or equal to the preset difference value, determining that the loss value obtained at the certain time meets the preset iteration termination condition; at this time, the terminal may stop the iterative adjustment of the N sets of sub-shooting parameters.
It can be understood that when the adjustment times of the shooting parameters reach the set times, the last obtained N groups of shooting parameters are adopted, and one group of shooting parameters corresponding to the smallest loss value among the N loss values calculated correspondingly is the target shooting parameter; in the iteration process, when the adjustment times do not reach the preset times, N loss values are correspondingly calculated by adopting N groups of shooting parameters obtained after certain iterative adjustment, and the minimum loss value in the N loss values is close to or equal to the preset loss threshold value, the group of shooting parameters corresponding to the minimum loss value in the N loss values is the target shooting parameter.
In some embodiments of the present application, the continuing to perform the next parameter adjustment based on the current shooting parameter and the current step length in the above step S3013 may be implemented by:
s41, determining the next step length corresponding to the current step length of the ith group based on the current shooting parameter of the ith group and the preset optimization parameter;
and S42, adjusting the current shooting parameter of the ith group by adopting the next step length to obtain the next shooting parameter.
In the embodiment of the present application, before S3013 described above, N sets of next optimal shooting parameters may be determined.
In the embodiment of the present application, for each group of current shooting parameters, after iteratively adjusting the current shooting parameters once, the terminal substitutes the obtained adjusted shooting parameters and the jitter data obtained in real time into the picture loss function, calculates a corresponding loss value, and determines the loss value corresponding to the iterative adjustment, and the smallest loss value among the loss values corresponding to all iterative adjustments before the iterative adjustment, and uses the adjusted shooting parameter corresponding to the smallest loss value as a group of next optimal shooting parameters corresponding to the group of current shooting parameters, because, in the embodiment of the present application, N groups of current shooting parameters are iteratively adjusted at the same time, after performing loss value calculation according to the adjusted shooting parameters obtained after each iterative adjustment, for N groups of current shooting parameters, then, the N groups of adjusted shooting parameters corresponding to the N groups of current shooting parameters one to one can be used as the N groups of next optimal shooting parameters of the corresponding N groups of current shooting parameters.
For the current shooting parameter of the A-th group, after the current shooting parameter of the A-th group is iteratively adjusted by the terminal, the obtained adjusted shooting parameter and the jitter data obtained in real time are substituted into a picture loss function, a loss value corresponding to the iterative adjustment is calculated, the loss value corresponding to the iterative adjustment is determined, the minimum loss value is determined from the loss values corresponding to all previous iterative adjustments, and the adjusted shooting parameter obtained after the iterative adjustment of a certain time corresponding to the minimum loss value is used as a next optimal shooting parameter corresponding to the current shooting parameter of the A-th group; for B, C, D th and E groups of current shooting parameters, a group of next optimal shooting parameters which correspond to each other one by one can be obtained in the same way; thus, five sets of next optimum shooting parameters can be obtained. It is understood that the current time may be understood as the nth time, and the next time may be understood as the (n + 1) th time, where n is an integer greater than or equal to 2 and less than or equal to the preset number of iterations.
Here, the above S41 may be implemented as: based on the full-group optimal parameters and the ith group optimal parameters which respectively correspond to the target parameters in the N groups of next optimal shooting parameters, weighting the target step length corresponding to the target parameters in the current step length of the ith group under the action of preset optimal parameters to obtain the next target step length corresponding to the target parameters; the target parameter is at least one of a first gain parameter, a second gain parameter and an exposure parameter; and determining the next step length at least based on the next target step length.
In some embodiments, the determining the next step size based on at least the next target step size may be implemented as: determining the remaining next target step length corresponding to the remaining parameters according to the next target step length corresponding to the target parameters and the first constraint condition, so as to obtain the next step length; the first constraint condition is the product of the step length corresponding to the first gain parameter and the step length corresponding to the second gain parameter, and the product is in negative correlation with the step length corresponding to the exposure parameter.
Here, when N sets of next optimal photographing parameters are obtained, which correspond to the N sets of current photographing parameters one to one, in a case where each set of sub-initial photographing parameters includes the first gain parameter, the second gain parameter, and the exposure parameter, then for each set of current photographing parameters, one set of next optimal photographing parameters is composed of one set of optimal first gain parameter, one set of optimal second gain parameter, and one set of optimal exposure parameter. For example, for the current time shooting parameters of the A-th group, the next optimal shooting parameters of the group corresponding to the current time shooting parameters of the A-th group are determined by the A-th group optimal first gain parameters z1A first group A of optimum second gain parameters z2And an A-th set of optimal exposure parameters z3And (4) forming. And when the terminal obtains N groups of current time optimal shooting parameters, the N groups of current time optimal shooting parameters and the obtained N groups of current time optimal shooting parametersThe jitter data is substituted into a picture loss function to calculate loss values, so that N loss values are correspondingly obtained, after N loss values which are in one-to-one correspondence with N groups of current shooting parameters are obtained, the terminal can determine the minimum loss value in the N loss values and take the minimum loss value as the next full-group optimal target loss value, and a group of next shooting parameters corresponding to the next full-group optimal target loss value are taken as the next full-group optimal shooting parameters; under the condition that each group of sub-initial shooting parameters comprises a first gain parameter, a second gain parameter and an exposure parameter, for each group of current shooting parameters, a group of next full-group optimal shooting parameters comprises a full-group optimal first gain parameter, a full-group optimal second gain parameter and a full-group optimal shooting parameter. For example, continuing to take A, B, C, D th and E-th groups of sub-initial shooting parameters as examples, the current shooting parameter of the a-th group is obtained after the sub-initial shooting parameter of the a-th group is iteratively adjusted once, the current shooting parameter of the B-th group is obtained after the sub-initial shooting parameter of the B-th group is iteratively adjusted once, the current shooting parameter of the C-th group is obtained after the sub-initial shooting parameter of the C-th group is iteratively adjusted once, the current shooting parameter of the D-th group is obtained after the sub-initial shooting parameter of the D-th group is iteratively adjusted once, and the current shooting parameter of the E-th group is obtained after the sub-initial shooting parameter of the E-th group is iteratively adjusted once; the next full set of optimal shooting parameters corresponding to the current shooting parameters of the A, B, C, D th and E th groups are composed of a full set of optimal first gain parameters z'1One full set of optimal second gain parameters z'2And one full set of optimal exposure parameters z'3And (4) forming.
Therefore, when the target parameter is the first gain parameter, the full group of optimal parameters corresponding to the target parameter is the full group of optimal first gain parameter in the next full group of optimal shooting parameters, and the ith group of optimal parameters corresponding to the target parameter is the ith group of optimal first gain parameter in the next optimal shooting parameters corresponding to the first time; when the target parameter is the second gain parameter and the exposure parameter, the same process is not repeated here.
In some embodiments of the present application, the terminal may calculate a next target step corresponding to the target parameter through the following formula (9);
viDj+1=w×viDj+c1r1(piD-xiDj)+c2r2(pgD-xiDj) (9)
w、c1、c2、r1、r2is a preset optimization parameter, wherein w is a weighted value, c1、c2Is a learning factor or a preset acceleration constant, r1And r2Is [0,1 ]]A random number within a range; v. ofiDj+1Is the next target step length of the target parameter, j +1 represents the iterative adjustment times; v. ofiDjIs the target step size, P, of the target parameteriDIs the ith set of optimal parameters, P, of the target parametergDIs the full set of optimal parameters for the target parameter; x is the number ofiDjCurrent shooting parameters representing target parameters.
In some embodiments, the above S42 may be implemented as: adjusting a first gain parameter in the current shooting parameter of the ith group by adopting a next target step length corresponding to the first gain parameter in the next step length to obtain a first adjustment gain parameter; and/or adjusting a second gain parameter in the current shooting parameter of the ith group by adopting a next target step length corresponding to the second gain parameter in the next step length to obtain a second adjustment gain parameter; and/or adjusting the exposure parameter in the current shooting parameter of the ith group by adopting the next target step length corresponding to the exposure parameter in the next step length to obtain an exposure adjustment parameter; and determining the next shooting parameter based on at least one of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter.
In the embodiment of the present application, each parameter in the ith group of current shooting parameters may be adjusted by using the following formula (10);
xiDj+1=xiDj+viDj+1(10) wherein x isiDj+1Each adjusted parameter (first adjustment gain parameter, second adjustment gain parameter) representing current shooting parameter of ith groupGain parameter or exposure adjustment parameter), xiDjEach parameter (first gain parameter, second gain parameter, or exposure parameter) in the current time shooting parameter representing the ith group; v. ofiDj+1For the next step (V)iDj+1) The target step size of the corresponding parameter (next target step size of the first gain parameter, target step size of the second gain parameter, or next target step size of the exposure parameter); j +1 is the number of iterations.
As can be seen from the above equation (10), when adjusting the current shooting parameter of the ith group, specifically, the sum of the first gain parameter in the current shooting parameter of the ith group and the next target step length of the first gain parameter may be used as the first adjusted gain parameter; and/or taking the sum of a second gain parameter in the current shooting parameter of the ith group and the next target step length of the second gain parameter as a second adjustment gain parameter; and/or taking the sum of the exposure parameter in the current shooting parameter of the ith group and the next target step length of the exposure parameter as an exposure adjustment parameter; thereby obtaining at least one of the first adjustment gain parameter, the second adjustment gain parameter, and the exposure adjustment parameter, to determine a next shooting parameter based on the at least one.
In some embodiments, the above S42 may also be implemented as: determining the remaining adjustment parameters of the remaining parameters according to one or two of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter, and the second constraint condition, so as to determine the next shooting parameter; wherein, the rest adjusting parameters are parameters except one or two of the first adjusting gain parameter, the second adjusting gain parameter and the exposure adjusting parameter; the second constraint condition is a product of the first adjustment gain parameter and the second adjustment gain parameter, which is negatively correlated with the exposure adjustment parameter, and the product of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter is a normal constant.
In the embodiment of the present application, the principle of determining the next shooting parameter is the same as the calculation principle of the equation (8), and is not described herein again.
Through the introduction of the above embodiments, it can be understood that, in the embodiment of the present application, in the shooting process of the camera, not only the influence of the imaging illumination intensity and other environments is considered, but also the acceleration sensor data is connected to the image processor according to the shake degree of the camera, so as to perform fast judgment and decision on the shake degree of the shot picture; then, the existing algorithm is supplemented and modified based on the jitter degree, an optimization function about the image definition of the image is established according to the jitter degree of the camera on the basis of the existing 3A parameters (Exp _ time, Again and Dgain), the 3A parameters obtained by the 3A algorithm are used as initial values, the particle swarm algorithm is used for iterative calculation of the optimal values of Exp _ time, Again and Dgain, and the optimal values of Exp _ time, Again and Dgain are adopted for image acquisition, so that the overall image quality of the image is effectively improved.
The embodiment of the present application further provides a shooting parameter adjusting apparatus 1, fig. 11 shows an exemplary structure that can be implemented as a software module, and as shown in fig. 11, the shooting parameter adjusting apparatus 1 may include: the acquisition module 10 is used for acquiring jitter data of the acquisition device and initial shooting parameters in real time in the shooting process; the jitter data represents the jitter degree of the acquisition device; the adjusting module 11 is configured to perform multiple iterative adjustments on the initial shooting parameter based on a preset initial step length, and when a preset iteration termination condition is reached, obtain multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data; a determining module 12, configured to determine a minimum loss value from the plurality of loss values, and determine a group of shooting parameters corresponding to the minimum loss value as target shooting parameters.
In some embodiments of the present application, the apparatus further includes a shooting module 13 (not shown in fig. 11) for shooting with the target shooting parameters to obtain a shot image.
In some embodiments of the present application, the apparatus further includes an obtaining module 14 (not shown in fig. 11) configured to, after performing iterative adjustment on the initial shooting parameter for multiple times based on a preset initial step size, and when a preset iteration termination condition is reached, before obtaining multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data, obtain a first constraint relationship between the picture quality, the jitter degree, and the exposure parameter according to a first priori knowledge; the picture quality and the jitter degree are in negative correlation, and the picture quality and the exposure parameter are also in negative correlation; obtaining a second constraint relation between the picture quality and the gain parameter according to second priori knowledge; the picture quality and the gain parameter are in negative correlation; determining a constraint relation among the shooting parameter, the shaking degree and the picture quality based on the first constraint relation and the second constraint relation; the adjusting module 11 is further configured to perform multiple iterative adjustments on the initial shooting parameter based on a preset initial step length, and when a preset iteration termination condition is reached, obtain multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data according to the constraint relationship among the shooting parameter, the jitter degree, and the picture quality.
In some embodiments of the present application, the initial step size comprises: n groups of sub-initial step lengths, wherein the initial shooting parameters comprise: n groups of initial shooting parameters; the sub-initial step length corresponds to the sub-initial shooting parameters one by one; the plurality of adjusted shooting parameters include: the adjusted ith group of sub-shooting parameters; the plurality of penalty values comprises: n individual target loss values; wherein N is greater than or equal to 1; the adjusting module 11 is further configured to perform iterative adjustment on the ith group of sub-initial shooting parameters for multiple times by using an ith group of sub-initial step length, calculate the adjusted ith group of sub-initial shooting parameters and the jitter data, and obtain the ith group of sub-target shooting parameters and corresponding individual target loss values when the preset iteration termination condition is reached, so as to obtain N groups of sub-target shooting parameters corresponding to the N groups of sub-initial shooting parameters; i is an integer from 1 to N; the N groups of sub-target shooting parameters and the N individual target loss values are obtained; i is an integer from 1 to N; the determining module 12 is further configured to determine a minimum individual target loss value from the N individual target loss values, and determine a group of sub-shooting parameters corresponding to the minimum individual target loss value from the N groups of sub-target shooting parameters as the target shooting parameters.
In some embodiments of the present application, the adjusting module 12 is further configured to perform parameter adjustment on the ith group of sub-initial shooting parameters based on the ith group of sub-initial step sizes to obtain a current step size and a current shooting parameter; calculating the jitter data and the current shooting parameter according to the constraint relation among the shooting parameters, the jitter degree and the picture quality to obtain a current loss value; when the loss value does not meet a preset iteration termination condition, continuing to perform next parameter adjustment based on the current shooting parameter and the current step length until the loss value obtained by the Mth adjustment meets the preset iteration termination condition, and obtaining the ith group of sub-target shooting parameters and corresponding individual target loss values; wherein M is a positive integer greater than 1.
In some embodiments of the present application, the preset iteration termination condition includes: the loss value is obtained when the adjustment times of the ith group of sub-initial shooting parameters reach preset times; or the loss value is obtained when the adjustment times of the ith group of sub-initial shooting parameters do not reach the preset times, and the difference value between the loss value and the preset loss threshold value is smaller than or equal to the preset difference value.
In some embodiments of the present application, the adjusting module 11 is further configured to perform parameter adjustment on the ith group of sub-initial shooting parameters based on the ith group of sub-initial step sizes, and determine N groups of current-time optimal shooting parameters before obtaining the current-time step size and the current-time shooting parameters. In some embodiments of the present application, the adjusting module 11 is further configured to determine the current sub-step length corresponding to the ith group of sub-initial step lengths based on the ith group of sub-initial shooting parameters and a preset optimization parameter; and adjusting the ith group of sub-initial shooting parameters by adopting the current step length to obtain the current shooting parameters.
In some embodiments of the present application, the ith group of sub-initial shooting parameters includes: a first gain parameter, a second gain parameter, and an exposure parameter; the adjusting module 11 is further configured to weight, based on a full set of optimal parameters and an ith set of optimal parameters, which correspond to target parameters, in the N sets of current-time optimal shooting parameters, with a target initial step length, which corresponds to the target parameters, in the ith set of sub-initial step lengths under the action of the preset optimization parameters, so as to obtain a target step length corresponding to the target parameters; the target parameter is at least one of the first gain parameter, the second gain parameter and the exposure parameter; and determining the current step length at least based on the target step length.
In some embodiments of the present application, the adjusting module 11 is further configured to determine a remaining target step length corresponding to a remaining parameter according to the target step length corresponding to the target parameter and according to a negative correlation between the first product value and the step length corresponding to the exposure parameter, so as to obtain the current step length; wherein the first product value is a product value between a step length corresponding to the first gain parameter and a step length corresponding to the second gain parameter; the target parameter is at least one of the following parameters: the first gain parameter, the second gain parameter, and the exposure parameter.
In some embodiments of the present application, the ith group of sub-initial shooting parameters includes: a first gain parameter, a second gain parameter, and an exposure parameter; the adjusting module 11 is further configured to adjust the first gain parameter in the i-th group of initial shooting parameters by using a target step length corresponding to the first gain parameter in the current step length to obtain a first adjusted gain parameter; and/or adjusting the second gain parameter in the ith group of initial shooting parameters by adopting a target step length corresponding to the second gain parameter in the current step length to obtain a second adjustment gain parameter; and/or adjusting the exposure parameter in the ith group of sub-initial shooting parameters by adopting the target step length corresponding to the exposure parameter in the current step length to obtain an exposure adjustment parameter; determining the current shooting parameter based on at least one of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter.
In some embodiments of the present application, the adjusting module 11 is further configured to determine a remaining adjusting parameter of remaining parameters according to one or two of the first adjusting gain parameter, the second adjusting gain parameter, and the exposure adjusting parameter, and according to a second product value that is negatively related to the exposure adjusting parameter, and a product of the first adjusting gain parameter, the second adjusting gain parameter, and the exposure adjusting parameter is a first preset constant, so as to determine the current shooting parameter; wherein the second product value is a product value between the first adjusted gain parameter and the second adjusted gain parameter; the remaining adjustment parameter is a parameter other than one or two of the first adjustment gain parameter, the second adjustment gain parameter, and the exposure adjustment parameter.
In some embodiments of the present application, the apparatus further includes a control module 15, configured to obtain shake data of the acquisition device and initial shooting parameters in real time during a shooting process; before the jitter data represents the jitter degree of the acquisition device, determining the real-time jitter degree of the acquisition device according to the multi-frame preview image acquired by the acquisition device; when the determined real-time jitter degree is greater than or equal to a preset degree, starting an acceleration sensor and controlling the acceleration sensor to work at a first detection frequency; when the determined shaking degree is smaller than the preset degree, starting the acceleration sensor, and controlling the acceleration sensor to work at a second detection frequency; the first detection frequency is greater than the second detection frequency;
in some embodiments of the present application, the obtaining module 10 is further configured to obtain an initial shooting parameter of the collecting apparatus during a shooting process, and obtain a discrete shake amount of the collecting apparatus in real time through the acceleration sensor; and carrying out difference processing on the discrete jitter amount to obtain the jitter data.
In some embodiments of the present application, the obtaining module 10 is further configured to obtain real-time shake data of the collecting device in real time through the acceleration sensor during the shooting process, and obtain real-time initial shooting parameters; the adjusting module 11 is further configured to perform multiple iterative adjustments on the initial shooting parameter based on a preset initial step length, and obtain multiple loss values obtained by calculating the multiple adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached.
In some embodiments of the present application, the second a priori knowledge comprises: a plurality of groups of prior images corresponding to different gain parameters; the obtaining module 14 is further configured to determine, through an edge detection operator, a convolution of the edge detection operator of each pixel point in each prior image in the horizontal direction and the vertical direction, so as to obtain a horizontal convolution value and a vertical convolution value; obtaining the definition of each pixel point according to the horizontal convolution value and the vertical convolution value; obtaining the definition of each prior image according to the definition of each pixel point; and obtaining a second constraint relation between the picture quality and the gain parameters according to the definition of each prior image and the plurality of groups of different gain parameters.
An embodiment of the present application also provides an electronic device, as shown in fig. 12, the electronic device includes an image sensor (sensor)21, an image processor (Pre-Isp)22, an acceleration sensor 23, an image signal processor (Isp)24, and an Application Processor (AP) 25; the image sensor 21, the image processor 22, the acceleration sensor 23, the image signal processor 24, and the application processor 25 are connected via a bus 26 (not shown in fig. 12). The image sensor 21 and the image processor 22 are further connected through a mobile industry processor interface 27, the image processor 22 and the acceleration sensor 23 are further connected through an I2C interface 28, the image processor 22 and the image signal processor 24 are connected, and the image signal processor 24 is connected with the application processor 25; the acceleration sensor 23 is used for acquiring shake data of the image sensor 21 in real time in the shooting process; the shake data represents a degree of shake of the image sensor 21; an image processor 22 for acquiring initial photographing parameters from an image signal processor 24; performing multiple iterative adjustments on the initial shooting parameters based on a preset initial step length, and obtaining multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached; determining a minimum loss value from the loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters; the image sensor 21 is used for shooting by adopting the target shooting parameters to obtain a shot image; an application processor 25 for controlling the display of the captured image.
An embodiment of the present application further provides an electronic device, as shown in fig. 13, the electronic device 3 includes: a memory 31 and a processor 32, and the memory 31 and the processor 32 are connected by a communication bus 33; a memory 31 for storing executable instructions; a processor 32 for implementing the methods shown in fig. 4-7, 9-10 when executing the executable instructions stored in the memory.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the shooting parameter adjustment method described in the embodiment of the present application.
Embodiments of the present application provide a computer-readable storage medium having stored thereon executable instructions, which when executed by a processor, will cause the processor to perform a method provided by embodiments of the present application, for example, the method shown in fig. 4-7 and 9-10. In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories. In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code). By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In summary, according to the embodiment of the present application, for the situation that the picture is blurred due to shaking during shooting, the picture blurring degree is reduced by reducing the Exp _ time, and meanwhile, in order to reduce the influence of the Exp _ time on the picture brightness degree, the influence of the Exp _ time on the picture brightness is reduced by increasing Again and Dgain, and the grain sense of the picture is inevitably increased by increasing Again and Dgain, and the picture quality is reduced.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (15)

1. A shooting parameter adjustment method is characterized by comprising the following steps:
in the shooting process, acquiring jitter data of the acquisition device and initial shooting parameters in real time; the jitter data represents the jitter degree of the acquisition device;
performing multiple iterative adjustments on the initial shooting parameters based on a preset initial step length, and obtaining multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached;
and determining a minimum loss value from the loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters.
2. The method according to claim 1, wherein after the initial shooting parameters are iteratively adjusted for a plurality of times based on a preset initial step size, and when a preset iteration termination condition is reached, a plurality of loss values calculated for the adjusted shooting parameters and the shake data are obtained, the method further comprises:
obtaining a first constraint relation among the picture quality, the jitter degree and the exposure parameter according to the first priori knowledge; the picture quality and the jitter degree are in negative correlation, and the picture quality and the exposure parameter are also in negative correlation;
obtaining a second constraint relation between the picture quality and the gain parameter according to second priori knowledge; the picture quality and the gain parameter are in negative correlation;
determining a constraint relation among the shooting parameter, the shaking degree and the picture quality based on the first constraint relation and the second constraint relation;
the iterative adjustment of the initial shooting parameter for multiple times based on a preset initial step length is performed, and when a preset iteration termination condition is reached, multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data are obtained, and the iterative adjustment of the initial shooting parameter for multiple times comprises the following steps:
and carrying out iteration adjustment on the initial shooting parameters for multiple times based on a preset initial step length, and obtaining a plurality of loss values obtained by calculating a plurality of adjusted shooting parameters and the jitter data according to the constraint relation among the shooting parameters, the jitter degree and the picture quality when a preset iteration termination condition is reached.
3. The method of claim 1, wherein the initial step size comprises: n groups of sub-initial step lengths, wherein the initial shooting parameters comprise: n groups of initial shooting parameters; the sub-initial step length corresponds to the sub-initial shooting parameters one by one; the plurality of adjusted shooting parameters include: the adjusted ith group of sub-shooting parameters; the plurality of penalty values comprises: n individual target loss values; wherein N is greater than or equal to 1;
the iterative adjustment of the initial shooting parameter for multiple times based on a preset initial step length is performed, and when a preset iteration termination condition is reached, multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data are obtained, and the iterative adjustment of the initial shooting parameter for multiple times comprises the following steps:
performing iterative adjustment on the ith group of sub-initial shooting parameters for multiple times by adopting an ith group of sub-initial step length, calculating the adjusted ith group of sub-initial shooting parameters and the jitter data, and obtaining the ith group of sub-target shooting parameters and corresponding individual target loss values when the preset iteration termination condition is reached, so as to obtain N groups of sub-target shooting parameters and N individual target loss values corresponding to the N groups of sub-initial shooting parameters; i is an integer from 1 to N;
the determining a minimum loss value from the loss values and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters includes:
and determining the minimum individual target loss value from the N individual target loss values, and determining a group of sub-shooting parameters corresponding to the minimum individual target loss value from the N groups of sub-target shooting parameters as the target shooting parameters.
4. The method according to claim 3, wherein the iterative adjustment of the ith group of sub-initial shooting parameters is performed for a plurality of times by using the ith group of sub-initial step sizes, the adjusted ith group of sub-shooting parameters and the jitter data are calculated, and when the preset iteration termination condition is reached, the ith group of sub-target shooting parameters and the corresponding individual target loss values are obtained, including:
performing parameter adjustment on the ith group of sub-initial shooting parameters based on the ith group of sub-initial step lengths to obtain a current step length and current shooting parameters;
calculating the jitter data and the current shooting parameter according to the constraint relation among the shooting parameters, the jitter degree and the picture quality to obtain a current loss value;
when the loss value does not meet the preset iteration termination condition, continuing to perform next parameter adjustment based on the current shooting parameter and the current step length until the loss value obtained by the Mth adjustment meets the preset iteration termination condition, and obtaining the ith group of sub-target shooting parameters and the corresponding individual target loss value; wherein M is a positive integer greater than 1.
5. The method of claim 4, wherein the preset iteration termination condition comprises: the loss value is obtained when the adjustment times of the ith group of sub-initial shooting parameters reach preset times; or the loss value is obtained when the adjustment times of the ith group of sub-initial shooting parameters do not reach the preset times, and the difference value between the loss value and the preset loss threshold value is smaller than or equal to the preset difference value.
6. The method according to claim 4, wherein the parameter adjustment is performed on the ith group of sub-initial shooting parameters based on the ith group of sub-initial step sizes, and before the current step size and the current shooting parameters are obtained, the method further comprises:
and determining N groups of current optimal shooting parameters.
7. The method of claim 6, wherein the parameter adjustment of the ith group of sub-initial shooting parameters based on the ith group of sub-initial step sizes to obtain a current step size and a current shooting parameter comprises:
determining the current secondary step length corresponding to the ith group of sub-initial step length based on the ith group of sub-initial shooting parameters and preset optimization parameters;
and adjusting the ith group of sub-initial shooting parameters by adopting the current step length to obtain the current shooting parameters.
8. The method of claim 7, wherein the i-th group of sub-initial shooting parameters comprises: a first gain parameter, a second gain parameter, and an exposure parameter;
the determining the current time step length corresponding to the ith group of sub-initial step lengths based on the ith group of sub-initial shooting parameters and preset optimization parameters includes:
based on the N groups of current optimal shooting parameters, respectively weighting the full group of optimal parameters and the ith group of optimal parameters corresponding to the target parameters under the action of the preset optimal parameters, and weighting the target initial step length corresponding to the target parameters in the ith group of sub-initial step lengths to obtain the target step length corresponding to the target parameters; the target parameter is at least one of the first gain parameter, the second gain parameter and the exposure parameter;
and determining the current step length at least based on the target step length.
9. The method of claim 8, wherein the target parameter is at least one of: the first gain parameter, the second gain parameter, and the exposure parameter;
the determining the current step size based on at least the target step size includes:
determining the residual target step length corresponding to the residual parameters according to the target step length corresponding to the target parameters and the negative correlation between the first product value and the step length corresponding to the exposure parameters, thereby obtaining the current step length;
wherein the first product value is a product value between a step size corresponding to the first gain parameter and a step size corresponding to the second gain parameter.
10. The method of claim 7, wherein the i-th group of sub-initial shooting parameters comprises: a first gain parameter, a second gain parameter, and an exposure parameter;
the adjusting the ith group of sub-initial shooting parameters by adopting the current step length to obtain the current shooting parameters comprises:
adjusting the first gain parameter in the ith group of initial shooting parameters by adopting a target step length corresponding to the first gain parameter in the current step length to obtain a first adjustment gain parameter; and/or the presence of a gas in the gas,
adjusting the second gain parameter in the ith group of initial shooting parameters by adopting a target step length corresponding to the second gain parameter in the current step length to obtain a second adjustment gain parameter; and/or the presence of a gas in the gas,
adjusting the exposure parameter in the ith group of sub-initial shooting parameters by adopting the target step length corresponding to the exposure parameter in the current step length to obtain an exposure adjustment parameter;
determining the current shooting parameter based on at least one of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter.
11. The method of claim 10, wherein determining the current shot parameter based on at least one of the first adjusted gain parameter, the second adjusted gain parameter, and the exposure adjustment parameter comprises:
determining the remaining adjustment parameters of the remaining parameters according to one or two of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter, and according to a second product value which is in negative correlation with the exposure adjustment parameter, wherein the product of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter is a first preset constant, so as to determine the current shooting parameter;
wherein the second product value is a product value between the first adjusted gain parameter and the second adjusted gain parameter; the remaining adjustment parameter is a parameter other than one or two of the first adjustment gain parameter, the second adjustment gain parameter, and the exposure adjustment parameter.
12. A shooting parameter adjustment apparatus, characterized by comprising:
the acquisition module is used for acquiring jitter data of the acquisition device and initial shooting parameters in real time in the shooting process; the jitter data represents the jitter degree of the acquisition device;
the adjusting module is used for carrying out multiple iterative adjustments on the initial shooting parameters based on a preset initial step length, and obtaining a plurality of loss values obtained by calculating a plurality of adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached;
and the determining module is used for determining the minimum loss value from the loss values and determining a group of shooting parameters corresponding to the minimum loss value as the target shooting parameters.
13. An electronic device, comprising:
a memory for storing executable instructions;
a processor for implementing the method of any one of claims 1 to 11 when executing executable instructions stored in the memory.
14. An electronic device, comprising:
the acceleration sensor is used for acquiring the shaking data of the image sensor in real time in the shooting process; the shake data characterizes a degree of shake of the image sensor;
the image processor is used for acquiring initial shooting parameters from the image signal processor in real time; performing multiple iterative adjustments on the initial shooting parameters based on a preset initial step length, and obtaining multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached; determining a minimum loss value from the loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters;
the image sensor is used for shooting by adopting the target shooting parameters to obtain a shot image;
an application processor for controlling display of the captured image.
15. A computer-readable storage medium having stored thereon executable instructions for, when executed by a processor, implementing the method of any one of claims 1 to 11.
CN202110560531.6A 2021-05-21 2021-05-21 Shooting parameter adjusting method and device, electronic equipment and computer storage medium Active CN113347352B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110560531.6A CN113347352B (en) 2021-05-21 2021-05-21 Shooting parameter adjusting method and device, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110560531.6A CN113347352B (en) 2021-05-21 2021-05-21 Shooting parameter adjusting method and device, electronic equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN113347352A true CN113347352A (en) 2021-09-03
CN113347352B CN113347352B (en) 2023-10-03

Family

ID=77470770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110560531.6A Active CN113347352B (en) 2021-05-21 2021-05-21 Shooting parameter adjusting method and device, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN113347352B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114430463A (en) * 2022-04-01 2022-05-03 青岛大学附属医院 Optimization method and system for self-adaptive medical-grade image effect

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070242936A1 (en) * 2006-04-18 2007-10-18 Fujitsu Limited Image shooting device with camera shake correction function, camera shake correction method and storage medium recording pre-process program for camera shake correction process
US20130057714A1 (en) * 2010-05-21 2013-03-07 Panasonic Corporation Image pickup device, image processing device, image processing method, and image processing program
CN104219448A (en) * 2014-08-28 2014-12-17 小米科技有限责任公司 Shooting method and shooting device
CN106375676A (en) * 2016-09-20 2017-02-01 广东欧珀移动通信有限公司 Photographing control method and device of terminal equipment, and terminal equipment
WO2017054689A1 (en) * 2015-09-29 2017-04-06 宁波舜宇光电信息有限公司 Correction device for camera module optical image stabilizer system and correction method therefor
CN109361853A (en) * 2018-10-22 2019-02-19 Oppo广东移动通信有限公司 Image processing method, device, electronic equipment and storage medium
CN109671061A (en) * 2018-12-07 2019-04-23 深圳美图创新科技有限公司 A kind of image analysis method, calculates equipment and storage medium at device
CN109862253A (en) * 2018-12-06 2019-06-07 中国人民解放军陆军工程大学 A kind of digital video digital image stabilization method based on deep learning
CN110430365A (en) * 2019-08-26 2019-11-08 Oppo广东移动通信有限公司 Anti-fluttering method, device, computer equipment and storage medium
CN111357273A (en) * 2019-02-21 2020-06-30 深圳市大疆创新科技有限公司 Shooting parameter adjusting method, shooting equipment and movable platform

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070242936A1 (en) * 2006-04-18 2007-10-18 Fujitsu Limited Image shooting device with camera shake correction function, camera shake correction method and storage medium recording pre-process program for camera shake correction process
US20130057714A1 (en) * 2010-05-21 2013-03-07 Panasonic Corporation Image pickup device, image processing device, image processing method, and image processing program
CN104219448A (en) * 2014-08-28 2014-12-17 小米科技有限责任公司 Shooting method and shooting device
CN104967788A (en) * 2014-08-28 2015-10-07 小米科技有限责任公司 Shooting method and shooting device
US20160065852A1 (en) * 2014-08-28 2016-03-03 Xiaomi Inc. Method and device for photographing
WO2017054689A1 (en) * 2015-09-29 2017-04-06 宁波舜宇光电信息有限公司 Correction device for camera module optical image stabilizer system and correction method therefor
CN106375676A (en) * 2016-09-20 2017-02-01 广东欧珀移动通信有限公司 Photographing control method and device of terminal equipment, and terminal equipment
CN109361853A (en) * 2018-10-22 2019-02-19 Oppo广东移动通信有限公司 Image processing method, device, electronic equipment and storage medium
CN109862253A (en) * 2018-12-06 2019-06-07 中国人民解放军陆军工程大学 A kind of digital video digital image stabilization method based on deep learning
CN109671061A (en) * 2018-12-07 2019-04-23 深圳美图创新科技有限公司 A kind of image analysis method, calculates equipment and storage medium at device
CN111357273A (en) * 2019-02-21 2020-06-30 深圳市大疆创新科技有限公司 Shooting parameter adjusting method, shooting equipment and movable platform
CN110430365A (en) * 2019-08-26 2019-11-08 Oppo广东移动通信有限公司 Anti-fluttering method, device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114430463A (en) * 2022-04-01 2022-05-03 青岛大学附属医院 Optimization method and system for self-adaptive medical-grade image effect

Also Published As

Publication number Publication date
CN113347352B (en) 2023-10-03

Similar Documents

Publication Publication Date Title
WO2020038072A1 (en) Exposure control method and device, and electronic device
US9407831B2 (en) Intelligent auto-exposure bracketing
US7940325B2 (en) Apparatus and method of capturing images having optimized quality under night scene conditions
US10021313B1 (en) Image adjustment techniques for multiple-frame images
JP4240023B2 (en) Imaging apparatus, imaging method and imaging program, and image processing apparatus, image processing method and image processing program
CN109194882B (en) Image processing method, image processing device, electronic equipment and storage medium
JP5249077B2 (en) Imaging apparatus and image processing method
US9148561B2 (en) Image capturing apparatus, executable autoexposure bracketing and control method thereof
US8937677B2 (en) Digital photographing apparatus, method of controlling the same, and computer-readable medium
CN108616689B (en) Portrait-based high dynamic range image acquisition method, device and equipment
CN108337446B (en) High dynamic range image acquisition method, device and equipment based on double cameras
CN102946513A (en) Method, device and terminal for starting HDR (high-dynamic range) function of shooting device
JP6935272B2 (en) Devices, methods, and programs for creating high dynamic range images
JP5759190B2 (en) Imaging apparatus and control method thereof
US20110044680A1 (en) Imaging apparatus and control method therefor
CN112118388A (en) Image processing method, image processing device, computer equipment and storage medium
JP4999871B2 (en) Imaging apparatus and control method thereof
JP2018056702A (en) Image processing device, image processing method and program
CN113347352B (en) Shooting parameter adjusting method and device, electronic equipment and computer storage medium
CN110278386B (en) Image processing method, image processing device, storage medium and electronic equipment
US10972676B2 (en) Image processing method and electronic device capable of optimizing hdr image by using depth information
JP7229728B2 (en) Imaging device, its control method, and program
US8488020B2 (en) Imaging device, method for controlling the imaging device, and recording medium recording the method
US20190052803A1 (en) Image processing system, imaging apparatus, image processing apparatus, control method, and storage medium
US20130194456A1 (en) Imaging device

Legal Events

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