Photographing method, electronic device, and storage medium

By adaptively adjusting the degree of bokeh based on ISO sensitivity and shooting scene, the problem of inflexible bokeh effects on electronic devices has been solved, improving the bokeh effect and user experience while reducing costs.

CN119277193BActive Publication Date: 2025-11-11HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410285752.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-12
Publication Date
2025-11-11
Estimated Expiration
2044-03-12

AI Technical Summary

Technical Problem

In existing technologies, electronic devices are not flexible enough in adjusting the degree of blur in photos, and their reliance on variable aperture cameras leads to high costs. Furthermore, the blurring effect is poor when the user is not a professional.

Method used

Electronic devices can adaptively adjust the degree of bokeh based on light sensitivity and shooting scene. By flexibly adjusting the bokeh effect of the blurred image through light sensitivity, the background sharpness is reduced and the foreground sharpness is improved. This is applicable to devices with and without variable aperture cameras.

Benefits of technology

It enables flexible blur adjustment under different ISO and scene conditions, improves the aesthetics of blurred images and user experience, reduces costs, and adapts to blur processing of different numbers of faces and image content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277193B_ABST
    Figure CN119277193B_ABST
Patent Text Reader

Abstract

This application relates to the field of terminals, and more particularly to a shooting method, electronic device, and storage medium. The method includes: the electronic device displaying a shooting preview interface. Then, in a first shooting scenario, in response to a user's first operation, the electronic device captures a first blurred image. Next, in the same first shooting scenario, in response to a user's second operation, the electronic device captures a second blurred image. The degree of blurring in the second blurred image is greater than that in the first blurred image; the first blurred image corresponds to a first ISO sensitivity, and the second blurred image corresponds to a second ISO sensitivity; the second ISO sensitivity is greater than the first ISO sensitivity. In this method, the electronic device can flexibly adjust the degree of blurring of the blurred image according to the ISO sensitivity. Furthermore, using the above method can improve the blurring effect of the blurred image captured by the electronic device, enhancing the aesthetics of the blurred photo.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and more particularly to a shooting method, electronic device, and storage medium. Background Technology

[0002] With the development of terminal technology, users are using electronic devices more and more frequently. To meet users' needs to record and share their lives anytime, anywhere, most electronic devices such as mobile phones and tablets have shooting functions, allowing them to take photos, record videos, and so on. At the same time, to improve the user experience of photos, electronic devices can add a blurring effect, meaning they can capture photos with a blurred background.

[0003] Currently, how to flexibly adjust the degree of blur in blurred photos is a problem that needs to be solved. Summary of the Invention

[0004] This application provides a shooting method, an electronic device, and a storage medium. In this method, the electronic device can blur an image to different degrees based on its photosensitivity. Therefore, the electronic device can flexibly adjust the degree of blurring in the image.

[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0006] Firstly, a shooting method is provided, applicable to electronic devices such as mobile phones and tablets, the electronic devices including cameras. The method includes: the electronic device displaying a shooting preview interface; then, in a first shooting scenario, in response to a user's first operation, the electronic device captures a first blurred image; next, in the aforementioned first shooting scenario, in response to a user's second operation, the electronic device captures a second blurred image. The degree of blurring in the second blurred image is greater than that in the first blurred image; the first blurred image corresponds to a first ISO sensitivity, and the second blurred image corresponds to a second ISO sensitivity; the second ISO sensitivity is greater than the first ISO sensitivity.

[0007] The first blurred image corresponds to the first sensitivity, which can be understood as the sensitivity of the camera when capturing the original image corresponding to the first blurred image; the second blurred image corresponds to the second sensitivity, which can be understood as the sensitivity of the camera when capturing the original image corresponding to the second blurred image.

[0008] In this method, the electronic device can capture images with different degrees of blur based on the light sensitivity. In other words, the electronic device can flexibly adjust the degree of blur in the image based on the light sensitivity.

[0009] Furthermore, in the above method, since the degree of blurring in the second blurred image is greater than that in the first blurred image, and the second sensitivity is greater than the first sensitivity, meaning that a higher sensitivity results in a higher degree of blurring in the image captured by the electronic device, the blurring effect of the image captured using this method can be comparable to that of an image captured by a camera with a variable aperture function. Therefore, using this method can improve the blurring effect of images captured by electronic devices, enhancing the aesthetic appeal of blurred photos.

[0010] In one possible design of the first aspect, the method further includes: in a second shooting scenario, in response to a third operation by the user, the electronic device captures a third blurred image. The third blurred image corresponds to a third ISO, which is the same as the second ISO; the second shooting scenario differs from the first shooting scenario, and the degree of blurring in the third blurred image differs from the degree of blurring in the second blurred image.

[0011] In this design, the electronic device can capture images with varying degrees of bokeh depending on the shooting scene. In other words, the electronic device can flexibly adjust the degree of bokeh based on the shooting scene, further enhancing the flexibility of adjusting the bokeh level.

[0012] In another possible design of the first aspect, the method further includes: in response to a fourth user operation, the electronic device captures a fourth blurred image; in response to a fifth user operation, the electronic device captures a fifth blurred image; the degree of blurring in the fourth blurred image is greater than the degree of blurring in the fifth blurred image. Wherein, the fourth blurred image includes one face, and the fifth blurred image includes more than one face.

[0013] In this design, the electronic device can capture images with varying degrees of blur based on the number of faces included in the blurred image. In other words, the electronic device can flexibly adjust the degree of blur based on the number of faces, further enhancing the flexibility of adjusting the blur level.

[0014] In another possible design of the first aspect, the degree of blurring of the second blurred image is greater than that of the first blurred image, including: the clarity of the background area of ​​the second blurred image is lower than that of the background area of ​​the first blurred image.

[0015] In another possible design of the first aspect, the sharpness of the background region of the second blurred image is lower than that of the background region of the first blurred image, including: the equivalent aperture value of the second blurred image is smaller than the equivalent aperture value of the first blurred image.

[0016] In another possible design of the first aspect, the electronic device captures the first blurred image, comprising: the electronic device acquiring an original image via a camera; the electronic device reducing the sharpness of the background area of ​​the original image based on the camera's sensitivity when acquiring the original image, to obtain the first blurred image; the non-background area of ​​the original image is the area where the camera's focus target is located. The degree to which the sharpness of the background area of ​​the original image is reduced is positively correlated with the camera's sensitivity.

[0017] In this design, the electronic device can reduce the sharpness of the background area of ​​the original image based on the light sensitivity. Therefore, the electronic device can flexibly reduce the sharpness of the background area of ​​the original image, meaning it can flexibly adjust the degree of blurring in the image.

[0018] In another possible design of the first aspect, reducing the sharpness of the background area of ​​the original image based on the camera's sensitivity when acquiring the original image includes: the electronic device performing face detection on the original image to obtain the number of faces included in the original image. If the number of faces included in the original image is greater than 0, the electronic device obtains a blurring parameter for the original image based on the sensitivity. Next, the electronic device reduces the sharpness of the background area of ​​the original image according to the blurring parameter.

[0019] In another possible design of the first aspect, the aforementioned bokeh parameter obtained based on photosensitivity includes: if the number of faces is 1, the electronic device obtains a first bokeh parameter based on the correspondence between photosensitivity and bokeh parameters under the single-face category, where the single-face category is obtained based on the number of faces being 1. If the number of faces is greater than 1, the electronic device obtains a second bokeh parameter based on the correspondence between photosensitivity and bokeh parameters under the multi-face category, where the multi-face category is obtained based on the number of faces being greater than 1. The aforementioned reduction of the clarity of the background area of ​​the original image based on the bokeh parameter includes: the electronic device reducing the clarity of the background area of ​​the original image by a first ratio based on the first bokeh parameter; or, the electronic device reducing the clarity of the background area of ​​the original image by a second ratio based on the second bokeh parameter. The first bokeh parameter is greater than the second bokeh parameter, and the first ratio is greater than the second ratio.

