Image processing method, electronic device and computer readable storage medium

By acquiring and processing the phase image of the target image, and using guided filtering technology for filtering processing and depth calculation, the problem of poor depth image quality is solved, processing efficiency and image quality are improved, and it is suitable for 3D scene reconstruction applications.

CN112714925BActive Publication Date: 2024-09-20SHENZHEN HEYTAP TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201880097727.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-11-19
Publication Date
2024-09-20
Estimated Expiration
2038-11-19

AI Technical Summary

Technical Problem

The existing technology has the problem of poor quality in depth image processing. In particular, the denoising and smoothing processing efficiency of depth images is low, making it difficult to meet high-quality requirements.

Method used

By obtaining at least two phase images of the target image, performing filtering processing to obtain the filtered phase image, and performing depth calculation on it, using guided filtering technology to achieve denoising and smoothing, and improve the quality and processing efficiency of the depth image.

Benefits of technology

It improves the quality of depth images, achieves denoising and smoothing at the same stage, improves the efficiency of image depth processing, avoids the post-processing process of point cloud data, and improves the operating efficiency of 3D scene reconstruction applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112714925B
    Figure CN112714925B
Patent Text Reader

Abstract

An image processing method comprises: acquiring at least two phase images corresponding to a target image; filtering the phase images to obtain filtered phase images; and performing depth calculation on the filtered phase images to obtain a depth image corresponding to the target image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, an electronic device, and a computer-readable storage medium. Background Art

[0002] The depth images collected by the camera module have poor quality and need to be enhanced. Traditional enhancement methods include image denoising, image smoothing, image super-resolution, etc. Denoising and smoothing remove salt and pepper noise by applying bilateral filtering to the depth image to make the three-dimensional space points evenly distributed. Then, the point cloud data generated by the depth image is smoothed and filtered to improve the quality of the point cloud to meet the quality requirements. Summary of the invention

[0003] Embodiments of the present application provide an image processing method, an electronic device, and a computer-readable storage medium.

[0004] An image processing method, comprising:

[0005] Acquire at least two phase images corresponding to the target image;

[0006] performing filtering processing on the phase image to obtain a filtered phase image; and

[0007] Depth calculation is performed on the filtered phase image to obtain a depth image corresponding to the target image.

[0008] An electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor performs the following operations:

[0009] Acquire at least two phase images corresponding to the target image;

[0010] performing filtering processing on the phase image to obtain a filtered phase image; and

[0011] Depth calculation is performed on the filtered phase image to obtain a depth image corresponding to the target image.

[0012] A computer-readable storage medium includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor performs the following operations:

[0013] Acquire at least two phase images corresponding to the target image;

[0014] performing filtering processing on the phase image to obtain a filtered phase image; and

[0015] Depth calculation is performed on the filtered phase image to obtain a depth image corresponding to the target image.

[0016] The image processing method, electronic device and computer-readable storage medium of the embodiment of the present application, when it is necessary to perform depth processing on the target image, first obtain at least two phase images corresponding to the target image as phase images, then filter the obtained phase images to obtain the filtered phase images, and finally perform depth calculation on the filtered phase images to obtain the depth image corresponding to the target image. When performing depth processing on the image, the quality of the depth image is improved through the guided filtering processing method, and at the same time, the denoising and smoothing of the graphics are achieved at the same stage, thereby improving the efficiency of the depth processing of the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 FIG. 4 is a diagram of an application environment of an image processing method in an embodiment.

[0019] Figure 2 FIG. 4 is a flowchart of an image processing method in one embodiment.

[0020] Figure 3 FIG. 4 is a flowchart of steps for obtaining a confidence image in one embodiment.

[0021] Figure 4 FIG. 1 is a flow chart of steps for performing filtering processing in one embodiment.

[0022] Figure 5 FIG. 4 is a flowchart of steps for performing depth image processing in one embodiment.

[0023] Figure 6 FIG. 4 is a structural block diagram of an image processing device in an embodiment.

[0024] Figure 7 FIG. 1 is a schematic diagram of the architecture of an electronic device in an embodiment.

