CN113347352B - 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
CN113347352B
CN113347352B CN202110560531.6A CN202110560531A CN113347352B CN 113347352 B CN113347352 B CN 113347352B CN 202110560531 A CN202110560531 A CN 202110560531A CN 113347352 B CN113347352 B CN 113347352B
Authority
CN
China
Prior art keywords
parameter
shooting
parameters
initial
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110560531.6A
Other languages
Chinese (zh)
Other versions
CN113347352A (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

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

Landscapes

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

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, jitter data of the acquisition device and initial shooting parameters are acquired in real time; the jitter data represents the jitter degree of the acquisition device; performing repeated iterative adjustment 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 jitter data when a preset iterative termination condition is reached; and determining the minimum loss value from the plurality of loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters. According to the application, the optimal shooting parameters corresponding to the shake data can be obtained, so that the quality of the shot image in the shake state can be improved.

Description

Shooting parameter adjusting method and device, electronic equipment and computer storage medium
Technical Field
The present application relates to image capturing technologies, and in particular, to a method and apparatus for adjusting shooting parameters, an electronic device, and a computer storage medium.
Background
In the process of shooting the mobile phone, the mobile phone parameters are important factors influencing the imaging quality, and meanwhile, as the mobile phone user is not a professional photographer, the quality of the shot picture is often influenced by external factors, such as the stability of the mobile phone held by the user, therefore, in the shooting process, the selection of the relevant imaging parameters not only needs to consider the parameters under ideal conditions, but also needs to correspondingly adjust the actual shooting level of the user so as to achieve a good imaging effect.
In this regard, there are some adjustment methods in the related art for improving the magnitude of the influence of external factors on the picture quality, however, the adjustment effect achieved by the method in the related art is limited, and the quality of the obtained picture 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 optimal shooting parameters corresponding to shake data, so that the quality of a shot image in a shake 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, jitter data of the acquisition device and initial shooting parameters are acquired in real time; the jitter data represents the jitter degree of the acquisition device; performing repeated iterative adjustment 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 iterative termination condition is reached; and determining a minimum loss value from the plurality of loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters.
An embodiment of the present application provides a photographing parameter adjusting apparatus, including: the acquisition module is used for acquiring shake 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 repeated iterative adjustment 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 iterative termination condition is reached; and the determining module is used for determining the minimum loss value from the plurality of loss values and determining a group of shooting parameters corresponding to the minimum loss value as 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 adjustment method provided by the embodiment of the application when executing the executable instructions stored in the memory.
An embodiment of the present application provides an electronic device, including:
the acceleration sensor is used for acquiring shake data of the image sensor in real time in the shooting process; the dithering data characterizes the dithering degree of the image sensor;
The image processor is used for acquiring initial shooting parameters from the image signal processor in real time; performing repeated iterative adjustment 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 iterative termination condition is reached; determining a minimum loss value from the plurality of 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 shooting image.
The embodiment of the application provides a computer readable storage medium which stores executable instructions for realizing the shooting parameter adjustment method provided by the embodiment of the application when being executed by a processor.
The embodiment of the application has the following beneficial effects: in the actual shooting process, jitter data of an acquisition device are acquired in real time, initial shooting parameters are acquired in real time, iteration adjustment is carried out on the acquired initial shooting parameters for a plurality of times according to a preset initial step length, and when a preset iteration termination condition is reached, a plurality of loss values obtained by calculating a plurality of adjusted shooting parameters and the jitter data are obtained; determining a minimum loss value from the plurality of 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 dithering data, so that the influence of dithering 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 the dithering state can be improved when the image is acquired.
Drawings
FIGS. 1, 2A and 2B are schematic diagrams illustrating effects of different exp_time on acquired images according to embodiments of the present application;
FIGS. 3A-3I are schematic diagrams illustrating the effects of different exp_time, again, and Dgain parameters on imaging quality, according to embodiments of the present application;
FIG. 3J is an enlarged detailed schematic of FIG. 3D provided by an embodiment of the present application;
FIG. 3K is an enlarged detailed schematic of FIG. 3I provided by an embodiment of the present application;
fig. 4 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment of the present application;
fig. 5 is a schematic flow chart of an alternative method for adjusting shooting parameters according to an embodiment of the present application
Fig. 6 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment of the present application;
fig. 7 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment of the present application;
FIG. 8A is a graph illustrating exemplary picture quality versus jitter levels provided by embodiments 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 diagram illustrating the relationship between an exemplary acquisition device and the degree of jitter, exp_time, and the magnitude of the decrease in picture quality provided by an embodiment of the present application;
Fig. 9 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment of the present application;
fig. 10 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment of the present application;
FIG. 11 is a schematic diagram of an alternative configuration of a device for adjusting shooting parameters according to an embodiment of the present application;
FIG. 12 is a schematic diagram of an alternative configuration of an electronic device according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
The present application will be further described in detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present application more apparent, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the 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 to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In the following description, the terms "first", "second", "third" and the like are merely used to distinguish similar objects and do not represent a specific ordering of the objects, it being understood that the "first", "second", "third" may be interchanged with a specific order or sequence, as permitted, to enable embodiments of the application described herein to be practiced otherwise than as illustrated 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 application only and is not intended to be limiting of the application.
Before describing embodiments of the present application in further detail, the terms and terminology involved in the embodiments of the present application will be described, and the terms and terminology involved in the embodiments of the present application will be used in the following explanation.
1) Logic gain: again for short;
2) Digital gain: english is called as Digital Gain, which is abbreviated as Dgain;
3) Exposure time: the english term "time of exposure", abbreviated as exp_time, is the time required for opening the shutter in order to project light onto the photosensitive surface of the photographic material. Depending on the sensitivity of the photographic light-sensitive material and the illuminance on the light-sensitive surface. The light entering the device is more when the exposure time is long, and the device is suitable for the condition of relatively poor light; the short exposure time is suitable for the condition of better light.
4) Sensitivity of: english is called International Standardization Organization, ISO for short; is an international unified index for measuring the film photosensitive speed standard used by the traditional camera, and reflects the speed of the film when the film is photosensitive;
5) The Charge coupling element is called Charge-coupled Device (CCD) for short, and is a detection element for transmitting signals in a coupling mode by using the Charge quantity to represent the signal size;
6) Complementary metal oxide semiconductor: english full name Complementary Metal Oxide Semiconductor, CMOS for short, refers to a technology for manufacturing large scale integrated circuit chip or chip manufactured by the technology, and is a readable and writable RAM chip on a computer motherboard;
7) An image processor: english is called Pre-Image Signal Processor, pre-Isp for short, and mainly aims at digital data (Raw data) transmitted after ADC conversion to perform image dead pixel repair, white balance, gamma correction, sharpness, color interpolation and the like;
8) An image signal processor: english is called Image Signal Processor, ISP for short, and is generally used for processing output data of Image Sensor, such as AEC (automatic exposure control), AGC (automatic gain control), AWB (automatic white balance), color correction, lens Shading, gamma correction, and defective pixel removal.
9) The application processor: english is called Application Processor, AP for short; the operating system, user interface and application programs are all executing on the AP;
10 Automatic exposure: english is called Automatic Exposure, AE for short; 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, AF for short; the principle of object light reflection is utilized, 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 perform focusing, so that the automatic focusing is called;
12 Automatic white balance): english is called Automatic white balance, AWB; the images shot in the room of the fluorescent lamp can appear green, the scenery shot under the light of the indoor tungsten filament can be yellow, the photos shot at the sun shadow place can be blue everywhere, the reason is that the white balance is set, and the effect of the white balance is to recover the normal color of the images under the scenes;
13 Mobile industry processor interface): the English is called Mobile Industry Processor Interface, MIPI for short, is a alliance established by ARM, nokia, ST, TI and other companies 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 the design of the mobile phone is reduced and the design flexibility is improved. Different workgroups are arranged under the MIPI alliance, and a series of mobile phone internal interface standards, such as a camera interface CSI, a display interface DSI, a radio frequency interface DigRF and the like, are respectively defined;
14 I2C): english is called Inter-Integrated Circuit;
15 3A algorithm: autofocus (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 shooting object, and compensate the chromatic aberration of a picture under different light rays, thereby presenting the image information with higher image quality.
Many video borescopes and camera accessories on the market today, gain and sensitivity (ISO) settings are seen in the camera menu, and adjusting these individual settings gives immediate results, both controls being essentially adjusting the brightness of the picture. That is, they will lighten the obtained image under conditions that are not normally allowed, for example, when the light is insufficient. 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 the gain and ISO become very useful in performing a valid inspection. Gain is the electronic amplification of the video signal. This means that the signal will be electronically enhanced to add more voltage to the pixels on the imager (CCD or CMOS) so that they amplify the intensity, ultimately brightening the image. In general, when a video or image is taken with a large amount of gain, more particles or noise are created in the video or image file, which means less image detail. In view of these factors, it is sufficient to ensure that the operation to be performed when the touch gain is on and off is fully known. In an actual scene, if the scene is dark, the general photographing is performed as follows:
1. If possible, the aperture is opened (which would allow more light to enter the camera);
2. if possible, the shutter speed is reduced (which increases the amount of light reaching the sensor);
3. adding another light source;
ISO and gain can improve the quality of an image by allowing the brightness of the image to be increased using ISO or gain or all digitally.
In the process of shooting the mobile phone, exp_time, again and Dgain parameters are important factors influencing imaging quality, and meanwhile, as a mobile phone user is often not a professional photographer, the quality of a shot picture is often influenced by external factors, such as the stability of the mobile phone held by the user, in the process of shooting, the selection of relevant imaging parameters not only needs to consider parameters under ideal conditions, but also needs to correspondingly adjust the actual shooting level of the user so as to achieve the optimal imaging effect.
By way of example, fig. 1 shows the effect of different exp_times on the acquired images, and as shown in fig. 1, when capturing one windmill, the three shutter speeds are respectively high-speed, medium-speed and low-speed shutters from left to right, and the acquired image effects at these three shutter speeds obviously vary greatly in the quality of the acquired images at different exp_times. By way of example, fig. 2A and 2B also show the effect of different exp_time on the acquired image, wherein the shutter speed in fig. 2A is 1/200s and the shutter speed in fig. 2B is 1/50s, and it can be seen that when the exposure time is long, the phenomenon of blurring of the object in the acquired image exists. For the influence of exp_time, again and Dgain parameters on imaging quality, it can be known from the following FIGS. 3A-3I, where FIGS. 3A-3I are image effects of shooting the same object under different exp_time, again and Dgain parameters, and are acquired by using a main camera sensor of a mobile phone of a certain model; the parameters corresponding to fig. 3A are: exp_time (ms) 43.8, again100, dgain100; the parameters corresponding to fig. 3B are: exp_time (ms) 21.9, again200, dgain100; the parameters corresponding to fig. 3C are: exp_time (ms) 10.95, again400, dgain100; the parameters corresponding to fig. 3D are: exp_time (ms) 5.475, again800, dgain100; the parameters corresponding to fig. 3E are: exp_time (ms) 3.737, again1600, dgain100; the parameters corresponding to fig. 3F are: exp_time (ms) 1.36, again3300, dgain100; the parameters corresponding to fig. 3G are: exp_time (ms) 0.68, again6400, dgain100; the parameters corresponding to fig. 3H are: exp_time (ms) 0.34, again6400, dgain300; the parameters corresponding to fig. 3I are: exp_time (ms) 0.17, again6400, dgain400; fig. 3J is an enlarged detail view of fig. 3D, and fig. 3K is an enlarged detail view of fig. 3I. As can be seen from fig. 3A to 3K, the quality of the photographed image is not the same in the case where exp_time, again, and Dgain are different, while other factors (e.g., white balance, focus, overall brightness, etc. are the same) are maintained, wherein it is apparent from the different granularity of the images in fig. 3J and 3K.
In addition, when the handheld device of the user is unstable, the phenomenon that the shot object in the acquired image is blurred also occurs, and in this case, the phenomenon that the picture is unstable due to the unstable handheld device is not expected by the user, and often occurs on children, the elderly and the small white body of photography. However, the existing 3A algorithm at the mobile phone end often takes the shortage into consideration, and more consideration is given to the situation of the whole picture in the settings of exp_time, again and Dgain of imaging, and too little consideration is given to the influence caused by the shake of the mobile phone. In this case, although the shot image has a smaller granular feel and is purer, the shake of the mobile phone can cause problems of blurring of the shot image main body, ghosting and the like, and conversely, the overall quality of the shot image is reduced, so that the effect is poor. In this regard, some related art methods 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 underexposure of the picture, and may not balance the photographing brightness and the quality of the image, so that the achieved adjustment effect is poor.
In general, the method in the related art cannot improve the quality of an image photographed in a camera shake state on the premise of improving photographing brightness, resulting in lower quality of an image photographed in a shake state by a camera.
The embodiment of the application provides a shooting parameter adjusting method and device, an electronic device and a computer readable storage medium, which can obtain an optimal shooting parameter corresponding to shaking data, so that the quality of an image acquired in a shaking state can be improved.
The shooting parameter adjustment method provided by the embodiment of the application will be described in detail below.
Referring to fig. 4, fig. 4 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment of the present application, and will be described with reference to the steps shown in fig. 4.
S101, in the shooting process, jitter data of an acquisition device and initial shooting parameters are acquired in real time; the jitter data characterizes the jitter degree of the acquisition device.
In the embodiment of the application, in the process of image shooting by the self acquisition device, the terminal can acquire shake data representing the shake degree of the acquisition device in real time through the self acceleration sensor, and the terminal also acquires initial shooting parameters stored by the terminal so as to determine whether to adjust the initial shooting parameters or not through the acquired shake data, and when the initial shooting parameters are determined to be adjusted according to the acquired shake data, the terminal adjusts the initial shooting parameters by adopting a subsequent method based on the acquired shake data and other data.
In an embodiment of the present application, the initial photographing 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 the second gain parameter is the other one of Again and Dgain, respectively; the exposure parameter may then be exp_time.
In some embodiments of the present application, the initial photographing parameters may be calculated by a 3A algorithm. In other embodiments of the present application, the initial photographing parameters may be obtained in other manners.
In an embodiment of the present application, the capturing device may be a camera of the terminal, for capturing an image.
S102, performing repeated iterative adjustment on 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 jitter data when a preset iterative 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 genetic algorithm, a differential evolution algorithm and other preset algorithms can be adopted, the acquired initial shooting parameters are adjusted according to the preset initial step length and the constraint relation among the shooting parameters, the shake degree and the picture quality, and the adjusted shooting parameters and shake data are calculated, so that when the preset iteration termination condition is reached, the adjustment of the initial shooting parameters is stopped, a plurality of groups of adjusted shooting parameters can be obtained, and a plurality of loss values corresponding to the groups of adjusted shooting parameters are obtained. In the embodiment of the present application, the (n+1) th adjustment of the photographing parameter is performed based on the (n) th adjustment of the photographing parameter; and calculating a plurality of adjusted photographing parameters and shake data to obtain a plurality of loss values, the shake data being identical.
In some embodiments of the present application, the constraint relationship between the shooting parameters, the shake degree, and the picture quality may be expressed as a function. For convenience of description, a constraint relationship between a photographing parameter, a shake degree, and a picture quality will be expressed below using a picture loss function. The picture loss function is as follows:
loss_function=D(Again,Dgain)+q*sum(a x ,a y ,a z ,Exp_time) (1)
wherein q is a preset weight value, a x ,a y ,a z Shake data of the acquisition device in the x, y and z directions are correspondingly represented, and 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 ,a y ,a z exp_time) represents a constraint relationship between the degree of dithering, picture quality, and exp_time. In the embodiment of the application, the target shooting parameters are a group 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 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, determining the minimum loss value from the plurality of loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters.
In the embodiment of the present application, after the terminal obtains a plurality of loss values corresponding to a plurality of groups of adjusted shooting parameters, the plurality of losses may be ranked according to the magnitude of the values, so as to determine a minimum loss value therein, and a group of shooting parameters corresponding to the minimum loss is determined as a target shooting parameter.
In the embodiment of the application, shake data of an acquisition device are acquired in real time in the actual shooting process, initial shooting parameters are acquired in real time, the acquired initial shooting parameters are subjected to repeated iterative adjustment according to a preset initial step length, a plurality of loss values obtained by calculating a plurality of adjusted shooting parameters and shake data are obtained when a preset iterative termination condition is reached, a minimum loss value is determined from the plurality of loss values, and a group of shooting parameters corresponding to the minimum loss value is determined as a target shooting parameter. Since the corresponding image has the highest picture quality when the loss value corresponding to the picture loss function is the smallest, the obtained target shooting parameter is also the best, so that the optimal shooting parameter corresponding to the real-time jitter data can be obtained, the influence of the jitter on the picture quality of the image to be acquired subsequently can be reduced by changing the initial shooting parameter, and the quality of the image shot in the jitter state can be improved when the image acquisition is performed.
In some embodiments of the present application, after S103 of fig. 4, S104 may also be performed:
s104, shooting by adopting target shooting parameters to obtain a shooting 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 under the action of the target shooting parameters, the image is shot through the acquisition device, so that the high-quality image is obtained.
In the embodiment of the application, the preset shooting parameters are adjusted according to the jitter degree obtained in real time, the preset step length and the function for restraining the relation among the picture quality, the jitter degree and the shooting parameters in the process of shooting the image, so that the target parameters are finally obtained; therefore, an optimal photographing parameter corresponding to the real-time shaking data can be obtained to reduce the influence of shaking on the picture quality of an image to be acquired by changing the initial photographing parameter, thereby improving the quality of the photographed image in a shaking state.
In some embodiments of the present application, fig. 5 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment of the present application, S001-S003 may be performed before S101 in fig. 4, and S101 may be implemented through S1011-S1012, which will be described in connection with the steps shown in fig. 5.
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 jitter degree is greater 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 present application, when the acquisition function of the acquisition device is started, the terminal may obtain a plurality of frames of continuous preview images through the acquisition device, determine a current jitter degree of the acquisition device according to the obtained plurality of frames of continuous preview images, and when the determined jitter degree is greater than or equal to a preset degree, the terminal starts its own acceleration sensor, and controls the acceleration sensor to operate at a first detection frequency, so as to detect the jitter degree of the acquisition device of the terminal in real time.
It will be appreciated that the first detection frequency is a higher frequency, so that the detected jitter level of the acquisition device may be 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 grading of the grade information herein. By way of example, the degree of jitter may represent any of the several levels of higher, high, medium, general, and low, or may also represent any of the several levels of high, medium, and low; correspondingly, the preset degree can be "high" or "medium", etc.
S003, when the determined real-time jitter degree is smaller than a 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, when the terminal determines that the jitter degree is less than the preset degree, the terminal may turn on its own acceleration sensor and control the acceleration sensor to operate 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 smaller than the preset degree, the influence on the quality of the photographed image is smaller or hardly influenced, and because the second detection frequency is a lower frequency, when the terminal determines that the shake degree is smaller than the preset degree, the terminal starts the acceleration sensor of the terminal, but controls the acceleration sensor to work at a lower detection frequency, so that the power consumption of the terminal can be reduced without influencing the quality of the photographed image.
In the embodiment of the application, the terminal comprises an image processor, and the terminal can control the starting of the acceleration sensor and the detection frequency of the acceleration sensor through the image processor.
In the embodiment of the present application, the preset degree may be preset according to actual needs, which is not limited in the embodiment of the present application.
S1011, acquiring initial shooting parameters of the acquisition device in the shooting process, and acquiring discrete shaking amount of the acquisition device in real time through an acceleration sensor.
S1012, performing differential processing on the discrete jitter amount to obtain jitter data.
When the terminal starts the acceleration sensor, the terminal can acquire the discrete acceleration components of the acquisition device in the x, y and z directions in real time through the acceleration sensor, and because the sensor acquires the discrete components, the terminal needs to perform differential processing on the discrete components, so as to acquire the original data of the jitter degree, namely jitter data (a) x ,a y ,a z )。
In other embodiments of the present application, fig. 6 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment 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 in connection with the steps shown in fig. 6.
S1013, acquiring real-time shake data of the acquisition device and real-time initial shooting parameters through the acceleration sensor in the shooting process.
In the embodiment of the application, the terminal can start the acceleration sensor of the terminal when starting the acquisition device, and acquire real-time jitter data of the acquisition device in real time through the acceleration sensor.
S1021, when the jitter data is larger than or equal to the jitter threshold value, performing repeated iterative adjustment 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 iterative termination condition is reached.
In the embodiment of the application, the terminal can compare the jitter data obtained in real time with the preset jitter threshold, and perform repeated iterative adjustment on the initial shooting parameters obtained in real time based on the preset initial step length when the jitter data is larger than or equal to the jitter threshold, and obtain a plurality of loss values obtained by calculating a plurality of adjusted shooting parameters and the jitter data when the preset iterative termination condition is reached; thus, unnecessary adjustment of shooting parameters can be avoided, and thus the computing resources of the terminal itself can be saved.
In the embodiment of the present application, the jitter threshold is preset according to actual needs, which is not limited in the embodiment of the present application.
In some embodiments of the present application, fig. 7 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment of the present application, S201 to S203 may also be performed before S102 in fig. 4, and S102 in fig. 4 may also be implemented through S1022, which will be described in connection with 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; the picture quality is inversely related to the jitter level, and the picture quality is inversely related to the exposure parameter.
Here, the negative correlation between the picture quality of the image and the degree of shake, i.e., the greater the degree of shake, the worse the picture quality of the acquired image, as shown in fig. 8A; the positive correlation between the picture blur degree of the image and the exp_time is shown in fig. 8B, that is, the negative correlation is also shown between the picture quality of the image and the exp_time, and the longer the exp_time is, the worse the picture quality of the acquired image, whereby the acquisition apparatus can be regarded as a function, the input amount is a jitter degree and an exp_time, and the output amount is a picture quality degradation degree (picture loss degree), as shown in fig. 8C. Therefore, the first priori knowledge may be obtained in advance in the following manner: acquiring acceleration components of the acquisition device in x, y and z directions at each different moment under a plurality of different exp_times of the acquisition device in advance, and acquiring images shot under the exposure parameters at the same time to obtain x, y and z at each moment of the acquisition device in a plurality of different moments corresponding to each preset exp_time, Acceleration components in y and z directions to obtain a plurality of first images; then, acceleration components in x, y, and z directions at each time are subjected to differential processing, and shake data (a x ,a y ,a z ) The method comprises the steps of carrying out a first treatment on the surface of the Finally, jitter data (a) of each moment is obtained in a plurality of different moments corresponding to each preset exp_time x ,a y ,a z ) The method comprises the steps of carrying out a first treatment on the surface of the Meanwhile, under a plurality of different preset exp_time of the acquisition device, acquiring images again when the acquisition device is static, so as to obtain a plurality of standard images altogether; finally, jitter data (a) at each moment is obtained under different preset exp_time x ,a y ,a z ) And a plurality of first images and a plurality of standard images, thereby obtaining a first priori knowledge.
In the case of obtaining the first priori knowledge, the first priori knowledge may be stored in the terminal, so that the terminal may calculate the pixel difference between a first picture and a standard picture with the same preset exp_time according to the stored image, and sum the squares of the pixel difference to obtain a plurality of sums of squares, and use the plurality of sums of squares as a plurality of obtained picture quality degradation amplitudes, and further, according to the plurality of picture quality degradation amplitudes, and the stored jitter data (a x ,a y ,a z ) The first constraint relation among the jitter degree, the exposure time and the picture quality is obtained through analysis, and the first constraint relation is shown as a formula (2):
sum(a x ,a y ,a z ,Exp_time) (2)。
s202, obtaining a second constraint relation between picture quality and gain parameters according to second priori knowledge; the picture quality is inversely related to the gain parameter.
In some embodiments of the application, the second prior knowledge comprises: multiple prior images corresponding to multiple groups of different gain parameters; in the step S202, the convolution of the edge detection operators of each pixel point in the horizontal direction and the vertical direction in each prior image may be determined by the edge detection operators, 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; finally, according to the definition of each prior image and a plurality of groups of different gain parameters, a second constraint relation between the picture quality and the gain parameters is obtained.
Here, regarding Again, dgain, and picture quality, when Again and Dgain are increased, although brightness of a picture can be improved, granularity of the picture is increased, and picture quality is lowered, so that picture quality is inversely related to Again and Dgain. Thus, the second prior knowledge may be obtained in advance in the following manner: under the condition that the exposure time of the terminal is constant, a plurality of groups of different Again and Dgain are adopted to respectively shoot a plurality of second images, a plurality of groups of different Again and Dgain are obtained, and a plurality of corresponding second images (the priori images) are obtained, so that second priori knowledge is obtained.
In the case 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 sharpness D (f) of each stored second image, and according to the stored multiple sets of Again and Dgain, and the multiple sharpness D (f) (i.e., the picture quality) that are correspondingly calculated, thereby obtaining a second constraint relationship between Again, dgain and picture quality:
D(Again,Dgain) (3)
in some embodiments of the present application, the terminal may determine the convolution value G of the edge detection operator of each pixel point (x, y) in the horizontal direction in each prior image by using the edge detection operator of the following formula (4) x (x, y), and the convolution value G of the edge detection operator in the vertical direction y (x, y) and then, by the formulaAnd finally, according to the definition of all the pixel points in each prior image, obtaining the picture definition of each prior image, wherein the picture definition is shown in the following formula (5):
D(f)=∑ yx |G(x,y)| (5)
s203, determining a constraint relation among shooting parameters, jitter degree and picture quality based on the first constraint relation and the second constraint relation.
In the embodiment of the present application, after obtaining the above formula (2) and the above formula (3), the terminal may determine a function for measuring the loss degree of the picture according to the above formula (2), the above formula (3), and a preset weight value, that is, the above formula (1):
loss_function=D(Again,Dgain)+q×sum(a x ,a y ,a z ,Exp_time) (1)
In an embodiment of the application, a when the acquisition device is not shaking x ,a y ,a z The values of (2) are 0, and Again, dgain and exp_time are all preset initial shooting parameters; a when the acquisition device shakes x ,a y ,a z Is jitter data obtained by performing differential calculation on component values in the x, y, and z directions obtained from the acceleration sensor.
S1022, performing repeated iterative adjustment 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 jitter data according to a constraint relation among the shooting parameters, the jitter degree and the picture quality when a preset iterative termination condition is reached.
In the embodiment of the present application, after determining the picture loss function, the terminal may substitute the previously obtained shake data and each obtained set of adjusted shooting parameters into the picture loss function to perform calculation of the loss value, and when reaching the preset iteration termination condition, may correspondingly obtain a plurality of loss values corresponding to a plurality of sets of adjusted shooting parameters.
It should be noted that S201 to S203 may be performed before S101 or may be performed simultaneously with S101, which is not limited in the 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, performing repeated iterative adjustment on the ith sub-initial shooting parameter by adopting the ith sub-initial step length, calculating the adjusted ith sub-shooting parameter and jitter data, and obtaining the ith sub-target shooting parameter and a corresponding individual target loss value when a preset iteration termination condition is reached, thereby obtaining 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 comprises the following steps: n groups of sub-initial step sizes, wherein initial shooting parameters comprise: n groups of sub-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 sub shooting parameters of the ith group; the plurality of loss values includes: n individual target loss values; wherein N is greater than or equal to 1; i is an integer from 1 to N.
S302, determining the minimum individual target loss value from N individual target loss values, and determining a group of sub-shooting parameters corresponding to the minimum individual target loss value from N groups of sub-target shooting parameters as target shooting parameters.
In S301, the initial step size includes: n groups of sub-initial step sizes, wherein initial shooting parameters comprise: n groups of sub-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 sub shooting parameters of the ith group; the plurality of loss values includes: n individual target loss values. It can be understood that the terminal may perform iterative adjustment on N sets of sub-initial shooting parameters corresponding to N sets of sub-initial shooting parameters for multiple times, and for each set of sub-initial shooting parameters, after each iterative adjustment, a set of adjusted shooting parameters is obtained, and the terminal substitutes the obtained set of adjusted shooting parameters and shake data obtained through the acceleration sensor into the picture loss function to perform loss calculation, so as to obtain a corresponding loss value, determine whether the loss value meets a preset iteration termination condition, and when the loss value meets the preset iteration termination condition, obtain an individual target loss value corresponding to the set of sub-initial shooting parameters, and determine that the adjusted shooting parameter corresponding to the individual target loss value is the sub-target shooting parameter of the set. It should be noted that, since the N sets 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 the iterative adjustment, N individual target loss values corresponding to the N sets of sub-initial shooting parameters one by one and N sets of sub-target shooting parameters corresponding to the N individual target loss values one by one can be obtained finally. For example, when there are five sets of sub-initial shooting parameters numbered A, B, C, D and E, respectively, after the terminal stops iterating, five individual target loss values a, B, C, D and E corresponding to the five sets of sub-initial shooting parameters A, B, C, D and E, respectively, are finally obtained, five sets of sub-target shooting parameters A1, B1, C1, D1 and E1 corresponding to the five individual target loss values a, B, C, D and E, respectively, wherein the sub-target shooting parameter numbered A1 corresponds to the sub-initial shooting parameter numbered a and the individual target loss value numbered a, the sub-target shooting parameter numbered B1 corresponds to the sub-initial shooting parameter numbered B and the individual target loss value numbered B, respectively, the sub-target shooting parameter numbered C1 corresponds to the sub-initial shooting parameter numbered C and the individual target loss value numbered C, the sub-target shooting parameter numbered D1 corresponds to the sub-initial shooting parameter numbered D and the individual target loss value numbered D, respectively, and the sub-target shooting parameter numbered E1 corresponds to the sub-initial shooting parameter numbered E and the individual loss value numbered E.
In S302, after the terminal stops the iterative adjustment, N individual target loss values corresponding to N groups of sub-initial shooting parameters one by one are finally obtained, and N groups of sub-target shooting parameters corresponding to N individual target loss values one by one are obtained; therefore, the terminal may select a minimum individual target loss value from the N individual target loss values as a full set of target loss values, and determine a set of sub-target photographing parameters corresponding to the full set of target loss values as target photographing parameters to perform subsequent image photographing using the target photographing parameters.
In some embodiments, the terminal may first generate a set of initial shooting parameters by using a 3A algorithm, and then perform N transforms on the set of initial shooting parameters, so as to obtain N sets of different sub-initial shooting parameters according to the set of initial parameters; in other embodiments, the terminal may also directly generate N sets of sub-initial shooting parameters by using a 3A algorithm, which is not limited in the embodiments of the present application.
In some embodiments of the present application, fig. 9 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment of the present application, where S301 may be implemented through S3011-S3013, and will be described below with reference to fig. 9.
S3011, based on the ith sub-initial step length, carrying out parameter adjustment on the ith sub-initial shooting parameters to obtain the current step length and the current shooting parameters.
In some embodiments, the terminal may determine N sets of current sub-optimal shooting parameters before performing parameter adjustment on the i-th set of sub-initial shooting parameters based on the i-th set of sub-initial step sizes to obtain the current sub-step size and the current sub-shooting parameters.
Here, the terminal does not adjust the sub-initial photographing parameters before the parameter adjustment is started on the i-th sub-initial photographing parameters, so that the adjusted photographing parameters do not exist, and therefore, before the terminal adjusts the i-th sub-initial photographing parameters for the first time based on the i-th sub-initial step length, the terminal can take the i-th sub-initial step length as the current sub-optimal photographing parameters of the i-th set for the first time, and since the N-th sub-initial photographing parameters are simultaneously and iteratively adjusted, for the N-th sub-initial photographing parameters, N-th current sub-optimal photographing parameters corresponding to the N-th sub-initial photographing parameters one by one can be determined.
In some embodiments of the present application, fig. 10 is a schematic flowchart of an alternative method for adjusting shooting parameters according to an embodiment of the present application, where S3011 may be implemented through S401 to S402, and will be described below with reference to fig. 10.
S401, determining the current step length corresponding to the ith sub-initial step length based on the ith sub-initial shooting parameter and a preset optimization parameter.
S402, adjusting the ith sub-initial shooting parameter by adopting the current step length to obtain the current shooting parameter.
In some embodiments of the present application, S401 may be implemented by: based on the current sub-full group of optimal shooting parameters in the N groups of current sub-optimal shooting parameters and the i group of current sub-optimal shooting parameters, respectively carrying out difference processing with the i group of sub-initial shooting parameters; and under the action of preset optimization parameters, weighting is carried out with the ith group of sub-initial step length to obtain the current sub-step length. Specifically, the method can be divided into the following two steps:
s11, weighting a target initial step length corresponding to the target parameter in the ith sub-initial step length under the action of a preset optimization parameter based on the full-set optimal parameter and the ith optimal parameter corresponding to the target parameter in the N groups of current sub-optimal shooting parameters respectively to obtain a target step length corresponding to the target parameter; the target parameter is at least one of a first gain parameter, a second gain parameter and an exposure parameter;
s12, determining the current step length at least based on the target step length.
In S11, when the N sets of the first sub-optimal shooting parameters corresponding to the N sets of the sub-initial shooting parameters one by one are obtained, if each set of the sub-initial shooting parameters includes the first gain parameter, the second gain parameter, and the exposure parameter, then for each set of the sub-initial shooting parameters, one set of the current sub-optimal shooting parameters is composed of one set of the optimal first gain parameter, one set of the optimal second gain parameter, and one set of the optimal exposure parameter. For example, for the A-th sub-initial shooting parameters, a current sub-optimal shooting parameter set corresponding to the A-th sub-initial shooting parameters is defined by an A-th optimal first gain parameter z 1 An A-th group optimal second gain parameter z 2 And an A-th group optimum exposure parameter z 3 Composition is prepared. When the terminal obtains N groups of current sub-optimal shooting parameters for the first time, the terminal can substitute the N groups of current sub-optimal shooting parameters and the acquired jitter data into the picture lossIn the function, calculating the loss values so as to correspondingly obtain N loss values, after N loss values which are in one-to-one correspondence with N groups of sub-initial shooting parameters are obtained, determining the smallest one of the N loss values by the terminal, taking the smallest one as the current sub-full-group optimal target loss value, and taking a group of sub-initial shooting parameters which are corresponding to the current sub-full-group optimal target loss value as the current sub-full-group optimal shooting parameters; in case each set of sub-initial photographing parameters comprises a first gain parameter, a second gain parameter and an exposure parameter, then for each set of sub-initial photographing parameters, a set of current full-set optimal photographing parameters consists of a full-set optimal first gain parameter, a full-set optimal second gain parameter and a full-set optimal photographing parameter. For example, continuing to take A, B, C, D and E sub-initial shooting parameters as an example, the A, B, C, D and E sub-initial shooting parameters correspond to a current sub-full set of optimal shooting parameters, which are defined by a full set of optimal first gain parameters z' 1 A full set of optimal second gain parameters z' 2 And a complete set of optimal exposure parameters z' 3 Composition is prepared.
When the target parameter is the first gain parameter, after the first iterative adjustment, the full-set optimal parameter corresponding to the target parameter is the full-set optimal first gain parameter in the current full-set optimal shooting parameter corresponding to the first time, and the i-th optimal parameter corresponding to the target parameter is the i-th optimal first gain parameter in the current sub-optimal shooting parameter corresponding to the first time; and when the target parameter is the second gain parameter and the exposure parameter, the same is 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);
v iDj =w×v iD0 +c 1 r 1 (p iD -x iD0 )+c 2 r 2 (p gD -x iD0 ) (6)
w、c 1 、c 2 、r 1 、r 2 is a preset optimization parameter, wherein w is a weight value, and c 1 、c 2 For learning factors or preset acceleration constants (acceleration constant), r 1 And r 2 Is [0,1 ]]Random numbers within a range; v idj A target step size, j, which is a target parameter, represents the number of iterative adjustments, where j=1 due to the first iterative adjustment; v iD0 Target initial step size, P, which is target parameter iD The i-th set of optimal parameters, P, being target parameters gD Is the full set of optimal parameters for the target parameters; x is x iD0 Sub-initial shooting parameters representing target parameters.
In S12, the terminal may determine a remaining target step corresponding to the remaining parameter according to the target step corresponding to the target parameter and the negative correlation between the first product value and the step corresponding to the exposure parameter, so as to obtain a current sub-step; 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 a first gain parameter of 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 parameters are exposure parameters, which are only exemplary illustrations herein and are not limiting of the target parameter and the remaining parameters.
In the embodiment of the present application, the first product value is inversely related to the step size corresponding to the exposure parameter, which can be understood as that the adjustment of the exposure parameter is a negative adjustment for reducing the blurring of the picture caused by the shake, and the product of the first gain parameter and the second gain parameter is a positive adjustment for maintaining the brightness of the picture, and the product of the step size corresponding to the first gain parameter and the step size corresponding to the second gain parameter is a second preset constant data1. That is, for the sub-initial photographing parameters of the exposure parameters, the reduced exposure parameters may be obtained at each iterative adjustment by the target step length of the exposure parameters, and for the sub-initial photographing parameters of the first gain parameters and the second gain parameters, the increased first gain parameters and the increased second gain parameters may be obtained at each iterative adjustment by the target step length of the first gain parameters and the second gain parameters; of course, for the sub-initial shooting parameters of the exposure parameters, there may be shooting parameters that are increased when the magnitude of a certain decrease is too large, and the shooting parameters are obtained in the next several iterative adjustments; and, for the sub-initial photographing parameters of the first gain parameter and the second gain parameter, there may be a case where after a certain increase is excessive, the reduced first gain parameter and second gain parameter are obtained at the time of the latter several iterative adjustments.
It should be noted that, data1 may be determined according to actual needs, or may be calculated by a 3A algorithm.
In some embodiments of the present application, when the target parameter is a shooting parameter, for example, a first gain parameter, since a first target step size of the first gain parameter has been obtained according to the above S12, and a product value (the above first product value) between a step size corresponding to the first gain parameter and a step size corresponding to the second gain parameter, and a product between a step size corresponding to the exposure parameter is data1, a product value of a target step size corresponding to the first second gain parameter and a target step size corresponding to the exposure parameter can be obtained according to the data1 and the first target step size of the first gain parameter, and a product value of a target step size corresponding to the second gain parameter and a target step size corresponding to the exposure parameter can be obtained respectively, thereby determining a current sub-step size of the ith sub-initial step size. 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 in the mode, so that the calculated 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 parameters are two shooting parameters, for example, the first gain parameter and the second gain parameter, since the first target step size of the first gain parameter and the first target step size of the second gain parameter have 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, and the product value between the step size corresponding to the exposure parameter is data1, the target step size of the first exposure parameter can be directly calculated according to the data1 and the first target step size of the first gain parameter, and the first target step size of the second gain parameter, thereby implementing the determination of the current step size of the ith sub-initial step size; therefore, the target step length of the exposure parameter is not required to be calculated again by adopting the mode, so that the calculated amount of the terminal is reduced, and the calculation resource of the terminal is saved; the iterative adjustment efficiency is further 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 of the first time of the first gain parameter, the target step size of the first time of the second gain parameter, and the target step size of the first time of the exposure parameter are obtained according to S12, thereby determining the current step size of the i-th group of sub-initial step sizes. Because the target step length of each shooting parameter is obtained through iterative adjustment, the subsequent iterative adjustment of the sub-initial shooting parameters can be more accurate, thereby being beneficial to obtaining the target shooting parameters.
In some embodiments of the present application, for S402 described above, it may be implemented by the following S21-S24:
s21, adjusting a first gain parameter in the ith group of sub-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 number of the groups of groups,
s22, adjusting a second gain parameter in the ith group of sub-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 number of the groups of groups,
s23, adjusting the exposure parameters in the ith sub-initial shooting parameters by adopting a target step length corresponding to the exposure parameters in the current step length to obtain exposure adjustment parameters;
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, the following formula (7) may be adopted to adjust each parameter in the i-th group of sub-initial photographing parameters;
x iDj =x iD0 +v iDj (7) Wherein x is iDj Represents x, which represents each adjusted parameter (first adjustment gain parameter, second adjustment gain parameter, or exposure adjustment parameter) of the i-th group of sub-initial shooting parameters iD0 Representing each parameter (first gain parameter, second gain parameter, or exposure parameter) in the i-th set of sub-initial photographing parameters; v iDj The target step length of the corresponding parameter (the target step length of the first gain parameter, the target step length of the second gain parameter or the target step length of the exposure parameter) in the current step length (namely the current step length obtained after the calculation of the ith group of sub-initial step lengths for the first time); j is the iteration number, where j=1, since each parameter in the i-th set of sub-initial shooting parameters is adjusted for the first time using the current step size.
As can be seen from the above formula (7), when the i-th group of sub-initial shooting parameters are adjusted, specifically, the sum between the first gain parameter in the i-th group of sub-initial shooting parameters and the target step length of the first gain parameter is used as the first adjustment gain parameter; and/or taking the sum of the 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 sub-initial shooting parameter 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, for S402 described above, it may also be implemented by S31:
s31, determining the residual adjustment parameters of the residual parameters according to one or two of the first adjustment gain parameter, the second adjustment gain parameter and the exposure adjustment parameter, and determining the current shooting parameter according to the fact that the second product value is inversely related to 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; the residual adjustment parameters are one or two of the first adjustment gain parameters, the second adjustment gain parameters and the exposure adjustment parameters; the second product value is a product value between the first adjustment gain parameter and the second adjustment gain parameter.
In the embodiment of the application, when one shooting parameter 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 intended to limit the remaining parameters in the present application.
In an embodiment of the present application, the second product value is inversely related to 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, which may be expressed as the following formula (8):
Data=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, the product of the first adjustment gain parameter and the second adjustment gain parameter may be determined according to the exposure adjustment parameter and the first preset constant Data, and under the condition that the product between the first adjustment gain parameter and the second adjustment gain parameter is known, the first adjustment gain parameter and the second adjustment gain parameter may be obtained, so as to obtain the first adjustment gain parameter, the second adjustment gain parameter, and the exposure adjustment parameter, thereby realizing determining the current photographing parameter. Therefore, the first adjustment gain parameter and the second adjustment gain parameter do not need to be calculated again by adopting the mode, so that the calculated 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 an embodiment of the present application, the first preset constant Data may be calculated according to a 3A algorithm. For example, after real-time exp_time, again and Dgain are calculated by the 3A algorithm, the product between real-time exp_time and Again and Dgain is used as a standard constant Data.
In other embodiments, when two shooting parameters, such as the first 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 adjustment parameter is obtained through iterative adjustment, so that the obtained adjustment parameters can be more accurate, and the acquisition of the target shooting parameters is facilitated.
S3012, substituting the jitter data and the current shooting parameters 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 previous shooting parameters are obtained through the above iterative calculation, the obtained jitter data and the previous shooting parameters may be substituted into the picture loss function, that is, the above formula (1), and since the parameters are substituted into the formula (1), again, dgain, exp _time, a x 、a y 、a z Since q 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 perform the 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 the embodiment of the application, when the current loss value is calculated, the terminal determines whether the current loss value meets the preset iteration termination condition, and when the current loss value does not meet the preset iteration termination condition, continuously carries out the next parameter adjustment according to the current shooting parameter and the current step length obtained at this time to obtain the next target step length, adopts the next target step length to obtain the next shooting parameter, continuously carries out the calculation of the next loss value by adopting the next shooting parameter and the obtained jitter data, and circulates until the loss value obtained by the Mth adjustment meets the preset iteration termination condition, thereby obtaining the sub-target shooting parameters and the corresponding individual target loss values of each group.
In an embodiment of the present application, the preset iteration termination condition includes: the loss value is obtained when the adjustment times of the i-th group sub-initial shooting parameters reach the preset times; or the loss value is obtained when the adjustment times of the ith 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 the adjustment is performed, the obtained adjusted shooting parameters and the shake data obtained before are substituted into the picture loss function to perform loss value calculation, so 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 is judged; if the obtained loss value at a certain time is obtained when the adjustment times of the set of sub-initial shooting parameters reach the preset times, determining that the obtained loss value at a certain time meets the preset iteration termination condition; or if the obtained loss value 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 between the obtained loss value at a certain time and the preset loss threshold value is smaller than or equal to the preset difference, determining that the obtained loss value at a certain time meets the preset iteration termination condition; at this time, the terminal may stop the iterative adjustment of the N sets of sub-photographing parameters.
It can be understood that when the adjustment times of the shooting parameters reach the set times, adopting the last obtained N groups of shooting parameters, and correspondingly calculating one group of shooting parameters corresponding to the smallest loss value in the N loss values, wherein the group of shooting parameters corresponding to the smallest loss value is the target shooting parameter; in the iterative 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 smallest loss value in the N loss values is close to or equal to a preset loss threshold value, a group of shooting parameters corresponding to the smallest loss value in the N loss values is the target shooting parameter.
In some embodiments of the present application, the foregoing step S3013 of continuing to perform the next parameter adjustment based on the current capturing parameter and the current step may be implemented in the following manner:
s41, determining the next step corresponding to the current step of the ith group based on the current shooting parameter of the ith group and a preset optimization parameter;
s42, adjusting the current shooting parameters of the ith group by adopting the next step length to obtain the next shooting parameters.
In the embodiment of the present application, N sets of next optimal photographing parameters may be determined before S3013 described above.
In the embodiment of the present application, after iteratively adjusting the current shooting parameters of each group, 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, determines the loss value corresponding to the iterative adjustment, and determines the smallest loss value among the loss values corresponding to all the iterative adjustment before the iterative adjustment, and uses the adjusted shooting parameters corresponding to the smallest loss value as a group of next optimal shooting parameters corresponding to the group of current shooting parameters.
For the current shooting parameters of the A-th group, after iteratively adjusting the current shooting parameters of the A-th group, substituting the obtained adjusted shooting parameters and jitter data acquired in real time into a picture loss function, calculating a loss value corresponding to the iterative adjustment, determining the smallest loss value in the loss values corresponding to all previous iterative adjustments, and taking the adjusted shooting parameters obtained after the iterative adjustment corresponding to the smallest loss value as a group of next optimal shooting parameters corresponding to the current shooting parameters of the A-th group; for the current shooting parameters of the B, C, D th and E th groups, a group of next optimal shooting parameters corresponding to each other one by one can be obtained in the same way; thus, five sets of next optimal photographing parameters can be obtained. It will be appreciated that the current time may be understood as the nth time and the next time as the n+1th time, where n is an integer greater than or equal to 2 and less than or equal to a preset number of iterations.
Here, the above S41 may be implemented as: based on the full-set optimal parameters and the i-th optimal parameters corresponding to the target parameters in the N groups of next optimal shooting parameters, weighting the target step corresponding to the target parameters in the current step of the i-th optimal parameters under the action of preset optimal parameters to obtain the next target step 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; the next step size is determined based at least on the next target step size.
In some embodiments, the determining the next step based on at least the next target step 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 and the step length corresponding to the exposure parameter are in negative correlation.
Here, when N sets of next-best shooting parameters corresponding to N sets of current shooting parameters one by one are obtained, in the case where 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 current shooting parameters, one set of next-best shooting parameters is composed of one set of the optimal first gain parameters, one set of the optimal second gain parameters, and one set of the optimal exposure parameters. For example, for the current photographing parameter of the A-th group, a group of next optimal photographing parameters corresponding to the current photographing parameter of the A-th group is composed of an A-th group optimal first gain parameter z 1 An A-th group optimal second gain parameter z 2 And an A-th group optimum exposure parameter z 3 Composition is prepared. When obtaining N groups of current sub-optimal shooting parameters, the terminal can substitute the N groups of current sub-optimal shooting parameters and the acquired jitter data into a picture loss function to calculate loss values, so that N loss values are correspondingly obtained, after obtaining N loss values which are in one-to-one correspondence with the N groups of current shooting parameters, the terminal can determine the smallest loss value in the N loss values, take the smallest loss value as the next full-set optimal target loss value, and take a group of next shooting parameters which are corresponding to the next full-set optimal target loss value as the next full-set optimal shooting parameters; in case each set of sub-initial shooting parameters comprises a first gain parameter, a second gain parameter and an exposure parameter, then for each set of current shooting parameters, a next set of full-set optimal shooting parameters consists of one full-set optimal first gain parameter, one full-set optimal second gain parameter and one full-set optimal shooting parameter. For example, continue toA, B, C, D and E groups of sub-initial shooting parameters are taken as examples, the A group of sub-initial shooting parameters are iteratively adjusted once to obtain the current shooting parameters of the A group, the B group of sub-initial shooting parameters are iteratively adjusted once to obtain the current shooting parameters of the B group, the C group of sub-initial shooting parameters are iteratively adjusted once to obtain the current shooting parameters of the C group, the D group of sub-initial shooting parameters are iteratively adjusted once to obtain the current shooting parameters of the D group, and the E group of sub-initial shooting parameters are iteratively adjusted once to obtain the current shooting parameters of the E group; a next full set of optimal shooting parameters corresponding to the current shooting parameters of the A, B, C, D and E sets is obtained by a full set of optimal first gain parameters z' 1 A full set of optimal second gain parameters z' 2 And a complete set of optimal exposure parameters z' 3 Composition is prepared.
Thus, when the target parameter is the first gain parameter, the full-set optimal parameter corresponding to the target parameter is the full-set optimal first gain parameter in the next full-set optimal shooting parameter, and the ith-set optimal parameter corresponding to the target parameter is the ith-set optimal first gain parameter in the next optimal shooting parameter corresponding to the first time; and when the target parameter is the second gain parameter and the exposure parameter, the same is repeated here.
In some embodiments of the present application, the terminal may calculate the next target step corresponding to the target parameter through the following formula (9);
v iDj+1 =w×v iDj +c 1 r 1 (p iD -x iDj )+c 2 r 2 (p gD -x iDj ) (9)
w、c 1 、c 2 、r 1 、r 2 is a preset optimization parameter, wherein w is a weight value, and c 1 、c 2 For learning factors or preset acceleration constants, r 1 And r 2 Is [0,1 ]]Random numbers within a range; v iDj+1 The next target step length of the target parameter is j+1, and the iteration adjustment times are represented; v iDj Target step length, P, which is a target parameter iD The i-th set of optimal parameters, P, being target parameters gD Is the full set of optimal parameters for the target parameters; x is x iDj Representing the current shot parameters of the target parameters.
In some embodiments, S42 described above may be implemented as: adopting the next target step length corresponding to the first gain parameter in the next step length, and adjusting the first gain parameter in the current shooting parameters of the ith group to obtain a first adjustment gain parameter; and/or, adjusting the second gain parameter in the current shooting parameters of the ith group by adopting the 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 parameters in the current shooting parameters of the ith group by adopting the next target step length corresponding to the exposure parameters in the next step length to obtain exposure adjustment parameters; the next photographing parameter is determined 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, the following formula (10) may be adopted to adjust each parameter in the current photographing parameters of the i-th group;
x iDj+1 =x iDj +v iDj+1 (10) Wherein x is iDj+1 Each adjusted parameter (first adjustment gain parameter, second adjustment gain parameter, or exposure adjustment parameter) representing the current photographing parameter of the i-th group, x iDj Each parameter (first gain parameter, second gain parameter, or exposure parameter) in the current shooting parameters representing the i-th group; v iDj+1 For the next step (V iDj+1 ) The target step size of the corresponding parameter (the next target step size of the first gain parameter, the target step size of the second gain parameter or the next target step size of the exposure parameter); j+1 is the number of iterations.
As can be seen from the above formula (10), when the current capturing parameter of the i-th group is being adjusted, specifically, the sum between the first gain parameter in the current capturing parameter of the i-th group and the next target step of the first gain parameter is used as the first adjustment gain parameter; and/or taking the sum of the second gain parameter in the current shooting parameters 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 photographing parameter based on the at least one.
In some embodiments, S42 described above 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; the residual adjustment parameters are one or two of the first adjustment gain parameters, the second adjustment gain parameters and the exposure adjustment parameters; the second constraint condition is the product of the first adjustment gain parameter and the second adjustment gain parameter, which is inversely related to 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 standard 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 formula (8), and will not be described here again.
By introducing 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 environments such as imaging illumination intensity 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 rapid judgment and decision of the shake degree of the shot picture; then, the existing algorithm is supplemented and modified based on the jitter degree, an optimization function of the picture 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 values of the optimal exp_time, again and Dgain are calculated by iteration of the particle swarm algorithm, and the values of the optimal exp_time, again and Dgain are adopted to collect the image, so that the overall picture quality of the image is effectively improved.
The embodiment of the present application further provides a photographing parameter adjusting apparatus 1, fig. 11 shows an exemplary structure that may be implemented as a software module, and as shown in fig. 11, the photographing parameter adjusting apparatus 1 may include: the acquisition module 10 is used for acquiring shake 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 iterative adjustment on the initial shooting parameters for multiple times based on a preset initial step length, and obtain multiple loss values obtained by calculating multiple adjusted shooting parameters and the jitter data when a preset iteration termination condition is reached; the determining module 12 is configured to determine a minimum loss value from the plurality of loss values, and determine a set of shooting parameters corresponding to the minimum loss value as target shooting parameters.
In some embodiments of the present application, the apparatus further comprises a photographing module 13 (not shown in fig. 11) for photographing with the target photographing parameters to obtain a photographed image.
In some embodiments of the present application, the apparatus further includes an obtaining module 14 (not shown in fig. 11) configured to, when the initial shooting parameter is adjusted for a plurality of iterations based on a preset initial step size, obtain a plurality of loss values obtained by calculating a plurality of adjusted shooting parameters and the shake data before reaching a preset iteration termination condition, obtain a first constraint relation among a picture quality, a shake degree, and an exposure parameter according to a first priori knowledge; the picture quality and the jitter degree are inversely related, and the picture quality and the exposure parameter are inversely related; 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 inversely related; determining a constraint relation among the shooting parameter, the jitter degree and the picture quality based on the first constraint relation and the second constraint relation; the adjustment module 11 is further configured to perform iterative adjustment on the initial shooting parameters for a plurality of times based on a preset initial step size, and obtain a plurality of loss values obtained by calculating a plurality of adjusted shooting parameters and the shake data according to the constraint relation among the shooting parameters, the shake degree and the picture quality when a preset iteration termination condition is reached.
In some embodiments of the application, the initial step size comprises: n groups of sub-initial step sizes, wherein the initial shooting parameters comprise: n groups of sub-initial shooting parameters; the sub-initial step length corresponds to the sub-initial shooting parameters one by one; the plurality of adjusted shooting parameters comprise: the adjusted sub shooting parameters of the ith group; the plurality of loss values includes: n individual target loss values; wherein N is greater than or equal to 1; the adjusting module 11 is further configured to perform multiple iterative adjustments on the ith sub-initial shooting parameter by using the ith sub-initial step, calculate the adjusted ith sub-shooting parameter and the jitter data, and obtain the ith sub-target shooting parameter and a corresponding individual target loss value when the preset iteration termination condition is reached, thereby obtaining 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; 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, as the target shooting parameter, a group of sub-shooting parameters corresponding to the minimum individual target loss value from the N groups of sub-target shooting parameters.
In some embodiments of the present application, the adjusting module 12 is further configured to perform parameter adjustment on the i-th group of sub-initial shooting parameters based on the i-th group of sub-initial step sizes, so as to obtain a current sub-step size and a current sub-shooting parameter; calculating the jitter data and the current shooting parameters 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 the 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 sub-initial shooting parameters reach the preset times; or the loss value is obtained when the adjustment times of the ith 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 sub-initial shooting parameter based on the ith sub-initial step, and determine N sets of current sub-optimal shooting parameters before obtaining the current sub-step and the current shooting parameter. In some embodiments of the present application, the adjustment module 11 is further configured to determine the current sub-step corresponding to the i-th sub-initial step based on the i-th sub-initial shooting parameter and a preset optimization parameter; and adjusting the ith sub-initial shooting parameter by adopting the current step length to obtain the current shooting parameter.
In some embodiments of the present application, the i-th set of sub-initial photographing 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 i-th set of optimal parameters corresponding to the target parameters in the N sets of current sub-optimal shooting parameters, a target initial step corresponding to the target parameters in the i-th set of sub-initial step under the action of the preset optimal parameters, so as to obtain a target step 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 corresponding to a remaining parameter according to the target step corresponding to the target parameter and a negative correlation between a first product value and a step corresponding to the exposure parameter, so as to obtain the current sub-step; the first product value is a product value between a step length corresponding to a first gain parameter and a step length corresponding to a 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 i-th set of sub-initial photographing 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 ith sub-initial shooting parameter set by using a target step size corresponding to the first gain parameter in the current step size, to obtain a first adjusted gain parameter; and/or, adjusting the second gain parameter in the ith group of sub-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 parameters in the ith group of sub-initial shooting parameters by adopting a target step length corresponding to the exposure parameters in the current step length to obtain exposure adjustment parameters; the current photographing parameter is determined 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 adjustment parameter of a remaining parameter 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 inversely related to the exposure adjustment parameter, where a 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 capturing parameter; wherein the second product value is a product value between the first adjustment gain parameter and the second adjustment 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 acquire shake data of the acquisition apparatus and initial shooting parameters in real time during the 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 a 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 acquiring module 10 is further configured to acquire, during the shooting process, an initial shooting parameter of the acquisition device, and acquire, in real time, a discrete shake amount of the acquisition device through the acceleration sensor; and carrying out differential processing on the discrete jitter amount to obtain the jitter data.
In some embodiments of the present application, the acquiring module 10 is further configured to acquire real-time shake data of the acquisition device and acquire real-time initial shooting parameters in real time through the acceleration sensor during the shooting process; the adjustment module 11 is further configured to perform multiple iterative adjustment on the initial shooting parameter based on a preset initial step, and obtain multiple loss values obtained by calculating multiple adjusted shooting parameters and the shake data when a preset iteration termination condition is reached.
In some embodiments of the application, the second prior knowledge comprises: multiple prior images corresponding to multiple groups of different gain parameters; the obtaining module 14 is further configured to determine, by using an edge detection operator, convolution of the edge detection operator of each pixel point in the horizontal direction and the vertical direction in each prior image, 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; according to the definition of each pixel point, the definition of each prior image is obtained; and obtaining a second constraint relation between the picture quality and the gain parameters according to the definition of each prior image and the multiple groups of different gain parameters.
The embodiment of the present application further provides an electronic device, as shown in fig. 12, where 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 through a bus 26 (not shown in fig. 12). The image sensor 21 is further connected with the image processor 22 through a mobile industry processor interface 27, the image processor 22 is further connected with the acceleration sensor 23 through an I2C interface 28, the image processor 22 is connected with the image signal processor 24, and the image signal processor 24 is connected with the application processor 25; an acceleration sensor 23 for acquiring shake data of the image sensor 21 in real time during photographing; the shake data characterizes the shake degree of the image sensor 21; an image processor 22 for acquiring initial photographing parameters from the image signal processor 24; performing repeated iterative adjustment 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 iterative termination condition is reached; determining a minimum loss value from the plurality of loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters; an image sensor 21 for capturing an image using the target capturing parameter to obtain a captured image; an application processor 25 for controlling the display of the captured image.
The 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 through a communication bus 33; a memory 31 for storing executable instructions; a processor 32 for implementing the methods shown in figures 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 according to the embodiment of the application.
Embodiments of the present application provide a computer readable storage medium having stored therein executable instructions which, when executed by a processor, cause the processor to perform a method provided by embodiments of the present application, for example, as shown in fig. 4-7, 9-10. In some embodiments, the computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; but may be a variety of devices including one or any combination of the above memories. In some embodiments, the executable instructions may be in the form of programs, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment. As an example, the executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) 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). As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or, alternatively, distributed across multiple sites and interconnected by a communication network.
In summary, according to the embodiment of the application, for the case of blurring of a picture caused by shaking during shooting, the degree of blurring of the picture is reduced by reducing the exp_time, meanwhile, in order to reduce the influence of exp_time on the brightness of the picture, the influence of exp_time on the brightness of the picture is reduced by increasing Again and Dgain, and the grain sense of the picture is inevitably increased by increasing Again and Dgain, so that the picture quality is reduced.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (13)