[0020] In this design, electronic devices can apply different blurring techniques based on the number of faces, such as reducing the degree of blur in the image. This allows for flexible adjustment of the blur level. Furthermore, at the same ISO, the blur level of an image with more than one face is lower than that of an image with only one face; that is, the background of an image with only one face will be more blurred than the background of an image with more than one face. Because the background of an image with only one face is more blurred, the foreground of that image will stand out more, enhancing the blurring effect. And because the background of an image with more than one face is not very blurred, the focal area of ​​that image will be wider, further enhancing the blurring effect.

[0021] In another possible design of the first aspect, the aforementioned first blurring parameter includes: a first sub-blurring parameter, a second sub-blurring parameter, or a third sub-blurring parameter. The electronic device obtains the first blurring parameter based on the correspondence between photosensitivity and blurring parameters under the single-person category, and the photosensitivity itself includes: if the photosensitivity is within a first interval, the electronic device obtains a first sub-blurring parameter; if the photosensitivity is within a second interval, the electronic device obtains a second sub-blurring parameter; if the photosensitivity is within a third interval, the electronic device obtains a third sub-blurring parameter; the first interval, the second interval, and the third interval are all different.

[0022] In another possible design of the first aspect, the aforementioned reduction of the background region sharpness of the original image based on the camera's sensitivity during image acquisition includes: the electronic device performing face detection on the original image to obtain the number of faces included in the original image. If the number of faces in the original image is zero, the electronic device performs content recognition on the original image to obtain a content label, which characterizes the image content. The electronic device obtains the scene category of the original image based on the content label. Then, the electronic device obtains the bokeh parameter of the original image based on the correspondence between sensitivity and bokeh parameters under the scene category, and the camera's sensitivity during image acquisition. Next, the electronic device reduces the sharpness of the background region of the original image based on the bokeh parameter.

[0023] In this design, electronic devices can apply different mappings to blur the image based on its content, such as reducing the degree of blur. This allows for flexible adjustment of the blur level.

[0024] In another possible design of the first aspect, the aforementioned content tag includes a first content tag or a second content tag. Furthermore, the electronic device obtains the scene category of the original image based on the content tag, including: if the content tag includes a first content tag (e.g., a text content tag), then the scene category of the original image is a first scene category (e.g., a multi-body scene category). If the content tag includes a second content tag (e.g., a green plant content tag), then the scene category of the original image is a second scene category (e.g., an object scene category). The electronic device obtains the bokeh parameter of the original image based on the correspondence between sensitivity and bokeh parameters under the scene category, and the sensitivity, including: if the scene category of the original image is a first scene category, then the electronic device obtains a third bokeh parameter based on the correspondence between sensitivity and bokeh parameters under the first scene category, and the sensitivity. If the scene category of the original image is a second scene category, then the electronic device obtains a fourth bokeh parameter based on the correspondence between sensitivity and bokeh parameters under the second scene category, and the sensitivity. The aforementioned reduction of the background region sharpness of the original image based on the blurring parameters of the original image includes: the electronic device reducing the sharpness of the background region of the original image at a third ratio based on a third blurring parameter; or, reducing the sharpness of the background region of the original image at a fourth ratio based on a fourth blurring parameter. The third blurring parameter and the fourth blurring parameter are different, and the third ratio and the fourth ratio are different.

[0025] In another possible design of the first aspect, the above-mentioned display of the shooting preview interface includes: the electronic device performs blurring processing on the image captured by the camera in real time according to the camera's light sensitivity to obtain a blurred preview image; and displays the blurred preview image on the shooting preview interface.

[0026] In this design, the electronic device can display a blurred preview image in real time on the preview interface based on the camera's light sensitivity. This allows users to view the blurred preview image directly on the preview screen, enhancing the user experience. Furthermore, the electronic device can flexibly display blurred preview images with varying degrees of blur based on the actual blurred image.

[0027] In another possible design of the first aspect, the above method further includes: the electronic device acquiring a sixth image. Then, the electronic device displays an image display interface for the sixth image, the image display interface including the sixth image and a blurring control. Next, in response to a triggering operation of the blurring control, the electronic device reduces the sharpness of the background area of ​​the sixth image based on the light sensitivity corresponding to when the sixth image was captured, thus obtaining a sixth blurred image.

[0028] In this design, the electronic device also blurs the image in the image display interface based on the light sensitivity, reducing the sharpness of the background area. This allows for flexible adjustment of the blur level based on the light sensitivity.

[0029] In a second aspect, an electronic device is provided, the electronic device including a memory and one or more processors, the memory being coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions; when the computer instructions are executed by the processor, the electronic device performs the method provided by the first aspect and any possible design of the first aspect.

[0030] Thirdly, a computer-readable storage medium is provided, including computer instructions that, when executed on an electronic device, cause the electronic device to perform the methods provided by the first aspect and any possible design of the first aspect.

[0031] Fourthly, a computer program product containing instructions is provided, which, when run on an electronic device, enables the electronic device to perform the methods provided by the first aspect and any possible design of the first aspect.

[0032] Fifthly, a chip system is provided for use in an electronic device, the chip system including one or more processors for invoking computer instructions to cause the electronic device to perform the methods provided by the first aspect and any possible design of the first aspect.

[0033] The technical effects of any of the design methods in aspects two through five can be found in the technical effects of different design methods in aspect one, and will not be repeated here. Attached Figure Description

[0034] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0035] Figure 2 A schematic diagram of the architecture of an electronic device provided in an embodiment of this application;

[0036] Figure 3 A schematic diagram of the shooting method provided for the implementation of this application;

[0037] Figure 4 A schematic diagram of data flow provided for embodiments of this application;

[0038] Figure 5 A schematic diagram of the blurring parameter-sensitivity function provided for an embodiment of this application;

[0039] Figure 6 A schematic diagram illustrating a user shooting process provided in an embodiment of this application;

[0040] Figure 7 A schematic diagram of a set of user image interfaces provided in the embodiments of this application;

[0041] Figure 8 A schematic diagram illustrating yet another user shooting process provided in an embodiment of this application;

[0042] Figure 9 A schematic diagram illustrating another user shooting process provided in an embodiment of this application;

[0043] Figure 10 A schematic diagram illustrating yet another user shooting process provided in an embodiment of this application;

[0044] Figure 11 A schematic diagram illustrating another user shooting process provided in an embodiment of this application;

[0045] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0046] Figure 13 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation

[0047] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of the embodiments of this application, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0048] In this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being better or more advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.

[0049] The technical solutions disclosed in this application involve the collection, storage, use, processing, transmission, provision, and disclosure of users' personal information, all of which comply with relevant laws and regulations and do not violate public order and good morals.

[0050] With the development of terminal technology, users are using electronic devices more and more frequently. To meet users' needs to record and share their lives anytime, anywhere, most electronic devices such as mobile phones and tablets have shooting functions, allowing them to take photos, record videos, and so on. To improve the user experience of photos, electronic devices can add blurring effects to photos, such as blurring the background and highlighting the foreground. Photos with blurring effects can be called blurred photos.

[0051] In some solutions, electronic devices can adjust the degree of bokeh in a captured photo by changing the aperture size of the device during image capture. For example, an electronic device can capture a bokeh photo using a camera with variable aperture functionality. Specifically, when capturing a bokeh photo using a camera, the electronic device can change the aperture size of the camera to alter the degree of bokeh. Generally speaking, bokeh photos captured using a variable aperture camera produce a better bokeh effect, offering a higher level of visual appeal and aesthetics.