[0025] Figure 8 FIG. 1 is a partial structural block diagram of a mobile phone in an embodiment. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0027] It can be understood that the terms "first", "second", etc. used in the embodiments of the present application can be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element.

[0028] Figure 1 FIG. 1 is a schematic diagram of an application environment of an image processing method in an embodiment. Figure 1 As shown, the application environment includes an electronic device 100. When the electronic device 100 needs to perform depth processing on a target image, it first obtains at least two phase images corresponding to the target image as a phase map, then performs filtering processing on the obtained phase image to obtain a filtered phase image, and finally performs depth calculation on the filtered phase image to obtain a depth image corresponding to the target image. It is understandable that the electronic device 100 can be a smart phone, a tablet computer, a personal digital assistant, etc.

[0029] In one embodiment, an image processing method is provided, which is illustrated by applying the above electronic device 100. Figure 2 As shown, the method includes the following operations:

[0030] Operation 202: acquiring a phase image corresponding to a target image.

[0031] The target image refers to the initial image generated to the depth image.

[0032] A camera can be installed on an electronic device, and images can be acquired through the installed camera. Cameras can be divided into laser cameras, visible light cameras and other types according to the different images acquired. Laser cameras can acquire images formed by irradiating lasers onto objects, and visible light cameras can acquire images formed by irradiating visible light onto objects. Several cameras can be installed on an electronic device, and the installation locations are not limited. For example, a camera can be installed on the front panel of an electronic device, and two cameras can be installed on the back panel. The camera can also be installed inside the electronic device in an embedded manner, and then the camera can be opened by rotating or sliding. Specifically, a front camera and a rear camera can be installed on an electronic device. The front camera and the rear camera can acquire images from different perspectives. Generally, the front camera can acquire images from the front perspective of the electronic device, and the rear camera can acquire images from the back perspective of the electronic device.

[0033] In this embodiment, when the electronic device acquires and generates the target image, it is necessary to perform corresponding image processing on the acquired initial image, so as to obtain an image that meets the output requirements. Specifically, when processing the initial image, firstly, a phase image corresponding to the initial image is acquired. At this time, the obtained phase image needs to be processed to a certain extent, so it is called a phase image to be processed, and the initial image is the target image.

[0034] Furthermore, obtaining at least two phase images corresponding to the target image includes: obtaining at least two phase images corresponding to the target image based on a time-of-flight ToF camera module.

[0035] Among them, Time of Flight (ToF) is to continuously emit light pulses through an infrared transmitter and receive the reflected light pulses to calculate the time difference between the emission and reflection of infrared light to form stereoscopic vision. At least two phase images corresponding to the target image are obtained through the Time of Flight ToF camera module, where the phase image includes an amplitude image, and the final depth-processed image is obtained by processing based on the phase image.

[0036] Furthermore, after acquiring at least two phase images corresponding to the target image, the method further includes: obtaining a corresponding confidence image based on the phase image, wherein the confidence image is a reference image when filtering the phase image, that is, a filtering guide map.

[0037] When filtering a phase image, a filtering guide map is required. In order to ensure the accuracy of filtering, a corresponding filtering guide map, i.e., a confidence image, is obtained based on the obtained phase image. The confidence image is obtained from the phase image. Specifically, all feature parameters and image information of the confidence image are obtained based on the phase image, including the pixel value corresponding to each pixel position in the confidence image, the saturation of the confidence image, and other image information.

[0038] In operation 204, filtering is performed on the phase image to obtain a filtered phase image.

[0039] Among them, the filtering process can perform denoising on the image, which can effectively improve the quality of the final generated image.

[0040] When the corresponding confidence image is obtained based on the acquired phase image, the phase image will be filtered according to the confidence image. In fact, there are many filtering methods, such as bilateral filtering, joint bilateral filtering, median filtering and guided filtering (i.e. guided filtering). In this embodiment, the phase image is filtered by guided filtering.

[0041] Guided filtering is a filtering algorithm that can preserve edges. When using guided filtering for filtering, a filter guide map is required, where the filter guide map can be another separate image or the input image itself. When the filter guide map is the input image itself, guided filtering becomes an edge-preserving filtering operation. In addition, guided filtering can be used for noise reduction, detail smoothing, HDR compression, cutout, defogging, and joint sampling.

