Image processing method, electronic device and computer readable storage medium
By dynamically switching the blur mode according to the status of the electronic device, the problem of poor single-camera blur effect and high power consumption of dual-camera blur is solved, and efficient blur processing in different scenes is achieved.
Patent Information
- Application Number
- CN202210932795.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-04
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-08-04
AI Technical Summary
During the shooting process of existing electronic equipment, the single-shot blur effect is not good, while the dual-shot blur results in high power consumption, and there is a lack of solutions that take into account both the blur effect and energy consumption.
According to the current status of the electronic device (such as power consumption, case temperature and shooting scene), the blur mode is dynamically switched, and the image data is blurred using single-shot blur, dual-shot blur, or a coexistence mode of both.
It is possible to improve the shooting performance of electronic equipment, reduce power consumption, and adapt to the blurring needs of different scenes while taking into account the blurring effect and energy consumption.
Smart Images

Figure CN115484402B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of image processing technology, and more specifically, to an image processing method, an electronic device, and a computer-readable storage medium. Background Art
[0002] Most of the current electronic devices have shooting functions (e.g., taking photos, recording videos, etc.). During the shooting process, in order to highlight the subject of the shooting, the captured image data is usually processed by blurring technology.
[0003] The blur technology includes a variety of blur modes (eg, single-camera blur, dual-camera blur, etc.), however, any single blur mode has certain limitations. Summary of the invention
[0004] The embodiments of the present application provide an image processing method, an electronic device, and a computer-readable storage medium. The following introduces various aspects involved in the embodiments of the present application.
[0005] In a first aspect, an image processing method is provided, which is applied to an electronic device, wherein the electronic device includes an image sensor, and the method includes: obtaining image data to be processed using the image sensor; obtaining a current state of the electronic device; if the current state of the electronic device is a first state, blurring the image data to be processed using a first blurring mode; if the current state of the electronic device is a second state, blurring the image data to be processed using a second blurring mode; wherein the first state is different from the second state, and the first blurring mode is different from the second blurring mode.
[0006] In a second aspect, an electronic device is provided, comprising: an image sensor for acquiring image data to be processed; a processor connected to the image sensor, and configured to perform the following operations: acquiring a current state of the electronic device; if the current state of the electronic device is a first state, blurring the image data to be processed using a first blurring mode; if the current state of the electronic device is a second state, blurring the image data to be processed using a second blurring mode; wherein the first state is different from the second state, and the first blurring mode is different from the second blurring mode.
[0007] In a third aspect, an electronic device includes: a memory for storing codes; and a processor for loading and executing the codes in the memory to implement the image processing method as described in the first aspect.
[0008] According to a fourth aspect, a chip includes a processor, wherein the processor is used to execute the image processing method according to the first aspect.
[0009] According to a fifth aspect, a computer-readable storage medium is provided, on which an executable code is stored. When the executable code is executed, the image processing method according to the first aspect can be implemented.
[0010] According to a sixth aspect, a computer program product is provided, comprising an executable code, which, when executed, can implement the image processing method as described in the first aspect.
[0011] The image processing method in the embodiment of the present application can select a blur mode that matches the current state of the electronic device to blur the image data, thereby helping to balance the blur effect and energy consumption of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
[0013] Figure 2 It is a flowchart of an image processing method provided in one embodiment of the present application.
[0014] Figure 3 It is a structural schematic diagram of a single-shot blur mode provided in one embodiment of the present application.
[0015] Figure 4 It is a structural schematic diagram of a dual-camera blur mode provided in an embodiment of the present application.
[0016] Figure 5 It is a structural schematic diagram of a dual-camera blur mode provided in another embodiment of the present application.
[0017] Figure 6 It is a structural diagram of a coexistence mode provided in an embodiment of the present application.
[0018] Figure 7 It is a structural diagram of a switching trigger strategy for a virtualization mode provided in an embodiment of the present application.
[0019] Figure 8 yes Figure 7 A flow chart of the switching triggering strategy is shown in FIG.
[0020] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
[0021] Fig.10 It is a structural schematic diagram of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0022] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0023] It should be noted that, in the embodiments of the present application, the descriptions of "first", "second", "third", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first", "second", "third" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments may be combined with each other.
[0024] It should be noted that the electronic device involved in the embodiments of the present application refers to an electronic device with a shooting function, which can be any of various types of mobile or portable computer system devices. For example, the electronic device can be a smart phone, a smart camera, a tablet computer, a portable Internet device, etc.
[0025] Most of the current electronic devices have shooting functions (e.g., taking photos, recording videos, etc.). During the shooting process, in order to highlight the subject of the shooting, the captured image data is usually processed by blurring technology.
[0026] The blur technology includes a variety of blur modes, which mainly include single-camera blur, dual-camera blur, etc.
[0027] Single-camera blurring refers to blurring the image data collected by a single camera based on an image sensor (also called a camera). One possible way to achieve single-camera blurring is to use a blurring algorithm to process the area outside the focus area to achieve the purpose of blurring. However, since only one camera is used, it is difficult to obtain the depth information between the camera and the shooting area, resulting in similar blur levels in different areas processed by single-camera blurring, lacking a sense of hierarchy.
[0028] Another possible way to achieve single-shot blur is to introduce an AI algorithm in the blurring process. For example, a deep learning algorithm can be used to segment the background of the image data and calculate the depth information between the camera and the shooting area. After background segmentation, we can determine which objects are the subjects we want to focus on clearly and which objects are the backgrounds we want to blur. Since the calculation of depth information depends on the AI algorithm model, however, the AI algorithm model is not perfect, resulting in inaccurate depth information. Therefore, the blurring effect obtained by blurring the foreground and background segmentation results based solely on this simple depth information is also unnatural to a certain extent. In addition, the AI segmentation algorithm is not perfect, and the foreground and background may also be misjudged, resulting in errors in foreground and background segmentation.
[0029] In fact, for image blur processing, in theory, the farther away from the focal plane, the larger the circle of confusion and the blurrier the image. In other words, the closer to the focal plane, the clearer the image. The ideal blur effect is that although everything outside the depth of field is blurry, the degree of blur is different. The closer to the focal plane, the clearer it is, and the farther away from the focal plane, the blurrier it is.
[0030] With the development of technology, the performance of electronic products is gradually improving. At present, many electronic products include multiple cameras, that is, they have the ability to process dual-channel data at the same time, and dual-camera blurring has also emerged. Dual-camera blurring refers to blurring the image data collected by two cameras based on two cameras. Dual-camera blurring is mainly based on the principle of binocular parallax to accurately calculate the depth information of image data. Dual cameras can be used to construct a depth map (DepthMap) of image data to infer the front and back relationship of the scene and control the degree of blurring. Specifically, dual cameras can use the difference in the viewing angles of the two cameras to calculate the distance of each pixel from the focal plane, and thus calculate the blurring based on the focal plane distance. Although using dual-camera blurring can achieve a better blurring effect, the power consumption of electronic equipment will be higher due to the need to open the dual-channel data stream for a long time.
[0031] At present, electronic devices usually have a fixed blur scheme when they leave the factory, depending on the product performance. According to the description above, the blur effect of single-camera blur is relatively poor, and the power consumption of dual-camera blur is relatively high. In other words, any single blur mode has certain limitations.
[0032] In response to the above problems, an image processing method is proposed in an embodiment of the present application. According to the current state of the electronic device, a blur mode that matches the current state of the electronic device can be selected to blur the image data, thereby helping to balance the blur effect and energy consumption of the electronic device.
[0033] In order to facilitate understanding of the solutions in the embodiments of the present application, the main structure of the electronic device in the embodiments of the present application is first introduced.
[0034] Figure 1 The electronic device 100 is a schematic diagram of a structure of an electronic device provided in an embodiment of the present application. The electronic device 100 may be any electronic device mentioned above, such as Figure 1 As shown, the electronic device 100 may include an image sensor 110 , an image signal processing chip 120 , and an application processing chip 130 .
[0035] The image sensor 110 may be referred to as a camera, and is mainly used to obtain image data to be processed.
[0036] The image signal processing chip 120 can be called a front-end processing chip. The image signal processing chip 120 is a special chip in the image field, which is mainly used for differentiation algorithms, such as backlight photography in the RAW (unprocessed image) domain, high dynamic range image (HDR) photography, preview, and video effect enhancement. By setting the image signal processing chip, the processing pressure of the application processing chip can be relieved. The image signal processing chip 120 may include a pre-image signal processing (PreISP) module, a central processing unit (CPU), a double data rate synchronous dynamic random access memory (DDR), and a mobile industry processor interface (MIPI). The pre-image signal processing module may include a front-end processing (FE) module, a neural-network processing unit (NPU), and a back-end processing (BE) module.
[0037] The application processing chip 130 may be referred to as a back-end processing chip, and is mainly used to process traditional image processing algorithms, such as bad pixel correction, temporal noise reduction, white balance, automatic exposure, etc. The application processing chip 130 may include an image signal processing (ISP) module, a central processing unit, a graphics processing unit (GPU), a digital signal processing (DSP), and a double rate synchronous dynamic random access memory, etc. The image signal processing module may include an image front end processing (IFE) module, an image processing engine (IPE), and a Bayer processing segment (BPS), etc.
[0038] Figure 2 The image processing method 200 is a flowchart of an image processing method provided in an embodiment of the present application. The image processing method 200 may be applied to an electronic device, such as the electronic device 100, and the image processing method 200 may include steps S220 to S280.
[0039] In step S220, image data to be processed is acquired using an image sensor.
[0040] The image sensor may include one or more cameras, and an adapted number of cameras may be enabled according to different blur modes to obtain image data to be processed. As an example, if the current blur mode is single-camera blur, one camera may be enabled. If the current blur mode is dual-camera blur, two cameras may be enabled.
[0041] The image data to be processed may be one or more frames of image data, video image data, photo image data, or other forms of image data, which are not specifically limited in the embodiments of the present application.
[0042] In step S240, the current state of the electronic device is obtained.
[0043] The electronic device may include some sensors for detecting the current state of the electronic device. The current state of the electronic device may include, for example, the power consumption, shell temperature, and shooting scene of the electronic device. As an example, the electronic device may include a power consumption detector, a temperature sensor, and the like. The power consumption detector may be used to detect the current power consumption state of the electronic device, for example, by detecting voltage and current. The temperature sensor may be used to detect the shell temperature of the electronic device to determine the current processing data flow of the processor. When the temperature exceeds a certain threshold, the electronic device may experience a certain freeze phenomenon, and the user experience is poor. In some embodiments, the current shooting scene of the image sensor, such as photo shooting, video shooting, etc., may be obtained through the application processing chip in the electronic device. The embodiment of the present application does not specifically limit the current state of the electronic device, for example, it may also include the number of open cameras of the electronic device, the data flow state of the electronic device, and the like.
[0044] In step S260, if the current state of the electronic device is the first state, the first blurring mode is used to perform blurring processing on the image data to be processed.
[0045] In step S280, if the current state of the electronic device is the second state, the second blurring mode is used to perform blurring processing on the image data to be processed.
[0046] The first blur mode and the second blur mode may be any two different blur modes among the multiple blur modes. For example, the first blur mode may be single-camera blur, and the second blur mode may be dual-camera blur.
[0047] The first state and the second state are two different states of the electronic device. For example, taking the current state of the electronic device as the power consumption state of the electronic device as an example, the first state may be the first power consumption state, and the second state may be the second power consumption state. The second power consumption is lower than the first power consumption. In other words, when the electronic device is in different power consumption states, a variety of different blurring modes may be switched to select a blurring mode adapted to the current state to blur the image data. For example, when the power consumption of the electronic device is in a higher first power consumption state, a single-shot blurring may be used to blur the image data to be processed. When the power consumption of the electronic device is in a lower second power consumption state, the second blurring mode may be used to blur the image data to be processed.
[0048] For another example, taking the current state of the electronic device as the shell temperature state of the electronic device as an example, the first state may be the first shell temperature state, and the second state may be the second shell temperature state. The second shell temperature is lower than the first shell temperature. In some embodiments, the shell temperature of the electronic device may also be set to a plurality of gears, and then according to different shell temperature gears, a blurring mode adapted to the current shell temperature gear is selected. For example, a first temperature threshold and a second temperature threshold may be preset, and the shell temperature of the electronic device may be divided into three gears: low temperature, medium temperature, and high temperature. When the shell temperature of the electronic device is in the first shell temperature state of high temperature, a single-camera blurring may be used to blur the image data to be processed. When the shell temperature of the electronic device is in the second shell temperature state of low temperature, a dual-camera blurring may be used to blur the image data to be processed. Exemplarily, the first temperature threshold may be set to 35°C, and the second temperature threshold may be set to 30°C. It should be understood that when the shell temperature of the electronic device is in the medium temperature gear, the current blurring mode may be maintained, or a coexistence mode of single-camera blurring and dual-camera blurring may be used, which will be discussed later in conjunction with Figure 7 and Figure 8 , an example is given to illustrate the coexistence mode, which will not be introduced in detail here.
[0049] For another example, when the current state of the electronic device is a shooting scene of the electronic device, the user generally does not pay too much attention to the blur details of the video, so the single-camera blur mode can be selected to continuously ensure that the high frame rate and high-resolution recording scene always has a basic blur effect. If it is a photo scene, the user generally has a relatively high requirement for the blur effect of the photo, and the dual-camera blur mode can be used to blur the image data of the photo to ensure the layered blur effect.
[0050] For another example, taking the current state of the electronic device as a shooting scene of the electronic device as an example, the blur mode adapted to the current scene can also be switched according to the complexity of the shooting scene. Generally speaking, for relatively simple scenes, a single-shot blur can obtain a better blur effect, while for shooting scenes with a relatively complex front-and-back relationship of objects, a dual-shot blur mode needs to be used to obtain more accurate depth information and avoid false blurring. That is, the first state can be a shooting scene of a first complexity, and the second state can be a shooting scene of a second complexity, and the complexity of the first state is lower than the complexity of the second state.
[0051] In some embodiments, the power consumption state of the electronic device may further include a third state, which is a state between the first state and the second state. At this time, the single-shot blur and dual-shot blur coexistence mode may be used to blur the image data to be processed. Taking the third state as a photo shooting state at the third shell temperature as an example, the first state is a photo shooting state at the first shell temperature, and the second state is a photo shooting state at the second shell temperature. Among them, the third shell temperature is greater than or equal to the second temperature threshold, and less than or equal to the first temperature threshold. That is, the third shell temperature is a medium temperature gear. It can be understood that in the photo shooting state, two parts of image data may be included, the first part of the image data may refer to the preview image data, and the second part of the image data may refer to the frame or multiple frames of image data of the photo. Exemplarily, in the third state, the single-shot blur may be used to blur the preview image data, and the dual-shot blur may be used to blur the photo frame data. This is mainly because users generally do not pay much attention to the image blur details in the preview stage, but pay special attention to the blur details of the image data of the photo. Therefore, the coexistence mode can take into account both high precision of the photo and low power consumption of the entire scene.
[0052] In some embodiments, before blurring the image data to be processed, depth information calculation and background segmentation processing are generally performed on the image data to be processed. The depth information may refer to the depth information between the camera and the shooting area. In the embodiment of the present application, the depth information of the image data to be processed is first obtained, and then the background segmentation processing is performed based on the depth information, so that a more accurate segmentation result can be obtained.
[0053] According to the above description, it can be seen that the image processing method in the embodiment of the present application can select and switch the blur mode that is compatible with the current state of the electronic device according to the current state of the electronic device to blur the image data. It is also possible to select the coexistence mode of single-camera blur and dual-camera blur to blur the image data in combination with the power consumption / temperature rise state and the shooting scene state of the electronic device, thereby helping to balance the blur effect and energy consumption of the electronic device.
[0054] The present application provides three illustrative blur modes, including a single-camera blur mode, a dual-camera blur mode, and a single-camera blur and dual-camera blur coexistence mode. Figures 3 to 6 The three blur modes are introduced in detail.
[0055] Single-shot blur mode
[0056] like Figure 3 As shown, the image sensor 310 can be used to obtain the image data to be processed, and then transmit it to the image signal processing chip 320. The image signal processing chip 320 can use the front-end processing module FE to perform HDR algorithm processing on the image data to be processed to generate an HDR image to improve the dark scene preview / video quality. The network processor NPU can be used to calculate the depth information between the image sensor 310 and the shooting area. In addition, based on the depth information, the network processor NPU can also perform background segmentation processing on the HDR image data, so that a more accurate segmentation result can be obtained. The back-end processing module BE can be used to perform noise reduction processing on the HDR image. Then, the image signal processing chip 320 can send the depth information data of the image data, the background segmentation image data, and the image data after noise reduction to the application processing chip 330, and the blurring processing (Bokeh Rendering) is completed in the application processing chip 330. Specifically, the blurring processing can be completed in the graphics processor GPU in the application processing chip 330. It should be noted that the above single-shot blurring processing process is performed for the photo preview scene or video scene, and the data stream of the above single-shot blurring processing can also be called a preview data stream or a video data stream.
[0057] In some embodiments, the image signal processing chip 320 also includes a module, and the cache mode may be a buffer queue for caching image data to be processed, so as to realize zero shutter lag (ZSL) technology. The data stream from the cache mode to the camera blur processing module may be referred to as a photo data stream. It can be seen that operations such as depth information calculation, background segmentation, and blur processing of the photo data stream are mainly performed in the application processing chip 330. For example, blur processing can be implemented by a graphics processor GPU. It should be noted that the blur processing model and algorithm model of the photo data stream are more complex than the blur processing of the preview data stream or the video data stream.
[0058] In fact, the above single-camera blur processing is based on the processing method of a single camera, and the depth information that can be obtained is still relatively small, which will lead to poor blur effect.
[0059] Dual-camera blur mode
[0060] The dual-camera blur mode can be divided into the traditional dual-camera blur mode and the dual-camera blur mode with superimposed image signal processing chip.
[0061] like Figure 4 As shown, it can be seen that in the traditional dual-camera blur technology, image sensor 410 and image sensor 411 can be used to obtain image data to be processed. However, no matter the image data to be processed is a preview data stream, a photo data stream or a video data stream, it is necessary to perform depth information calculation, background segmentation, image noise reduction, blur processing and other operations in the blur processing module of the application processing chip 430, resulting in high power consumption of the electronic device 400. The processing module may include, for example, a central processing unit, a graphics processor, etc.
[0062] like Figure 5 As shown, the image sensor 510 and the image sensor 511 can be used to obtain image data to be processed. It can be seen that in the dual-camera blur technology of the superimposed image signal processing chip 520, since the depth information calculation, background segmentation, image noise reduction and other processing of the preview data stream and the video data stream are all completed in the image signal processing chip 520, then only the blur processing is completed in the application processing chip 530. Therefore, compared with the traditional dual-camera blur technology, the dual-camera blur technology of the superimposed image signal processing chip 520 has lower power consumption, but compared with the single-camera blur, an additional image sensor 511 will still be opened, and the two data streams will also cause the image signal processing chip 520 to need to add a front-end processing module 2. In other words, the dual-camera blur technology of the superimposed image signal processing chip can take into account the advantages of the traditional single-camera blur and the dual-camera blur, that is, it can take into account both blur accuracy and energy consumption.
[0063] Single-camera blur and dual-camera blur coexistence mode
[0064] The following uses the photo scene as an example to introduce the coexistence mode of single-camera blur and dual-camera blur. Figure 6 As shown, it can be seen that Figure 5 The difference between the blur processing technology in the image signal processing chip 620 and the blur processing technology in the image signal processing chip 620 is that the network processor in the image signal processing chip 620 calculates the depth information based on the image data obtained by an image sensor 510, that is, the preview data stream is blurred by single-camera blur in the application processing chip 630. In other words, in the coexistence mode, the preview data stream can be blurred by single-camera blur, and the photo data stream can be blurred by dual-camera blur. In this way, both high-precision photography and low power consumption of the entire photography scene can be achieved.
[0065] See Table 1 below. Taking a photo-taking scene as an example, Table 1 exemplarily shows a comparison of blur effects and corresponding power consumption of several blur modes.
[0066] Table 1
[0067]
[0068] In some embodiments, the above three blur modes can be comprehensively adjusted according to the power consumption, temperature rise and scene changes of the electronic device to achieve the best comprehensive blur effect in the shooting scene.
[0069] Take the case temperature of electronic devices and the photo-taking scene as an example. Figure 7 As shown, the following blur mode switching trigger strategy can be adopted:
[0070] (1) When the case temperature is low, switch to the dual-camera blur mode to achieve a better blur effect.
[0071] (2) When the case temperature is medium, switch to the single-camera preview blur mode and dual-camera blur mode to balance photo accuracy and power consumption.
[0072] (3) When the case temperature is high, switch to single-shot blur mode to avoid power consumption or temperature rise exceeding the standard.
[0073] When judging the shell temperature, a first temperature threshold and a second temperature threshold may be preset. For example, the first temperature threshold may be set to 35°C, and the second temperature threshold may be set to 30°C.
[0074] In order to further understand the above blur mode switching trigger strategy, Figure 8 The triggering process is described in detail.
[0075] like Figure 8 As shown, the switching trigger of the above three blur modes includes the following steps:
[0076] Step 1: Set the high and low judgment thresholds of the shell temperature of the electronic device. For example, two temperature thresholds can be preset, namely the first temperature threshold and the second temperature threshold. For example, the first temperature threshold can be set to 35° C. and the second temperature threshold can be set to 30° C. Then, the image sensor can be turned on by the application processing chip to obtain the image data to be processed.
[0077] Step 2: The application processing chip can obtain the current shell temperature of the electronic device through the temperature sensor, and compare the current shell temperature with a preset temperature threshold.
[0078] Step 3: According to the preset temperature threshold, the shell temperature can be divided into three gears, namely low temperature, medium temperature and high temperature. Select the current blur mode according to the shell temperature gear. Specifically, if the shell temperature is low, you can switch to the dual-camera blur mode to achieve a better blur effect; if the shell temperature is medium, you can switch to the single-camera preview blur and dual-camera blur coexistence mode (which can be referred to as the coexistence mode) to take into account both photo accuracy and power consumption; if the shell temperature is high, you can switch to the single-camera blur mode to avoid power consumption or temperature rise exceeding the standard.
[0079] Step 4: Determine the current shell temperature to see if the shell temperature level has changed. If the shell temperature level has changed, jump to step 2; if the shell temperature level has not changed, jump to step 5.
[0080] Step 5: Continue using the current blur mode.
[0081] Combination of the above Figures 1 to 8 , describes the method embodiment of the present application in detail, and the following is combined with Fig. 9 , describes the device embodiment of the present application in detail. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so the parts not described in detail can refer to the previous device embodiment.
[0082] Fig. 9 9 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 900 may include an image sensor 910 and a processor 920 .
[0083] The image sensor 910 may be used to acquire image data to be processed.
[0084] The processor 920 is connected to the image sensor 910, and can be used to perform the following operations: obtaining the current state of the electronic device; if the current state of the electronic device is the first state, blurring the image data to be processed using the first blurring mode; if the current state of the electronic device is the second state, blurring the image data to be processed using the second blurring mode; wherein the first state is different from the second state, and the first blurring mode is different from the second blurring mode.
[0085] Optionally, the current state of the electronic device includes the power consumption, shell temperature and shooting scene of the electronic device; the first state is a first power consumption state, the second state is a second power consumption state, and the second power consumption is lower than the first power consumption; or the first state is a first shell temperature state, the second state is a second shell temperature state, and the second shell temperature is lower than the first shell temperature; or the first state is a video shooting state, and the second state is a photo shooting state.
[0086] Optionally, the image data to be processed includes a first part of image data and a second part of image data, and the processor is also used to: if the current state of the electronic device is a third state, blur the first part of the image data using a first blur mode, and blur the second part of the image data using a second blur mode; wherein the third state is a state between the first state and the second state.
[0087] Optionally, the first blur mode is single-shot blur, and the second blur mode is dual-shot blur.
[0088] Optionally, after acquiring the image data to be processed, the processor is further used to: acquire depth information of the image data to be processed; and perform background segmentation on the image data to be processed based on the depth information of the image data to be processed.
[0089] Combine the following Fig.10 Another image data processing device in an embodiment of the present application is introduced. Fig.10 The dotted line in the figure indicates that the unit or module is optional. The device 1000 can be used to implement the method described in the above method embodiment. The device 1000 can be a computer or any type of electronic device.
[0090] The apparatus 1000 may include one or more processors 1010. The processor 1010 may support the apparatus 1000 to implement the method described in the foregoing method embodiment.
[0091] The apparatus 1000 may further include one or more memories 1020. The memory 1020 stores a program, which can be executed by the processor 1010, so that the processor 1010 executes the method described in the above method embodiment. The memory 1020 may be independent of the processor 1010 or integrated in the processor 1010.
[0092] The apparatus 1000 may further include a transceiver 1030. The processor 1010 may communicate with other devices through the transceiver 1030. For example, the processor 1010 may transmit and receive data with other devices through the transceiver 1030.
[0093] The embodiment of the present application also provides a machine-readable storage medium for storing a program, and the program enables a computer to execute the method in each embodiment of the present application.
[0094] The embodiment of the present application also provides a computer program product. The computer program product includes a program. The program enables a computer to execute the method in each embodiment of the present application.
[0095] The present application also provides a computer program that enables a computer to execute the methods in the various embodiments of the present application.
[0096] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a machine-readable storage medium, or transmitted from one machine-readable storage medium to another machine-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The machine-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0097] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments of the present disclosure can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present disclosure.
[0098] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0099] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0100] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0101] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. An image processing method, characterized in that: The method is applied to an electronic device, the electronic device includes an image sensor, and the method includes: Acquiring image data to be processed using the image sensor; Acquire the current state of the electronic device; If the current state of the electronic device is the first state, blurring the image data to be processed using the first blurring mode; If the current state of the electronic device is the second state, blurring the image data to be processed using the second blurring mode; Wherein, the first state is different from the second state, and the first blur mode is different from the second blur mode; The image data to be processed includes a first portion of image data and a second portion of image data, and the method further includes: If the current state of the electronic device is the third state, blurring the first portion of image data using the first blurring mode, and blurring the second portion of image data using the second blurring mode; The third state is a state between the first state and the second state, the first portion of image data is preview image data, and the second portion of image data is photographed image data; The first blur mode is single-shot blur, and the second blur mode is dual-shot blur.
2. The method according to claim 1, characterized in that The current state of the electronic device includes power consumption, housing temperature and shooting scene of the electronic device; The first state is a first power consumption state, the second state is a second power consumption state, and the second power consumption is lower than the first power consumption; or The first state is a first shell temperature state, the second state is a second shell temperature state, and the second shell temperature is lower than the first shell temperature; or The first state is a video shooting state, and the second state is a photo shooting state.
3. The method according to claim 1, characterized in that After acquiring the image data to be processed by using the image sensor, the method further includes: Acquiring depth information of the image data to be processed; Based on the depth information of the image data to be processed, background segmentation processing is performed on the image data to be processed.
4. An electronic device, characterized in that: include: An image sensor, used for acquiring image data to be processed; A processor, connected to the image sensor, is configured to perform the following operations: Acquire the current state of the electronic device; If the current state of the electronic device is the first state, blurring the image data to be processed using the first blurring mode; If the current state of the electronic device is the second state, blurring the image data to be processed using the second blurring mode; Wherein, the first state is different from the second state, and the first blur mode is different from the second blur mode; The image data to be processed includes a first portion of image data and a second portion of image data, and the processor is further configured to: If the current state of the electronic device is the third state, blurring the first portion of image data using the first blurring mode, and blurring the second portion of image data using the second blurring mode; The third state is a state between the first state and the second state, the first portion of image data is preview image data, and the second portion of image data is photographed image data; The first blur mode is single-shot blur, and the second blur mode is dual-shot blur.
5. The electronic device according to claim 4, characterized in that: The current state of the electronic device includes power consumption, housing temperature and shooting scene of the electronic device; The first state is a first power consumption state, the second state is a second power consumption state, and the second power consumption is lower than the first power consumption; or The first state is a first shell temperature state, the second state is a second shell temperature state, and the second shell temperature is lower than the first shell temperature; or The first state is a video shooting state, and the second state is a photo shooting state.
6. The electronic device according to claim 4, characterized in that: After acquiring the image data to be processed, the processor is further configured to: Acquiring depth information of the image data to be processed; Based on the depth information of the image data to be processed, background segmentation processing is performed on the image data to be processed.
7. A computer-readable storage medium having executable code stored thereon, characterized in that: When the executable code is executed, the method according to any one of claims 1 to 3 can be implemented.