[0052] However, in this approach, cameras with variable aperture are relatively expensive, and the cost of electronic devices to change the blur level of a blurred photo in this way is also quite high.

[0053] In other solutions, electronic devices can blur images to create blurred photos. For example, an electronic device can segment a photo to separate the foreground and background. Then, the device reduces the background sharpness and / or increases the foreground sharpness, resulting in a blurred photo (hereinafter referred to as a blurred photo). Understandably, because this solution does not rely on a camera with an aperture-adjustable function, it is applicable to electronic devices equipped with both aperture-adjustable and non-aperture-adjustable cameras.

[0054] When a user takes a photo with a blurred background using an electronic device, the user can actively adjust the degree of blur. For example, a user can trigger the electronic device to take a photo through the camera's preview interface. When the user triggers the photo through the preview interface, they can set the aperture value for this photo. By changing the aperture value, the user can change the degree of blur in the resulting image.

[0055] It should be understood that for electronic devices equipped with cameras featuring adjustable aperture, the aforementioned "aperture value of the electronic device taking this photo" can be understood as the actual aperture size of the camera, or as the aperture size virtualized by the electronic device using virtual aperture technology. Furthermore, for electronic devices without cameras featuring adjustable aperture, the aforementioned "aperture value of the electronic device taking this photo" can be understood as the aperture size virtualized by the electronic device using virtual aperture technology.

[0056] However, this approach requires users to manually set the aperture value in the shooting preview interface, making adjustments to the degree of bokeh in the photos less flexible. Furthermore, if users lack professional photography knowledge and skills, the resulting photos taken with the phone based on the user-defined aperture value may have poor bokeh effects and low aesthetic appeal.

[0057] In conclusion, how to flexibly adjust the degree of blur in photos obtained through bokeh processing on electronic devices is a problem that needs to be solved. Furthermore, how to improve the blur effect of bokeh photos is also a problem that needs to be solved.

[0058] In view of this, embodiments of this application provide a shooting method in which, in response to a user's shooting operation, an electronic device can capture a blurred image; and, during the process of capturing a blurred image, the electronic device can adaptively blur the image to different degrees based on the sensitivity of the electronic device and the shooting scene (e.g., the content being captured, the number of faces included in the image, etc.). For example, the electronic device can determine the degree of blurring when blurring the image based on the sensitivity of the camera when capturing the image, and then blur the image based on the degree of blurring to obtain the blurred image; or, the electronic device can also determine the degree of blurring when blurring the image based on the image content (e.g., static objects, artificial environments, natural environments, etc.), and then blur the image based on the degree of blurring to obtain the blurred image. The aforementioned sensitivity can also be abbreviated as ISO.

[0059] In this method, the blurred image is obtained through bokeh processing by the electronic device. Therefore, blurred images can be obtained regardless of whether a variable aperture camera is deployed. This means that the cost of the electronic device can be saved. Furthermore, during the bokeh processing, the electronic device can adjust the degree of blur without relying on the aperture value set by the user, allowing for convenient and flexible adjustment of the blurred image's blur level, thus improving the user experience. Moreover, because the electronic device can adaptively blur the image to different degrees based on its sensitivity and the content being captured, the blurred image obtained through bokeh processing can be comparable to a blurred image captured by a variable aperture camera. This enhances the bokeh effect of the blurred image and improves the aesthetics of the blurred photo.

[0060] The aforementioned images can be understood as photographs or video frames. The degree of blurring in these images can be understood as the reduction in the sharpness of the image's background. It can be understood that the degree of reduction in background sharpness can be characterized by the image's equivalent aperture; the equivalent aperture value is inversely proportional to the degree of blurring. For example, image A is blurred to obtain blurred image A. The greater the degree of blurring in blurred image A, the greater the reduction in the sharpness of the background of blurred image A compared to the background of image A, and the smaller the equivalent aperture value of blurred image A compared to image A.

[0061] It should be understood that in the embodiments of this application, the foreground and background of an image are two relative concepts. The foreground of an image can also be referred to as the foreground region of the image, and the background of an image can also be referred to as the background region of the image. In some embodiments, the foreground can be understood as the region where the camera of the electronic device is focused when capturing the image. The background can be understood as the region in the image other than the region where the camera is focused when capturing the image. The focus target is the target corresponding to the focal point of the camera of the electronic device.

[0062] For example, the technical solutions provided in this application can be applied to the process of a user using the shooting function of an electronic device. The aforementioned electronic device can also be referred to as a terminal, terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The aforementioned electronic device 100 can be a mobile phone, tablet computer, wearable device, smart screen, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), or other electronic devices with shooting functions. This application does not impose any limitations on the product form of the electronic device.

[0063] Next, the hardware structure and architecture of the electronic device provided in the embodiments of this application will be described.

[0064] Figure 1 The diagram shows the hardware structure of an electronic device 100, which may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a camera 193, and a display screen 194, etc.

[0065] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0066] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0067] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0068] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0069] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, a mobile industry processor interface (MIPI), and / or a universal serial bus (USB) interface, etc.

[0070] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).

[0071] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0072] USB interface 130 is an interface that conforms to the USB standard specification, specifically it can be a Mini USB interface, Micro USB interface, USB Type C interface, etc. USB interface 130 can be used to connect a charger to charge electronic device 100, and it can also be used for data transfer between electronic device 100 and peripheral devices.

[0073] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0074] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0075] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0076] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0077] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature during the shooting process. In some embodiments, the ISP can be set in the camera 193.

[0078] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0079] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0080] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0081] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0082] After introducing the hardware structure of the electronic device provided in the embodiments of this application, the architecture of the electronic device will be described.

[0083] The architecture of the electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses a layered architecture based on Android. TM Taking the system as an example, the architecture of electronic device 100 is illustrated.

[0084] For example, see Figure 2 A layered architecture can be divided into several layers, each with a clear role and function. Layers communicate with each other through interfaces. In some embodiments, Android... TM The system is divided into five layers, from top to bottom: application layer, application framework layer, hardware abstraction layer (HAL), kernel layer, and hardware layer.

[0085] The application layer can include a series of application packages.

[0086] like Figure 2 As shown, the application package can include applications such as camera apps and gallery apps.

[0087] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0088] like Figure 2 As shown, the application framework layer may include a window manager, content provider, view system, resource manager, etc.

[0089] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0090] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0091] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0092] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0093] The application framework layer may also include a camera interface, which provides an API to the camera application so that the camera application can interact with the camera module of the HAL layer by calling the API.

[0094] The Hardware Abstraction Layer (HAL) is an abstraction layer that sits between the hardware and higher layers. It provides a unified interface to the upper layers, allowing applications to work without needing to know the specifics of how the underlying hardware works, thus shielding them from the underlying implementation details.

[0095] The Hardware Abstraction Layer (HAL) provides a standard interface to expose device hardware functionality to higher-level application framework layers. The HAL contains multiple library modules, each implementing an interface for a specific type of hardware component. These library modules include, at a minimum, a camera module, etc. When the application framework layer requests access to the device hardware, the system loads the corresponding library module for that hardware component. Manufacturers can define interfaces within the HAL.

[0096] The camera module may include: a bokeh processing module, a bokeh decision-making module, a scene content awareness module, an AE module, etc. The functions of each of these modules will be explained in detail in subsequent examples.

[0097] The kernel layer is the layer between hardware and software, located below the HAL (Hardware Layer). The kernel layer contains at least the display driver, camera driver, and so on.

[0098] The hardware layer includes at least a camera.