[0042] In this embodiment, the confidence image is used as a filtering guide map to filter the phase image in a guided filtering manner to obtain a denoised phase image.

[0043] Operation 206 : performing depth calculation on the filtered phase image to obtain a depth image corresponding to the target image.

[0044] When the filtered phase image is obtained by filtering, the depth calculation is performed on the filtered phase image, and then the depth processed image corresponding to the target image is obtained according to the depth calculation result. In the actual processing process, at least two phase images are first obtained as the basis for processing the target image, and corresponding image processing is performed based on the phase image to achieve the effect of denoising and smoothing the target image.

[0045] In this embodiment, when it is necessary to perform depth processing on the target image, at least two phase images corresponding to the target image are first obtained as the phase images to be processed, and then the obtained phase images are filtered to obtain the filtered phase images, and finally the filtered phase images are depth calculated to obtain the depth processed images corresponding to the target image. When performing depth processing on the image, the quality of the depth image is improved through the guided filtering processing method, and at the same time, the denoising and smoothing of the image are achieved at the same stage, thereby improving the efficiency of the image depth processing.

[0046] In one embodiment, Figure 3 As shown, based on the phase image, the corresponding confidence image is obtained, including:

[0047] Operation 302 : Acquire the first pixel value corresponding to the same pixel position in the phase image to obtain the confidence pixel value corresponding to the pixel position, wherein the confidence pixel value is the average value of the first pixel values.

[0048] Operation 304 : Obtain confidence pixel values ​​corresponding to each pixel position, and obtain corresponding confidence images based on the confidence pixel values ​​corresponding to each pixel position.

[0049] When obtaining a confidence image based on a phase image, all image information contained in the confidence image is determined by the phase image. Specifically, if there are multiple phase images, firstly, the first pixel value corresponding to the same pixel position in the phase image is obtained, and then the confidence pixel value of the corresponding position is obtained based on the obtained first pixel value, and then the corresponding confidence image is obtained.

[0050] When depth processing is performed based on the time-of-flight ToF camera module, the number of phase images obtained is usually four. In this embodiment, it is assumed that the number of phase images obtained is four, and the first pixel values ​​corresponding to the same pixel point A in the four phase images are obtained, and the first pixel values ​​are Q1, Q2, Q3 and Q4, which respectively represent the pixel values ​​corresponding to the same pixel point position of different phase images, and the confidence pixel value at pixel point A is That is, the confidence pixel value is the average of all pixel values. In fact, the number of phase images can be more than four. When the number of phase images is multiple, the confidence pixel value at pixel A is Wherein N is the number of phase images, i represents the i-th phase image, and Qi represents the pixel value of the i-th phase image at pixel point A.

[0051] By calculating the confidence pixel value of each pixel position, the confidence pixel value corresponding to each pixel position in the confidence image is obtained, and then the corresponding confidence image is generated. In the confidence image, the pixel value of each pixel position has a certain correlation with all phase images. In this embodiment, the subsequent filtering operation is performed based on the confidence image obtained according to the phase image obtained from the target graphic, so that the final image after depth processing is more accurate.

[0052] In one embodiment, operation 204, filtering the phase image to obtain a filtered phase image, includes: using the confidence image as a guidance map, filtering the phase image to obtain a filtered phase image.

[0053] Specifically, Figure 4 As shown, after filtering the phase image, the filtered phase image includes:

[0054] In operation 402, original vectors corresponding to the phase images are obtained, and a steering vector corresponding to the confidence image is obtained.

[0055] In operation 404, a corresponding relationship between the original vector and the steering vector is established.

[0056] In operation 406, a filtered phase image is obtained according to the corresponding relationship.

[0057] Among them, guided filtering is an image filtering technology that filters the target image through a filter guide map. The target image is the input image for image processing, so that the final output image is roughly similar to the target image, but the texture part is similar to the filter guide map. There are two typical applications: edge-preserving image smoothing and matting.

