Method, device, electronic device and computer storage medium for determining shooting parameters
By processing pixel statistics and dynamic range scoring information of the target preview image, the problem of poor imaging quality of high dynamic range images in the existing technology is solved, an exposure strategy that matches the scene is realized, and the image synthesis effect is improved.
Patent Information
- Application Number
- CN202210718801.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-06-23
AI Technical Summary
When existing electronic equipment shoots high dynamic range images, the imaging quality is poor and the dynamic range of the shooting scene cannot be accurately determined, resulting in a mismatch in exposure strategies and affecting the image synthesis effect.
By counting the pixels in the target preview image, the dynamic range score information and exposure factor are determined. Based on the relationship between the dynamic range score information and the preset threshold, it is judged whether it is a dynamic range scene, and the target exposure compensation value is calculated based on the exposure factor to optimize the exposure strategy. to improve image quality.
It improves the imaging quality of dynamic range images, ensures that the exposure strategy matches the shooting scene, and improves the image synthesis effect.
Smart Images

Figure CN115103129B
Abstract
Description
Technical Field
[0001] The present application relates to the field of camera technology, and in particular to a method, device, electronic device and computer-readable storage medium for determining shooting parameters. Background Art
[0002] With the continuous development of smart terminal technology, the use of electronic devices (such as smart phones, tablet computers, etc.) is becoming more and more common. Most electronic devices have built-in cameras, and with the enhancement of mobile smart terminal processing capabilities and the development of camera technology, users have higher and higher requirements for the quality of captured images.
[0003] Compared with ordinary images, high dynamic range (HDR) images can provide more dynamic range and image details. High dynamic range images can better reflect the visual effects of the real environment. At present, many electronic devices can capture images with high dynamic range. However, the image quality of high dynamic range images captured by many electronic devices is poor. Summary of the invention
[0004] The embodiments of the present application provide a method, device, electronic device, computer-readable storage medium, and computer program product for determining shooting parameters, which can improve the imaging quality of high dynamic range images.
[0005] In a first aspect, the present application provides a method for determining shooting parameters. The method comprises:
[0006] Count the pixels in the target preview image to obtain statistical index information;
[0007] Determine dynamic range score information according to the statistical indicator information;
[0008] determining an exposure factor according to pixel values in the target preview image;
[0009] Determining whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range scoring information and a preset threshold;
[0010] When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, the corresponding target exposure compensation value is determined according to the exposure factor.
[0011] In a second aspect, the present application also provides a device for determining photographing parameters. The device comprises:
[0012] The pixel information statistics module is used to count the pixels in the target preview image to obtain statistical index information;
[0013] A scoring information determination module, used to determine dynamic range scoring information according to the statistical indicator information;
[0014] An exposure factor determination module, used to determine an exposure factor according to pixel values in the target preview image;
[0015] A dynamic scene determination module, used to determine whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range score information and a preset threshold;
[0016] The dynamic scene determination module is used to determine the corresponding target exposure compensation value according to the exposure factor when it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene.
[0017] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0018] Count the pixels in the target preview image to obtain statistical index information;
[0019] Determine dynamic range score information according to the statistical indicator information;
[0020] determining an exposure factor according to pixel values in the target preview image;
[0021] Determining whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range scoring information and a preset threshold;
[0022] When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, the corresponding target exposure compensation value is determined according to the exposure factor.
[0023] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0024] Count the pixels in the target preview image to obtain statistical index information;
[0025] Determine dynamic range score information according to the statistical indicator information;
[0026] determining an exposure factor according to pixel values in the target preview image;
[0027] Determining whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range scoring information and a preset threshold;
[0028] When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, the corresponding target exposure compensation value is determined according to the exposure factor.
[0029] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0030] Count the pixels in the target preview image to obtain statistical index information;
[0031] Determine dynamic range score information according to the statistical indicator information;
[0032] determining an exposure factor according to pixel values in the target preview image;
[0033] Determining whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range scoring information and a preset threshold;
[0034] When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, the corresponding target exposure compensation value is determined according to the exposure factor.
[0035] The above-mentioned shooting parameter determination method, device, computer equipment, computer-readable storage medium and computer program product obtain statistical index information by counting the pixels in the target preview image, determine the dynamic range score information according to the statistical index information, determine the exposure factor according to the pixel value in the target preview image, and determine whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range score information and the preset threshold. When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, the corresponding target exposure compensation value is determined according to the exposure factor. Finally, an exposure compensation value with a high degree of matching with the shooting scene corresponding to the target preview image can be obtained, which is conducive to improving the synthesis effect of the dynamic range synthetic image and improving the imaging quality of the synthetic image. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 is a flow chart of a method for determining photographing parameters in one embodiment;
[0038] Figure 2is a flow chart of step 106 in one embodiment;
[0039] Figure 3 is a flow chart of step 108 in one embodiment;
[0040] Figure 4 is a flow chart of step 302 in one embodiment;
[0041] Figure 5 is a flow chart of step 110 in one embodiment;
[0042] Figure 6 is a flow chart of step 504 in one embodiment;
[0043] Figure 7 is a flow chart of step 506 in one embodiment;
[0044] Figure 8 is a flow chart of a method for determining photographing parameters in another embodiment;
[0045] Fig. 9 is a flow chart of a method for determining photographing parameters in another embodiment;
[0046] Fig.10 is a flow chart of step 804 in one embodiment;
[0047] Fig.11 is a flow chart of a method for determining photographing parameters in another embodiment;
[0048] Fig.12 is a structural block diagram of a device for determining photographing parameters in one embodiment;
[0049] Fig.13 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] When using bracketing for high dynamic range image synthesis, it is necessary to first obtain multiple frames of images with different exposures of the same scene. Bracketing refers to the pre-setting of shooting multiple frames of images with different exposures. There are two main ways to set the exposure strategy of bracketing: the first is to use a fixed bracketing strategy, that is, the exposure strategy set in each shooting scene is the same, for example, output 3 frames of images with different exposures, and the corresponding exposure compensation value is [EV+2, EV0, EV-2]; the second is to determine the exposure strategy that matches the current shooting scene based on the brightness statistics on the RAW data. For example, when outputting 3 frames of images with different exposures, the corresponding exposure compensation value in the indoor scene is [EV+1, EV0, EV-1], while the corresponding exposure compensation value in the outdoor daytime scene is [EV+2, EV0, EV-3], and so on. For the first bracketing exposure strategy, the exposure strategies corresponding to different shooting scenes are the same. There is no different exposure strategy set for different shooting scenes, and the imaging quality of the final synthesized image is different. The second bracketing exposure strategy is obtained based on the statistical analysis of RAW data. When the image is synthesized in the YUV domain, the brightness information of the YUV data obtained after processing by the image processing module has changed relative to the RAW data. Therefore, when continuing to determine the bracketing exposure strategy of the final YUV image based on the statistical analysis of the RAW data, the corresponding bracketing exposure strategy is inaccurate and the quality of the synthesized image is not high.
[0052] Based on this, the present application proposes a method for determining shooting parameters, which obtains statistical index information by counting the pixels in the target preview image, determines the dynamic range score information according to the statistical index information, determines the exposure factor according to the pixel value in the target preview image, and determines whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range score information and the preset threshold. When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, the corresponding target exposure compensation value is determined according to the exposure factor. A dynamic range exposure strategy with a high degree of matching with the shooting scene corresponding to the target preview image can be obtained, that is, the corresponding exposure compensation value is assigned to the shooting scene corresponding to the target preview image, which is conducive to improving the synthesis effect of the dynamic range synthetic image and improving the imaging quality of the synthetic image.
[0053] The method for determining shooting parameters provided in the embodiments of the present application is described by taking the operation on an electronic device as an example. The electronic device may be, but is not limited to, various personal computers, cameras, scanners, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc.
[0054] In one embodiment, Figure 1 As shown, a method for determining shooting parameters is provided, including the following steps 102 to 110.
[0055] Step 102: Count the pixels in the target preview image to obtain statistical index information.
[0056] Among them, the preview image refers to the image that the camera previews when facing the shooting scene. When the electronic device receives the shooting instruction from the user, it starts the camera to shoot, and the scene that the camera is aimed at is the shooting scene. For example, the user opens the camera application on the electronic device and points the camera at an object to take a photo or record a video. The scene containing the object that the camera of the electronic device is aimed at is the shooting scene. It can be understood that the shooting scene is not necessarily a fixed specific scene, but a scene that changes as the camera moves.
[0057] In this embodiment, after the electronic device starts the camera and before the user triggers the shooting command, it is necessary to perform a real-time preview display of the shooting scene in the viewfinder. Among them, the electronic device can determine the automatic exposure parameters according to the camera's metering system, and continuously expose through the image sensor according to the automatic exposure parameters to obtain a preview image corresponding to the shooting scene. The shooting command can be a photo command or a video recording command. The target preview image can be an initial preview image of the shooting scene directly obtained by the camera, or it can be an image after the initial preview image directly obtained by the camera is processed by image signal, for example, the brightness or clarity of the initial preview image is processed to obtain the target preview image.
[0058] After obtaining the target preview image, the number of pixels of preset types in the target preview image is counted to obtain corresponding statistical indicator information. Optionally, the target preview image can be converted into a grayscale image to obtain a target grayscale image, and the number of pixels of preset types in the target grayscale image is counted, for example, the corresponding statistical indicator information can be obtained based on the grayscale histogram corresponding to the target grayscale image. Among them, the number of pixels of preset types can be, for example, the number of pixels corresponding to pixels of different grayscale levels, the number of pixels corresponding to pixels of different saturation levels, the size and number of blocks of different grayscale levels, the size and number of blocks of pixels of different saturation levels, etc. In some embodiments, the statistical indicator information can also include pixel information of the target area in the target preview image, such as the brightness or grayscale of the target area in the target preview image.
[0059] Step 104: Determine dynamic range score information based on the statistical indicator information.
[0060] In this embodiment, the electronic device can determine the dynamic range scoring information corresponding to the shooting scene corresponding to the target preview image based on the statistical indicator information. The dynamic range scoring information can be understood as the scoring information of the dynamic range of the shooting scene corresponding to the target preview image. The dynamic range of the shooting scene corresponding to the target preview image can be determined based on the dynamic range scoring information, so as to determine the corresponding image synthesis strategy based on the dynamic range. The image synthesis strategy, for example, can be a bracketing exposure synthesis method or a normal synthesis method. When the bracketing exposure synthesis method is determined, the number of bracketing exposure frames and the corresponding exposure compensation value need to be determined.
[0061] In some embodiments, each statistical indicator information may be weighted and summed, and the result of the weighted summation may be normalized to a value between [0, 1] as the dynamic range score information corresponding to the statistical indicator information. It is understandable that different statistical indicator information corresponds to different dynamic range score information, and there is at least one statistical indicator information.
[0062] Step 106: determining an exposure factor according to the pixel values in the target preview image.
[0063] According to the pixel values in the target preview image, the exposure factor corresponding to the shooting scene corresponding to the target preview image can be determined. The exposure factor can be understood as the exposure condition corresponding to the shooting scene corresponding to the target preview image. Among them, there can be multiple exposure factors, such as underexposure factor and overexposure factor. The underexposure factor can be used to characterize the underexposure condition corresponding to the underexposed pixels in the target preview image, and the overexposure factor can be used to characterize the overexposure condition corresponding to the overexposed pixels in the target preview image. Among them, the underexposed pixels refer to darker pixels, and the overexposed pixels refer to brighter pixels.
[0064] In some embodiments, the corresponding exposure factor may be determined according to the proportion of pixel values of different exposure conditions in the target preview image. For example, the average value or median value of the pixel values of pixels of the same exposure condition in the target preview image may be used as the corresponding exposure factor.
[0065] Step 108: Determine whether the shooting scene corresponding to the target preview image is a dynamic range scene based on the relationship between the dynamic range score information and the preset threshold.
[0066] In this embodiment, it is possible to determine whether the shooting scene corresponding to the target preview image is a dynamic range scene based on the size relationship between the dynamic range score information and the preset threshold. If the dynamic range score information meets the corresponding preset threshold condition, it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene; if the dynamic range score information does not meet the corresponding preset threshold condition, it is determined that the shooting scene corresponding to the target preview image is a non-dynamic range scene. Among them, the preset threshold may vary depending on the shooting scene, and the preset threshold may be set according to the specific scene requirements.
[0067] In an optional example, when the dynamic range score information is greater than a preset threshold, it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, and the target image is synthesized according to the bracketing exposure method; when the dynamic range score information is not greater than the preset threshold, it is determined that the shooting scene corresponding to the target preview image is a non-dynamic range scene, and the target image is synthesized according to the ordinary method.
[0068] Step 110: When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, a corresponding target exposure compensation value is determined according to the exposure factor.
[0069] When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, it is necessary to synthesize the target image according to the bracketing exposure method, and further determine the corresponding target exposure compensation value according to the exposure factor. Among them, the target exposure compensation value can be understood as the exposure value (EV), which indicates the size of the exposure. The larger the exposure value, the greater the exposure. EV+ indicates overexposure, and the larger the value thereafter, the higher the degree of overexposure; EV- indicates underexposure, and the larger the value thereafter, the higher the degree of underexposure. Since it is necessary to first obtain multiple frames of initial images with different exposures when the bracketing exposure method is used to synthesize the target image, the specific number of frames of the initial image can be determined according to the relationship between the dynamic range score information and the preset threshold, and then the target exposure compensation value corresponding to each frame of the initial image can be further determined according to the exposure factor.
[0070] In some optional embodiments, a baseline exposure compensation value may be first determined based on brightness information of a target preview image, and then a candidate exposure compensation value may be determined based on the baseline exposure compensation value and an exposure factor, and a target exposure compensation value may be obtained based on the baseline exposure compensation value and the candidate exposure compensation value, wherein the candidate exposure compensation value is an exposure compensation value other than the baseline exposure compensation value in the target exposure compensation value.
[0071] In some optional embodiments, a baseline exposure compensation value may be determined based on the brightness information of the target preview image, and then a candidate exposure compensation value may be determined based on the brightness information and exposure factor of the target preview image, and the target exposure compensation value may be obtained based on the baseline exposure compensation value and the candidate exposure compensation value.
[0072] The exposure compensation value can be adjusted by three parameters: exposure time, sensitivity, and aperture. The electronic device can set multiple different exposure compensation values by adjusting the exposure time among the above three parameters. For example, keeping the other two parameters unchanged, the exposure compensation value is increased by increasing the exposure time, and the exposure compensation value is decreased by decreasing the exposure time. In some optional embodiments, the exposure compensation value can also be increased or decreased by the sensitivity or aperture among the above parameters.
[0073] In the above-mentioned method for determining shooting parameters, statistical index information is obtained by counting the pixels in the target preview image, dynamic range score information is determined according to the statistical index information, exposure factor is determined according to the pixel value in the target preview image, and whether the shooting scene corresponding to the target preview image is a dynamic range scene is determined according to the relationship between the dynamic range score information and the preset threshold. When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, the corresponding target exposure compensation value is determined according to the exposure factor. Finally, a dynamic range exposure strategy with a high degree of matching with the shooting scene corresponding to the target preview image can be obtained, that is, the corresponding exposure compensation value is assigned to the shooting scene corresponding to the target preview image, which is conducive to improving the synthesis effect of the dynamic range synthetic image and improving the imaging quality of the synthetic image.
[0074] In one embodiment, the statistical indicator information includes at least one of the number of first pixels, the number of second pixels, the number of third pixels, the number of third pixel blocks, the size of third pixel blocks, and the grayscale statistical value of the target area in the target preview image; wherein the grayscale value corresponding to the first pixel is less than the first grayscale threshold, the grayscale value corresponding to the second pixel is greater than the second grayscale threshold, the first grayscale threshold is less than the second grayscale threshold, and the grayscale value corresponding to the third pixel is the maximum grayscale value; step 104 of determining the dynamic range score information according to the statistical indicator information includes:
[0075] Weighted processing is performed on at least one of the number of first pixels, the number of second pixels, the number of third pixels, the number of third pixel blocks, the size of the third pixel blocks, and the grayscale statistics of the target area to obtain a weighted sum, and a dynamic range score value is determined based on the weighted sum, wherein the dynamic range score value is negatively correlated with the weighted sum.
[0076] In the target preview image, at least one statistical indicator information of the number of first pixels, the number of second pixels, the number of third pixels, the number of third pixel blocks, the size of the third pixel block, and the grayscale statistical value of the target area is counted. Among them, the first pixel is a pixel in the target preview image whose grayscale value is less than the first grayscale threshold; the second pixel is a pixel in the target preview image whose grayscale value is greater than the second grayscale threshold, and the first grayscale threshold is less than the second grayscale threshold; the third pixel is a pixel with the largest grayscale value, for example, according to the current general grayscale level division method, the grayscale value 255 is the maximum grayscale value. It should be noted here that the maximum grayscale value can be selected according to the grayscale value regulations followed when the scheme is used; the third pixel block refers to a block composed of continuous third pixels greater than a preset number, for example, a block in the target preview image with a continuous third pixel number greater than 100 is called the third pixel block. For three-pixel blocks, the number of third pixel blocks is the number of third pixel blocks that meet the conditions; the size of the third pixel block can be understood as the number of third pixels included in the third pixel block. For example, if a third pixel block includes 200 third pixels, then the size of the third pixel block is 200; the target area can be understood as a local image area in the target preview image that requires special attention, such as a face area in the target preview image or a focus area selected by a user. The grayscale statistical value of the target area can refer to the grayscale value mean or grayscale value median of all pixels in the target area, or it can be the sum of the grayscale values of all pixels in the target area.
[0077] Weighted processing is performed on at least one of the statistical indicator information including the number of first pixels, the number of second pixels, the number of third pixels, the number of third pixel blocks, the size of the third pixel block and the grayscale statistical value of the target area to obtain a weighted sum, and a dynamic range score value is determined according to the weighted sum, wherein the weight corresponding to each statistical indicator information can be set according to the importance of each statistical indicator information in the corresponding shooting scene, and the sum of the weights corresponding to all the statistical indicator information participating in the weighted sum is 1.
[0078] In some embodiments, after obtaining the weighted sum, the weighted sum is normalized to obtain a dynamic range score value between 0 and 1. The dynamic range score value is negatively correlated with the weighted sum, that is, the larger the weighted sum, the smaller the corresponding dynamic range score value, and vice versa, the smaller the weighted sum, the larger the corresponding dynamic range score value.
[0079] In one example, the dynamic range score HDR can be calculated according to the following formula (1): score :
[0080]
[0081] In formula (1), s nRepresents statistical indicator information, w n is the weight corresponding to the statistical indicator information, n is a positive integer, and C is a constant.
[0082] In the above embodiment, by performing weighted processing on the statistical indicator information to obtain a weighted sum, and determining the dynamic range score value based on the weighted sum, each statistical indicator information can be fully reflected in the dynamic range score value, so that the obtained dynamic range score value is more consistent with the actual shooting scene, the dynamic range score value is more accurate, and ultimately the exposure strategy determined based on the dynamic range score value is also more accurate.
[0083] In one embodiment, the target preview image includes a first pixel, a second pixel, and a fourth pixel, wherein the grayscale value corresponding to the first pixel is less than a first grayscale threshold, the grayscale value corresponding to the second pixel is greater than the second grayscale threshold, and the grayscale value corresponding to the fourth pixel is greater than the first grayscale threshold and less than the second grayscale threshold; the exposure factor includes a first exposure factor and a second exposure factor; Figure 2 As shown, step 106 of determining the exposure factor according to the pixel value in the target preview image includes steps 202 to 204.
[0084] Step 202: Determine a first exposure factor according to the pixel value corresponding to the first pixel and the pixel value corresponding to the fourth pixel.
[0085] Step 204: Determine a second exposure factor according to the pixel value corresponding to the second pixel and the pixel value corresponding to the fourth pixel.
[0086] In this embodiment, a first exposure factor can be obtained according to the ratio of the pixel value corresponding to the first pixel and the pixel value corresponding to the fourth pixel, and the first exposure factor is used to characterize the exposure condition corresponding to the first pixel; a second exposure factor can be obtained according to the ratio of the pixel value corresponding to the second pixel and the pixel value corresponding to the fourth pixel, and the second exposure factor is used to characterize the exposure condition corresponding to the second pixel. Exemplarily, the first pixel can be, for example, a darker pixel, which can also be called an underexposed pixel, and the grayscale value of the underexposed pixel is less than the first grayscale threshold; the second pixel can be, for example, a brighter pixel, which can also be called an overexposed pixel, and the grayscale value of the overexposed pixel is greater than the second grayscale threshold; the fourth pixel can be a pixel at an intermediate brightness, and the grayscale value is between the underexposed pixel and the overexposed pixel.
[0087] In an optional embodiment, the ratio of the average pixel value corresponding to the first pixel to the average pixel value corresponding to the fourth pixel is used as the first exposure factor; the ratio of the average pixel value corresponding to the second pixel to the average pixel value corresponding to the fourth pixel is used as the second exposure factor. For example, the ratio of the average pixel value of all first pixels to the average pixel value of all fourth pixels can be used as the first exposure factor; the ratio of the average pixel value of all second pixels to the average pixel value of all fourth pixels can be used as the second exposure factor.
[0088] In another optional embodiment, the ratio of the median pixel value corresponding to the first pixel to the median pixel value corresponding to the fourth pixel is used as the first exposure factor; the ratio of the median pixel value corresponding to the second pixel to the median pixel value corresponding to the fourth pixel is used as the second exposure factor. For example, the ratio of the median pixel value of all first pixels to the median pixel value of all fourth pixels can be used as the first exposure factor; the ratio of the median pixel value of all second pixels to the median pixel value of all fourth pixels can be used as the second exposure factor.
[0089] In some embodiments, the ratio of the sum of the pixel values corresponding to the first pixel to the sum of the pixel values corresponding to the fourth pixel is used as the first exposure factor; the ratio of the sum of the pixel values corresponding to the second pixel to the sum of the pixel values corresponding to the fourth pixel is used as the second exposure factor. For example, the ratio of the sum of the pixel values of all first pixels to the sum of the pixel values of all fourth pixels can be used as the first exposure factor; the ratio of the sum of the pixel values of all second pixels to the sum of the pixel values of all fourth pixels can be used as the second exposure factor.
[0090] In the above embodiment, the first exposure factor is determined according to the pixel value corresponding to the first pixel and the pixel value corresponding to the fourth pixel, and the second exposure factor is determined according to the pixel value corresponding to the second pixel and the pixel value corresponding to the fourth pixel. The first exposure factor and the second exposure factor can be determined simply, quickly and accurately, so as to quantitatively represent the exposure conditions corresponding to the corresponding pixels in the target preview image.
[0091] In one embodiment, Figure 3 As shown, step 108 of determining whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range score information and the preset threshold includes the following steps 302 to 304.
[0092] Step 302: When the dynamic range score information is greater than a first preset threshold, it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene.
[0093] Step 304: When the dynamic range score information is not greater than the first preset threshold, it is determined that the shooting scene corresponding to the target preview image is not a dynamic range scene.
[0094] Optionally, a first preset threshold is set in advance. When the dynamic range score value is greater than the first preset threshold, the shooting scene corresponding to the target preview image is determined to be a dynamic range scene; when the dynamic range score value is not greater than the first preset threshold, the shooting scene corresponding to the target preview image is determined to be a non-dynamic range scene. Different shooting scenes can use different image synthesis strategies and different exposure strategies. When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, it can be further determined to use a bracketing exposure method for image synthesis. Under the premise that the dynamic range score value is greater than the first preset threshold, the number of frames required to synthesize the target image can be further determined according to the scoring interval in which the dynamic range score value is located. Among them, the dynamic range score value is in a different scoring interval, and the corresponding dynamic scene level is also different.
[0095] In the above embodiment, whether the shooting scene corresponding to the target preview image is a dynamic range scene is determined by the size relationship between the dynamic range score information and the first preset threshold. When the dynamic range score information is greater than the first preset threshold, it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene. By setting a preset threshold to determine the shooting scene type corresponding to the target preview image, the shooting scene type can be quickly determined, so that the corresponding target image synthesis strategy can be quickly and accurately obtained.
[0096] In one embodiment, Figure 4 As shown, when the dynamic range score information is greater than the first preset threshold, step 302 of determining that the shooting scene corresponding to the target preview image is a dynamic range scene includes the following steps 402 to 406.
[0097] Step 402: When the dynamic range score information is greater than the first preset threshold and not greater than the second preset threshold, the shooting scene corresponding to the target preview image is a first-level dynamic scene.
[0098] Step 404: When the dynamic range score information is greater than the second preset threshold and not greater than the third preset threshold, the shooting scene corresponding to the target preview image is a secondary dynamic scene.
[0099] Step 406, when the dynamic range score information is greater than the third preset threshold, the shooting scene corresponding to the target preview image is a third-level dynamic scene; wherein the third preset threshold is greater than the second preset threshold, and the second preset threshold is greater than the first preset threshold; the number of synthesized image frames under the first-level dynamic scene is less than the number of synthesized image frames under the second-level dynamic scene, and the number of synthesized image frames under the second-level dynamic scene is less than the number of synthesized image frames under the third-level dynamic scene.
[0100] In an optional embodiment, when the dynamic range score information is greater than the first preset threshold and not greater than the second preset threshold, the shooting scene corresponding to the target preview image is a first-level dynamic scene, and the corresponding number of synthetic image frames is a first number of frames; when the dynamic range score information is greater than the second preset threshold and not greater than the third preset threshold, the shooting scene corresponding to the target preview image is a second-level dynamic scene, and the corresponding number of synthetic image frames is a second number of frames; when the dynamic range score information is greater than the third preset threshold, the shooting scene corresponding to the target preview image is a third-level dynamic scene, and the corresponding number of synthetic image frames is a third number of frames. Wherein, the first number of frames is less than the second number of frames, and the second number of frames is less than the third number of frames.
[0101] In one example, the first preset threshold is Thresh low , the second preset threshold is Thresh middle , the third preset threshold is Thresh high When dynamic range scoring information HDR score Greater than Thresh high When the target preview image corresponds to a three-level dynamic scene, the corresponding synthetic image frame number is 5 frames; when the dynamic range score information HDR score Greater than Thresh middle and not greater than Thresh high When the target preview image corresponds to a secondary dynamic scene, the corresponding synthetic image frame number is 3 frames; when the dynamic range score information HDR score Greater than Thresh low and not greater than Thresh middle When the target preview image corresponds to a first-level dynamic scene, the corresponding synthetic image frame number is 2 frames; when the dynamic range score information HDR score No greater than Thresh low When the target preview image corresponds to a non-dynamic range scene, the target image is synthesized using a common synthesis method.
[0102] In the above embodiment, on the basis of determining that the shooting scene corresponding to the target preview image is a dynamic range scene, the dynamic scene level corresponding to the dynamic range scene is further determined by setting three preset thresholds, and the corresponding number of image synthesis frames is determined according to the corresponding dynamic scene level. The number of image synthesis frames with a high degree of match with the shooting scene corresponding to the target preview image can be quickly and accurately determined according to the dynamic range scoring information.
[0103] In one embodiment, Figure 5 As shown, in step 110 , determining the corresponding target exposure compensation value according to the exposure factor includes the following steps 502 to 506 .
[0104] Step 502: Determine a reference exposure compensation value according to the brightness of the target preview image.
[0105] The reference exposure compensation value is used to characterize the reference exposure value of normal exposure. In addition to normal exposure, other exposure values are overexposure or underexposure, but the corresponding degrees of overexposure or underexposure are different. Optionally, the reference exposure compensation value can be determined according to the brightness information of the target preview image. The brightness information of the target preview image can be the sum of the brightness of all pixels in the target preview image, or the average brightness of all pixels in the target preview image, or the median brightness of all pixels in the target preview image. The specific selection can be made according to the actual processing situation.
[0106] Step 504: Determine a candidate exposure compensation value according to the reference exposure compensation value and the exposure factor.
[0107] In this embodiment, the candidate exposure compensation value can be determined according to the reference exposure compensation value and the exposure factor, wherein the candidate exposure compensation value is an exposure compensation value other than the reference exposure compensation value. For example, in the above steps, it is determined that the shooting scene corresponding to the target preview image is a third-level dynamic scene, and the corresponding number of synthetic image frames is 5 frames, then 1 frame corresponds to the reference exposure compensation value, and the other 4 frames correspond to the candidate exposure compensation value. Optionally, when it is determined in the above steps that the shooting scene corresponding to the target preview image is a first-level dynamic scene, and the corresponding number of synthetic image frames is 2 frames, then 1 frame corresponds to the reference exposure compensation value, and the other 1 frame corresponds to the candidate exposure compensation value, and the candidate exposure compensation value corresponding to the frame can be determined according to any one of the exposure factors and the reference exposure compensation value.
[0108] Optionally, an exposure increment between the reference exposure compensation value and the candidate exposure compensation value may be determined according to the exposure factor, and the candidate exposure compensation value may be determined according to the exposure increment.
[0109] Step 506: Obtain a target exposure compensation value according to the reference exposure compensation value and the candidate exposure compensation value.
[0110] After the reference exposure compensation value and the candidate exposure compensation values are determined, the target exposure compensation value may be obtained according to the reference exposure compensation value and the candidate exposure compensation values.
[0111] In the above embodiment, a baseline exposure compensation value is determined according to the brightness of the target preview image, and a candidate exposure compensation value is determined according to the baseline exposure compensation value and the exposure factor, thereby obtaining a target exposure compensation value. The target exposure compensation value corresponding to the shooting scene corresponding to the target preview image can be accurately obtained, thereby effectively improving the synthesis quality of the synthesized image.
[0112] In one embodiment, Figure 6As shown, the exposure factor includes a first exposure factor and a second exposure factor, and the first exposure factor is less than the second exposure factor; the candidate exposure compensation value includes a first exposure compensation value and a second exposure compensation value; and step 504 of determining the candidate exposure compensation value according to the reference exposure compensation value and the exposure factor includes the following steps 602 to 604.
[0113] Step 602: Obtain a first exposure compensation value according to a reference exposure compensation value and a first exposure factor.
[0114] The first exposure factor may represent an exposure condition corresponding to a first pixel in the target preview image, and a grayscale value corresponding to the first pixel is less than a first grayscale threshold. Optionally, a first exposure increment between a first exposure compensation value and a reference exposure compensation value is determined according to the first exposure factor, and the first exposure compensation value is determined according to the reference exposure compensation value and the first exposure increment.
[0115] Step 604: Obtain a second exposure compensation value according to the reference exposure compensation value and the second exposure factor.
[0116] The second exposure factor may characterize the exposure condition corresponding to the second pixel in the target preview image, and the grayscale value corresponding to the second pixel is greater than the second grayscale threshold. The first grayscale threshold is less than the second grayscale threshold. The first exposure factor is less than the second exposure factor. Optionally, a second exposure increment between the second exposure compensation value and the reference exposure compensation value is determined according to the second exposure factor, and the second exposure compensation value is determined according to the reference exposure compensation value and the second exposure increment.
[0117] In an optional embodiment, the exposure step length is first obtained, wherein the exposure step length is used to calculate the brightness gain of the image frame corresponding to the candidate exposure compensation value, and the brightness gain is a parameter used to adjust the image brightness. It should be noted that when adjusting the image brightness, the image brightness can be adjusted by adjusting the exposure time, or by adjusting the brightness gain. For example, based on the image frame brightness corresponding to the reference exposure compensation value, the brightness gain of the image frame corresponding to the candidate exposure compensation value is multiplied to obtain the brightness of the image frame corresponding to the candidate exposure compensation value. In an example, the brightness gain can be calculated by the following formula (2):
[0118]
[0119] Among them, sensiGain is used to characterize the brightness gain of the image frame corresponding to the candidate exposure compensation value, sensiGain0 is used to characterize the brightness gain of the image frame corresponding to the reference exposure compensation value, x represents the exposure increment between the corresponding candidate exposure compensation value and the reference exposure compensation value, and D represents the exposure step.
[0120] The exposure step is usually set during the image processing process. According to the exposure step and the first exposure factor, a first exposure increment is obtained; according to the first exposure increment and the reference exposure compensation value, a first exposure compensation value is obtained. Similarly, according to the exposure step and the second exposure factor, a second exposure increment is obtained; according to the second exposure increment and the reference exposure compensation value, a second exposure compensation value is obtained. Specifically, the product of the exposure step and the reciprocal of the first exposure factor can be used as the first exposure increment, and the difference between the reference exposure compensation value and the first exposure increment and the exposure step can be used as the first compensation value; the product of the exposure step and the second exposure factor can be used as the second exposure increment, and the sum of the reference exposure compensation value and the second exposure increment is calculated, and the sum and the exposure step can be used as the second exposure compensation value.
[0121] In one example, the first exposure compensation value EV1 is: EV1=(EV0-F1 -1 ×D) / D, the second exposure compensation value EV2 is: EV2=(EV0+F2×D) / D, where EV0 represents the base exposure compensation value, F1 represents the first exposure factor, F2 represents the second exposure factor, and D represents the exposure step. For example, when the exposure step is 6, assuming the first exposure factor is 0.5, then the first exposure compensation value is EV-2, which is equivalent to half the exposure of the base exposure compensation value; assuming the second exposure factor is 2, then the second exposure compensation value is EV+2, which is equivalent to twice the exposure of the base exposure compensation value.
[0122] In the above embodiment, the first exposure compensation value is obtained according to the baseline exposure compensation value and the first exposure factor, and the second exposure compensation value is obtained according to the baseline exposure compensation value and the second exposure factor. The corresponding exposure compensation value can be obtained according to the specific exposure factor, so that the obtained candidate exposure compensation value is more accurate, and thus the final target exposure compensation value is also more accurate.
[0123] In some embodiments, the exposure factor includes a first exposure factor and a second exposure factor. Determining the corresponding target exposure compensation value according to the exposure factor in step 110 includes:
[0124] A reference exposure compensation value is determined according to the brightness information of the target preview image; a first exposure compensation value is determined according to the brightness information of the target preview image and a first exposure factor; a second exposure compensation value is determined according to the brightness information of the target preview image and a second exposure factor; a target exposure compensation value is obtained according to the reference exposure compensation value, the first compensation value, and the second compensation value.
[0125] In an optional embodiment, a reference exposure compensation value is determined by table lookup according to the brightness information of the target preview image; the product of the brightness information of the target preview image and the first exposure factor is taken as the first product, and the first exposure compensation value is determined according to the first product; the product of the brightness information of the target preview image and the second exposure factor is taken as the second product, and the second exposure compensation value is determined according to the second product. Optionally, the corresponding first exposure compensation value can be obtained according to the first product, and the corresponding second exposure compensation value can be obtained according to the second product by table lookup. The target exposure compensation value can be obtained according to the reference exposure compensation value, the first compensation value, and the second compensation value.
[0126] In one embodiment, Figure 7 As shown, step 506 of obtaining a target exposure compensation value according to a reference exposure compensation value and a candidate exposure compensation value includes steps 702 to 706 below.
[0127] Step 702: Perform interpolation processing according to the reference exposure compensation value and the first exposure compensation value to obtain a third exposure compensation value.
[0128] After obtaining the reference exposure compensation value and the first exposure compensation value, interpolation may be performed between the reference exposure compensation value and the first exposure compensation value to obtain a third exposure compensation value. The third exposure compensation value may be multiple. Optionally, an average value or an intermediate value of the reference exposure compensation value and the first exposure compensation value may be inserted as the third exposure compensation value. For example, EV-2 may be inserted between EV-4 and EV0 as the third exposure compensation value.
[0129] Step 704: Perform interpolation processing according to the reference exposure compensation value and the second exposure compensation value to obtain a fourth exposure compensation value.
[0130] After obtaining the reference exposure compensation value and the second exposure compensation value, interpolation may be performed between the reference exposure compensation value and the second exposure compensation value to obtain a fourth exposure compensation value. The fourth exposure compensation value may be multiple. Optionally, an average value or an intermediate value of the reference exposure compensation value and the second exposure compensation value may be inserted as the fourth exposure compensation value. For example, EV+1 may be inserted between EV0 and EV+2 as the fourth exposure compensation value.
[0131] Step 706: Use the reference exposure compensation value, the first exposure compensation value, the second exposure compensation value, the third exposure compensation value, and the fourth exposure compensation value as target exposure compensation values.
[0132] The reference exposure compensation value, the first exposure compensation value, the second exposure compensation value, the third exposure compensation value and the fourth exposure compensation value are used as target exposure compensation values and are respectively allocated to corresponding frames to obtain frame images of corresponding exposure compensation values.
[0133] Optionally, after inserting the third exposure compensation value or the fourth exposure compensation value, interpolation may continue between known exposure compensation values to obtain a new exposure compensation value. For example, a fifth exposure compensation value may be inserted between the first exposure compensation value and the third exposure compensation value, and so on, which will not be described in detail here.
[0134] In one example, correspondingly, when the aforementioned embodiment determines that the shooting scene corresponding to the target preview image is a first-level dynamic scene, the corresponding number of synthetic image frames is 2 frames, and there are corresponding 2 target exposure compensation values, such as [EV0, EV+1] or [EV-1, EV0]; when the aforementioned embodiment determines that the shooting scene corresponding to the target preview image is a second-level dynamic scene, the corresponding number of synthetic image frames is 3 frames, and there are corresponding 3 target exposure compensation values, such as [EV-1, EV0, EV+1]; when the aforementioned embodiment determines that the shooting scene corresponding to the target preview image is a third-level dynamic scene, the corresponding number of synthetic image frames is 5 frames, and there are corresponding 5 target exposure compensation values, such as [EV-4, EV-2, EV0, EV+1, EV+2]. It can be understood that the number of target exposure compensation values corresponds to the number of synthetic image frames.
[0135] In the above embodiment, by interpolating between known exposure compensation values to obtain other unknown exposure compensation values, a target exposure compensation value can be obtained quickly and accurately, thereby improving image synthesis efficiency.
[0136] In some embodiments, Figure 8 As shown, before step 102 of counting pixels in the target preview image to obtain statistical indicator information, the method further includes the following steps 802 to 804.
[0137] Step 802: Obtain an initial preview image and a brightness adjustment parameter corresponding to the initial preview image.
[0138] The initial preview image can be understood as the image previewed in the camera's viewfinder. However, the initial preview image is usually an image that has been processed by multiple image processing modules based on the image data actually involved in the photo-taking algorithm, and in particular, the brightness has been adjusted so that the initial preview image seen by the human eye is consistent with the real scene. In other words, the initial preview image cannot truly represent the image data information involved in the photo-taking algorithm calculation. The processing flow of obtaining the exposure strategy based on the initial preview image analysis is as follows: Fig. 9 As shown, the initial preview image is YUV format data obtained after being processed by an image signal processor based on the original RAW format data.
[0139] In order to make the exposure strategy finally obtained by this solution more accurate, the brightness of the initial preview image needs to be adjusted back to the original brightness when participating in the photo algorithm calculation. Therefore, it is necessary to obtain the brightness adjustment parameters corresponding to the initial preview image.
[0140] Step 804: adjust the brightness of the initial preview image according to the brightness adjustment parameter to obtain a target preview image.
[0141] In this embodiment, the brightness of the initial preview image is adjusted according to the brightness adjustment parameter to obtain the target preview image, which is equivalent to restoring the brightness of the initial preview image to the brightness before adjustment by the brightness adjustment parameter.
[0142] In the above embodiment, the brightness of the initial preview image is adjusted according to the brightness adjustment parameter corresponding to the initial preview image to obtain a target preview image, so that the brightness of the target preview image is consistent with the brightness corresponding to the image data involved in the image algorithm calculation. The brightness of the target preview image can more realistically reflect the brightness information obtained by the camera in the shooting scene, thereby making the synthetic image exposure strategy obtained based on the target preview image analysis more accurate.
[0143] In one embodiment, step 802 of obtaining an initial preview image and a brightness adjustment parameter corresponding to the initial preview image includes:
[0144] Acquire an initial preview image; identify corresponding shooting scene information according to the initial preview image; and acquire corresponding brightness adjustment parameters according to the shooting scene information.
[0145] In this embodiment, the electronic device can identify the corresponding shooting scene information according to the initial preview image, and obtain the corresponding brightness adjustment parameters according to the shooting scene information. Among them, the shooting scene information includes the brightness of the shooting scene, and the brightness adjustment parameters include multiple ones. For example, according to the initial preview image, the corresponding shooting scene information is identified to obtain whether the corresponding shooting scene belongs to a night scene or a day scene, or an indoor scene or an outdoor scene, etc. Different scene information has different corresponding brightness adjustment parameters. In this embodiment, each type of scene information corresponds to a brightness adjustment parameter that matches it. Obtaining the corresponding brightness adjustment parameter according to the shooting scene information can make the obtained brightness adjustment parameter more accurate and more consistent with the actual shooting scene.
[0146] In one embodiment, Fig.10 As shown, the step 804 of adjusting the brightness of the initial preview image according to the brightness adjustment parameter to obtain the target preview image includes the following steps 1002 to 1004.
[0147] Step 1002, when the brightness of the first initial pixel in the initial preview image is greater than the first brightness threshold, the brightness of the first initial pixel is adjusted according to the first brightness adjustment parameter to obtain the brightness of the first target pixel in the target preview image; wherein the first target pixel corresponds to the first initial pixel.
[0148] The brightness of the pixels in the initial preview image is compared with the first brightness threshold in sequence. When the brightness of the first initial pixel in the initial preview image is greater than the first brightness threshold, the brightness of the first initial pixel is adjusted according to the first brightness adjustment parameter to obtain the brightness of the first target pixel in the target preview image. Optionally, when the brightness of the first initial pixel in the initial preview image is greater than the first brightness threshold, the product of the brightness of the first initial pixel and the first brightness adjustment parameter is used as the brightness of the first target pixel in the target preview image. The first target pixel corresponds to the position of the first initial pixel.
[0149] Step 1004, when the brightness of the second initial pixel in the initial preview image is less than the second brightness threshold, the brightness of the second initial pixel is adjusted according to the second brightness adjustment parameter to obtain the brightness of the second target pixel in the target preview image; wherein the second target pixel corresponds to the second initial pixel; and the first brightness threshold is greater than the second brightness threshold.
[0150] The brightness of the pixels in the initial preview image is compared with the second brightness threshold in sequence. When the brightness of the second initial pixel in the initial preview image is less than the second brightness threshold, the brightness of the second initial pixel is adjusted according to the second brightness adjustment parameter to obtain the brightness of the second target pixel in the target preview image. Optionally, when the brightness of the second initial pixel in the initial preview image is less than the second brightness threshold, the quotient of the brightness of the second initial pixel and the second brightness adjustment parameter is used as the brightness of the second target pixel in the target preview image. The second target pixel corresponds to the position of the second initial pixel; the first brightness threshold is greater than the second brightness threshold, and the first brightness adjustment parameter is different from the second brightness adjustment parameter.
[0151] In one example, the brightness of the initial preview image is adjusted according to the brightness adjustment parameter to obtain the target preview image as shown in the following formula (3):
[0152]
[0153] Wherein, Y0(x,y) represents the brightness of the pixel at the coordinate (x,y) in the initial preview image, Y(x,y) represents the brightness of the pixel at the corresponding position in the target preview image, drcGain represents the first brightness adjustment parameter, DBGain represents the second brightness adjustment parameter, Bright_th represents the first brightness threshold, and Dark_th represents the second brightness threshold.
[0154] In the above embodiment, the brightness of corresponding pixels of different brightness in the initial preview image is adjusted respectively by the first brightness adjustment parameter and the second brightness adjustment parameter. For example, the brighter pixels in the initial preview image are adjusted by the first brightness adjustment parameter, and the darker pixels in the initial preview image are adjusted by the second brightness adjustment parameter. This restores the brightness of pixels in the target preview image to the effect of not having been adjusted by the brightness adjustment parameter, which is closer to the brightness of the image data acquired by the camera, and makes the exposure strategy obtained based on the analysis of the target preview image more accurate.
[0155] In some embodiments, Fig.11 As shown, the method for determining shooting parameters includes the following steps 1102 to 1114.
[0156] Step 1102: Obtain an initial preview image and a brightness adjustment parameter corresponding to the initial preview image.
[0157] Step 1104: adjust the brightness of the initial preview image according to the brightness adjustment parameter to obtain a target preview image.
[0158] Step 1106, counting the pixels in the target preview image to obtain statistical index information.
[0159] Step 1108, determining dynamic range score information based on the statistical indicator information.
[0160] Step 1110, determining an exposure factor according to pixel values in the target preview image.
[0161] Step 1112: Determine whether the shooting scene corresponding to the target preview image is a dynamic range scene based on the relationship between the dynamic range score information and a preset threshold.
[0162] Step 1114: when it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, a corresponding target exposure compensation value is determined according to the exposure factor.
[0163] The method for determining the shooting parameters in the above embodiment, based on the exposure strategy corresponding to the shooting scene set by the target preview image, can accurately obtain a dynamic range exposure strategy with a high degree of matching with the shooting scene corresponding to the target preview image, that is, allocate the number of exposure image frames matching the shooting scene and the corresponding exposure compensation value, thereby improving the synthesis effect and imaging quality of the dynamic range synthetic image.
[0164] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0165] Based on the same inventive concept, the embodiment of the present application also provides a device for determining shooting parameters for implementing the above-mentioned method for determining shooting parameters. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of one or more devices for determining shooting parameters provided below can refer to the limitations of the method for determining shooting parameters above, and will not be repeated here.
[0166] In one embodiment, Fig.12 As shown, a device for determining shooting parameters is provided, including: a pixel information statistics module 1202, a score information determination module 1204, an exposure factor determination module 1206, a dynamic scene determination module 1208 and an exposure compensation determination module 1210, wherein:
[0167] The pixel information statistics module 1202 is used to count the pixels in the target preview image to obtain statistical index information;
[0168] A scoring information determination module 1204, configured to determine dynamic range scoring information according to the statistical indicator information;
[0169] An exposure factor determination module 1206, configured to determine an exposure factor according to pixel values in the target preview image;
[0170] A dynamic scene determination module 1208, configured to determine whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range score information and a preset threshold;
[0171] The exposure compensation determination module 1210 is configured to determine a corresponding target exposure compensation value according to the exposure factor when it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene.
[0172] In one embodiment, the statistical indicator information includes at least one of the number of first pixels, the number of second pixels, the number of third pixels, the number of third pixel blocks, the size of third pixel blocks and the grayscale statistical value of the target area in the target preview image; wherein, the grayscale value corresponding to the first pixel is less than the first grayscale threshold, the grayscale value corresponding to the second pixel is greater than the second grayscale threshold, the first grayscale threshold is less than the second grayscale threshold, and the grayscale value corresponding to the third pixel is the maximum grayscale value; the scoring information determination module 1204 is also used to: perform weighted processing according to at least one of the number of the first pixels, the number of the second pixels, the number of the third pixels, the number of third pixel blocks, the size of the third pixel block and the grayscale statistical value of the target area to obtain a weighted sum, and determine a dynamic range scoring value according to the weighted sum, and the dynamic range scoring value is negatively correlated with the weighted sum.
[0173] In one embodiment, the target preview image includes a first pixel, a second pixel and a fourth pixel, wherein the grayscale value corresponding to the first pixel is less than a first grayscale threshold, the grayscale value corresponding to the second pixel is greater than the second grayscale threshold, and the grayscale value corresponding to the fourth pixel is greater than the first grayscale threshold and less than the second grayscale threshold; the exposure factor includes a first exposure factor and a second exposure factor; the exposure factor determination module 1206 is further used to: determine the first exposure factor according to the pixel value corresponding to the first pixel and the pixel value corresponding to the fourth pixel; determine the second exposure factor according to the pixel value corresponding to the second pixel and the pixel value corresponding to the fourth pixel.
[0174] In one embodiment, the dynamic scene determination module 1208 is further used to: when the dynamic range score information is greater than a first preset threshold, determine that the shooting scene corresponding to the target preview image is a dynamic range scene; when the dynamic range score information is not greater than the first preset threshold, determine that the shooting scene corresponding to the target preview image is not a dynamic range scene.
[0175] In one embodiment, the dynamic scene determination module 1208 is further used to: when the dynamic range score information is greater than a first preset threshold and not greater than a second preset threshold, the shooting scene corresponding to the target preview image is a first-level dynamic scene; when the dynamic range score information is greater than the second preset threshold and not greater than a third preset threshold, the shooting scene corresponding to the target preview image is a second-level dynamic scene; when the dynamic range score information is greater than the third preset threshold, the shooting scene corresponding to the target preview image is a third-level dynamic scene; the third preset threshold is greater than the second preset threshold, and the second preset threshold is greater than the first preset threshold; the number of synthetic image frames under the first-level dynamic scene is less than the number of synthetic image frames under the second-level dynamic scene, and the number of synthetic image frames under the second-level dynamic scene is less than the number of synthetic image frames under the third-level dynamic scene.
[0176] In one embodiment, the exposure compensation determination module 1210 is further used to: determine a baseline exposure compensation value according to the brightness of the target preview image; determine a candidate exposure compensation value according to the baseline exposure compensation value and the exposure factor; and obtain the target exposure compensation value according to the baseline exposure compensation value and the candidate exposure compensation value.
[0177] In one embodiment, the exposure factor includes a first exposure factor and a second exposure factor, and the first exposure factor is less than the second exposure factor; the candidate exposure compensation value includes a first exposure compensation value and a second exposure compensation value; the exposure compensation determination module 1210 is further used to: obtain a first exposure compensation value according to the baseline exposure compensation value and the first exposure factor; obtain a second exposure compensation value according to the baseline exposure compensation value and the second exposure factor.
[0178] In one embodiment, the exposure compensation determination module 1210 is further used to: perform interpolation processing according to the baseline exposure compensation value and the first exposure compensation value to obtain a third exposure compensation value; perform interpolation processing according to the baseline exposure compensation value and the second exposure compensation value to obtain a fourth exposure compensation value; and use the baseline exposure compensation value, the first exposure compensation value, the second exposure compensation value, the third exposure compensation value and the fourth exposure compensation value as the target exposure compensation value.
[0179] In one embodiment, the device also includes a preview brightness adjustment module, which is used to obtain an initial preview image and a brightness adjustment parameter corresponding to the initial preview image before counting the pixels in the target preview image to obtain statistical indicator information; adjust the brightness of the initial preview image according to the brightness adjustment parameter to obtain the target preview image.
[0180] In one embodiment, the preview brightness adjustment module is further used to: obtain an initial preview image; identify corresponding shooting scene information according to the initial preview image; and obtain corresponding brightness adjustment parameters according to the shooting scene information.
[0181] In one embodiment, the preview brightness adjustment module is further used to: when the brightness of a first initial pixel in the initial preview image is greater than a first brightness threshold, adjust the brightness of the first initial pixel according to a first brightness adjustment parameter to obtain the brightness of a first target pixel in the target preview image; the first target pixel corresponds to the first initial pixel; when the brightness of a second initial pixel in the initial preview image is less than a second brightness threshold, adjust the brightness of the second initial pixel according to a second brightness adjustment parameter to obtain the brightness of a second target pixel in the target preview image; the second target pixel corresponds to the second initial pixel; the first brightness threshold is greater than the second brightness threshold.
[0182] Each module in the above-mentioned device for determining photographing parameters can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0183] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.13 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for determining photographing parameters is implemented.
[0184] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0185] The embodiment of the present application also provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the method for determining photographing parameters.
[0186] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute a method for determining photographing parameters.
[0187] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0188] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0189] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0190] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for determining shooting parameters, characterized in that: include: Count the pixels in the target preview image to obtain statistical index information; Performing weighted processing on the statistical indicator information to obtain a weighted sum, and determining a dynamic range score value according to the weighted sum; the dynamic range score value is negatively correlated with the weighted sum; determining an exposure factor according to pixel values in the target preview image; Determining whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range score value and a preset threshold value; the preset threshold value varies according to different shooting scenes; When it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene, the corresponding target exposure compensation value is determined according to the exposure factor.
2. The method according to claim 1, characterized in that The statistical indicator information includes at least one of the number of first pixels, the number of second pixels, the number of third pixels, the number of third pixel blocks, the size of third pixel blocks, and the grayscale statistical value of the target area in the target preview image; wherein the grayscale value corresponding to the first pixel is less than a first grayscale threshold, the grayscale value corresponding to the second pixel is greater than a second grayscale threshold, the first grayscale threshold is less than the second grayscale threshold, and the grayscale value corresponding to the third pixel is the maximum grayscale value; performing weighted processing on the statistical indicator information to obtain a weighted sum, and determining the dynamic range score value according to the weighted sum, includes: Weighted processing is performed based on at least one of the number of the first pixels, the number of the second pixels, the number of the third pixels, the number of third pixel blocks, the size of the third pixel blocks and the grayscale statistics of the target area to obtain a weighted sum, and the dynamic range score value is determined based on the weighted sum.
3. The method according to claim 1, characterized in that The target preview image includes a first pixel, a second pixel, and a fourth pixel, wherein the grayscale value corresponding to the first pixel is less than a first grayscale threshold, the grayscale value corresponding to the second pixel is greater than a second grayscale threshold, and the grayscale value corresponding to the fourth pixel is greater than the first grayscale threshold and less than the second grayscale threshold; the exposure factor includes a first exposure factor and a second exposure factor; and determining the exposure factor according to the pixel value in the target preview image includes: determining the first exposure factor according to a pixel value corresponding to the first pixel and a pixel value corresponding to a fourth pixel; The second exposure factor is determined according to a pixel value corresponding to the second pixel and a pixel value corresponding to the fourth pixel.
4. The method according to any one of claims 1 to 3, characterized in that The determining, based on the relationship between the dynamic range score value and a preset threshold, whether the shooting scene corresponding to the target preview image is a dynamic range scene includes: When the dynamic range score value is greater than a first preset threshold, it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene; When the dynamic range score value is not greater than the first preset threshold, it is determined that the shooting scene corresponding to the target preview image is not a dynamic range scene.
5. The method according to claim 4, characterized in that When the dynamic range score value is greater than a first preset threshold, determining that the shooting scene corresponding to the target preview image is a dynamic range scene includes: When the dynamic range score value is greater than the first preset threshold value and not greater than the second preset threshold value, the shooting scene corresponding to the target preview image is a first-level dynamic scene; When the dynamic range score value is greater than the second preset threshold and not greater than the third preset threshold, the shooting scene corresponding to the target preview image is a secondary dynamic scene; When the dynamic range score value is greater than a third preset threshold, the shooting scene corresponding to the target preview image is a level 3 dynamic scene; The third preset threshold is greater than the second preset threshold, and the second preset threshold is greater than the first preset threshold; the number of synthetic image frames in the first-level dynamic scene is less than the number of synthetic image frames in the second-level dynamic scene, and the number of synthetic image frames in the second-level dynamic scene is less than the number of synthetic image frames in the third-level dynamic scene.
6. The method according to claim 1, characterized in that The determining a corresponding target exposure compensation value according to the exposure factor includes: Determining a reference exposure compensation value according to the brightness of the target preview image; determining a candidate exposure compensation value according to the reference exposure compensation value and the exposure factor; The target exposure compensation value is obtained according to the reference exposure compensation value and the candidate exposure compensation value.
7. The method according to claim 6, characterized in that The exposure factor includes a first exposure factor and a second exposure factor, the first exposure factor being smaller than the second exposure factor; The candidate exposure compensation values include a first exposure compensation value and a second exposure compensation value; The step of determining a candidate exposure compensation value according to the reference exposure compensation value and the exposure factor comprises: Obtaining a first exposure compensation value according to the reference exposure compensation value and the first exposure factor; A second exposure compensation value is obtained according to the reference exposure compensation value and the second exposure factor.
8. The method according to claim 7, characterized in that The step of obtaining the target exposure compensation value according to the reference exposure compensation value and the candidate exposure compensation value comprises: Performing interpolation processing according to the reference exposure compensation value and the first exposure compensation value to obtain a third exposure compensation value; Performing interpolation processing according to the reference exposure compensation value and the second exposure compensation value to obtain a fourth exposure compensation value; The reference exposure compensation value, the first exposure compensation value, the second exposure compensation value, the third exposure compensation value and the fourth exposure compensation value are used as the target exposure compensation value.
9. The method according to claim 1, characterized in that: Before counting the pixels in the target preview image to obtain statistical indicator information, the method further includes: Obtaining an initial preview image and a brightness adjustment parameter corresponding to the initial preview image; The brightness of the initial preview image is adjusted according to the brightness adjustment parameter to obtain the target preview image.
10. The method according to claim 9, characterized in that The obtaining of the initial preview image and the brightness adjustment parameter corresponding to the initial preview image includes: Get the initial preview image; identifying corresponding shooting scene information according to the initial preview image; According to the shooting scene information, corresponding brightness adjustment parameters are obtained.
11. The method according to claim 9, characterized in that The step of adjusting the brightness of the initial preview image according to the brightness adjustment parameter to obtain the target preview image includes: When the brightness of the first initial pixel in the initial preview image is greater than a first brightness threshold, the brightness of the first initial pixel is adjusted according to a first brightness adjustment parameter to obtain the brightness of the first target pixel in the target preview image; the first target pixel corresponds to the first initial pixel; When the brightness of the second initial pixel in the initial preview image is less than the second brightness threshold, the brightness of the second initial pixel is adjusted according to the second brightness adjustment parameter to obtain the brightness of the second target pixel in the target preview image; the second target pixel corresponds to the second initial pixel; and the first brightness threshold is greater than the second brightness threshold.
12. A device for determining photographing parameters, characterized in that: include: The pixel information statistics module is used to count the pixels in the target preview image to obtain statistical index information; A scoring information determination module, configured to perform weighted processing on the statistical indicator information to obtain a weighted sum, and determine a dynamic range scoring value according to the weighted sum; the dynamic range scoring value is negatively correlated with the weighted sum; An exposure factor determination module, used to determine an exposure factor according to pixel values in the target preview image; A dynamic scene determination module, used to determine whether the shooting scene corresponding to the target preview image is a dynamic range scene according to the relationship between the dynamic range score value and a preset threshold value; the preset threshold value varies according to different shooting scenes; The exposure compensation determination module is used to determine the corresponding target exposure compensation value according to the exposure factor when it is determined that the shooting scene corresponding to the target preview image is a dynamic range scene.
13. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Method and device for acquiring exposure compensation value of high-dynamic range image, equipment and medium
CN108337447A
Image noise reduction method and device, electronic equipment and storage medium
CN110248106A
Image contrast adjustment method and device, terminal equipment and storage medium
CN110809146A
Systems and methods for image coding
US20210409761A1