[0099] The following is an example illustrating the workflow of the hardware and software of the electronic device during the shooting process.

[0100] For example, see Figure 2 , Figure 2 The sparse dashed lines in the diagram illustrate the transmission path of control commands. For example, during runtime, the camera application can send user-issued control commands (e.g., start shooting, stop shooting, zoom in, zoom out, etc.) to the camera interface in the frame layer, and then the camera interface sends these commands to the camera module in the HAL layer. Next, the camera module calls the camera driver in the kernel layer to drive the camera in the hardware layer to perform actions corresponding to the aforementioned control commands (e.g., turn on the camera, turn off the camera, adjust camera parameters, etc.).

[0101] Next, see you again. Figure 2 , Figure 2 The solid lines in the image data transmission path are shown. After the camera begins acquiring image data, it transmits the acquired image data to the camera module via the camera driver. For example, the camera transmits image data A to the scene content awareness module of the camera module via the camera driver. Next, the scene content awareness module performs scene detection on image data A to obtain scene detection information and sends this information to the bokeh decision module. Then, the bokeh decision module obtains the camera's ISO at the time of acquiring image data A from the automatic exposure (AE) module. Next, the bokeh decision module obtains the bokeh parameters for image A based on the ISO and scene detection information. Image A is the image corresponding to image data A. Then, the bokeh processing module performs bokeh processing on image A according to the bokeh parameters to obtain a blurred image A. Finally, the bokeh processing module sends the blurred image A to the camera application via the camera interface. Thus, the camera application can display the blurred image A in the shooting preview interface. Alternatively, the camera application can also send the blurred image A to the gallery application, which will then store the blurred image A.

[0102] It should be pointed out that, in Figure 2 The workflow of the AE module is illustrated by densely dotted lines. When the camera acquires image data, the AE module obtains the image data from the camera driver and, based on the image data and a preset AE algorithm, controls the camera's exposure-related parameters (such as ISO, shutter speed, etc.) through the camera driver. For example, the AE algorithm obtains the exposure-related parameters for the current frame from the previous frame's image data, and the camera acquires the image data for the current frame based on these parameters. The AE algorithm can then send the ISO to the bokeh decision module. It should be understood that the AE algorithm is a mechanism that automatically adjusts the exposure and gain based on the intensity of ambient light to prevent overexposure or underexposure.

[0103] Below, we take a mobile phone as an example of an electronic device, which has the above-mentioned features. Figure 1 The hardware structure shown, and the hardware having the above Figure 2 Taking the illustrated architecture as an example, the shooting method provided in the embodiments of this application will be introduced.

[0104] For example, see Figure 3 The shooting method provided in this application embodiment may include steps S300-S304.

[0105] The S300 phone displays the shooting preview interface.

[0106] After the phone displays the shooting preview interface, the phone's camera continuously captures image data and displays the corresponding images on the shooting preview interface. In other words, the shooting preview interface includes images captured by the phone's camera in real time.

[0107] It should be understood that users can trigger the display of the camera preview interface in various ways while using their mobile phones. For example, users can trigger the display of the camera preview interface by clicking the camera app icon. Alternatively, users can trigger the display of the camera preview interface via voice command. Specifically, the settings can be configured according to actual usage needs, and this application embodiment does not impose any restrictions on the methods for triggering the display of the camera preview interface.

[0108] As is understandable, capturing raw (RAW) images by a camera is a continuous process, thus generating an image data stream, which can be simply referred to as a data stream. In other words, during a phone's shooting process, the data stream of the RAW image captured by the phone's camera can be divided into multiple data streams. Some data streams are used to display preview images on the phone's preview screen, some are used to generate photos, and some are used to assist in shooting, such as guiding the camera to focus and adjusting camera parameters.

[0109] For example, see Figure 4 The phone preprocesses the RAW image data stream captured by the camera to obtain a first data stream and a second data stream. This preprocessing may include operations such as encoding conversion. The first data stream is used to display a preview image on the phone's preview interface, while the second data stream is used to generate the shooting result, such as a photo, video, or image. Furthermore, the first data stream can be downsampled to reduce its resolution, resulting in a third data stream, which assists the phone in shooting. The first data stream can also be referred to as the preview stream, and the third data stream can also be referred to as the tiny stream.

[0110] It should be noted that in some other embodiments, tiny can also be obtained by downsampling the second data stream described above, and the specific settings can be configured according to actual usage requirements.

[0111] It should be understood that during the shooting process, the mobile phone can also have more data streams, and the specific settings can be made according to actual usage needs. This application embodiment does not impose any restrictions on this.

[0112] In some embodiments, the phone's bokeh effect can be always on; in other embodiments, the bokeh effect can be activated in response to user actions, such as when the user triggers the phone to activate portrait mode or bokeh mode. Specifically, the method of activating the bokeh effect can be set according to actual usage needs, and this application does not limit this.

[0113] S301. The scene perception module performs face detection on the image to obtain the number of faces.

[0114] The image can be an image included in the tiny stream, or an image included in the first or second data stream mentioned above. Alternatively, the image can also be a RAW image. Specifically, it can be set according to actual usage requirements, and this application embodiment does not limit this. In the following embodiments of this application, face detection of an image included in the tiny stream by the scene perception module will be used as an example for explanation.

[0115] Furthermore, the method by which the scene perception module performs face detection on the image can refer to relevant technologies. For example, the image can be detected by a pre-trained artificial intelligence model related to face recognition to obtain face detection boxes. Then, the scene perception module counts the number of face detection boxes to obtain the number of faces. This application embodiment does not impose any restrictions on this.

[0116] It should be noted that the above number of faces can be understood as the number of faces included in the image, that is, the number of face detection boxes obtained by the scene perception module when performing face detection on the image; and the above number of faces can also be understood as the number of faces in the image whose size conforms to the preset, that is, the number of face detection boxes obtained by the scene perception module when performing face detection on the image and conforming to the preset.

[0117] For example, if the scene perception module performs face detection on an image and does not detect any faces (i.e., does not obtain a face detection box), then the scene perception module will obtain a face count of 0. As another example, if the scene perception module performs face detection on an image and detects one face (i.e., obtains a face detection box), but the size of this face detection box does not conform to a preset value, then the scene perception module will obtain a face count of 0.

[0118] The fact that the size of the face detection box does not meet the preset can be understood as the percentage of the image occupied by the face detection box being less than the percentage threshold, which can be 10%, 8%, 15%, etc.

[0119] After step S301, if the scene perception module obtains that the number of faces is 0, the mobile phone executes step S302.

[0120] S302. The scene perception module performs scene detection on the image to obtain the scene category.

[0121] In step S302, the image used for scene detection by the scene perception module is the same as the image in step S301. Furthermore, the method by which the scene perception module performs scene detection on the image can refer to relevant technologies. For example, a pre-trained AI model related to content recognition can be used to perform content recognition on the image to obtain its content tags. These content tags can include: cat, dog, panda, blue sky, night scene, fireworks, cloudy day, sunset, beach, snow, waterfall, stage, ancient building, text, food, flowers, green plants, car, bicycle, etc. Subsequently, the scene perception module can determine the scene category of the image based on the correspondence between content tags and scene categories. The number of scene categories is less than the number of content tags. Understandably, because the scene perception module can define content tags to fewer scene categories than content tags, it can reduce the amount of data required for the subsequent bokeh decision module to obtain the bokeh parameters of the image, thereby improving the performance of the mobile phone when performing image bokeh.