[0058] When filtering the phase image, the confidence image is used as a guide map to perform filtering operations, and the phase image and the confidence image are processed together to obtain a filtered phase image corresponding to the phase image currently being filtered. Specifically, firstly, the original vector corresponding to the phase image is obtained, and the guide vector corresponding to the confidence image is obtained, and then the corresponding relationship between the original vector of the phase image and the guide vector of the confidence image is established according to the implementation principle of guided filtering, and finally, the phase image after the phase image is filtered is generated according to the obtained corresponding relationship.

[0059] In this embodiment, the actual processing process based on guided filtering is as follows: the guiding vector of the confidence image (guided graph) is g, the initial vector of the phase image (input image) is p, and the result vector of the filtered phase image (output image) is q. The goal of guided filtering is to make the original input and output as similar as possible, while the texture part is similar to the filtered guided graph.

[0060] For goal 1: the phase image p and the filtered phase image q are as similar as possible, which can be described by the formula: min|qp| 2 . Among them, the formula min|qp| 2 It means that the calculated |qp| 2 The minimum value of |qp| 2 The smaller it is, the higher the similarity between the phase image p and the filtered phase image q.

[0061] For goal 2: the texture of the filtered phase image q is as similar as possible to the confidence image g, which can be described by the formula:

[0062] In the above formula, if the filtered phase image is a single-channel image and the confidence image is multi-channel, then a is a vector; if q and g have the same number of channels, then a is a scalar or a diagonal matrix. Obviously, the smaller the value of a, the smoother the final output image will be. That is, when the value of a is smaller, the texture of the filtered phase image q is more similar to the texture of the confidence image g. For the formula described in Objective 2, the corresponding transformation can also be performed to obtain: q = a*g+b.

[0063] In this embodiment, when filtering is performed, the phase image is actually denoised. For the phase image p, which is the original image with noise, assuming that n is the noise to be filtered out, the following formula is used: q = pn. The principle of guided filtering is: assuming that the distribution of q and g is the same, that is, there is a linear relationship between q and g, that is, q = a*g + b as described above, from which n = p-(a*gb) can be obtained, and this term is minimized to solve a and b. Then, the corresponding depth information is determined based on the obtained result information, and the filtered phase image is obtained.

[0064] Further, according to the corresponding relationship, a filtered phase image corresponding to the phase image is obtained, including:

[0065] Operation a, according to the corresponding relationship, obtain the pixel values ​​corresponding to the positions of each pixel point in the filtered phase image.

[0066] Operation b: generating a filtered phase image based on the pixel values ​​corresponding to the positions of the respective pixel points.

[0067] According to the above description, the established corresponding relationships include q=pn and q=a*g+b. According to the obtained corresponding relationship, n=p-(a*gb) can be obtained. By minimizing n=p-(a*gb) to obtain the corresponding values ​​of a and b, the corresponding filtered phase image is generated. In addition, the energy function can also be defined: Where i represents the traversal of each pixel point, k represents the kth phase image, and solving this energy function is the algorithm process of guided filtering. At the same time, in fact, when performing filtering processing, the pixel values ​​corresponding to the positions of each pixel point are obtained through filtering processing, that is, in this embodiment, the corresponding relationship established is q i =p i -n i and q i =a*g i +b, where i represents traversing each pixel. After obtaining the pixel values ​​corresponding to each pixel position, the corresponding filtered phase image is generated. Compared with other filtering methods, guided filtering avoids the flipping of pixels at the edge of the image and has a better noise suppression effect in flat areas.

[0068] In one embodiment, Figure 5 As shown, operation 206, calculating the depth of the filtered phase image to obtain a depth-processed image corresponding to the target image, includes:

[0069] Operation 502: Obtain a second pixel value corresponding to the same pixel position in the filtered phase image.

[0070] Operation 504 : obtaining depth information corresponding to the pixel position based on the second pixel value.

[0071] Operation 506 : generating a depth image corresponding to the target image according to the depth information corresponding to each pixel position.

[0072] When performing depth processing on an image, it is necessary to obtain a corresponding depth-processed image. Therefore, after obtaining the filtered phase image, depth processing will be performed based on the filtered phase image to obtain a depth-processed image after depth processing of the target image. Specifically, the second pixel value corresponding to the same pixel position in the filtered phase image is obtained, and then the depth information corresponding to the pixel position is obtained based on the obtained second pixel value. For all pixels, the depth information corresponding to each pixel position is obtained in the same way, and then the depth-processed image corresponding to the target image is obtained.