1. A shooting parameter adjustment method, characterized by comprising:
In the shooting process, jitter data of the acquisition device and initial shooting parameters are acquired in real time; the jitter data represents the jitter degree of the acquisition device;
obtaining a first constraint relation among picture quality, the dithering data and exposure parameters according to first priori knowledge; the picture quality and the dithering data are inversely related, and the picture quality and the exposure parameter are inversely related;
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 inversely related;
determining a constraint relation among shooting parameters, the shake data and the picture quality based on the first constraint relation and the second constraint relation; the shooting parameters include: the exposure parameter and the gain parameter;
performing repeated iterative adjustment 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 iterative termination condition is reached;
determining a minimum loss value from the plurality of loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters;
The step of substituting the initial value of the shooting parameter into a constraint relation among the shooting parameter, the dithering data and the picture quality based on a preset initial step length, performing iterative adjustment for a plurality of times, and obtaining a plurality of loss values obtained by calculating a plurality of adjusted shooting parameters and the dithering data when a preset iteration termination condition is reached, wherein the step of obtaining the loss values comprises the following steps:
and carrying out repeated iterative adjustment on the initial value of the shooting parameter 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 parameter, the jitter data and the picture quality when a preset iterative termination condition is reached.
2. The method of claim 1, wherein the initial step size comprises: n groups of sub-initial step sizes, wherein the initial shooting parameters comprise: n groups of sub-initial shooting parameters; the sub-initial step length corresponds to the sub-initial shooting parameters one by one; the plurality of adjusted shooting parameters comprise: the adjusted sub shooting parameters of the ith group; the plurality of loss values includes: n individual target loss values; wherein N is greater than or equal to 1;
The method comprises the steps of carrying out iterative adjustment on the initial shooting parameters for a plurality of times based on a preset initial step length, 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 further comprising:
performing repeated iterative adjustment on the ith sub-initial shooting parameter by adopting the ith sub-initial step length, calculating the adjusted ith sub-shooting parameter and the jitter data, and obtaining the ith sub-target shooting parameter and a corresponding individual target loss value when the preset iteration termination condition is reached, thereby obtaining 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 plurality of loss values, and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters includes:
determining a 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;
The step of adopting the ith sub-initial step length, performing repeated iterative adjustment on the ith sub-initial shooting parameter, calculating the adjusted ith sub-shooting parameter and the jitter data, and obtaining the ith sub-target shooting parameter and the corresponding individual target loss value when the preset iteration termination condition is reached, wherein the step of adopting the ith sub-initial step length comprises the following steps:
based on the ith sub-initial step length, carrying out parameter adjustment on the ith sub-initial shooting parameters to obtain a current sub-step length and a current shooting parameter;
calculating the jitter data and the current shooting parameters 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 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.
3. The method of claim 2, wherein the preset iteration termination condition comprises: the loss value is obtained when the adjustment times of the ith sub-initial shooting parameters reach the preset times; or the loss value is obtained when the adjustment times of the ith 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.
4. The method of claim 2, wherein the parameter adjustment is performed on the ith sub-initial shooting parameter based on the ith sub-initial step size, and before obtaining the current sub-step size and the current sub-shooting parameter, the method further comprises:
n groups of current suboptimal shooting parameters are determined.
5. The method of claim 4, wherein the performing parameter adjustment on the i-th sub-initial shooting parameters based on the i-th sub-initial step length to obtain a current sub-step length and a current sub-shooting parameter comprises:
determining the current sub-step corresponding to the ith sub-initial step based on the ith sub-initial shooting parameter and a preset optimization parameter;
and adjusting the ith sub-initial shooting parameter by adopting the current step length to obtain the current shooting parameter.
6. The method of claim 5, wherein the i-th set of sub-initial capture parameters comprises: a first gain parameter, a second gain parameter, and an exposure parameter;
the determining the current step corresponding to the ith sub-initial step based on the ith sub-initial shooting parameter and a preset optimization parameter includes:
Based on the N groups of current suboptimal shooting parameters, respectively weighting a full group of optimal parameters and an i group of optimal parameters corresponding to target parameters with a target initial step length corresponding to the target parameters in the i group of sub-initial step lengths under the action of the preset optimal parameters 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.
7. The method of claim 6, wherein the determining the current sub-step based at least on the target step comprises:
determining the residual target step length corresponding to the residual 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, thereby obtaining the current sub-step length; the remaining parameters are parameters other than the target parameter among the first gain parameter, the second gain parameter, and the exposure parameter;
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.
8. The method of claim 5, wherein the i-th set of sub-initial capture parameters comprises: a first gain parameter, a second gain parameter, and an exposure parameter;
the step of adopting the current step length to adjust the ith sub-initial shooting parameter to obtain the current shooting parameter comprises the following steps:
adjusting the first gain parameter in the ith group of sub-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 number of the groups of groups,
adjusting the second gain parameter in the ith group of sub-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 number of the groups of groups,
adjusting the exposure parameters in the ith group of sub-initial shooting parameters by adopting a target step length corresponding to the exposure parameters in the current step length to obtain exposure adjustment parameters;
the current photographing parameter is determined based on at least one of the first adjustment gain parameter, the second adjustment gain parameter, and the exposure adjustment parameter.
9. The method of claim 8, wherein the determining the current shot parameter based on at least one of the first adjusted gain parameter, the second adjusted gain parameter, and the exposure adjusted parameter comprises:
Determining a residual adjustment parameter of a residual parameter 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 inversely related to 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 adjustment gain parameter and the second adjustment 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.
10. A photographing parameter adjusting apparatus, comprising:
the acquisition module is used for acquiring shake 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; obtaining a first constraint relation among picture quality, the dithering data and exposure parameters according to first priori knowledge; the picture quality and the dithering data are inversely related, and the picture quality and the exposure parameter are inversely related; 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 inversely related; determining a constraint relation among shooting parameters, the shake data and the picture quality based on the first constraint relation and the second constraint relation; the shooting parameters include: the exposure parameter and the gain parameter;
The adjusting module is further used for performing repeated iterative adjustment 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 according to the constraint relation among the shooting parameters, the jitter data and the picture quality when a preset iteration termination condition is reached;
and the determining module is used for determining the minimum loss value from the plurality of loss values and determining a group of shooting parameters corresponding to the minimum loss value as target shooting parameters.
11. An electronic device, comprising:
a memory for storing executable instructions;
a processor for implementing the method of any one of claims 1 to 9 when executing executable instructions stored in said memory.
12. An electronic device, comprising:
the acceleration sensor is used for acquiring shake data of the image sensor in real time in the shooting process; the dithering data characterizes the dithering degree of the image sensor;
the image processor is used for acquiring a first constraint relation among the picture quality, the jitter data and the exposure parameters according to the first priori knowledge; the picture quality and the dithering data are inversely related, and the picture quality and the exposure parameter are inversely related; 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 inversely related; determining a constraint relation among shooting parameters, the shake data and the picture quality based on the first constraint relation and the second constraint relation; the shooting parameters include: the exposure parameter and the gain parameter; acquiring initial shooting parameters from an image signal processor in real time; performing iterative adjustment on the initial shooting parameters for a plurality of 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; determining a minimum loss value from the plurality of 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 shooting image;
and the application processor is used for controlling the display of the shot image.
13. A computer readable storage medium storing executable instructions for implementing the method of any one of claims 1 to 9 when executed by a processor.
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 CN113347352A (en) 2021-09-03
CN113347352B true 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)