[0122] In some embodiments, the aforementioned scene categories may include: static entity categories, man-made environment categories, natural environment categories, and other categories. The static entity category may include content tags such as cats, dogs, pandas, food, flowers, green plants, cars, and bicycles. The man-made environment category may include content tags such as fireworks, stages, ancient buildings, and text. The natural environment category may include content tags such as blue sky, night scene, cloudy day, sunset, beach, snow, and waterfall. The other categories include content tags other than those included in the static entity category, man-made environment category, and natural environment category.

[0123] Alternatively, in other embodiments, the aforementioned scene categories may include: single-object scene categories (including content tags such as cat, dog, panda, etc.), environmental scene categories (including content tags such as blue sky, night scene, fireworks, cloudy day, sunset, beach, snow, waterfall, etc.), multi-object scene categories (including content tags such as stage, ancient building, text, etc.), object scene categories (including content tags such as food, flowers, green plants, car, bicycle, etc.), and other scene categories. The content tags included in other scene categories are those other than those included in the single-object scene categories, environmental scene categories, multi-object scene categories, and object scene categories.

[0124] It should be understood that in some other embodiments, there may be more other labels, which can be set according to actual usage requirements.

[0125] In some embodiments, the aforementioned multi-body scene category may be referred to as the first scene category, the aforementioned object scene category may be referred to as the second scene category, the aforementioned environment scene category may be referred to as the third scene category, the aforementioned single-body scene category may be referred to as the fourth scene category, and the aforementioned other scene categories may be referred to as the fifth scene category.

[0126] After step S302, the mobile phone executes step S303; or, if the scene perception module obtains that the number of faces is not 0, the mobile phone executes step S303.

[0127] S303. The blurring decision module obtains the blurring parameters of the image based on the ISO corresponding to the above image.

[0128] ISO reflects the camera's sensitivity to light when capturing image data for a given image; a higher ISO indicates greater sensitivity. The bokeh decision module obtains the ISO corresponding to the image from the AE module, which is calculated using the AE algorithm. It should be understood that the ISO value should be a positive integer. The bokeh parameter controls the degree to which the bokeh processing module reduces the background sharpness of the image during subsequent bokeh processing; in other words, it determines the degree of bokeh in the generated image. A higher bokeh parameter results in a greater reduction in background sharpness, leading to a more bokeh-rich image, and vice versa.

[0129] As one possible implementation, the bokeh decision module can be configured with bokeh parameter relationships corresponding to different shooting scenarios. The shooting scenarios can be divided according to the number of faces included in the image and the image content.

[0130] The blurring parameter relationship is the correspondence between ISO and blurring parameters. Next, if the number of faces is 1 in step S301, the blurring parameters of the image are obtained according to the correspondence between ISO and blurring parameters under the single-person category; if the number of faces is greater than 1 in step S301, the blurring parameters of the image are obtained according to the correspondence between ISO and blurring parameters under the multi-person category; if the number of faces is 0 in step S301, the blurring parameters of the image are obtained according to the correspondence between ISO and blurring parameters under the scene category of the image.

[0131] For example, a possible correspondence between ISO and bokeh parameters is shown in Table 1 below:

[0132] Table 1

[0133]

[0134] As another example, another possible correspondence between ISO and bokeh parameters is shown in Table 2 below:

[0135] Table 2

[0136]

[0137] In some embodiments, the ISO ranges in Table 1 or Table 2 above, such as [50, 300], can be referred to as the first interval, [301, 600] as the second interval, [601, 1200] as the third interval, and [1201, +∞] as the fourth interval. As can be seen from Table 2 above, under the single-person category, if the ISO is within the first interval, the resulting blurring parameter is 50, which is the first sub-blurring parameter. And, under the single-person category, if the ISO is within the second interval, the resulting blurring parameter is 60, which is the second sub-blurring parameter. And, under the single-person category, if the ISO is within the third interval, the resulting blurring parameter is 70, which is the third sub-blurring parameter.

[0138] It should be understood that in other correspondences between ISO and bokeh parameters, the ISO range can be further refined. For example, the ISO range can be divided into [50, 150], [151, 300], [301, 450], [451, 600], [601, 900], [901, 1200], [1201, +∞], etc. Specifically, this can be set according to actual usage needs. Furthermore, in practical use, the above correspondence between ISO and bokeh parameters can be set according to the camera's ISO range. If the camera's minimum ISO is 50, then the minimum ISO in the correspondence between ISO and bokeh parameters can be 50; if the camera's minimum ISO is 30, then the minimum ISO in the correspondence between ISO and bokeh parameters can be 30.

[0139] As another possible implementation, during step S303 above, the blurring decision module can also calculate the blurring parameters of the image based on the ISO corresponding to the image.

[0140] For example, taking a single-person scenario as an example, the blurring decision module can... Figure 5 The corresponding ISO-blur parameter function calculates the blur parameters of the image.

[0141] After step S303, the mobile phone executes step S304.

[0142] S304. The blurring processing module performs blurring processing on the image according to the blurring parameters to obtain a blurred image.

[0143] For example, the blurring module can segment the image into foreground and background, obtaining the foreground and background. Then, it reduces the sharpness of the background based on the blurring parameters. For instance, if the blurring parameter is 60, the background sharpness is reduced by 60%; if the blurring parameter is 70, the background sharpness is reduced by 70%, and so on. Next, the blurring module can fuse the reduced-sharp background and foreground to obtain a blurred image.

[0144] Understandably, the blurring processing module can segment the image into foreground and background in various ways. For example, it can achieve foreground and background segmentation by calculating the depth of field using two cameras. Alternatively, it can achieve foreground and background segmentation using a manually created model. Specifically, the design can be tailored to actual usage requirements, and this application embodiment does not limit this approach.

[0145] It is understandable that in low-light shooting environments, if a variable aperture camera is used, the aperture of this type of camera will be relatively large, resulting in a shallow depth of field. Using this type of camera will result in a higher degree of bokeh in the captured image.

[0146] In the solutions provided in this application embodiment, as can be seen from the correspondence between ISO and bokeh parameters (as shown in Tables 1 and 2), a larger ISO corresponds to a larger bokeh parameter. Furthermore, a larger bokeh parameter results in a higher degree of bokeh in the subsequently generated bokeh image. In other words, in this application embodiment, the degree of bokeh in the image is directly proportional to the ISO of the mobile phone's camera when capturing the image. It is understandable that, as described above regarding the AE module, ISO is obtained based on the AE algorithm. A larger ISO reflects a lower brightness environment during camera shooting. That is, in low-light conditions, the shooting method provided in this application embodiment yields a bokeh image with a higher degree of bokeh. Therefore, the bokeh image obtained using the solution provided in this application embodiment has a similar bokeh effect to the bokeh image obtained using a variable aperture camera; thus, the bokeh image obtained using the solution provided in this application embodiment can be compared to the bokeh image obtained using a variable aperture camera. Therefore, the mobile phone, through the above... Figure 3 The resulting blurred image has a good blurring effect and is aesthetically pleasing.

[0147] In some embodiments, during the process of blurring the image according to the image's blurring parameters, the blurring processing module can also improve the sharpness of the foreground of the image. Thus, a blurred image can also be obtained.

[0148] It should be noted that during step S304, the image processed by the blurring processing module can be one or more of the images from the first data stream, the second data stream, and RAW images.

[0149] For example, if in step S304 the blurring processing module performs blurring processing on the image of the first data stream according to the image blurring parameters to obtain a blurred image, then after step S304, the mobile phone can display the blurred image on the preview interface. In this way, the user can see the blurred image after previewing the image on the mobile phone's preview interface.