[0073] When the filtered phase image is actually obtained, the second pixel value corresponding to the same pixel position in the filtered phase image is obtained, and then the depth information corresponding to this pixel position is obtained based on the obtained second pixel value. After obtaining the depth information of all pixel positions, the corresponding depth processed image is generated.

[0074] Furthermore, operation 504, based on the second pixel value, obtains depth information corresponding to the pixel position, including:

[0075] Operation c: obtaining a corresponding phase angle based on the second pixel value, and acquiring an output frequency of the time-of-flight ToF camera module;

[0076] Operation d: obtaining depth information corresponding to the pixel position according to the phase difference and the output frequency; wherein the depth information is proportional to the phase difference and inversely proportional to the output frequency.

[0077] Specifically, taking the phase image as an example, the phase angle obtained according to the pixel value corresponding to the pixel position is Where Q1, Q2, Q3 and Q4 are the second pixel values ​​corresponding to the same position of the four phase images. When the depth information is obtained, the corresponding depth calculation formula is: Wherein, d is the depth information, c is the speed of light, and f is the output frequency of the time-of-flight ToF camera module. When the depth information corresponding to each pixel position is calculated, the corresponding depth-processed image is generated.

[0078] The above image processing method improves the quality of the depth image in order to avoid the post-processing process at the point cloud stage. At the same time, the traversal of the image data can be completed within a limited time complexity through array subscripts, which is much more efficient than the traversal of unordered point cloud data, and thus has higher operating efficiency. In addition, in the application of 3D scene reconstruction, the above image processing method improves the quality of the depth image and makes the pixel points of the depth image evenly distributed, thus avoiding the uniform processing of the point cloud data and improving the operating efficiency of the application.

[0079] In 3D face reconstruction applications, by improving the quality of depth images, the impact of noise on non-rigid surface reconstruction can be reduced, making facial features clearer.

[0080] It should be understood that, although each operation in the above-mentioned each flow chart is shown successively according to the indication of arrow, these operations are not necessarily performed successively according to the order indicated by arrow.Unless there is clear explanation in this article, the execution of these operations does not have strict order restriction, and these operations can be performed in other order.And, at least a part of the operations in the above-mentioned each flow chart can include a plurality of sub-operations or a plurality of stages, and these sub-operations or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-operations or stages is not necessarily performed successively, but can be performed in turn or alternately with at least a part of other operations or sub-operations of other operations or stages.

[0081] Figure 6 FIG. 1 is a structural block diagram of an image processing device in an embodiment. Figure 6 As shown, the device includes: an image acquisition module 602, a filter processing module 604 and a depth processing module 606, wherein:

[0082] The image acquisition module 602 is used to acquire at least two phase images corresponding to the target image.

[0083] The filtering processing module 604 is used to perform filtering processing on the phase image to obtain a filtered phase image.

[0084] The depth processing module 606 is used to perform depth calculation on the filtered phase image to obtain a depth image corresponding to the target image.

[0085] In one embodiment, an image acquisition module is provided that is also used to obtain at least two phase images corresponding to the target image based on a time-of-flight ToF camera module, wherein the phase image includes an amplitude image.

[0086] In one embodiment, an image processing device is provided that further includes a guidance map acquisition module, wherein the guidance map acquisition module is used to obtain a corresponding confidence image based on the phase image, so as to use the confidence image as a filtering guidance map.

[0087] In one embodiment, a guidance map acquisition module is provided, including a pixel value calculation module and a guidance map generation module. The pixel value calculation module is used to obtain the first pixel value corresponding to the same pixel position in the phase image to obtain the confidence pixel value corresponding to the pixel position, wherein the confidence pixel value is the average value of the first pixel value, and the guidance map generation module is used to obtain the confidence pixel value corresponding to each pixel position, and based on the confidence pixel value corresponding to each pixel position, obtain the corresponding confidence image, so as to use the confidence image as a filtering guidance map.

[0088] In one embodiment, a filtering processing module is provided for filtering the phase image using the confidence image as a filtering guide map to obtain a filtered phase image.

