Image processing method and apparatus, and electronic device and medium
By obtaining the depth of field information and area segmentation information of the image, the area to be blurred is automatically determined and blurred is performed, which solves the problems of complex and low intelligence of the existing image blurring operation, and achieves convenient and intelligent image processing effects.
Patent Information
- Application Number
- PCT/CN2024/121626
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-27
- Filing Date
- 2024-09-27
- Publication Date
- 2025-04-03
AI Technical Summary
The existing image blur processing is complex and has low intelligence, making it difficult to achieve convenient and intelligent image processing.
By obtaining the depth of field information and area segmentation information of the image, the area to be blurred is automatically determined and blurred is performed to achieve convenient and intelligent image processing.
It improves the intelligence of image blur processing, simplifies the operation process, and realizes a more efficient and automated image processing process.
Smart Images

Figure CN2024121626_03042025_PF_FP_ABST
Abstract
Description
Image processing method, device, electronic device and medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application No. 202311267427.3 filed in China on September 27, 2023, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present application belongs to the field of communication technology, and specifically relates to an image processing method, device, electronic device and medium. Background Art
[0004] With the rapid development of mobile electronic devices, users have increasingly higher requirements for image processing. Among them, image blurring can more effectively highlight the image content that users want to express.
[0005] However, existing image blurring processing requires the use of software to manually select the area to be blurred, which is complex to operate and has a low level of intelligence.
[0006] Summary of the Invention
[0007] The purpose of the embodiments of the present application is to provide an image processing method, device, electronic device and medium, which can solve the problems of complex operations and low intelligence of existing image virtual processing.
[0008] In a first aspect, an embodiment of the present application provides an image processing method, comprising:
[0009] Acquiring depth of field information and region segmentation information of the first image;
[0010] The first image is blurred according to the depth of field information and the region segmentation information to obtain a second image.
[0011] In a second aspect, an embodiment of the present application provides an image processing device, comprising:
[0012] An acquisition module, configured to acquire depth of field information and region segmentation information of the first image;
[0013] The first processing module is configured to perform blurring processing on the first image according to the depth of field information and the region segmentation information to obtain a second image.
[0014] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method described in the first aspect.
[0017] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method described in the first aspect.
[0018] In an embodiment of the present application, for the first image to be processed, by obtaining its depth of field information and region segmentation information, further blurring processing is performed to achieve a convenient and intelligent image processing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] FIG1 is a flow chart of an image processing method according to an embodiment of the present application;
[0020] FIG2 is a schematic diagram of an image processing method according to an embodiment of the present application applied to Example 1;
[0021] FIG3 is a schematic flow chart of steps in the image processing method of Example 1;
[0022] FIG4 is a schematic diagram of an image processing method according to an embodiment of the present application applied to Example 2;
[0023] FIG5 is a schematic flow chart of steps in the image processing method of Example 2;
[0024] FIG6 is a schematic diagram of an image processing method according to an embodiment of the present application applied to Example 3;
[0025] FIG7 is a schematic flow chart of the steps in the image processing method of Example 3;
[0026] FIG8 is a schematic structural diagram of an image processing device according to an embodiment of the present application;
[0027] FIG9 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
[0028] FIG10 is a schematic structural diagram of an electronic device according to another embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0030] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0031] The image processing method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0032] As shown in FIG1 , an image processing method according to an embodiment of the present application includes:
[0033] Step 101: Obtain depth of field information and region segmentation information of a first image.
[0034] The first image is the original image selected by the user for image processing. In this step, the depth of field information and region segmentation information of the first image are obtained in preparation for blurring processing.
[0035] Step 102 : blurring the first image according to the depth of field information and the region segmentation information to obtain a second image.
[0036] In this way, according to steps 101 and 102, the electronic device that applies the image processing method of the embodiment of the present application can further perform blurring processing on the first image to be processed by obtaining its depth of field information and region segmentation information, thereby realizing a convenient and intelligent image processing process.
[0037] Optionally, in some embodiments, the first image is YUV image data output by an image sensor. After the image sensor (RGB sensor) is powered on and the process is turned on (streamOn), the raw image file (Raw) data can be normally exposed and output (including support for various sensor types: StaggerHDR sensor / DCG sensor, etc.). After input and output, the image signal processing (ISP) module of the sensor itself or the ISP module of the SoC is applied to convert the Raw data into YUV data. The corresponding effect parameters need to be adapted to achieve a specific display effect.
[0038] The first image is output by one image sensor or multiple image sensors.
[0039] Optionally, in some embodiments, obtaining depth of field information and region segmentation information of the first image includes:
[0040] The depth of field information and the area segmentation information are obtained through a main control chip or an image processing chip.
[0041] Among them, the main control chip is also called the system on chip (Soc), such as the Soc embedded neural network processor (NPU). Specifically, the main control chip obtains the depth of field information and the region segmentation information through its own image processor, such as the ISP module of a certain series of chips. The image processing chip is also called an external image processor, which is a separate chip connected to the main control chip of the electronic device. The functions supported by the image processing chip are pre-set, so the image processing chip can complete the acquisition of depth of field information and region segmentation information by setting the functions supported by the image processing chip.
[0042] Optionally, in some embodiments, blurring the first image according to the depth of field information and the region segmentation information to obtain the second image includes:
[0043] The second image is obtained by blurring the first image through the image processing chip.
[0044] That is, the image processing chip will perform blurring processing on the first image. For example, by setting the image processing chip to support blurring function, there is no need to use a main control chip, thereby reducing power consumption of the device.
[0045] For example, after the main control chip obtains the depth of field information and region segmentation information of the first image, it passes the depth of field information and region segmentation information to the image processing chip, and the image processing chip completes the blurring processing of the first image; or, after the image processing chip obtains the depth of field information and region segmentation information of the first image, it directly performs the blurring processing of the first image.
[0046] Optionally, in some embodiments, obtaining depth of field information of the first image includes:
[0047] In the case where the first image is a single-frame image, estimating the depth of field information based on different objects in the first image; or
[0048] In a case where the first image includes two associated images, the depth of field information is calculated based on distances from associated pixels in the two images to an image sensor; wherein the two images are captured by different image sensors.
[0049] That is, for a single-frame image, the acquisition of depth of field information will be based on different objects in the image. For example, the main control chip or image processing chip will set up a depth of field calculation component to obtain the depth of field information of the input first image. The depth of field calculation component can be a pre-trained monocular depth of field estimation network model. The first image is input into the monocular depth of field estimation network model for feature extraction, and the depth of field estimation result of the first image, i.e., the depth of field information, is output.
[0050] Two images (two frames) are linked, i.e., images output by two different image sensors at the same orientation. For these linked images, depth information is calculated based on the distance from the linked pixels in the two images to the image sensors. Depth is further determined by calculating parallax using a binocular depth calculation algorithm, which is not detailed here.
[0051] Optionally, in some embodiments, obtaining region segmentation information of the first image includes:
[0052] determining edge information of different objects in the first image;
[0053] The main area and the background area of the first image are segmented based on the edge information to obtain the area segmentation information.
[0054] That is, the edge information of different objects can be obtained by identifying different objects in the first image, and the subject area and the background area can be segmented according to the type (subject or background) of each object to obtain region segmentation information, also known as segmentation map information. For example, the region segmentation information includes the position information of the subject area and the position information of the background area; or, the region segmentation information includes the position information of different objects and the type of each object. For example, the main control chip or the image processing chip is provided with a subject / background segmentation map calculation component, which segments the subject area and the background area according to the edge information of different objects in the image, and finally outputs the region segmentation information as a labeling information, marking which pixels (pixels) are the subject area and which pixels are the background area.
[0055] Optionally, in some embodiments, blurring the first image according to the depth of field information and the region segmentation information to obtain the second image includes:
[0056] Determining a to-be-blurred area of the first image based on the depth of field information and the area segmentation information;
[0057] The area to be blurred is blurred to obtain the second image.
[0058] In this way, after acquiring the depth of field information and the region segmentation information, the image processing chip can automatically determine the region to be blurred in the first image, thereby performing blurring processing on the region to be blurred to obtain the second image.
[0059] The image processing chip may pre-configure a strategy for determining the area to be blurred. For example, if the area to be blurred satisfies: the depth of field is greater than a first threshold and it belongs to the background area, the background may be blurred.
[0060] Optionally, in some embodiments, before determining edge information of different objects in the first image, the method further includes:
[0061] When images collected by multiple image sensors are acquired, the images collected by the multiple image sensors are fused to obtain the first image.
[0062] In this way, for the target of blur processing, that is, the first image, if there are multiple image sensors, considering that the FOV of different image sensors has a slight deviation, multiple frames of YUV data from different image sensors will be fused to provide users with a clearer and more reasonable picture, and also provide a data source for subsequent steps.
[0063] Optionally, in some embodiments, the method further comprises:
[0064] Based on the region segmentation information and a preset processing strategy, different color and / or filter processing is performed on the subject region and the background region in the first image.
[0065] Here, the preset processing strategy is the image processing solution expected by the user. Based on the region segmentation information and the preset processing strategy, different color and / or filter processing can also be performed on the subject area and the background area, such as rendering different light spot shapes on the background area, rendering different colors on the subject area, and applying a cold color filter to the subject area.
[0066] Specifically, the main control chip or the image processing chip performs different color and / or filter processing on the subject area and the background area in the first image.
[0067] The following describes the application of the embodiments of the present application with reference to specific examples:
[0068] Example 1: As shown in FIG2 and FIG3, the image processing method includes:
[0069] Step 301: A single image sensor is powered on and outputs a first image, i.e., YUV image data;
[0070] Step 302: The image data (first image) is sent to a depth calculation component to calculate depth information.
[0071] After generating a single frame of YUV image data, it is sent to the depth calculation component of the main control chip. The depth calculation component determines the depth information of different pixels based on different objects in the image. Finally, the depth information of different objects in the entire picture is calibrated;
[0072] Step 303: The image data (first image) is sent to the subject / background segmentation map calculation component to calculate the segmentation map information;
[0073] After generating a single frame of YUV image data, it is sent to the subject / background segmentation map calculation component of the main control chip. Based on the edge information of different objects in the image, the subject area and the background area are segmented, and finally a label information is output to mark which pixels are the subject area and which pixels are the background area.
[0074] Step 304: input the image data (first image) + depth of field information + segmentation map information into the image processing chip, and the image processing chip performs blur processing;
[0075] The first image, depth of field information, and segmentation map information output by the image sensor are sent to the image processing chip for processing in the hardware module to blur the background and render different light spot shapes. Different colors are rendered for the subject to achieve a better and more elegant video effect.
[0076] Step 305: The processed data is sent to the preview display component for display;
[0077] The processed data is sent to the preview display component through the system channel. Users can see the rendering effect of the current scene in real time. Users can adjust the different levels and shapes of blur and light spots through the UI interface. Users can create a variety of recording effects by themselves;
[0078] Step 306: Send the data to the video encoding component, which encodes and saves the data.
[0079] The video encoding component compresses the processed data through encoding to save the video information in a smaller ROM space, saving ROM space for users to store more video and file information, and save the compressed data into files in the SD card;
[0080] Step 307: End.
[0081] Example 2: As shown in FIG4 and FIG5, the image processing method includes:
[0082] Step 501: Two or more image sensors are powered on to output a plurality of first images, i.e., a plurality of frames of YUV image data;
[0083] Two or more YUV image data are output to the next component.
[0084] Step 502: multiple frames of YUV image data are sent to a depth of field calculation component to calculate depth of field information;
[0085] After the YUV data is generated, the image data is sent to the depth of field calculation component of the main control chip. Based on the principle of dual-camera, the depth of field calculation component can calculate the distance from each point of the object in the image to the image sensor from two frames of images (two different image sensors in the same position). It can accurately calculate the depth of field information of the current object in the entire picture, and ultimately calibrate the depth of field information of different objects in the entire picture;
[0086] Step 503: Fusing multiple frames of information into one frame of image (YUV image data), i.e., the fused first image;
[0087] Fusion of multiple frames of YUV image data. Because the FOVs of different image sensors have slight deviations, the fusion algorithm is used to fuse the YUV image data to provide users with a clearer and more reasonable picture, and also provide a data source for subsequent steps. That is, the first image input to the subject / background segmentation map calculation component is a fused image of multiple frames of images from multiple image sensors.
[0088] Step 504: Send the image data (the fused first image) to the subject / background segmentation map calculation component to calculate the segmentation map information;
[0089] After the fused YUV image data is generated, it is sent to the subject / background calculation component of the main control chip. Based on the edge information of different objects in the image, the subject area and the background area are segmented, and finally a label information is output to mark which pixels are the subject area and which pixels are the background area.
[0090] Step 505: input the image data (the fused first image) + the depth of field information + the segmentation map information into the image processing chip, and the image processing chip performs blur processing;
[0091] The fused first image, depth of field information, and segmentation map information are sent to the image processing chip for processing in the hardware module to blur the background and render different light spot shapes. Different colors are rendered for the subject to achieve a better and more elegant video effect.
[0092] Step 506: The processed data is sent to the preview display component for display;
[0093] The processed data is sent to the preview display component through the system channel. Users can see the rendering effect of the current scene in real time. Users can adjust the different levels and shapes of blur and light spots through the UI interface. Users can create a variety of recording effects by themselves;
[0094] Step 507: Send the data to the video encoding component, which encodes and saves the data;
[0095] The video encoding component compresses the processed data through encoding to save the video information in a smaller ROM space, saving ROM space for users to store more video and file information, and save the compressed data into files in the SD card;
[0096] Step 508: End.
[0097] Example 3: As shown in FIG6 and FIG7 , the image processing method includes:
[0098] Step 701: A single image sensor is powered on and outputs a first image, i.e., YUV image data;
[0099] Step 702: The image data (first image) is sent to the image processing chip for hardware image processing.
[0100] In Example 1, the depth of field calculation solution is hardened into the image processing chip for hardware processing, and ultimately calibrates the depth of field information of different objects in the entire picture; in Example 2, the region segmentation information acquisition solution is hardened into the image processing chip for hardware processing, which segments the subject area and the background area, and ultimately outputs a labeling information to mark which pixels are the subject area and which pixels are the background area.
[0101] After generating a single frame of YUV image data, it is sent to the image processing chip, which performs hardware processing. After obtaining depth of field information and area segmentation information, it combines the first image output by the image sensor to blur the background and render different light spot shapes. Different colors are rendered for the subject to achieve a better and more elegant video effect.
[0102] Step 703: The processed data is sent to the preview display component for display;
[0103] The processed data is sent to the preview display component through the system channel. Users can see the rendering effect of the current scene in real time. Users can adjust the different levels and shapes of blur and light spots through the UI interface. Users can create a variety of recording effects by themselves;
[0104] Step 704: Send the data to the video encoding component, which encodes and saves the data.
[0105] The video encoding component compresses the processed data through encoding to save the video information in a smaller ROM space, saving ROM space for users to store more video and file information, and save the compressed data into files in the SD card;
[0106] Step 705: End.
[0107] The image processing method provided in the embodiment of the present application can be executed by an image processing device. In the embodiment of the present application, the image processing device provided in the embodiment of the present application is described by taking the image processing device executing the image processing method as an example.
[0108] As shown in FIG8 , an image processing apparatus 800 according to an embodiment of the present application includes:
[0109] An acquisition module 810 is configured to acquire depth of field information and region segmentation information of a first image;
[0110] The first processing module 820 is configured to perform blurring processing on the first image according to the depth of field information and the region segmentation information to obtain a second image.
[0111] Optionally, the acquisition module is further configured to:
[0112] The depth of field information and the area segmentation information are obtained through a main control chip or an image processing chip.
[0113] Optionally, the first processing module is further configured to:
[0114] The second image is obtained by blurring the first image through the image processing chip.
[0115] Optionally, the first processing module includes:
[0116] A first processing unit, configured to determine a to-be-blurred area of the first image based on the depth of field information and the area segmentation information;
[0117] The second processing unit is configured to perform blurring processing on the area to be blurred to obtain the second image.
[0118] Optionally, the acquisition module is further configured to:
[0119] In the case where the first image is a single-frame image, estimating the depth of field information based on different objects in the first image; or
[0120] In a case where the first image includes two associated images, the depth of field information is calculated based on distances from associated pixels in the two images to an image sensor; wherein the two images are captured by different image sensors.
[0121] Optionally, the acquisition module is further configured to:
[0122] determining edge information of different objects in the first image;
[0123] The main area and the background area of the first image are segmented based on the edge information to obtain the area segmentation information.
[0124] Optionally, the device further comprises:
[0125] The second processing module is used to perform different color and / or filter processing on the subject area and the background area in the first image based on the area segmentation information and a preset processing strategy.
[0126] Optionally, the device further comprises:
[0127] The third processing module is configured to, when images captured by multiple image sensors are acquired, fuse the images captured by the multiple image sensors to obtain the first image.
[0128] The device further performs blurring processing on a first image to be processed by acquiring its depth of field information and region segmentation information, thereby realizing a convenient and intelligent image processing process.
[0129] The image processing device in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other device other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.
[0130] The image processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0131] The image processing device provided in the embodiment of the present application can implement each process implemented in the method embodiments of Figures 1 to 7. To avoid repetition, they will not be described here.
[0132] Optionally, as shown in Figure 9, an embodiment of the present application also provides an electronic device 900, including a processor 901 and a memory 902, and the memory 902 stores a program or instruction that can be run on the processor 901. When the program or instruction is executed by the processor 901, the various steps of the above-mentioned image processing method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0133] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0134] FIG10 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
[0135] The electronic device 1000 includes but is not limited to components such as a radio frequency unit 1001 , a network module 1002 , an audio output unit 1003 , an input unit 1004 , a sensor 1005 , a display unit 1006 , a user input unit 1007 , an interface unit 1008 , a memory 1009 , and a processor 1010 .
[0136] Those skilled in the art will appreciate that the electronic device 1000 may further include a power source (such as a battery) to power various components. The power source may be logically connected to the processor 1010 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The electronic device structure shown in FIG10 does not limit the electronic device. The electronic device may include more or fewer components than shown, or may combine certain components or arrange the components differently, which will not be described in detail here.
[0137] The processor 1010 is configured to obtain depth of field information and region segmentation information of the first image;
[0138] The first image is blurred according to the depth of field information and the region segmentation information to obtain a second image.
[0139] For the first image to be processed, by obtaining its depth of field information and region segmentation information, further blurring processing is performed to achieve a convenient and intelligent image processing process.
[0140] Optionally, the processor 1010 is further configured to:
[0141] The depth of field information and the area segmentation information are obtained through a main control chip or an image processing chip.
[0142] Optionally, the processor 1010 is further configured to:
[0143] The second image is obtained by blurring the first image through the image processing chip.
[0144] Optionally, the processor 1010 is further configured to:
[0145] In the case where the first image is a single-frame image, estimating the depth of field information based on different objects in the first image; or
[0146] In a case where the first image includes two associated images, the depth of field information is calculated based on distances from associated pixels in the two images to an image sensor; wherein the two images are captured by different image sensors.
[0147] Optionally, the processor 1010 is further configured to:
[0148] determining edge information of different objects in the first image;
[0149] The main area and the background area of the first image are segmented based on the edge information to obtain the area segmentation information.
[0150] Optionally, the processor 1010 is further configured to:
[0151] Determining a to-be-blurred area of the first image based on the depth of field information and the area segmentation information;
[0152] The area to be blurred is blurred to obtain the second image.
[0153] Optionally, the processor 1010 is further configured to:
[0154] Based on the region segmentation information and a preset processing strategy, different color and / or filter processing is performed on the subject region and the background region in the first image.
[0155] Optionally, the processor 1010 is further configured to:
[0156] When images collected by multiple image sensors are acquired, the images collected by the multiple image sensors are fused to obtain the first image.
[0157] It should be understood that in an embodiment of the present application, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and an operating stick, which will not be repeated here.
[0158] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0159] Processor 1010 may include one or more processing units. Optionally, processor 1010 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 1010.
[0160] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned image processing method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0161] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk.
[0162] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0163] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0164] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned image processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0165] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0166] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0167] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. An image processing method, comprising: Acquiring depth of field information and region segmentation information of the first image; The first image is blurred according to the depth of field information and the region segmentation information to obtain a second image.
2. The method according to claim 1, wherein: Obtaining depth of field information and region segmentation information of the first image, including: The depth of field information and the area segmentation information are obtained through a main control chip or an image processing chip.
3. The method according to claim 2, wherein: The first image is blurred according to the depth of field information and the region segmentation information to obtain a second image, including: The second image is obtained by blurring the first image through the image processing chip.
4. The method according to claim 1 or 2, wherein: Obtaining depth information of the first image, including: In the case where the first image is a single-frame image, estimating the depth of field information based on different objects in the first image; or, In the case where the first image includes two associated images, the depth of field information is calculated based on the distance from associated pixels in the two images to an image sensor; wherein the two images are captured by different image sensors.
5. The method according to claim 1 or 2, wherein: Acquiring region segmentation information of the first image, including: determining edge information of different objects in the first image; The main area and the background area of the first image are segmented based on the edge information to obtain the area segmentation information.
6. The method according to claim 5, before determining edge information of different objects in the first image, further comprising: In the case of acquiring images captured by multiple image sensors, the images captured by the multiple image sensors are The images in the set are fused to obtain the first image.
7. The method according to claim 1 or 3, wherein: The first image is blurred according to the depth of field information and the region segmentation information to obtain a second image, including: Determining a region to be blurred of the first image based on the depth of field information and the region segmentation information; The area to be blurred is blurred to obtain the second image.
8. The method according to claim 1, further comprising: Based on the region segmentation information and a preset processing strategy, different color and / or filter processing is performed on the subject region and the background region in the first image.
9. An image processing device, comprising: An acquisition module, used to acquire depth of field information and region segmentation information of the first image; The first processing module is used to perform blurring processing on the first image according to the depth of field information and the region segmentation information to obtain a second image.
10. The device according to claim 9, wherein: The acquisition module is also used for: The depth of field information and the area segmentation information are obtained through a main control chip or an image processing chip.
11. The device according to claim 10, wherein: The first processing module is also used for: The second image is obtained by blurring the first image through the image processing chip.
12. The device according to claim 9 or 11, wherein: The first processing module comprises: A first processing unit, configured to determine a region to be blurred of the first image based on the depth of field information and the region segmentation information; The second processing unit is used to perform blurring processing on the area to be blurred to obtain the second image.
13. The device according to claim 9 or 10, wherein: The acquisition module is also used for: In the case where the first image is a single-frame image, estimating the depth of field information based on different objects in the first image; or, In the case where the first image includes two associated images, the depth of field information is calculated based on the distances from associated pixels in the two images to the image sensor; wherein the two images are obtained by different Collected by the same image sensor.
14. The device according to claim 9 or 10, wherein: The acquisition module is also used for: determining edge information of different objects in the first image; The main area and the background area of the first image are segmented based on the edge information to obtain the area segmentation information.
15. The apparatus according to claim 9, further comprising: The second processing module is used to perform different color and / or filter processing on the main area and the background area in the first image based on the area segmentation information and a preset processing strategy.
16. The apparatus according to claim 14, further comprising: The third processing module is used to fuse the images acquired by multiple image sensors to obtain the first image.
17. An electronic device comprising a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the image processing method according to any one of claims 1 to 8 are implemented.
18. A readable storage medium storing a program or instruction, wherein the program or instruction, when executed by a processor, implements the steps of the image processing method according to any one of claims 1 to 8.
19. A chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the data processing method according to any one of claims 1 to 8.
20. A computer program product, wherein the program product is stored in a storage medium and is executed by at least one processor to implement the steps of the data processing method according to any one of claims 1 to 8.
21. An image processing device / equipment, characterized in that: The device / equipment is used to execute the data processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Field depth obtaining method, device and equipment
CN108053438A
Image automatic focusing method and device, apparatus and readable storage medium
CN109191469A
Portrait segmentation method and device, storage medium and electronic equipment
CN112085002A
Image processing method and device, electronic equipment and computer readable storage medium
CN113313646A
Image processing method and device, electronic equipment and medium
CN117274097A