[0150] In some embodiments, the above-described shooting method may not include step S300; that is, the mobile phone can start executing the shooting method from step S301. For example, if the mobile phone starts executing the above-described shooting method from step S301, the mobile phone can perform steps S301-S303 on the image of the tiny stream, and the mobile phone can perform step S304 on the image of the second data stream to obtain a blurred image. Alternatively, the mobile phone can acquire an image from a photo album application and perform steps S301-S304 on the image acquired from the photo album application.

[0151] In some implementations, step S301 may be triggered when the phone executes step S301 in response to a user's shooting instruction. Following step S301, steps S302-S304 are then executed, or steps S302 and S304 are executed. During step S304, the phone performs blurring processing on the image of the second data stream according to blurring parameters to obtain a blurred image, and the phone's gallery application saves the blurred image.

[0152] For example, taking step S304 where the blurring processing module blurs both the image from the first data stream and the image from the second data stream as an example, steps S301-S304 will be described below. See Figure 6 ,exist Figure 6 In the scenario shown, a user takes a picture using mobile phone 100. During the process of the user taking the picture with mobile phone 100, the phone's camera captures image data of the real image 500 to generate a RAW image. It should be understood that... Figure 6In the illustrated scene, the image within the dashed box represents the physical world, which can be referred to as the real image 500. Next, the phone generates a first data stream and a second data stream based on the original image, and downsamples the first data stream to obtain a third data stream, the tiny stream. Then, the phone performs step S301 on the image included in the tiny stream. Since the real image 500 includes a face, the phone performs step S303 after step S301 to obtain the blurring parameters. Next, the phone performs step S304 on the image in the first data stream to obtain a blurred image 1, and displays the blurred image A501 in the shooting preview interface 502. Furthermore, in response to the shooting trigger operation, the phone performs step S304 on the second data stream to obtain and save the blurred image B503.

[0153] Specifically, when the mobile phone executes step S304, the "people" in the real image 500 are segmented as foreground, and the "trees" in the real image 500 are segmented as background. In the above... Figure 6 A diagonal line fills the image to indicate lower sharpness. For example, the sharpness of the trees in the blurred image A501 is lower than that of the trees in the real image 500; and the sharpness of the trees in the blurred image B503 is lower than that of the trees in the real image 500.

[0154] It is understood that the above-mentioned shooting trigger operation can be a click operation on the shooting control 502B included in the shooting preview interface 502, or it can be other operations, such as the user's voice shooting command, etc. This application embodiment does not limit this.

[0155] In addition, in some embodiments, in response to a shooting trigger operation, the mobile phone can also display a thumbnail of the blurred image B503 in the shooting result display control 502A.

[0156] It should be noted that because the phone uses the same blurring parameters for both the first and second data streams in step S304 during the above process, the blurring image displayed on the phone's preview screen and the blurring image saved on the phone will have the same degree of blurring; for example, blurring image A and blurring image B will have the same degree of blurring. Therefore, users can observe the degree of blurring in the captured image directly in the phone's preview screen, allowing them to grasp the degree of blurring in the captured image at a glance, thus improving the user experience.

[0157] It should also be noted that, due to the above Figure 6In the corresponding process, after the phone executes step S301, if the number of faces is not zero, then the phone is triggered to execute step S303, meaning the phone does not execute the aforementioned step S302. It is evident that in the above method, if a face is detected in the image, scene detection is not performed. This improves the efficiency of the phone in generating blurring parameters during portrait photography, thereby increasing the efficiency of the phone's blurring processing. As can be seen from the above description, in the shooting method provided in this application embodiment, face detection has a higher priority than scene detection; and because face detection has a higher priority than scene detection, the efficiency of the phone's blurring processing can be improved.

[0158] In other embodiments, the processes described in S301-S304 of this application can also be used for post-processing of images.

[0159] For example, see Figure 7 , Figure 7 The clarity of the diagonal fill in the image is relatively low. The phone displays a gallery preview interface 7000, which includes thumbnails of multiple images. Then, in response to a click on the target image thumbnail 7001, the phone displays an image display interface 7100, which includes a blur control 7101 and the target image 7102. Then, in response to a click on the blur control 7101, the phone displays a blurred target image display interface 7200, which includes a blurred target image 7201. The background clarity of the blurred target image 7201 is lower than that of the target image 7102. The blurred target image 7201 is obtained by the phone performing the above steps S301-S304 on the target image 7102. For example, the phone performs face extraction on the target image 7102 and obtains a face count of 1. Next, since the number of faces is not zero, the phone obtains the target blurring parameters based on the sensitivity of the target image 7102. Then, the phone blurs the target image 7102 according to the target blurring parameters to obtain the blurred target image 7201. The sensitivity of the target image 7102 can be obtained from the exchangeable image file format (EXIF) information of the target image 7102. It should be understood that the EXIF ​​information of the image records relevant parameters of the camera when the camera captured the image, such as the camera's sensitivity, shutter speed, etc.

[0160] The shooting method provided in the embodiments of this application will be described below with reference to the specific shooting process.

[0161] For example, see Figure 8 ,exist Figure 8In the image, the sharpness of the diagonal and horizontal fill lines is relatively low, with the horizontal fill lines being less sharp than the diagonal fill lines. It should be understood that... Figure 8 During the demonstration, the image within the dashed box represents the image in the physical world, which can be referred to as the real image 600.

[0162] exist Figure 8 During the demonstration, the user takes a picture using mobile phone 100. While the user is taking the picture, the phone's camera captures image data of a real image 600 at a first sensitivity. Next, in response to the user's shooting operation, the phone executes the aforementioned steps S301, S303, and S304, and the phone obtains a first blurred image 601. That is, in the first shooting scenario, in response to the user's first operation, the phone captures a first blurred image.

[0163] Next, the phone's camera captures image data of the aforementioned real image 600 at a second sensitivity. Then, in response to the user's shooting operation, the phone executes steps S301, S303, and S304, obtaining the second blurred image 602. In other words, in the first shooting scenario, in response to the user's second operation, the phone captures the second blurred image.

[0164] It should be noted that since the second sensitivity is higher than the first sensitivity, the bokeh parameter 2 obtained when the phone performs step S303 at the second sensitivity will be greater than the bokeh parameter 1 obtained when the phone performs step S303 at the first sensitivity. This will cause the bokeh degree of the second bokeh image 602 to be higher than that of the first bokeh image 601. For example, the clarity of the "trees" included in the second bokeh image 602 is lower than that of the "trees" included in the first bokeh image 601; and the equivalent aperture value of the second bokeh image 602 is smaller than that of the first bokeh image 601.

[0165] Understandably, the statement that the second ISO sensitivity is higher than the first ISO sensitivity can be interpreted as the second ISO sensitivity being higher than the ISO threshold, and the first ISO sensitivity being lower than the ISO threshold. The ISO threshold can be the endpoint of the ISO range in the aforementioned correspondence between ISO and bokeh parameters. For example, the second ISO sensitivity is 1000, and the first ISO sensitivity is 500.

[0166] For another example, see Figure 9 , Figure 9 In the image, the sharpness of the diagonal and horizontal fill lines is relatively low, with the horizontal fill lines being less sharp than the diagonal fill lines. It should be understood that... Figure 9 During the demonstration, the images within the dashed boxes represent images from the physical world, such as real image 700 and real image 702.

[0167] exist Figure 9 During the demonstration, the user uses mobile phone 100 to capture a real image 700. While the user is capturing the image with mobile phone 100, the phone's camera acquires image data of the real image 700. Next, in response to the user's shooting operation, the phone executes the aforementioned steps S301, S303, and S304, and the phone obtains the third blurred image 701. That is, in response to the user's fourth operation, the phone captures the fourth blurred image.