[0089] In one embodiment, a filtering processing module is provided, which further includes a vector acquisition module, a relationship establishment module and an image generation module. The vector acquisition module is used to acquire the original vectors corresponding to the phase image, and acquire the steering vector corresponding to the confidence image; the relationship establishment module is used to establish the corresponding relationship between the original vector and the steering vector; and the image generation module is used to obtain the filtered phase image according to the corresponding relationship.

[0090] In one embodiment, an image generation module is provided, which further includes a pixel value determination module and a generation module. The pixel value determination module is used to obtain the pixel values ​​corresponding to each pixel point position in the filtered phase image according to the corresponding relationship; the generation module is used to generate the filtered phase image based on the pixel values ​​corresponding to each pixel point position.

[0091] In one embodiment, a generation module is provided that further includes a pixel value acquisition module, a depth information acquisition module, and a depth image generation module. The pixel value acquisition module is used to acquire a second pixel value corresponding to the same pixel position in the filtered phase image; the depth information acquisition module is used to obtain the depth information corresponding to the pixel position based on the second pixel value; and the depth image generation module is used to generate a depth image corresponding to the target image based on the depth information corresponding to each pixel position.

[0092] For the specific definition of the image processing device, please refer to the definition of the image processing method above, which will not be repeated here. Each module in the above-mentioned image processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device or server in the form of hardware, or can be stored in the memory in the electronic device or server in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0093] In one embodiment, Figure 7 As shown, a schematic diagram of the internal structure of an electronic device is provided. The electronic device includes a processor, a memory, a display and a network interface connected by a system bus. Among them, the processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory is used to store data, programs, and / or instruction codes, etc., and at least one computer program is stored on the memory, and the computer program can be executed by the processor to implement the image processing method applicable to the electronic device provided in the embodiment of the present application. The memory may include a non-volatile storage medium such as a disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random-Access-Memory, RAM), etc. For example, in one embodiment, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an image processing method provided in each embodiment of the present application. The internal memory provides a cache operating environment for the operating system and the computer program in the non-volatile storage medium. The display can be used to display information, for example, to display various interfaces, etc. The network interface may be an Ethernet card or a wireless network card, etc., which is used to communicate with external electronic devices, for example, it can be used to communicate with a server.

[0094] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the electronic device or server to which the solution of the present application is applied. The specific electronic device or server may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0095] The present application also provides an electronic device. Figure 8 For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. Take the electronic device as a mobile phone as an example:

[0096] Figure 8This is a block diagram of a partial structure of a mobile phone related to the electronic device provided in the embodiment of the present application. Figure 8 The mobile phone includes: a radio frequency (RF) circuit 1110, a memory 1120, an input unit 830, a display unit 840, a sensor 850, an audio circuit 860, a wireless fidelity (WiFi) module 870, a processor 880, and a power supply 890. Those skilled in the art will understand that Figure 8 The structure of the mobile phone shown does not constitute a limitation of the mobile phone, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0097] Among them, the RF circuit 810 can be used for receiving and sending signals during information transmission or calls. After receiving the downlink information of the base station, it can be sent to the processor 880 for processing; it can also send the uplink data to the base station. Usually, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 810 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE)), email, Short Messaging Service (SMS), etc.

[0098] The memory 820 can be used to store software programs and modules, and can also be used to store application installation packages. The processor 880 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 820. The memory 820 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as an application for a sound playback function, an application for an image playback function, etc.); the data storage area can store data configured according to the use of the mobile phone (such as audio data, address book, etc.). In addition, the memory 820 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0099] The input unit 830 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone 800. Specifically, the input unit 1130 may include a touch panel 831 and other input devices 832. The touch panel 831, which may also be referred to as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 831 or near the touch panel 831 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. In one embodiment, the touch panel 831 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 880, and can receive and execute the command sent by the processor 880. In addition, the touch panel 831 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 831, the input unit 830 may further include other input devices 832. Specifically, the other input devices 832 may include but are not limited to one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), and the like.