Families Citing this family (1)

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

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4783252B2 (en) * 2006-04-18 2011-09-28 富士通株式会社 Image pickup apparatus with image stabilization function, image stabilization method, pre-processing program for image stabilization processing, and stored image determination program
WO2011145296A1 (en) * 2010-05-21 2011-11-24 パナソニック株式会社 Image capturing apparatus, image processing apparatus, image processing method, and image processing program

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Also Published As

Publication number Publication date
CN113347352A (en) 2021-09-03

Similar Documents

Publication Publication Date Title
US7940325B2 (en) Apparatus and method of capturing images having optimized quality under night scene conditions
US8937677B2 (en) Digital photographing apparatus, method of controlling the same, and computer-readable medium
CN109194882B (en) Image processing method, image processing device, electronic equipment and storage 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
US20080044170A1 (en) Image Capturing System And Method Of Operating The Same
JP2010193098A (en) Image sensing apparatus, and image processing method
JP6752667B2 (en) Image processing equipment and image processing methods and programs
JP5967902B2 (en) Imaging apparatus and aperture control method
JP5759190B2 (en) Imaging apparatus and control method thereof
CN110290325B (en) Image processing method, image processing device, storage medium and electronic equipment
CN111405185B (en) Zoom control method and device for camera, electronic equipment and storage medium
EP2763396A1 (en) Automatic exposure bracketing
CN113347352B (en) Shooting parameter adjusting method and device, electronic equipment and computer storage medium
US10972676B2 (en) Image processing method and electronic device capable of optimizing hdr image by using depth information
CN110266965B (en) Image processing method, image processing device, storage medium and electronic equipment
US10110826B2 (en) Imaging with adjustment of angle of view
JP2007199907A (en) Image noise reduction method and imaging pickup device
JP2013187660A (en) Electronic camera
US8488020B2 (en) Imaging device, method for controlling the imaging device, and recording medium recording the method
US10298865B2 (en) Image processing apparatus, image capturing apparatus, method for controlling image processing apparatus, and non-transitory computer-readable storage medium for correcting image corresponding to change in state of an optical member
US20130194456A1 (en) Imaging device
JP2007235421A (en) Imaging apparatus
JP5803873B2 (en) Exposure device, exposure method, and program
JP7309508B2 (en) IMAGING DEVICE, ITS CONTROL METHOD AND PROGRAM

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