[0168] Next, the user uses mobile phone 100 to capture a real image 702. During the process of the user capturing the image with mobile phone 100, the phone's camera acquires image data of the real image 702. Then, in response to the user's shooting operation, the phone executes the aforementioned steps S301, S303, and S304, and the phone obtains the fourth blurred image 703. That is, in response to the user's fifth operation, the phone captures the fifth blurred image.

[0169] It should be noted that the ISO of the camera when the phone (100) captures a real image at ISO 700 is the same as the ISO when the phone (100) captures a real image at ISO 702. Also, from... Figure 9 As can be seen, the number of faces in real image 700 is less than the number of faces in real image 702. In the above process, the phone performs step S303 based on real image 700 to obtain the third blurring parameter, and performs step S303 based on real image 702 to obtain the fourth blurring parameter. Since the number of faces in real image 700 is less than the number of faces in real image 702, and the phone's sensitivity is the same when the phone 100 captures real image 700 and when the phone 100 captures real image 702, the third blurring parameter is higher than the fourth blurring parameter. This results in the blurring degree of the third blurred image 701 being higher than the blurring degree of the fourth blurred image 703. For example, the clarity of the "trees" in the third blurred image 701 is lower than the clarity of the "trees" in the fourth blurred image 703.

[0170] For another example, see Figure 10 , Figure 10 In the image, the sharpness of the diagonal and horizontal fill lines is relatively low, with the horizontal fill lines being less sharp than the diagonal fill lines. It should be understood that... Figure 10 During the demonstration, the images within the dashed boxes represent images from the physical world, such as real image 1000 and real image 1002.

[0171] exist Figure 10During the demonstration, the user uses mobile phone 100 to capture a real image 1000. While the user is capturing the image, the phone's camera acquires image data of the real image 1000. Next, in response to the user's shooting operation, the phone executes the aforementioned steps S301, S302, S303, and S304, obtaining the fifth blurred image 1001. Afterward, the user uses mobile phone 100 to capture a real image 1002. While the user is capturing the image, the phone's camera acquires image data of the real image 1002. Next, in response to the user's shooting operation, the phone executes the aforementioned steps S301, S302, S303, and S304, obtaining the sixth blurred image 1003.

[0172] It should be noted that the ISO of the camera when the phone (100) captures a real image (1000) is the same as the ISO when the phone (100) captures a real image (1002). Also, from... Figure 10 As can be seen, real image 1000 does not include human faces, while real image 1000 includes greenery. Since real image 1000 does not include human faces, the phone executes step S301 and obtains a face count of 0, then proceeds to step S302. Next, during step S302, the phone obtains the scene category as a static single-object category. Then, during step S303, the phone obtains the 5th blur parameter based on the blur parameter relationship of the corresponding object scene category and the camera's ISO. Next, the phone executes step S304: obtaining the 5th blurred image 1001 based on the 5th blur parameter. And, from... Figure 10 As can be seen, the real image 1002 includes a face. Since the real image 1002 includes a face, the phone executes step S301 and obtains that the number of faces is 1. The phone then executes step S303. Subsequently, during step S303, the phone obtains the sixth blurring parameter based on the blurring parameter relationship corresponding to the individual character and the camera's ISO. Next, the phone executes step S304: obtaining the sixth blurred image 1003 based on the sixth blurring parameter.

[0173] As can be seen from the correspondence between ISO and blur parameters shown in Table 2 above, since the blur parameter of the object scene category under the same ISO is greater than the blur parameter of the single human category, that is, the 5th blur parameter is higher than the 6th blur parameter, this will cause the blur degree of the 5th blurred image 1001 to be higher than the blur degree of the 6th blurred image 1003. For example, the blur degree of the "table" included in the 5th blurred image 1001 is higher than the blur degree of the "table" included in the 6th blurred image 1003.

[0174] For another example, see Figure 11 , Figure 11In the image, the sharpness of the diagonal and horizontal fill lines is relatively low, with the horizontal fill lines being less sharp than the diagonal fill lines. It should be understood that... Figure 11 During the demonstration, the images within the dashed boxes represent images from the physical world, such as real image 1100 and real image 1102.

[0175] exist Figure 11 During the demonstration, the user uses mobile phone 100 to capture a real image 1100. While the user is capturing the image, the phone's camera acquires image data of the real image 1100. Next, in response to the user's capturing operation, the phone executes the aforementioned steps S301, S302, S303, and S304, and the phone obtains the 7th blurred image 1101. Afterwards, the user uses mobile phone 100 to capture a real image 1102. While the user is capturing the image, the phone's camera acquires image data of the real image 1102. Next, in response to the user's capturing operation, the phone executes the aforementioned steps S301, S302, S303, and S304, and the phone obtains the 8th blurred image 1103.

[0176] It should be noted that the ISO of the camera when the phone (100) captures real image 1100 is the same as the ISO when the phone (100) captures real image 1102. Also, from... Figure 11 As can be seen, real image 1100 does not include a face, but it does include text. Since real image 1100 does not include a face, the phone executes step S301 and finds the number of faces to be 0, then proceeds to step S302. Next, during step S302, the phone determines the scene category to be an artificial environment. Then, during step S303, the phone obtains the 7th bokeh parameter based on the bokeh parameter relationship corresponding to the artificial environment category and the camera's ISO. Next, the phone executes step S304: obtaining the 7th bokeh image 1101 based on the 7th bokeh parameter. And, from... Figure 11 As can be seen, the real image 1102 includes a face. Since the real image 1102 includes a face, the phone executes step S301 and obtains a face count of 1, then executes step S303. Subsequently, during step S303, the phone obtains the 8th blurring parameter based on the blurring parameter relationship corresponding to the individual character and the camera's ISO. Next, the phone executes step S304: obtaining the 8th blurred image 1103 based on the 8th blurring parameter.

[0177] As can be seen from the correspondence between ISO and blurring parameters shown in Table 1 above, since the blurring parameter of the artificial environment category under the same ISO is greater than the blurring parameter of the single human category, that is, the 7th blurring parameter is higher than the 8th blurring parameter, this will result in the blurring degree of the 7th blurred image 1101 being higher than the blurring degree of the 8th blurred image 1103. For example, the blurring degree of the "table" included in the 7th blurred image 1101 is higher than the blurring degree of the "table" included in the 8th blurred image 1103.

[0178] It should be noted that the personal information used in the technical solution of this application is limited to information for which individual consent has been obtained, including but not limited to notifying and reminding users to read the relevant user agreement (notification) and sign the agreement (authorization) which includes authorization of relevant user information before users use the function.

[0179] Based on the algorithmic steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementations should not be considered beyond the scope of this application.

[0180] This embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0181] This application also provides an electronic device, such as... Figure 12 As shown, the electronic device may include one or more processors 1801, memory 1802, and communication interfaces 1803.

[0182] The memory 1802, communication interface 1803, and processor 1801 are coupled together. For example, the memory 1802, communication interface 1803, and processor 1801 can be coupled together via bus 1804.

[0183] The communication interface 1803 is used for data transmission with other devices. The memory 1802 stores computer program code. The computer program code includes computer instructions, which, when executed by the processor 1801, cause the electronic device to perform the relevant method steps in the above-described method embodiments of this application.

[0184] The processor 1801 may be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0185] The bus 1804 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The aforementioned bus 1804 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 12 The symbol is represented by only one line, but this does not mean that there is only one bus or one type of bus.

[0186] This application also provides a chip system, such as... Figure 13 As shown, the chip system 2000 includes at least one processor 2001 and at least one interface circuit 2002. The processor 2001 and the interface circuit 2002 are interconnected via lines. For example, the interface circuit 2002 can be used to receive signals from other devices (e.g., the memory of an electronic device). As another example, the interface circuit 2002 can be used to send signals to other devices (e.g., the processor 2001). Exemplarily, the interface circuit 2002 can read instructions stored in the memory and send those instructions to the processor 2001. When the instructions are executed by the processor 2001, the electronic device can perform the steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in this application embodiment.