[0100] The display unit 840 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 840 can display according to the resolution. The display unit 840 may include a display panel 841. In one embodiment, the display panel 841 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc. In one embodiment, the touch panel 831 may cover the display panel 841. When the touch panel 831 detects a touch operation on or near it, it is transmitted to the processor 880 to determine the type of touch event, and then the processor 880 provides a corresponding visual output on the display panel 841 according to the type of touch event. Although in Figure 8 In the embodiment, the touch panel 831 and the display panel 841 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 831 and the display panel 841 can be integrated to realize the input and output functions of the mobile phone.

[0101] The mobile phone 800 may also include at least one sensor 850, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 841 and / or the backlight when the mobile phone is moved to the ear. The motion sensor may include an accelerometer, through which the magnitude of acceleration in each direction may be detected, and the magnitude and direction of gravity may be detected when stationary, which may be used for applications that identify the posture of the mobile phone (such as switching between horizontal and vertical screens), vibration recognition related functions (such as pedometer, tapping), etc.; in addition, the mobile phone may also be equipped with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc.

[0102] The audio circuit 860, the speaker 861 and the microphone 862 can provide an audio interface between the user and the mobile phone. The audio circuit 860 can transmit the received audio data to the speaker 861 after converting the electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 862 converts the collected sound signal into an electrical signal, which is received by the audio circuit 860 and converted into audio data. The audio data is then processed by the output processor 880 and can be sent to another mobile phone through the RF circuit 810, or the audio data is output to the memory 820 for subsequent processing.

[0103] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 870. It provides users with wireless broadband Internet access. Figure 8 A WiFi module 870 is shown, but it is understandable that it is not an essential component of the mobile phone 800 and can be omitted as needed.

[0104] The processor 880 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 820, and calling data stored in the memory 820, it executes various functions of the mobile phone and processes data, thereby monitoring the mobile phone as a whole. The processor 880 can also update applications according to the application installation package. In one embodiment, the processor 880 may include one or more processing units. In one embodiment, the processor 880 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc.; the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 880.

[0105] The mobile phone 800 also includes a power source 890 (such as a battery) for supplying power to various components. Preferably, the power source can be logically connected to the processor 880 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0106] In one embodiment, the mobile phone 800 may also include a camera, a Bluetooth module, etc.

[0107] In this embodiment, when the mobile phone 800 is in use, the processor 880 executes the steps of the image processing method by running the software programs and modules stored in the memory 820 .

[0108] The embodiment of the present application further provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, enable the processors to perform the steps of the image processing method.

[0109] A computer program product comprising instructions, when executed on a computer, causes the computer to perform an image processing method.

[0110] Any reference to memory, storage, database or other medium used in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0111] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire at least two phase images corresponding to the target image; Obtaining a first pixel value corresponding to the same pixel position in the phase image to obtain a confidence pixel value corresponding to the pixel position, wherein the confidence pixel value is an average value of the first pixel values; obtaining confidence pixel values ​​corresponding to each pixel position, and obtaining a corresponding confidence image based on the confidence pixel values ​​corresponding to each pixel position; According to the guided filtering method, the original vectors corresponding to the phase images are obtained, and the guided vectors corresponding to the confidence images are obtained; a corresponding relationship between the original vectors and the guided vectors is established; and a filtered phase image is obtained according to the corresponding relationship; and Obtain a second pixel value corresponding to the same pixel position in the filtered phase image; based on the second pixel value, obtain depth information corresponding to the pixel position; and generate a depth image corresponding to the target image according to the depth information corresponding to each pixel position.

2. The method according to claim 1, characterized in that The step of acquiring at least two phase images corresponding to the target image comprises: At least two phase images corresponding to the target image are obtained based on the time-of-flight ToF camera module, wherein the phase image includes an amplitude image.

3. The method according to claim 1, characterized in that The step of obtaining a filtered phase image according to the corresponding relationship includes: According to the corresponding relationship, the pixel values ​​corresponding to the positions of the pixels in the filtered phase image are obtained; and Based on the pixel values ​​corresponding to the positions of the respective pixel points, a filtered phase image is generated.

