CN-121985205-A - Shooting method, storage medium, electronic device, and program product
Abstract
The invention relates to the technical field of image processing and discloses a shooting method, a storage medium, electronic equipment and a program product, wherein the method comprises the steps that in the shooting process of the electronic equipment through a long-focus camera, a high-magnification image of the long-focus camera corresponding to the current magnification and a low-magnification image of the long-focus camera corresponding to a smaller magnification smaller than the current magnification are obtained; and when the shooting scene is a low-contrast scene, the image brightness of the high-magnification image is used as a reference to adjust the image brightness of the high-magnification image, so that the image brightness difference is smaller in the process that the electronic equipment switches different magnifications for shooting the same shooting scene, and when the shooting scene is a high-contrast scene, the image brightness of the high-magnification image is used as a reference to adjust the image brightness of the high-magnification image, and the phenomenon of overexposure or underexposure of the high-magnification image is avoided. Therefore, the electronic equipment can adjust the high-magnification image only through the long-focus camera, the normally-open main camera is not needed, and the power consumption is low.
Inventors
- Lv fuxing
Assignees
- 荣耀终端股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20241025
Claims (11)
- 1. A photographing method applied to an electronic device, comprising: Shooting at a first multiplying power; detecting a zooming shooting instruction, wherein the zooming shooting instruction adjusts the first multiplying power to a second multiplying power, and the second multiplying power is larger than the first multiplying power; Collecting a first image under the second multiplying power through a first camera, and collecting a second image under a third multiplying power through the first camera, wherein the third multiplying power is smaller than the second multiplying power, and the display content of the first image corresponds to the display content of a first area in the second image; determining a first luminance value of the first image and a second luminance value of the second image; adjusting the first luminance value of the first image to a third luminance value based on a difference between the first luminance value and the second luminance value; adjusting the brightness value of each pixel point in the first image based on the third brightness value to obtain a third image; And displaying the third image.
- 2. The method of claim 1, wherein the adjusting the first luminance value of the first image to a third luminance value based on the difference between the first luminance value and the second luminance value comprises: Determining a first difference between the first luminance value and the second luminance value; When the first difference value is smaller than or equal to a preset first threshold value, taking a weighted sum of the first brightness value and the second brightness value as the third brightness value, wherein the weight of the first brightness value is smaller than that of the second brightness value, and the weight of the second brightness value is in inverse relation with the first difference value; when the first difference value is larger than the first threshold value and the first brightness value is larger than the second brightness value, reducing the first brightness value by a first brightness difference value to obtain the third brightness value; And when the first difference value is larger than the first threshold value and the first brightness value is smaller than the second brightness value, increasing the first brightness value by a second brightness difference value to obtain the third brightness value.
- 3. The method according to claim 1, wherein the method further comprises: when the first luminance value is equal to the second luminance value, the third luminance value is equal to the second luminance value.
- 4. The method of claim 1, wherein the second magnification is a minimum working magnification of the first camera.
- 5. The method of claim 1, wherein the determining the first luminance value of the first image and the second luminance value of the second image comprises: Taking the average brightness value of the brightness values of all pixel points in the first image as the first brightness value; And taking the average brightness value of the brightness values of all pixel points in the second image as the second brightness value.
- 6. The method according to claim 1, wherein adjusting the brightness value of each pixel point in the first image based on the third brightness value to obtain a third image includes: And multiplying the brightness value of each pixel point in the first image by a brightness ratio to obtain a third image, wherein the brightness ratio is the ratio of the third brightness value to the first brightness value.
- 7. The method according to any one of claims 1 to 6, further comprising: when shooting is carried out at the first multiplying power, the working camera of the electronic equipment is a second camera; and detecting the zooming shooting instruction, and switching a working camera of the electronic equipment from the second camera to the first camera, wherein the first camera and the second camera are different cameras.
- 8. The method of claim 7, wherein the first camera is a tele camera and the second camera is a main camera.
- 9. A computer readable storage medium having stored thereon instructions that, when executed on an electronic device, cause the electronic device to implement the method of any of claims 1 to 8.
- 10. An electronic device, comprising: A memory for storing instructions for execution by one or more processors of the electronic device; And a processor, being one of the processors of the electronic device, for executing instructions stored in the memory to implement the method of any one of claims 1 to 8.
- 11. A program product comprising instructions which, when executed on an electronic device, cause the electronic device to implement the method of any one of claims 1 to 8.
Description
Shooting method, storage medium, electronic device, and program product Technical Field The present invention relates to the field of image processing technologies, and in particular, to a shooting method, a storage medium, an electronic device, and a program product. Background Electronic devices such as cell phones are often configured with different cameras, such as wide angle cameras, main cameras, tele cameras, and the like. The focal lengths of different cameras in an electronic device are generally different, the magnifications (hereinafter referred to as "magnification") corresponding to the different focal lengths are different, and the field of view (FOV) corresponding to the different magnifications is different. For example, the longer the focal length, the larger the magnification and the smaller the angle of view. For example, the electronic device may take a low-magnification image at a large angle of view using a lower magnification or take a high-magnification image at a small angle of view using a higher magnification during the photographing process. However, when the electronic device photographs the same photographed scene with a lower magnification and a higher magnification, respectively, the display brightness of the obtained low-magnification image and high-magnification image may have a large difference. For example, in the same shooting scene, when the electronic device is shooting with a lower magnification, the display brightness of the high-magnification image is usually adjusted based on the corresponding field brightness under a large field angle, when the electronic device is shooting with a higher magnification, the display brightness of the high-magnification image is only adjusted based on the corresponding field brightness under a small field angle, and the field brightness corresponding to different field angles is different, so that the display brightness of the low-magnification image and the display brightness of the high-magnification image may have a larger difference. Disclosure of Invention The embodiment of the invention provides a shooting method, a storage medium, electronic equipment and a program product. The invention provides a shooting method which is applied to electronic equipment and comprises the steps of shooting at a first multiplying power, detecting a zooming shooting instruction, adjusting the first multiplying power to a second multiplying power by the zooming shooting instruction, wherein the second multiplying power is larger than the first multiplying power, acquiring a first image under the second multiplying power through a first camera, acquiring a second image under a third multiplying power through the first camera, wherein the third multiplying power is smaller than the second multiplying power, the display content of the first image corresponds to the display content of a first area in the second image, determining a first brightness value of the first image and a second brightness value of the second image, adjusting the first brightness value of the first image to a third brightness value based on the difference of the first brightness value and the second brightness value, adjusting the brightness value of each pixel point in the first image to obtain a third image based on the third brightness value, and displaying the third image. In the embodiment of the invention, in the process of shooting by the electronic equipment through the long-focus camera (such as the first camera), a high-magnification image (such as the first image) of the current magnification corresponding to the long-focus camera and a low-magnification image (such as the second image) of the smaller magnification corresponding to the current magnification smaller than the current magnification are obtained, when the shooting scene is a low-contrast scene, the image brightness of the high-magnification image is adjusted by taking the image brightness of the low-magnification image as a reference, so that the small difference of the image brightness in the shooting process of switching different magnifications of the same shooting scene by the electronic equipment is ensured, and when the shooting scene is a high-contrast scene, the image brightness of the high-magnification image is taken as a reference to adjust the image brightness of the high-magnification image, thereby avoiding the phenomenon of overexposure or underexposure of the high-magnification image. Therefore, the electronic equipment can adjust the high-magnification image only through the long-focus camera, the normally-open main camera is not needed, and the power consumption is low. In one possible implementation of the first aspect, adjusting the first luminance value of the first image to be the third luminance value based on the difference between the first luminance value and the second luminance value includes determining a first difference value between the first luminance value and the secon