[0187] This application also provides a computer-readable storage medium storing computer program code. When the processor executes the computer program code, the electronic device executes the relevant method steps in the above method embodiments.

[0188] This application also provides a computer program product that, when run on a computer, causes the computer to execute the relevant method steps described in the above method embodiments.

[0189] The electronic devices, computer-readable storage media, or computer program products provided in this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0190] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0191] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0192] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0193] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0194] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, in essence, or the part that contributes, or all or part of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0195] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A shooting method, characterized in that, The method is applied to an electronic device, the electronic device including a camera; the method includes: Displays the shooting preview interface; In the first shooting scenario, in response to the user's first operation, the first blurred image is captured; In the first shooting scenario, in response to the user's second operation, a second blurred image is captured; the degree of blurring in the second blurred image is greater than the degree of blurring in the first blurred image. Wherein, the first blurred image is obtained by blurring the first original image captured by the camera according to the first sensitivity, and the second blurred image is obtained by blurring the second original image captured by the camera according to the second sensitivity; the first sensitivity is the sensitivity of the camera when capturing the first original image, the second sensitivity is the sensitivity of the camera when capturing the second original image, and the second sensitivity is greater than the first sensitivity.

2. The method according to claim 1, characterized in that, The method further includes: In the second shooting scenario, in response to the user's third operation, a third blurred image is captured. The third blurred image corresponds to a third ISO, which is the same as the second ISO; the second shooting scene is different from the first shooting scene, and the degree of blurring of the third blurred image is different from the degree of blurring of the second blurred image.

3. The method according to claim 1 or 2, characterized in that, The method further includes: In response to the user's fourth action, a fourth blurred image is captured; In response to the user's fifth operation, a fifth blurred image is captured; the degree of blurring of the fourth blurred image is greater than the degree of blurring of the fifth blurred image; The fourth blurred image includes 1 face, and the fifth blurred image includes more than 1 face.

4. The method according to claim 1 or 2, characterized in that, The degree of blurring of the second blurred image is greater than that of the first blurred image, including: the clarity of the background area of ​​the second blurred image is lower than that of the background area of ​​the first blurred image.

5. The method according to claim 4, characterized in that, The background region of the second blurred image has lower clarity than the background region of the first blurred image, including: The equivalent aperture value of the second blurred image is smaller than the equivalent aperture value of the first blurred image.

6. The method according to claim 1 or 2, characterized in that, The first blurred image obtained by capturing the image includes: The camera captures the original images; The first blurred image is obtained by reducing the clarity of the background area of ​​the original image based on the light sensitivity of the camera when acquiring the original image; the non-background area of ​​the original image is the area where the camera's focus target is located. The degree to which the sharpness of the background area of ​​the original image is reduced is positively correlated with the photosensitivity.

7. The method according to claim 6, characterized in that, The method of reducing the clarity of the background area of ​​the original image based on the light sensitivity of the camera when acquiring the original image includes: The number of faces included in the original image is obtained by performing face detection on the original image. If the number of faces in the original image is greater than 0, the blurring parameters of the original image are obtained based on the photosensitivity. The sharpness of the background area of ​​the original image is reduced based on the blurring parameters of the original image.

8. The method according to claim 7, characterized in that, The process of obtaining the blurring parameters of the original image based on the photosensitivity includes: If the number of faces is 1, then the first blurring parameter is obtained based on the correspondence between the photosensitivity and blurring parameters under the single-person category, and the photosensitivity. The single-person category is obtained based on the fact that the number of faces is 1. If the number of faces is greater than 1, then a second blurring parameter is obtained based on the correspondence between the photosensitivity and blurring parameters under the multi-person category, and the photosensitivity. The multi-person category is obtained based on the number of faces being greater than 1. The step of reducing the sharpness of the background region of the original image according to the blurring parameters of the original image includes: The sharpness of the background area of ​​the original image is reduced by a first ratio according to the first blurring parameter; Alternatively, the sharpness of the background area of ​​the original image may be reduced by a second ratio according to the second blurring parameter; The first blurring parameter is greater than the second blurring parameter, and the first ratio is higher than the second ratio.

9. The method according to claim 8, characterized in that, The first bokeh parameter includes: a first sub-bokeh parameter, a second sub-bokeh parameter, or a third sub-bokeh parameter; The step of obtaining the first blur parameter based on the correspondence between photosensitivity and blur parameters under a single-person category, and the photosensitivity, includes: If the photosensitivity is within the first range, then the first sub-blurring parameter is obtained; If the photosensitivity is within the second range, then the second sub-blurring parameter is obtained; If the photosensitivity is within the third interval, then the third sub-blurring parameter is obtained; the first interval, the second interval, and the third interval are all different.

10. The method according to claim 6, characterized in that, The method of reducing the clarity of the background area of ​​the original image based on the light sensitivity of the camera when acquiring the original image includes: The number of faces included in the original image is obtained by performing face detection on the original image. When the number of faces in the original image is equal to 0, content recognition is performed on the original image to obtain a content tag for the original image; the content tag is used to characterize the image content of the original image. The scene category of the original image is obtained based on the content tags; The bokeh parameters of the original image are obtained based on the correspondence between the sensitivity and bokeh parameters under the scene category, and the sensitivity of the camera when acquiring the original image. The sharpness of the background area of ​​the original image is reduced based on the blurring parameters of the original image.

11. The method according to claim 10, characterized in that, The content tags include a first content tag or a second content tag; The step of obtaining the scene category of the original image based on the content tag includes: If the content tag includes a first content tag, then the scene category of the original image is the first scene category; If the content tag includes a second content tag, then the scene category of the original image is the second scene category; The step of obtaining the bokeh parameters of the original image based on the correspondence between the sensitivity and bokeh parameters under the scene category, and the sensitivity, includes: If the scene category of the original image is the first scene category, then the third bokeh parameter is obtained based on the correspondence between the photosensitivity and the bokeh parameter under the first scene category, and the photosensitivity. If the scene category of the original image is the second scene category, then the fourth blur parameter is obtained according to the correspondence between the sensitivity and the blur parameter under the second scene category, and the sensitivity. The step of reducing the sharpness of the background region of the original image according to the blurring parameters of the original image includes: The sharpness of the background area of ​​the original image is reduced by a third ratio according to the third blurring parameter; Alternatively, the clarity of the background area of ​​the original image may be reduced by a fourth ratio according to the fourth blurring parameter; The third blurring parameter is different from the fourth blurring parameter, and the third ratio is different from the fourth ratio.

12. The method according to claim 1 or 2, characterized in that, The method further includes: Get the sixth image; Display an image display interface for the sixth image, the image display interface including the sixth image and a blur control; In response to the triggering operation of the blur control, the sharpness of the background area of ​​the sixth image is reduced based on the light sensitivity corresponding to the capture of the sixth image, thereby obtaining the sixth blurred image.

13. An electronic device, characterized in that, The electronic device includes a processor and a memory; the processor is coupled to the memory; the memory is used to store computer program code; the computer program code includes computer instructions, which, when executed by the processor, cause the electronic device to perform the method as described in any one of claims 1-12.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-12.

15. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the processors being configured to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-12.

16. A computer program product, characterized in that, The computer program product includes instructions that, when the computer program product is run on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-12.

Citation Information

Patent Citations

  • Image processing method, image processing apparatus, computer readable medium, and imaging apparatus

    CN101998053A

  • Image processing method and related product

    CN110363702A