4. The method according to claim 1, characterized in that: The obtaining, based on the second pixel value, depth information corresponding to the pixel point position includes: Obtaining a corresponding phase angle based on the second pixel value, and acquiring an output frequency of a time-of-flight ToF camera module; Depth information corresponding to the pixel position is obtained according to the phase angle and the output frequency, wherein the depth information is proportional to the phase angle and inversely proportional to the output frequency.

5. An image processing device, characterized in that: The device comprises: An image acquisition module, used to acquire at least two phase images corresponding to the target image; A guidance map acquisition module, used to acquire a first pixel value corresponding to the same pixel position in the phase image to obtain a confidence pixel value corresponding to the pixel position, wherein the confidence pixel value is an average value of the first pixel value; acquire confidence pixel values ​​corresponding to each pixel position respectively, and obtain a corresponding confidence image based on the confidence pixel values ​​corresponding to each pixel position; A filtering processing module, used to obtain the original vectors corresponding to the phase images and the steering vector corresponding to the confidence image in a guided filtering manner; establish a corresponding relationship between the original vectors and the steering vectors; and obtain a filtered phase image according to the corresponding relationship; and A depth processing module is used to obtain a second pixel value corresponding to the same pixel position in the filtered phase image; based on the second pixel value, obtain the depth information corresponding to the pixel position; and generate a depth image corresponding to the target image according to the depth information corresponding to each pixel position.

6. The device according to claim 5, characterized in that The image acquisition module is also used to obtain at least two phase images corresponding to the target image based on the time-of-flight ToF camera module, wherein the phase image includes an amplitude image.

7. The device according to claim 5, characterized in that The filtering processing module is also used to obtain the pixel values ​​corresponding to each pixel point position in the filtered phase image according to the corresponding relationship; and generate the filtered phase image based on the pixel values ​​corresponding to each pixel point position.

8. The device according to claim 5, characterized in that The depth processing module is also used to obtain the corresponding phase angle based on the second pixel value and obtain the output frequency of the time-of-flight ToF camera module; according to the phase angle and the output frequency, the depth information corresponding to the pixel point position is obtained, wherein the depth information is proportional to the phase angle and inversely proportional to the output frequency.

9. An electronic device, comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following operations: Acquire at least two phase images corresponding to the target image; Obtaining a first pixel value corresponding to the same pixel position in the phase image to obtain a confidence pixel value corresponding to the pixel position, wherein the confidence pixel value is an average value of the first pixel values; obtaining confidence pixel values ​​corresponding to each pixel position, and obtaining a corresponding confidence image based on the confidence pixel values ​​corresponding to each pixel position; According to the guided filtering method, the original vectors corresponding to the phase images are obtained, and the guided vectors corresponding to the confidence images are obtained; a corresponding relationship between the original vectors and the guided vectors is established; and a filtered phase image is obtained according to the corresponding relationship; and Obtain a second pixel value corresponding to the same pixel position in the filtered phase image; based on the second pixel value, obtain depth information corresponding to the pixel position; and generate a depth image corresponding to the target image according to the depth information corresponding to each pixel position.

10. The electronic device according to claim 9, characterized in that: When the computer program is executed by the processor, the processor further performs the following operations when executing the step of acquiring at least two phase images corresponding to the target image: At least two phase images corresponding to the target image are obtained based on the time-of-flight ToF camera module, wherein the phase image includes an amplitude image.

11. The electronic device according to claim 9, characterized in that: When the computer program is executed by the processor, the processor further performs the following operations when obtaining the filtered phase image according to the corresponding relationship: According to the corresponding relationship, the pixel values ​​corresponding to the positions of the pixels in the filtered phase image are obtained; and Based on the pixel values ​​corresponding to the positions of the respective pixel points, a filtered phase image is generated.

12. The electronic device according to claim 9, characterized in that: When the computer program is executed by the processor, the processor further performs the following operations when obtaining the depth information corresponding to the pixel point position based on the second pixel value: Obtaining a corresponding phase angle based on the second pixel value, and acquiring an output frequency of a time-of-flight ToF camera module; Depth information corresponding to the pixel position is obtained according to the phase angle and the output frequency, wherein the depth information is proportional to the phase angle and inversely proportional to the output frequency.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the image processing method as described in any one of claims 1 to 4 is implemented.