WO2022011657A1 - Image processing method and apparatus, electronic device, and computer-readable storage medium - Google Patents

Image processing method and apparatus, electronic device, and computer-readable storage medium Download PDF

Info

Publication number
WO2022011657A1
WO2022011657A1 PCT/CN2020/102502 CN2020102502W WO2022011657A1 WO 2022011657 A1 WO2022011657 A1 WO 2022011657A1 CN 2020102502 W CN2020102502 W CN 2020102502W WO 2022011657 A1 WO2022011657 A1 WO 2022011657A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
scene image
image
pixels
subject
Prior art date
Application number
PCT/CN2020/102502
Other languages
French (fr)
Chinese (zh)
Inventor
布迪萨·艾哈迈德
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2020/102502 priority Critical patent/WO2022011657A1/en
Publication of WO2022011657A1 publication Critical patent/WO2022011657A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules

Definitions

  • the present application relates to the field of imaging, and in particular, to an image processing method, an image processing apparatus, an electronic device, and a computer-readable storage medium.
  • An embodiment of the present application provides an image processing method, the image processing method includes acquiring a first scene image, the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image; acquiring a second scene image, the second scene image The far-field depth of the scene image is not greater than the near-field depth of the first scene image; and the subject area and the second scene image are fused to obtain the target image.
  • An embodiment of the present application provides an electronic device, the electronic device includes a memory and one or more processors, the one or more processors are connected to the storage, and the one or more processors are used for: acquiring a first scene image, the first scene image including a subject area, the subject area is located in the depth of field area of the first scene image; acquiring a second scene image, the far depth of field of the second scene image is not greater than the near depth of field of the first scene image; and fusing the subject area and the second scene image to obtain target image.
  • Embodiments of the present application provide an image processing apparatus, where the image processing apparatus includes a first acquisition module, a second acquisition module, and an image fusion module.
  • the first acquisition module is used for acquiring a first scene image, where the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image.
  • the second acquisition module is configured to acquire a second scene image, and the far field depth of the second scene image is not greater than the near field depth of the first scene image.
  • the image fusion module is used for fusing the subject area and the second scene image to obtain the target image.
  • FIG. 1 is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 3 is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG. 5 is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG. 6 is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG. 7 is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG. 8 is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG. 9 is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG. 10 is a flowchart of an image processing method according to an embodiment of the present application.
  • FIG. 11 is a schematic diagram of the principle of an image processing method according to an embodiment of the present application.
  • FIG. 12 is a schematic diagram of distortion correction of an image processing method according to an embodiment of the present application.
  • FIG. 13 is a schematic diagram of the principle of color overflow correction of the image processing method according to an embodiment of the present application.
  • FIG. 15 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
  • FIG. 16 is a schematic diagram of connection between a computer-readable storage medium and a processor according to an embodiment of the present application.
  • an embodiment of the present application provides an image processing method, and the image processing method includes:
  • an embodiment of the present application provides an electronic device, the electronic device includes a memory and one or more processors 320, the one or more processors 320 are connected to the storage, and the one or more processors 320 are used to execute 01 , 03, 05 methods. That is, the one or more processors 320 are configured to acquire a first scene image, the first scene image includes a subject area, and the subject area is located in the depth of field area of the first scene image; acquire a second scene image, and the distant depth of field of the second scene image is not greater than the near depth of field of the first scene image; and fusing the subject area with the second scene image to obtain the target image.
  • the one or more processors 320 include a first ISP processor 232 and a second ISP processor 234 .
  • Memory 260 includes image memory 260 .
  • the electronic device further includes a first camera 210 , a second camera 220 , a control logic 250 , a display 270 , and a communication module 280 .
  • the first camera 210 includes one or more first lenses 212 and a first image sensor 214 .
  • the first scene image may be any one of a visible light image (RGB image), an infrared image (IR image), or a black and white image. In an example, the acquisition of the first scene image here may be achieved by the first camera 210.
  • the first camera 210 is a visible light image
  • the first camera 210 is a color camera.
  • the first image sensor 214 may include An array of color filters (eg, Bayer filters), the first image sensor 214 can obtain the light intensity and wavelength information captured by each imaging pixel and provide a set of image data that can be processed by the first ISP processor 232.
  • the first camera 210 is an infrared light camera, and correspondingly, the first image sensor 214 may include an infrared filter array.
  • the first camera 210 is a black and white camera, and correspondingly, the first image sensor 214 may not be provided with a filter array.
  • the first camera 212 collects the first scene image and stores it in the image memory 260 of the electronic device 200, where the first ISP processor 232 and the second ISP processor 234 can obtain the first scene image. Reading the first scene image stored in the image memory 260 is implemented.
  • the first camera 210 collects the first scene image and stores it in the cloud or other devices, where the first scene image may be obtained by the communication module 280 in the electronic device 200 from the cloud or other devices, Then, it is transmitted to the first ISP processor 232 and the second ISP processor 234 by the communication module 280 for implementation.
  • the second camera 220 includes one or more second lenses 222 and a second image sensor 224 .
  • the second scene image may also be any one of a visible light image (RGB image), an infrared image (IR image), or a black and white image.
  • the acquisition of the second scene image here may be achieved by the second camera 220.
  • the second scene image 210 is a visible light image
  • the second camera 220 is a color camera.
  • the second image sensor 224 may include A color filter array, the second image sensor 224 can obtain the light intensity and wavelength information captured by each imaging pixel and provide a set of image data that can be processed by the first ISP processor 232.
  • the second camera 220 is an infrared light camera, and correspondingly, the second image sensor 224 may include an infrared filter array.
  • the second camera 220 is a black and white camera, and correspondingly, the second image sensor 224 may not be provided with a filter array.
  • the second camera 222 collects the second scene image and stores it in the image memory 260 of the electronic device 200, where the first ISP processor 232 and the second ISP processor 234 can obtain the second scene image. Reading the second scene image stored in the image memory 260 is implemented.
  • the second camera 220 collects the second scene image and stores it in the cloud or other devices, where the second scene image may be obtained by the communication module 280 in the electronic device 200 from the cloud or other devices, Then, it is transmitted to the first ISP processor 232 and the second ISP processor 234 by the communication module 280 for implementation.
  • the first scene image collected by the first camera 210 is transmitted to the first ISP processor 232 for processing.
  • the statistical data of the first scene image can be sent to the control logic 250,
  • the control logic 250 may determine the control parameters of the first camera 210 according to the statistical data, so that the first camera 210 may perform operations such as automatic focusing and automatic exposure according to the control parameters.
  • the first scene image can be stored in the image memory 260 after being processed by the first ISP processor 232 .
  • the first scene image can be directly sent to the display 270 for display, and the display 270 can also read the image in the image memory 260 for display.
  • the second image captured by the second camera 220 is transmitted to the second ISP processor 234 for processing.
  • the second ISP processor 234 can send the statistical data of the second scene image to the control logic. 250.
  • the control logic 250 may determine control parameters of the second camera 220 according to the statistical data, so that the second camera 220 may perform operations such as auto-focusing, auto-exposure, and the like according to the control parameters.
  • the second scene image can be stored in the image memory 260 after being processed by the second ISP processor 234 .
  • the second image after being processed by the second ISP processor 234, the second image can be directly sent to the display 270 for display, and the display 270 can also read the image in the image memory 260 for display.
  • both the first ISP processor 232 and the second ISP processor 234 can process image data pixel by pixel in various formats.
  • each image pixel may have a bit depth of 8, 10, 12, or 14 bits
  • both the first ISP processor 232 and the second ISP processor 234 may perform one or more image processing operations on the image data, collect information about the image Statistics of the data.
  • the image processing operations can be performed with the same or different bit depth precision.
  • Statistics determined by the first ISP processor 232 may be sent to the control logic 250 .
  • the statistical data may include statistical information of the first image sensor 214 such as automatic exposure, automatic white balance, automatic focus, flicker detection, black level compensation, shading correction of the first lens 212, and the like.
  • Statistics determined by the second ISP processor 234 may also be sent to the control logic 250 .
  • the statistical data may include second image sensor 224 statistics such as automatic exposure, automatic white balance, automatic focus, flicker detection, black level compensation, second lens 222 shading correction, and the like.
  • the control logic 250 may include a processor and/or a microcontroller executing one or more routines (eg, firmware) that may determine the control parameters and the first camera 210 based on the received statistics.
  • control parameters of the ISP processor 232 may include gain, integration time for exposure control, anti-shake parameters, flash control parameters, first lens 212 control parameters (eg, focal length for focusing or zooming), or these parameters combination, etc.
  • Control parameters for the first ISP processor 232 or the second ISP processor 234 may include gain levels and color correction matrices for automatic white balance and color adjustment (eg, during RGB processing).
  • the image memory 260 may be a part of the memory device, or may be an independent dedicated memory in a storage device or an electronic device, and may include a DMA (Direct Memory Access, direct memory access) feature.
  • DMA Direct Memory Access, direct memory access
  • the first ISP processor 232 and the second ISP processor 234 may be the same processor, or may be two independent processors, which are not limited herein.
  • the first scene image is an image obtained by shooting for a specific scene
  • the subject area refers to the region of interest in the obtained first scene image.
  • the process of processing and selectively ignoring the uninteresting region is the process of subject recognition.
  • the subject area refers to a first scene determined according to a preset subject recognition model, a preset subject recognition neural network, a subject recognition model obtained by machine learning, or a subject recognition neural network obtained by machine learning.
  • the area of interest in the image, the subject area includes but is not limited to the person or object with the largest area in the first scene image, the person or object in the center of the first scene image, or the person or object of a specific color in the first scene image. things, etc.
  • the subject area may be the focus area of the first scene image.
  • the subject area of the first scene image is located in the depth of field area of the first scene image
  • the depth of field refers to the range of the distance before and after the object measured by imaging at the front of the camera lens or other imagers that can obtain a clear image, that is, the first camera After the module is focused, the distance range of the clear image presented in the range before and after the focus, it can be understood that the main area of the first scene image is located in the depth of field area of the first scene image, which means that the main area of the first scene image is clear.
  • the degree is higher, eg, higher than the first predetermined sharpness.
  • the second scene image is also an image obtained by shooting for a specific scene.
  • the imaging effect of the second scene image is different from that of the first scene image, including but not limited to: the depth of field position of the second scene image is different from that of the first scene image. There are differences in the depth of field positions of the images. For example, in this embodiment, the far-field depth of the second scene image is not greater than the near-field depth of the first scene image.
  • the far depth of field of the second scene image is not greater than the near depth of field of the first scene image, so that the first scene image and the second scene image are in the focus position, the image clarity, resolution, gray value or shooting direction, There are differences in parameters such as angle and exposure.
  • the definition of the second scene image is relatively low, for example, lower than the second predetermined definition, and the second predetermined definition may be less than or equal to the first predetermined definition, so that the visual experience presented to the user by the first scene image is clear
  • the visual experience presented to the user by the second scene image is a blurred image.
  • the scene targeted by the first scene image and the scene targeted by the second scene image may be exactly the same, and in this case, the first camera 210 and the second camera 220 may be the same camera, that is, the first scene The image and the second scene image are images of different frames acquired by the same camera at different times. At this time, the first scene image and the second scene image have no parallax, and it is faster and simpler to perform the fusion method in 05.
  • the scene targeted by the first scene image and the scene targeted by the second scene image may have a lower degree of parallax.
  • the first camera 210 and the second camera 220 may be two cameras located on the same baseline. In this case, the image of the first scene and the image of the second scene may be acquired at the same time, which can reduce the time for acquiring images.
  • the usual practice is to first take a scene image, then distinguish the foreground part and the background part in the scene image, and finally use software to bokeh the background part to achieve the optical bokeh effect of the image.
  • this blurring processing method is obtained through software processing, and the effect of optical blurring is not good.
  • the image processing method and the electronic device obtain the target image by fusing the subject area and the second scene image. Since the subject area of the first scene image is located in the depth-of-field area of the first scene image, the definition is high and is presented to the user.
  • the visual experience of the second scene image is a clear image, and the far-field depth of the second scene image is not greater than the near-field depth of the first scene image. area and the blurred second scene image directly captured by the camera, thereby avoiding the use of software algorithm processing to achieve background blur, and the obtained target image has a good optical blur effect.
  • the image processing method further includes:
  • one or more processors 320 are further configured to perform the method in 07 . That is, one or more processors 320 are used to process the first scene image to obtain the subject area and the background mask area.
  • the body region refers to the region of interest in the acquired first scene image.
  • the body region refers to a subject recognition model based on a preset subject recognition model, a preset subject recognition neural network, a machine
  • the area of interest in the first scene image determined by the subject recognition model acquired by learning or the subject recognition neural network acquired by machine learning, and other areas in the first scene image except the subject area can be delineated as the background mask area.
  • 07 Process the first scene image to obtain the subject area and the background mask area, including:
  • 071 Process the first scene image through the subject recognition detection network to obtain an initial foreground area and an initial background area of the first scene image;
  • one or more processors 320 are further configured to perform the methods in 071 , 073 , and 075 . That is, one or more processors 320 can also be used to process the first scene image through the subject recognition detection network to obtain the initial foreground area and the initial background area of the first scene image; obtain the color at the junction of the initial foreground area and the initial background area an overflow area, the color overflow area includes at least one color overflow pixel; and performing color correction on the color overflow pixel to obtain the main body area and the background mask area.
  • the subject recognition detection network may be pre-stored in the memory, or may be acquired later through machine learning. As shown in FIG. 14 , by inputting the first scene image into the subject recognition detection network, the initial foreground area BG and the initial background area FG can be output.
  • the processor may: divide the boundary into a plurality of sub-areas Ai, and each sub-area Ai includes a certain number of pixels; and obtain the definition of each sub-area Ai, when the sub-area Ai
  • the resolution of the sub-area Ai is greater than the third predetermined resolution, then the sub-area Ai does not belong to the color overflow area, such as shown in Figure 13 (2); when the resolution of the sub-area Ai is less than the third predetermined resolution, then the sub-area Ai belongs to The color overflow area, for example, is shown in Figure 13(1).
  • the color overflow area includes at least one color overflow pixel
  • the third predetermined definition is smaller than the first predetermined definition.
  • Acquiring the sharpness of each sub-area Ai may specifically include: first obtaining the ratio of the number of pixels of high-frequency information in the sub-area Ai to all the pixels of the entire first scene image, and using the ratio to characterize the sharpness of the sub-area Ai , the higher the ratio, the higher the image clarity.
  • the first scene image is first processed by shaping low-pass filtering to obtain a filtered image.
  • high-frequency information is obtained according to the first scene image and the filtered image.
  • the high-frequency information can be obtained by subtracting the filtered image from the first scene image.
  • the high-frequency information is a part of the discrete cosine transform coefficient far from zero frequency, and this part is used to describe the detailed information of the first scene image.
  • the proportion of the number of pixels of high frequency information of the sub-region Ai in all the pixels of the first scene image is counted. For example, if the number of high-frequency information pixels in the sub-region Ai accounts for 10% of all the pixels in the first scene image, the ratio of 10% is used to represent the sharpness of the sub-region Ai.
  • the image processing method and electronic device obtain the target image by fusing the subject area and the second scene image. Since the subject area of the first scene image is obtained after color overflow correction, the clarity is further improved.
  • the definition of the subject area in the obtained target image is also high, which is in sharp contrast with the blurred second scene image, and further improves the optical blurring effect of the target image.
  • 071 Process the first scene image through a subject recognition detection network to obtain an initial foreground area and an initial background area of the first scene image, including:
  • 0717 Determine the initial foreground area and the initial background area according to the confidence map of the foreground area.
  • one or more processors 320 are further configured to perform the methods in 0711 , 0713 , 0715 , and 0717 . That is, the one or more processors 320 may be further configured to: acquire depth information of the first scene image; generate a center weight map corresponding to the first scene image according to the depth information, and the weight values represented by the center weight map are from the center to the edge Gradually decrease; input the first scene image and the center weight map into the subject recognition detection network to obtain the confidence map of the foreground subject area of the first scene image; and determine the initial foreground area and the initial background area according to the confidence map of the foreground subject area .
  • the first scene image is processed through the subject recognition detection network. Specifically, depth information of the first scene image may be obtained first, and then center weights corresponding to the first scene image may be generated according to the depth information of the first scene image.
  • the weight value represented by the center weight map gradually decreases from the center to the edge, which is conducive to highlighting the subject in the center position, and also conforms to the operating habits of general terminals or shooting users.
  • the first scene image and the center weight map are input into the subject recognition monitoring network to obtain a confidence map of the subject area of the first scene image. There may be some points with low confidence or scattered points in the confidence map.
  • the confidence map can be filtered and corrected by the ISP processor or the central processing unit, so as to obtain the initial foreground area and Initial background area.
  • the filtering process may employ a configured confidence threshold, and filter pixels whose confidence values are lower than the confidence threshold in the confidence map.
  • the confidence threshold can be an adaptive confidence threshold, a fixed threshold, or a corresponding threshold can be configured by region.
  • the preset detection model of the subject recognition detection network is obtained by collecting a large amount of training data in advance, and inputting the training data into the subject detection model including the initial network weights for training.
  • Each set of training data includes the visible light map, depth map, center weight map and annotated subject mask map corresponding to the same scene.
  • the visible light map and the center weight map are used as the input of the trained subject detection model, and the annotated subject mask map is used as the actual value that the trained subject detection model expects to output.
  • the subject mask map is an image filter template used to identify the subject in the image, which can block other parts of the image and filter out the subject in the image.
  • the subject detection model can be trained to recognize and detect various subjects, such as people, flowers, cats, dogs, backgrounds, etc.
  • the preset detection model of the subject recognition detection network is obtained by training according to the center weight map corresponding to the first scene image and the depth information of the first scene image.
  • the depth map and the center weight map are used as the input of the preset detection model.
  • the depth information of the depth map can be used to make objects closer to the camera easier to be detected, and the center attention mechanism of the center weight map can also be used.
  • the center weight is large and the surrounding weight is small), which makes the object in the center of the image easier to detect; in addition, the introduction of the depth map to enhance the depth feature of the subject, and the introduction of the center weight map to enhance the central attention feature of the subject, not only can accurately identify
  • the target subject in a simple scene a scene with a single subject and low contrast in the background area
  • the introduction of depth maps can also solve the ever-changing targets of natural images by traditional target detection methods. less robust problem.
  • the above image processing method further includes: when there are multiple subjects, determining according to at least one of the priority of the category to which each subject belongs, the area occupied by each subject, and the position of each subject.
  • acquiring the depth information of the first scene image is acquired through a binocular vision system
  • acquiring the depth information of the first scene image is acquired through a monocular vision system
  • acquiring the depth information of the first scene image is acquired by a structured light camera module
  • the depth information of the first scene image is obtained through a time-of-flight camera module.
  • the binocular disparity value is obtained through a binocular vision system to obtain the depth information of the first scene image. Specifically, through the first camera and the second camera of the binocular vision system, the first depth image and the second depth image corresponding to the first scene image are obtained respectively, so as to obtain the difference between the pixels of the first depth image and the second depth image. Relative geometric position relationship between pixels. Specifically, the first camera and the second camera are used to capture images of the checkerboard calibration board from multiple angles, and the internal parameters, external parameters and distortion coefficients of the first camera and the second camera are calculated respectively, as well as the first camera and the second camera. geometrical relationship between them.
  • the first camera and the second camera are two independent cameras with the same performance index (same optical lens and image sensor), and their optical axes are parallel to each other and on the same baseline.
  • the baseline between the two first cameras and the second camera can be adjusted according to different requirements, and two cameras with different focal lengths or models can be used to meet different functions; The two cameras can be placed horizontally or vertically, and the baseline distance can also be adjusted as required.
  • the first camera and the second camera can be color cameras of the same model, or a color camera, a black-and-white camera , it can also be a high-resolution zoom color camera, a low-resolution color camera, or a color camera with OIS optical image stabilization, a fixed-focus color camera, etc., without the above-mentioned restrictions.
  • the binocular disparity value between the corresponding pixels of the first depth image and the second depth image is determined, so as to obtain the coordinates of the corresponding pixels of the first depth image and the second depth image, and further obtain a sparse disparity map.
  • the sparse disparity map starting from the upper left corner of the sparse disparity map, the calculation is performed line by line from left to right, from top to bottom, pixel by pixel; if the pixel is a reference disparity point, skip it; if the pixel point If it is not a reference parallax point, select the reference parallax point closest to the pixel point as a reference, and calculate the parallax point of the pixel.
  • the parallax point is centered at the corresponding point in the image of the right camera, the search window is extracted, and then the parallax of the pixel is calculated by the method of block matching; after the calculation of each pixel is completed, the parallax value of the entire image can be obtained, and finally obtained Depth information of the first scene image.
  • algorithm calculation is performed by a monocular vision system to obtain the depth information of the first scene image.
  • a monocular vision system to obtain the depth information of the first scene image.
  • at least two frames of images are acquired through the camera of the monocular vision system, and depth information of the first scene image is acquired through a preset depth prediction model.
  • the acquired image can be pre-divided into multiple blocks using methods such as superpixels, and it is assumed that the depth values of the multiple image blocks are the same, and then absolute depth features and relative depth features are selected respectively.
  • the depth information of the first scene image is acquired through the structured light camera module, that is, the first scene image is acquired based on the structured light image sensor in the structured light camera module, and the first scene image is structured light image.
  • the structured light image sensor may include a laser light and a laser camera. Pulse Width Modulation (PWM for short) can modulate the laser light to emit structured light, the structured light is irradiated to the imaging object, and the laser camera can capture the structured light reflected by the imaging object for imaging to obtain the first scene image.
  • PWM Pulse Width Modulation
  • the depth engine can calculate and obtain the corresponding depth information according to the first scene image.
  • the depth engine demodulates the phase information corresponding to the deformed position pixels in the first scene image, converts the phase information into height information, and determines according to the height information. corresponding depth information.
  • a time of flight (ToF) camera module is used to obtain depth information of a first scene image, where the first scene image is a time of flight depth image.
  • the laser transmitter in the ToF camera module is controlled to be turned on to emit laser light to the scene, and at the same time, the timing circuit of each photosensitive pixel of the image sensor in the ToF camera module is controlled to start counting, and the emitted laser is passed through the scene. The object is reflected back and received by the image collector.
  • the avalanche photodiode in each photosensitive pixel in the image collector works in Geiger mode (the reverse bias voltage is higher than the avalanche voltage), the avalanche phenomenon will occur when a single photon is absorbed, so that the output current instantaneously (less than 1ps) reaches The maximum value is fed back to the independent timing circuit of each photosensitive pixel to make the timing circuit stop counting. According to each timing circuit, the count value and the speed of light are used to calculate the depth of each pixel in the time-of-flight depth image.
  • 075 Perform color correction on color bleed pixels to obtain a subject area and a background mask area, including:
  • 07511 Extend a predetermined range with each color overflow pixel as the center to obtain a correction area, and the correction area includes pixels in the foreground area and pixels in the background area;
  • 07517 Merge corrected pixels into the initial foreground area to obtain the subject area and background mask area.
  • one or more processors 320 are further configured to perform the methods in 07511 , 07513 , 07515 , and 07517 . That is, one or more processors 320 can also be used to: extend a predetermined range around each color overflow pixel to obtain a correction area, and the correction area includes pixels of the foreground area and pixels of the background area; obtain the pixels of the pixels of the foreground area in the correction area value; correct the color overflow pixels according to the pixel values of the foreground area pixels in the correction area to obtain corrected pixels; and merge the corrected pixels into the original foreground area to obtain the main area and the background mask area.
  • the area enclosed by the two black curves in FIG. 14 represents the color overflow area A1 .
  • the color overflow area A1 includes a plurality of color overflow pixels. Assuming that a color overflow pixel in the color overflow area A1 is P, the first ISP processor can take the color overflow pixel P as the center, and expand a predetermined range around to obtain the correction area A2, and the first ISP processor can use the color overflow pixel P as the center.
  • a predetermined range is extended to the surrounding area according to a predetermined shape to obtain a correction area A2, wherein the predetermined shape can be a circle, a triangle, a quadrilateral, a pentagon, a hexagon, an octagon, a dodecagon, etc. That is, the correction area A2 obtained after expanding the predetermined range may be a circle, a triangle, a quadrangle, a pentagon, a hexagon, an octagon, a dodecagon, etc., which is not limited herein.
  • the correction area A2 also includes three types of pixels: foreground area pixels, background area pixels, and color overflow pixels P.
  • the first ISP processor may select all foreground area pixels in the correction area A2, and use the pixel values of all foreground area pixels to correct the pixel value Pc of the color overflow pixel P. For example, assuming that there are N pixels in the foreground area, the pixel value of each foreground area pixel is Pi, i ⁇ N, and i is a positive integer, then In another example, the first ISP processor may select a part of the foreground area pixels located in the correction area A2, wherein, among the selected foreground area pixels, the space between each foreground area pixel and the color overflow pixel P The distance is less than or equal to the predetermined distance.
  • the first ISP corrects the pixel value Pc of the color overflow pixel P by using the pixel value of the selected part of the foreground area pixels. For example, assuming that there are N foreground area pixels, the first ISP processor may select M foreground area pixels from them, where M ⁇ N, and among the M foreground area pixels, the coordinate value Pxy of each foreground area pixel The spatial distance from the coordinate value Puv of the color overflow pixel P is less than or equal to the predetermined distance D, that is, If among the M foreground area pixels, the pixel value of each foreground area pixel is Pi, i ⁇ M, and i is a positive integer, then Compared with using the pixel values of all foreground area pixels in the correction area A2 to correct the pixel values of the color overflow pixels, only the pixel values of some foreground area pixels that are closer to the color overflow pixels are used to correct the pixel values of the color overflow pixels, On the one hand, the color overflow phenomenon can be
  • the pixel values of the color overflow pixels are corrected by using the pixel values of all foreground area pixels in the correction area A2. , the calculation amount of the first ISP processor can be reduced.
  • the first ISP processor may merge the corrected pixels into the foreground region.
  • the first ISP processor may use the manner shown in FIG. 6 to traverse all the color overflow pixels in the correction area to obtain a plurality of corrected pixels.
  • a plurality of corrected pixels are merged into the initial foreground area, so as to obtain the updated initial foreground area, that is, the subject area.
  • the area other than the subject area in the first scene image is the background mask area.
  • 075 Perform color correction on color bleed pixels to obtain a subject area and a background mask area, including:
  • 07521 Extend a predetermined range with each color overflow pixel as the center to obtain a correction area, and the correction area includes pixels in the foreground area and pixels in the background area;
  • 07527 Merge corrected pixels to the initial background area to obtain the subject area and background mask area.
  • one or more processors 320 are also used to perform the methods in 07521, 07523, 07525, and 07527. That is, one or more processors 320 can also be used to: extend a predetermined range around each color overflow pixel to obtain a correction area, and the correction area includes pixels of the foreground area and pixels of the background area; obtain the pixels of the pixels of the background area in the correction area value; correct the color overflow pixels according to the pixel values of the background area pixels in the correction area to obtain corrected pixels; and merge the corrected pixels into the original background area to obtain the main area and the background mask area.
  • the color overflow area A1 includes a plurality of color overflow pixels. Assuming that a color overflow pixel in the color overflow area A1 is P, the first ISP processor can take the color overflow pixel P as the center, and expand a predetermined range around to obtain the correction area A2. Wherein, the first ISP processor may take the color overflow pixel P as the center, and expand a predetermined range to the surrounding area according to a predetermined shape to obtain the correction area A2, wherein the predetermined shape may be a circle, a triangle, a quadrilateral, a pentagon, or a hexagon.
  • the correction area also includes three types of pixels: foreground area pixels, background area pixels, and color overflow pixels P.
  • the first ISP processor may select all background area pixels in the correction area A2, and use the pixel values of all background area pixels to correct the pixel value Pc of the color overflow pixel P.
  • the first ISP processor may select a part of the background area pixels located in the correction area A2, wherein, among the selected background area pixels, the space between each background area pixel and the color overflow pixel P The distance is less than or equal to the predetermined distance. Then, the first ISP corrects the pixel value Pc of the color overflow pixel P by using the pixel value of the selected background area pixels.
  • the first ISP processor may select M background area pixels from them, where M ⁇ N, and among the M background area pixels, the coordinate value Pxy of each background area pixel
  • the spatial distance from the coordinate value Puv of the color overflow pixel P is less than or equal to the predetermined distance D, that is, If among the M background area pixels, the pixel value of each background area pixel is Pi, i ⁇ M, and i is a positive integer, then Compared with using the pixel values of all background area pixels in the correction area A2 to correct the pixel values of the color overflow pixels, the pixel values of the color overflow pixels are corrected only by using the pixel values of some background area pixels that are closer to the color overflow pixels, On the one hand, the color overflow phenomenon can be eliminated, and on the other hand, the pixel values of the corrected pixels obtained after correction can be made more accurate.
  • the pixel values of all background area pixels in the correction area A2 are used to correct the pixel values of the color overflow pixels. , the calculation amount of the first ISP processor can be reduced.
  • the first ISP processor may merge the corrected pixels into the background area.
  • the first ISP processor may use the manner shown in FIG. 7 to traverse all the color overflow pixels in the correction area to obtain a plurality of corrected pixels.
  • a plurality of corrected pixels are merged into the initial background area, so as to obtain the updated initial background area, that is, the background mask area.
  • the area other than the background mask area in the first scene image is the main area.
  • the second scene image is an optically blurred image
  • the definition of the first scene image is higher than that of the second scene image.
  • 055 Acquire a target image according to the target subject area and the target background area.
  • one or more processors 320 are further configured to perform the methods in 051 , 053 and 055 . That is, one or more processors 320 may also be used to: take the subject area as the target subject area; fuse the background mask area and the background area in the second scene image to obtain the target background area; and obtain the target background area according to the target subject area and the target background area Get the target image.
  • the second scene image is, for example, an image obtained by macro shooting. At least part of the main body area and all the background areas in the scene image are blurred, so that the second scene has the effect of optical defocus, and the definition of the second scene image is lower than that of the first scene image.
  • any one of the first ISP processor or the second ISP processor may use the subject area in the first scene image as the target subject area.
  • any one of the first ISP processor or the second ISP processor can fuse the background mask area and the background area in the second scene image to obtain the target background area.
  • the pixel value of a background area pixel in the background mask area in the first scene image is Pi
  • the pixel value of a background area pixel in the background area in the second scene image is Pi'
  • the pixel value is Pi'.
  • the position of the background area pixel of Pi in the first scene image corresponds to the position of the background area pixel with the pixel value Pi' in the second scene image
  • the image processing method of the embodiment of the present application uses the subject area as the target subject area. Since the first scene image has high definition, after the subject area is used as the target subject area, the target subject area can also have high definition.
  • the image processing method of the embodiment of the present application fuses the background mask area and the background area in the second scene image to obtain the target background area, and can blur the target background image with the help of the optical defocus effect of the second scene image, which can improve the Bokeh effect for the target background image.
  • the depth corresponding to the background area pixel with the pixel value Pi and the background area pixel with the pixel value Pi' may be determined.
  • a can be set to be greater than b.
  • b can be set to be larger than a.
  • the image processing method further includes:
  • 011 Perform correction processing on the second scene image according to the transformation matrix to obtain a corrected image.
  • Fusion of the subject area and the second scene image to obtain the target image which may include:
  • 057 Fuse the subject area with the corrected image to obtain the target image.
  • one or more processors 320 are further configured to perform the methods in 09 , 011 and 057 . That is, the one or more processors 320 are configured to: obtain a transformation matrix corresponding to the second scene image when it is detected that there is image distortion in the second scene image; perform correction processing on the second scene image according to the transformation matrix to obtain a corrected image; And fuse the subject area with the corrected image to obtain the target image.
  • the image distortion may be that one of the parallel parameters such as pixel value, chromaticity, depth value or exposure of the image is distorted or multiple parameters are distorted.
  • the content difference of the second scene image can be obtained, and the content difference can be compared with a preset threshold to determine whether there is distortion in a specific parameter.
  • the content difference may be two adjacent pixel blocks (a pixel block may include a or multiple pixels), or the difference between parameters of pixel blocks at corresponding positions between different frame images acquired for the same object.
  • the content values of the same parameters of the first pixel block, the second pixel block, and the third pixel block are obtained, and the parameters include but are not limited to gray value, chromaticity, depth value, etc.
  • the first pixel block and the third pixel block are: Pixel blocks adjacent to the second pixel block, the second pixel block is located between the first pixel block and the third pixel block, and each pixel of the first pixel block, the second pixel block, and the third pixel block contains depth values. (i.e. the content value is the pixel value).
  • the first content mean value of each first pixel block and the second content mean value of the second pixel block may be determined, and the content difference between the first content value and the second content value may be determined. Understandably, if the content difference between the first pixel block and the second pixel block is low (for example, less than a preset threshold), it means that the first pixel block and the second pixel block actually correspond to the same position of the object being photographed.
  • the error of the depth value between the first pixel block and the second pixel block is small, and the distortion of the first pixel block and the second pixel block is small.
  • the content difference between the second pixel block and the third pixel block can be determined, and the content difference between the first pixel block and the third pixel block can be compared with a preset threshold, if the content difference is greater than the preset threshold, then There is image distortion. If the content difference is less than the preset threshold, there is no image distortion.
  • the above-mentioned first pixel block, second pixel block or third pixel block is adjacent, it can also be expressed as three pixel blocks are located in three adjacent frames of images, and any pixel block is located in the corresponding image. The position of the pixel block is the same as the position of the other two pixel blocks in the corresponding image, which is determined according to the specific application requirements.
  • FIG. 12 is a schematic diagram illustrating a comparison between an image with distortion and an image without distortion.
  • Figure 12 shows the images of the calibration plate acquired by the two cameras.
  • (1) in Figure 12 is the image of the calibration plate without image distortion.
  • a series of points in the image are regularly arranged in the horizontal and vertical directions with the same spacing, and the shape of each square is normal.
  • (2) in FIG. 12 is an image of the calibration plate with image distortion, the plates on the calibration plate are no longer arranged neatly and regularly in the horizontal and vertical directions, and the shape of the squares has changed.
  • a transformation matrix corresponding to the second scene image may be obtained.
  • the transformation matrix corresponding to the second scene image may be determined according to the focus segment of the camera used for capturing the second scene image when the second scene image is captured. If the focus segment of the camera is F1 to F2, the transformation matrix corresponding to the second scene image is matrix1. If the focus segment of the camera is F2 to F3, the transformation matrix corresponding to the second scene image is matrix2. If the focus segment corresponding to the camera If it is F3 ⁇ F4, the transformation matrix corresponding to the second scene image is matrix3...
  • the transformation matrix corresponding to the second scene image is matrix(n-1) .
  • the corresponding relationship between the focus segment and the transformation matrix is pre-calibrated and stored in the image memory shown in FIG. 2 . It can be understood that when the focus segment of the camera is different, the distortion form of the obtained image will also be different. According to the focus segment of the camera, the transformation matrix corresponding to the focus segment is selected, and the distortion of the image can be corrected more accurately, and the corrected image with better distortion correction effect can be obtained.
  • the method of distorted image correction is not limited to the above-mentioned processing through the corresponding transformation matrix, and the distortion correction can also be performed by means of edge erosion or morphological processing.
  • morphological treatments can include erosion and swelling.
  • the second scene image may be eroded first, then expanded, and then the morphologically processed binarized mask image may be subjected to guided filtering to implement edge filtering to obtain a corrected image.
  • guided filtering Through morphological processing and guided filtering processing, the noise in the edge part of the corrected image can be reduced or even small, and the edge of the corrected image is softer.
  • the subject area of the first scene image can be fused with the corrected image to obtain the target image. Since the target image is obtained by fusing the subject area of the first scene image and the corrected second scene image, there is no distortion in the target image, and the image quality is higher.
  • the first scene image and the second scene image are acquired by different cameras, and the image processing method may further include:
  • 017 Match the first feature point and the second feature point to obtain at least one feature point pair
  • one or more processors 320 are further configured to execute the methods in 013 , 015 , 017 , 019 and 021 . That is, one or more processors 320 may be further configured to: acquire at least one first feature point in the first scene image; acquire at least one second feature point in the second scene image; combine the first feature point with the second feature matching the points to obtain at least one feature point pair; determining a mapping matrix according to the feature point pair; and aligning the first scene image and the second scene image according to the mapping matrix.
  • the first scene image and the second scene image are acquired by different cameras
  • the first scene image is acquired by the first camera 210 shown in FIG. 2
  • the second scene image is acquired by the first camera 210 shown in FIG. 2
  • Two cameras 220 acquire.
  • the electronic device shown in FIG. 2 may further include a third camera (not shown), and the third camera may include a third lens and a third image sensor.
  • the first scene image may be obtained by, for example, the first camera 210
  • the second scene image may be obtained by, for example, a third camera, wherein the second camera 220 may be used to form a binocular stereo vision system with the first camera 210 to obtain depth information.
  • the first feature point in the first scene image and the second feature point in the second scene image can be identified, and the number of the first feature points can be one or more , the number of the second feature points may also be one or more.
  • the first feature point and the second feature point may be matched to obtain one or more feature point pairs.
  • the first feature point and the second feature point in each pair of feature points indicate the same position in the subject.
  • the mapping matrix of the first camera and the third camera can be determined according to one or more feature point pairs, and the first scene image and the second scene image can be aligned according to the mapping matrix.
  • first scene image and the second scene are obtained by different cameras, the fields of view between the different cameras are not completely overlapped, resulting in overlapping areas and non-overlapping areas in the first scene image and the second scene image. area.
  • the first scene image and the second scene image may be aligned to obtain the aligned first scene image and the aligned second scene image, and the aligned first scene image and the aligned second scene image are completely overlapping. In this way, the target image obtained by fusing the first scene image and the second scene image may have better image quality.
  • step 07 is to process the aligned first scene image
  • step 09 is to acquire the transformation matrix corresponding to the aligned second scene image when it is detected that the aligned second scene image has image distortion
  • step 011 is to compare the The aligned second scene image is subjected to correction processing to obtain a corrected image
  • Step 05 is to fuse the aligned and color corrected subject area in the first scene with the aligned and distortion corrected second scene image to obtain a corrected image. target image.
  • the alignment process of the first scene image and the second scene image may be performed after step 07 and performed before step 09 and step 011.
  • aligning the first scene image and the second scene image is Align the distortion-corrected second scene image and the color overflow-corrected first scene image
  • step 05 is to fuse the aligned and color-corrected subject area in the first scene with the aligned and distortion-corrected first scene image.
  • Second scene images to obtain target images.
  • the first scene image and the second scene image can be acquired at the same time, and there is no time difference between the acquisition of the two frames of images , which can avoid the problem of ghost images during fusion when there is a time difference between the acquisition times of the two frames of images.
  • the first scene image and the second scene image may also be acquired by the same camera (eg, the first camera 210 or the second camera 220 shown in FIG. 2 ) in a time-sharing manner.
  • the same camera is used to acquire the first scene image and the second scene image, the two frames of images are completely overlapped, and in this case, alignment processing is not required, and the amount of calculation can be reduced.
  • the present application further includes an image processing apparatus 150 .
  • the image processing apparatus 150 includes a first acquisition module 1510 , a second acquisition module 1512 , and an image fusion module 1514 .
  • the first acquisition module 1510 is configured to acquire a first scene image, where the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image.
  • the second acquisition module 1512 is configured to acquire a second scene image, where the far-field depth of the second scene image is not greater than the near-field depth of the first scene image.
  • the image fusion module 1514 is used to fuse the subject area and the second scene image to obtain the target image.
  • the image processing apparatus 150 of the embodiment of the present application obtains the target image by fusing the subject area and the second scene image. Since the subject area of the first scene image is located in the depth of field area of the first scene image, the definition is high, and the visual image presented to the user is high. The feeling is a clear image, and the distant depth of field of the second scene image is not greater than the near depth of field of the first scene image, the second scene image has a lower definition, and the visual experience presented to the user is a blurred image, that is, the combination is a clear subject area and The blurred second scene image is directly captured by the camera, thereby avoiding the use of software algorithm processing to achieve background blur, and the obtained target image has a good optical blur effect.
  • the image processing apparatus 150 may further include a processing module 1516, and the processing module 1516 is configured to process the first scene image to obtain the subject area and the background mask area. More specifically, the processing module 1516 can also be used to process the first scene image through the subject recognition detection network to obtain the initial foreground area and the initial background area of the first scene image; obtain the color overflow area at the junction of the initial foreground area and the initial background area. , the color overflow area includes at least one color overflow pixel; and perform color correction on the color overflow pixel to obtain the main body area and the background mask area.
  • the processing module 1516 can also be used to obtain the depth information of the first scene image; according to the depth information, a center weight map corresponding to the first scene image is generated, and the weight value represented by the center weight map gradually decreases from the center to the edge. ; Input the first scene image and the center weight map into the subject recognition detection network to obtain the confidence map of the foreground subject area of the first scene image; and determine the initial foreground area and the initial background area according to the confidence map of the foreground subject area.
  • the processing module 1516 can also be used to expand a predetermined range around each color overflow pixel to obtain a correction area, and the correction area includes pixels in the foreground area and pixels in the background area; obtain the pixel value of the pixels in the foreground area in the correction area; The pixel values of the foreground area pixels in the correction area are corrected for color overflow pixels to obtain corrected pixels; and the corrected pixels are merged into the original foreground area to obtain the subject area and the background mask area.
  • the processing module 1516 can also be used to extend a predetermined range around each color overflow pixel to obtain a correction area, and the correction area includes pixels in the foreground area and pixels in the background area; obtain the pixel value of the pixels in the background area in the correction area; The pixel values of the background area pixels in the correction area are used to correct the color overflow pixels to obtain corrected pixels; and merge the corrected pixels into the original background area to obtain the main area and the background mask area.
  • the image fusion module 1514 can also be used to use the subject area as the target subject area; fuse the background mask area and the background area in the second scene image to obtain the target background area; and according to the target The subject area and the target background area acquire the target image.
  • the image processing apparatus 150 may further include a third acquisition module 1518 and a fourth acquisition module 1520 .
  • the third obtaining module 1518 is configured to obtain a transformation matrix corresponding to the second scene image when it is detected that there is image distortion in the second scene image.
  • the fourth obtaining module 1520 is configured to perform correction processing on the second scene image according to the transformation matrix to obtain a corrected image.
  • the image fusion module 1514 can also be used to fuse the subject area and the corrected image to obtain the target image.
  • the image processing apparatus 150 may further include a fifth acquisition module 1522 , a sixth acquisition module 1524 , a matching module 1526 , a determination module 1528 and an alignment module 1530 .
  • the fifth acquisition module 1522 is used to acquire at least one first feature point in the first scene image
  • the sixth acquisition module 1524 is used to acquire at least one second feature point in the second scene image
  • the matching module 1526 is used to The feature points and the second feature points are matched to obtain at least one feature point pair
  • the determining module 1528 is used for determining a mapping matrix according to the feature point pair
  • the aligning module 1530 is used for aligning the first scene image and the second scene image according to the mapping matrix.
  • an embodiment of the present application further provides a computer-readable storage medium 160 on which a computer program 162 is stored.
  • the program is executed by the processor 320, the image processing method of any of the above-mentioned embodiments can be implemented. Steps, such as 01, 03, 05, 07, 071, 073, 075, 0711, 0713, 0715, 0717, 07511, 07513, 07515, 07517, 07521, 07523, 07525, 07527, 051, 053, 055, 09, Methods in 011, 057, 013, 015, 017, 019 and 021.
  • the computer-readable storage medium 160 may be set in the image processing apparatus 150 or the electronic device 200, or may be set in the cloud server. At this time, the image processing apparatus 100 or the electronic device 200 can communicate with the cloud server to obtain the corresponding computer. program 162.
  • the computer program 162 includes computer program code.
  • the computer program code may be in source code form, object code form, an executable file or some intermediate form, or the like.
  • Computer-readable storage media may include: any entity or device capable of carrying computer program codes, recording media, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random storage Access memory (RAM, Random Access Memory), and software distribution media, etc.
  • Any description of a process or method in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing a specified logical function or step of the process , and the scope of the preferred embodiments of the present application includes alternative implementations in which the functions may be performed out of the order shown or discussed, including performing the functions substantially concurrently or in the reverse order depending upon the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present application belong.

Abstract

An image processing method, comprising: obtaining a first scene image, the first scene image comprising a main region, the main region being located in a depth of field region of the first scene image; obtaining a second scene image, a deep depth of field of the second scene image being not greater than a shallow depth of field of the first scene image; and fusing the main region and the second scene image to obtain a target image.

Description

图像处理方法及装置、电子设备及计算机可读存储介质Image processing method and apparatus, electronic device and computer-readable storage medium 技术领域technical field
本申请涉及影像领域,特别是涉及一种图像处理方法、图像处理装置、电子设备和计算机可读存储介质。The present application relates to the field of imaging, and in particular, to an image processing method, an image processing apparatus, an electronic device, and a computer-readable storage medium.
背景技术Background technique
伴随着影像技术的发展,特定环境下需要对不同图像的背景展开虚化,以达到光学虚化的效果。为了得到背景虚化图像,通常的做法是先拍摄场景图像,再区分出场景图像中的前景部分与背景部分,最后采用软件对背景部分进行虚化算法处理,以达到图像的光学虚化效果。然而,此种虚化处理方法是通过软件处理得来的,光学虚化的效果并不佳。With the development of imaging technology, it is necessary to blur the background of different images in a specific environment to achieve the effect of optical blur. In order to obtain a background blurred image, the usual practice is to first shoot the scene image, then distinguish the foreground part and the background part in the scene image, and finally use the software to process the background part with a blurring algorithm to achieve the optical blurring effect of the image. However, this blurring processing method is obtained through software processing, and the effect of optical blurring is not good.
发明内容SUMMARY OF THE INVENTION
本申请实施方式提供一种图像处理方法,所述图像处理方法包括获取第一场景图像,第一场景图像包括主体区域,主体区域位于第一场景图像的景深区域;获取第二场景图像,第二场景图像的远景深不大于第一场景图像的近景深;及融合主体区域与第二场景图像,以获得目标图像。An embodiment of the present application provides an image processing method, the image processing method includes acquiring a first scene image, the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image; acquiring a second scene image, the second scene image The far-field depth of the scene image is not greater than the near-field depth of the first scene image; and the subject area and the second scene image are fused to obtain the target image.
本申请实施方式提供一种电子设备,电子设备包括存储器及一个或多个处理器,一个或多个处理器与存储连接,一个或多个处理器用于:获取第一场景图像,第一场景图像包括主体区域,主体区域位于第一场景图像的景深区域;获取第二场景图像,第二场景图像的远景深不大于第一场景图像的近景深;及融合主体区域与第二场景图像,以获得目标图像。An embodiment of the present application provides an electronic device, the electronic device includes a memory and one or more processors, the one or more processors are connected to the storage, and the one or more processors are used for: acquiring a first scene image, the first scene image including a subject area, the subject area is located in the depth of field area of the first scene image; acquiring a second scene image, the far depth of field of the second scene image is not greater than the near depth of field of the first scene image; and fusing the subject area and the second scene image to obtain target image.
本申请实施方式提供一种图像处理装置,所述图像处理装置包括第一获取模块、第二获取模块、及图像融合模块。所述第一获取模块用于获取第一场景图像,第一场景图像包括主体区域,主体区域位于第一场景图像的景深区域。所述第二获取模块用于获取第二场景图像,第二场景图像的远景深不大于第一场景图像的近景深。所述图像融合模块用于融合主体区域和第二场景图像,以获得目标图像。Embodiments of the present application provide an image processing apparatus, where the image processing apparatus includes a first acquisition module, a second acquisition module, and an image fusion module. The first acquisition module is used for acquiring a first scene image, where the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image. The second acquisition module is configured to acquire a second scene image, and the far field depth of the second scene image is not greater than the near field depth of the first scene image. The image fusion module is used for fusing the subject area and the second scene image to obtain the target image.
本申请实施方式的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of embodiments of the present application will be set forth, in part, in the following description, and in part will be apparent from the following description, or learned by practice of the present application.
附图说明Description of drawings
本申请的上述和/或附加的方面和优点可以从结合下面附图对实施方式的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and readily understood from the following description of embodiments in conjunction with the accompanying drawings, wherein:
图1是本申请实施方式的图像处理方法的流程图;1 is a flowchart of an image processing method according to an embodiment of the present application;
图2是本申请实施方式的电子设备的结构示意图;2 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
图3是本申请实施方式的图像处理方法的流程图;3 is a flowchart of an image processing method according to an embodiment of the present application;
图4是本申请实施方式的图像处理方法的流程图;4 is a flowchart of an image processing method according to an embodiment of the present application;
图5是本申请实施方式的图像处理方法的流程图;5 is a flowchart of an image processing method according to an embodiment of the present application;
图6是本申请实施方式的图像处理方法的流程图;6 is a flowchart of an image processing method according to an embodiment of the present application;
图7是本申请实施方式的图像处理方法的流程图;7 is a flowchart of an image processing method according to an embodiment of the present application;
图8是本申请实施方式的图像处理方法的流程图;8 is a flowchart of an image processing method according to an embodiment of the present application;
图9是本申请实施方式的图像处理方法的流程图;9 is a flowchart of an image processing method according to an embodiment of the present application;
图10是本申请实施方式的图像处理方法的流程图;10 is a flowchart of an image processing method according to an embodiment of the present application;
图11是本申请实施方式的图像处理方法的原理示意图;11 is a schematic diagram of the principle of an image processing method according to an embodiment of the present application;
图12是本申请实施方式的图像处理方法的畸变校正示意图;12 is a schematic diagram of distortion correction of an image processing method according to an embodiment of the present application;
图13是本申请实施方式的图像处理方法的色彩溢出校正的原理示意图;13 is a schematic diagram of the principle of color overflow correction of the image processing method according to an embodiment of the present application;
图14是本申请实施方式的图像处理方法的色彩溢出校正的原理示意图;14 is a schematic diagram of the principle of color overflow correction of the image processing method according to the embodiment of the present application;
图15是本申请实施方式的图像处理装置的结构示意图;FIG. 15 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application;
图16是本申请实施方式的计算机可读存储介质与处理器的连接示意图。FIG. 16 is a schematic diagram of connection between a computer-readable storage medium and a processor according to an embodiment of the present application.
具体实施方式detailed description
下面详细描述本申请的实施方式,实施方式的示例在附图中示出,其中,相同或类似的标号自始至终表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施方式是示例性的,仅用于解释本申请,而不能理解为对本申请的限制。Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary, only used to explain the present application, and should not be construed as a limitation on the present application.
请参阅图1,本申请实施方式提供一种图像处理方法,该图像处理方法包括:Referring to FIG. 1 , an embodiment of the present application provides an image processing method, and the image processing method includes:
01:获取第一场景图像,第一场景图像包括主体区域,主体区域位于第一场景图像的景深区域;01: Acquire a first scene image, where the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image;
03:获取第二场景图像,第二场景图像的远景深不大于第一场景图像的近景深;及03: Acquire a second scene image, the far-field depth of the second scene image is not greater than the near-field depth of the first scene image; and
05:融合主体区域与第二场景图像,以获得目标图像。05: Fusion of the subject area and the second scene image to obtain the target image.
请参阅图2,本申请实施方式提供一种电子设备,电子设备包括存储器及一个或多个处理器320,一个或多个处理器320与存储连接,一个或多个处理器320用于执行01、03、05中的方法。即,一个或多个处理器320用于获取第一场景图像,第一场景图像包括主体区域,主体区域位于第一场景图像的景深区域;获取第二场景图像,第二场景图像的远景深不大于第一场景图像的近景深;及融合主体区域与第二场景图像,以获得目标图像。Referring to FIG. 2, an embodiment of the present application provides an electronic device, the electronic device includes a memory and one or more processors 320, the one or more processors 320 are connected to the storage, and the one or more processors 320 are used to execute 01 , 03, 05 methods. That is, the one or more processors 320 are configured to acquire a first scene image, the first scene image includes a subject area, and the subject area is located in the depth of field area of the first scene image; acquire a second scene image, and the distant depth of field of the second scene image is not greater than the near depth of field of the first scene image; and fusing the subject area with the second scene image to obtain the target image.
具体地,如图2所示,一个或多个处理器320包括第一ISP处理器232、第二ISP处理器234。存储器260包括图像存储器260。电子设备还包括第一摄像头210、第二摄像头220、控制逻辑器250、显示器270、及通信模块280。Specifically, as shown in FIG. 2 , the one or more processors 320 include a first ISP processor 232 and a second ISP processor 234 . Memory 260 includes image memory 260 . The electronic device further includes a first camera 210 , a second camera 220 , a control logic 250 , a display 270 , and a communication module 280 .
第一摄像头210包括一个或多个第一透镜212和第一图像传感器214。第一场景图像可以是可见光图像(RGB图像)、红外图像(IR图像)、或黑白图像中的任意一种。在一个例子中,此处获取第一场景图像可以是由第一摄像头210实现,当第一场景图像210为可见光图像,则第一摄像头210为彩色摄像头,对应地,第一图像传感器214可包括彩色滤镜阵列(如Bayer滤镜),第一图像传感器214可获取每个成像像素捕捉的光强度和波长信息,并提供可由第一ISP处理器232处理的一组图像数据。当第一场景图像为红外光图像,则第一摄像头210为红外光摄像头,对应地,第一图像传感器214可包括红外滤镜阵列。当第一场景图像为黑白图像,则第一摄像头210为黑白摄像头,对应地,第一图像传感器214可以不设置滤镜阵列。在另一个例子中,第一摄像头212采集第一场景图像后存储在电子设备200的图像存储器260中,此处获取第一场景图像则可以是第一ISP处理器232及第二ISP处理器234读取图像存储器260中存储的第一场景图像实现。在又一个例子中,第一摄像头210采集第一场景图像后存储在云端或其他设备中,此处获取第一场景图像则可以是电子设备200中的通信模块280从云端或其他设备中获取,然后再由通信模块280传输至第一ISP处理器232及第二ISP处理器234实现。The first camera 210 includes one or more first lenses 212 and a first image sensor 214 . The first scene image may be any one of a visible light image (RGB image), an infrared image (IR image), or a black and white image. In an example, the acquisition of the first scene image here may be achieved by the first camera 210. When the first scene image 210 is a visible light image, the first camera 210 is a color camera. Correspondingly, the first image sensor 214 may include An array of color filters (eg, Bayer filters), the first image sensor 214 can obtain the light intensity and wavelength information captured by each imaging pixel and provide a set of image data that can be processed by the first ISP processor 232. When the first scene image is an infrared light image, the first camera 210 is an infrared light camera, and correspondingly, the first image sensor 214 may include an infrared filter array. When the first scene image is a black and white image, the first camera 210 is a black and white camera, and correspondingly, the first image sensor 214 may not be provided with a filter array. In another example, the first camera 212 collects the first scene image and stores it in the image memory 260 of the electronic device 200, where the first ISP processor 232 and the second ISP processor 234 can obtain the first scene image. Reading the first scene image stored in the image memory 260 is implemented. In another example, the first camera 210 collects the first scene image and stores it in the cloud or other devices, where the first scene image may be obtained by the communication module 280 in the electronic device 200 from the cloud or other devices, Then, it is transmitted to the first ISP processor 232 and the second ISP processor 234 by the communication module 280 for implementation.
第二摄像头220包括一个或多个第二透镜222和第二图像传感器224。第二场景图像也可以是可见光图像(RGB图像)、红外图像(IR图像)、或黑白图像中的任意一种。在一个例子中,此处获取第二场景图像可以是由第二摄像头220实现,当第二场景图像210为可见光图像,则第二摄像头220为彩色摄像头,对应地,第二图像传感器224可包括彩色滤镜阵列,第二图像传感器224可获取每个成像像素捕捉的光强度和波长信息,并提供可由第一ISP处理器232处理的一组图像数据。当第二场景图像为红外光图像,则第二摄像头220为红外光摄像头,对应地,第二图像传感器224可包括红外滤镜阵列。当第二场景图像为黑白图像,则第二摄像头220为黑白摄像头,对应地,第二图像传感器224可以不设置滤镜阵列。在另一个例子中,第二摄像头222采集第二场景图像后存储在电子设备200的图像存储器260中,此处获取第二场景图像则可以是第一ISP处理器232及第二ISP处理器234读取图像存储器260中存储的第二场景图像实现。在又一个例子中,第二摄像头220采集第二场景图像后存储在云端或其他设备中,此处获取第二场景图像则可以是电子设备200中的通信模块280从云端或其他设备中获取,然后再由通信模块280传输至第一ISP处理器232及第二ISP处理器234实现。The second camera 220 includes one or more second lenses 222 and a second image sensor 224 . The second scene image may also be any one of a visible light image (RGB image), an infrared image (IR image), or a black and white image. In an example, the acquisition of the second scene image here may be achieved by the second camera 220. When the second scene image 210 is a visible light image, the second camera 220 is a color camera. Correspondingly, the second image sensor 224 may include A color filter array, the second image sensor 224 can obtain the light intensity and wavelength information captured by each imaging pixel and provide a set of image data that can be processed by the first ISP processor 232. When the second scene image is an infrared light image, the second camera 220 is an infrared light camera, and correspondingly, the second image sensor 224 may include an infrared filter array. When the second scene image is a black and white image, the second camera 220 is a black and white camera, and correspondingly, the second image sensor 224 may not be provided with a filter array. In another example, the second camera 222 collects the second scene image and stores it in the image memory 260 of the electronic device 200, where the first ISP processor 232 and the second ISP processor 234 can obtain the second scene image. Reading the second scene image stored in the image memory 260 is implemented. In another example, the second camera 220 collects the second scene image and stores it in the cloud or other devices, where the second scene image may be obtained by the communication module 280 in the electronic device 200 from the cloud or other devices, Then, it is transmitted to the first ISP processor 232 and the second ISP processor 234 by the communication module 280 for implementation.
第一摄像头210采集的第一场景图像传输给第一ISP处理器232进行处理,第一ISP处理器232处理第一场景图像后,可将第一场景图像的统计数据发送给控制逻辑器250,控制逻辑器250可根据统计数据确定第一摄像头210的控制参数,从而第一摄像头210可根据控制参数进行自动对焦、自动曝光等操作。第一场景图像经过第一ISP处理器232进行处理后可存储至图像存储器260中。另外,第一场景图像经过ISP处理器232处理后可直接发送至显示器270进行显示,显示器270也可读取图像存储器260中图像以进行显示。The first scene image collected by the first camera 210 is transmitted to the first ISP processor 232 for processing. After the first ISP processor 232 processes the first scene image, the statistical data of the first scene image can be sent to the control logic 250, The control logic 250 may determine the control parameters of the first camera 210 according to the statistical data, so that the first camera 210 may perform operations such as automatic focusing and automatic exposure according to the control parameters. The first scene image can be stored in the image memory 260 after being processed by the first ISP processor 232 . In addition, after being processed by the ISP processor 232, the first scene image can be directly sent to the display 270 for display, and the display 270 can also read the image in the image memory 260 for display.
同样地,第二摄像头220采集的第二图像传输给第二ISP处理器234进行处理,第二ISP处理器 234处理第二场景图像后,可将第二场景图像的统计数据发送给控制逻辑器250,控制逻辑器250可根据统计数据确定第二摄像头220的控制参数,从而第二摄像头220可根据控制参数进行自动对焦、自动曝光等操作。第二场景图像经过第二ISP处理器234处理后可存储至图像存储器260中。另外,第二图像经过第二ISP处理器234处理后可直接发送至显示器270进行显示,显示器270也可读取图像存储器260中的图像以进行显示。Similarly, the second image captured by the second camera 220 is transmitted to the second ISP processor 234 for processing. After processing the second scene image, the second ISP processor 234 can send the statistical data of the second scene image to the control logic. 250. The control logic 250 may determine control parameters of the second camera 220 according to the statistical data, so that the second camera 220 may perform operations such as auto-focusing, auto-exposure, and the like according to the control parameters. The second scene image can be stored in the image memory 260 after being processed by the second ISP processor 234 . In addition, after being processed by the second ISP processor 234, the second image can be directly sent to the display 270 for display, and the display 270 can also read the image in the image memory 260 for display.
其中,第一ISP处理器232及第二ISP处理器234均可按多种格式逐个像素地处理图像数据。例如,每个图像像素可具有8、10、12或14比特的位深度,第一ISP处理器232及第二ISP处理器234均可对图像数据进行一个或多个图像处理操作、收集关于图像数据的统计信息。其中,图像处理操作可按相同或不同的位深度精度进行。Wherein, both the first ISP processor 232 and the second ISP processor 234 can process image data pixel by pixel in various formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and both the first ISP processor 232 and the second ISP processor 234 may perform one or more image processing operations on the image data, collect information about the image Statistics of the data. Among them, the image processing operations can be performed with the same or different bit depth precision.
第一ISP处理器232确定的统计数据可发送给控制逻辑器250。此时,统计数据可包括自动曝光、自动白平衡、自动聚焦、闪烁检测、黑电平补偿、第一透镜212阴影校正等第一图像传感器214统计信息。第二ISP处理器234确定的统计数据也可发送给控制逻辑器250。此时,统计数据可包括自动曝光、自动白平衡、自动聚焦、闪烁检测、黑电平补偿、第二透镜222阴影校正等第二图像传感器224统计信息。控制逻辑器250可包括执行一个或多个例程(如固件)的处理器和/或微控制器,一个或多个例程可根据接收的统计数据,确定第一摄像头210的控制参数及第一ISP处理器232的控制参数,和/或确定第二摄像头220的控制参数及第二ISP处理器234的控制参数。例如,第一摄像头210或第二摄像头220的控制参数可包括增益、曝光控制的积分时间、防抖参数、闪光控制参数、第一透镜212控制参数(例如聚焦或变焦用焦距)、或这些参数的组合等。第一ISP处理器232或第二ISP处理器234的控制参数可包括用于自动白平衡和颜色调整(例如,在RGB处理期间)的增益水平和色彩校正矩阵。Statistics determined by the first ISP processor 232 may be sent to the control logic 250 . At this time, the statistical data may include statistical information of the first image sensor 214 such as automatic exposure, automatic white balance, automatic focus, flicker detection, black level compensation, shading correction of the first lens 212, and the like. Statistics determined by the second ISP processor 234 may also be sent to the control logic 250 . At this time, the statistical data may include second image sensor 224 statistics such as automatic exposure, automatic white balance, automatic focus, flicker detection, black level compensation, second lens 222 shading correction, and the like. The control logic 250 may include a processor and/or a microcontroller executing one or more routines (eg, firmware) that may determine the control parameters and the first camera 210 based on the received statistics. A control parameter of the ISP processor 232 , and/or to determine the control parameter of the second camera 220 and the control parameter of the second ISP processor 234 . For example, the control parameters of the first camera 210 or the second camera 220 may include gain, integration time for exposure control, anti-shake parameters, flash control parameters, first lens 212 control parameters (eg, focal length for focusing or zooming), or these parameters combination, etc. Control parameters for the first ISP processor 232 or the second ISP processor 234 may include gain levels and color correction matrices for automatic white balance and color adjustment (eg, during RGB processing).
图像存储器260可为存储器装置的一部分,也可以是存储设备或电子设备内的独立的专用存储器,并可包括DMA(Direct Memory Access,直接直接存储器存取)特征。The image memory 260 may be a part of the memory device, or may be an independent dedicated memory in a storage device or an electronic device, and may include a DMA (Direct Memory Access, direct memory access) feature.
在一个实施例中,第一ISP处理器232和第二ISP处理器234可为同一处理器,也可以为两个独立的处理器,在此不做限制。In one embodiment, the first ISP processor 232 and the second ISP processor 234 may be the same processor, or may be two independent processors, which are not limited herein.
第一场景图像是针对某具体场景拍摄所获取的图像,主体区域是指所获取的第一场景图像中的感兴趣区域,进行处理而选择性的忽略不感兴趣区域的过程即主体识别的过程。在一实施方式中,主体区域是指根据通过预设的主体识别模型、预设的主体识别神经网络、机器学习获取的主体识别模型、或机器学习获取的主体识别神经网络来确定的第一场景图像中的感兴趣区域,主体区域包括但不限于第一场景图像中面积占比最大的人或物、处于第一场景图像中心位置的人或物、或第一场景图像中特定颜色的人或物等等。在本实施方式中,主体区域可为第一场景图像的合焦区域。The first scene image is an image obtained by shooting for a specific scene, and the subject area refers to the region of interest in the obtained first scene image. The process of processing and selectively ignoring the uninteresting region is the process of subject recognition. In one embodiment, the subject area refers to a first scene determined according to a preset subject recognition model, a preset subject recognition neural network, a subject recognition model obtained by machine learning, or a subject recognition neural network obtained by machine learning. The area of interest in the image, the subject area includes but is not limited to the person or object with the largest area in the first scene image, the person or object in the center of the first scene image, or the person or object of a specific color in the first scene image. things, etc. In this embodiment, the subject area may be the focus area of the first scene image.
其中,第一场景图像的主体区域位于第一场景图像的景深区域,景深是指在摄影机镜头或其他成像器前沿能够取得清晰图像的成像所测定的被摄物体前后距离范围,即,第一摄像模组对焦完成后,焦点前后的范围内所呈现的清晰图像的距离范围,可以理解,第一场景图像的主体区域位于第一场景图像的景深区域,则表明第一场景图像的主体区域的清晰度较高,例如高于第一预定清晰度。Wherein, the subject area of the first scene image is located in the depth of field area of the first scene image, and the depth of field refers to the range of the distance before and after the object measured by imaging at the front of the camera lens or other imagers that can obtain a clear image, that is, the first camera After the module is focused, the distance range of the clear image presented in the range before and after the focus, it can be understood that the main area of the first scene image is located in the depth of field area of the first scene image, which means that the main area of the first scene image is clear. The degree is higher, eg, higher than the first predetermined sharpness.
第二场景图像也是针对某具体的场景拍摄所获取的图像,第二场景图像的成像效果与第一场景图像的成像效果存在差异,包括但不限于:第二场景图像的景深位置与第一场景图像的景深位置存在差异,例如,在本实施例中,第二场景图像的远景深不大于所述第一场景图像的近景深。近景深又称前景深,前景深满足代表式:ΔL1=FδL^2/(f^2+FδL),远景深又称后景深,后景深满足代表式:ΔL2=FδL^2/(f^2-FδL),其中,δ为摄像头模组所容许弥散圆直径,F为摄像头的拍摄光圈值,f为摄像头的镜头焦距,L为摄像头的对焦距离,景深与摄像头使用光圈、镜头焦距、拍摄距离以及对像质的要求(表现为对容许弥散圆的大小)有关。本实施例中,第二场景图像的远景深不大于第一场景图像的近景深,使得第一场景图像和第二场景图像在对焦位置,图像清晰度、分辨率、灰度值或拍摄方向、角度、曝光度等参数上存在区别。例如,第二场景图像的清晰度较低,例如低于第二预定清晰度,第二预定清晰度可小于等于第一预定清晰度,由此,第一场景图像呈现给用户的视觉感受是清晰图像,第二场景图像呈现给用户的视觉感受是模糊图像。The second scene image is also an image obtained by shooting for a specific scene. The imaging effect of the second scene image is different from that of the first scene image, including but not limited to: the depth of field position of the second scene image is different from that of the first scene image. There are differences in the depth of field positions of the images. For example, in this embodiment, the far-field depth of the second scene image is not greater than the near-field depth of the first scene image. The near depth of field is also called the foreground depth, and the foreground depth satisfies the representative formula: ΔL1=FδL^2/(f^2+FδL), and the far field depth is also called the back depth of field, and the back depth of field satisfies the representative formula: ΔL2=FδL^2/(f^2 -FδL), where δ is the diameter of the circle of confusion allowed by the camera module, F is the shooting aperture value of the camera, f is the lens focal length of the camera, L is the focusing distance of the camera, and the depth of field is related to the aperture, lens focal length, and shooting distance of the camera. And the requirements for image quality (expressed as the size of the allowable circle of confusion) are related. In this embodiment, the far depth of field of the second scene image is not greater than the near depth of field of the first scene image, so that the first scene image and the second scene image are in the focus position, the image clarity, resolution, gray value or shooting direction, There are differences in parameters such as angle and exposure. For example, the definition of the second scene image is relatively low, for example, lower than the second predetermined definition, and the second predetermined definition may be less than or equal to the first predetermined definition, so that the visual experience presented to the user by the first scene image is clear The visual experience presented to the user by the second scene image is a blurred image.
进一步地,在一个实施方式中,第一场景图像针对的场景与第二场景图像针对的场景可以完全相同,此时,第一摄像头210与第二摄像头220可以是同一个摄像头,即第一场景图像与第二场景图像是同一个摄像头在不同时刻获取的不同帧的图像,此时,第一场景图像与第二场景图像没有视差,在执行05中 融合方法时更为快速简单。在另一个实施方式中,第一场景图像针对的场景与第二场景图像针对的场景可以有较低程度的视差,此时,第一摄像头210与第二摄像头220可以是处于同一基线上的两个摄像头,此时,第一场景图像与第二场景图像可以是同一时刻获取的,可以缩减图像获取的时间。Further, in one embodiment, the scene targeted by the first scene image and the scene targeted by the second scene image may be exactly the same, and in this case, the first camera 210 and the second camera 220 may be the same camera, that is, the first scene The image and the second scene image are images of different frames acquired by the same camera at different times. At this time, the first scene image and the second scene image have no parallax, and it is faster and simpler to perform the fusion method in 05. In another embodiment, the scene targeted by the first scene image and the scene targeted by the second scene image may have a lower degree of parallax. In this case, the first camera 210 and the second camera 220 may be two cameras located on the same baseline. In this case, the image of the first scene and the image of the second scene may be acquired at the same time, which can reduce the time for acquiring images.
为了得到背景虚化图像,通常的做法是先拍摄场景图像,再区分出场景图像中的前景部分与背景部分,最后采用软件对背景部分进行虚化处理,以达到图像的光学虚化效果。然而,此种虚化处理方法是通过软件处理得来的,光学虚化的效果并不佳。本申请实施方式的图像处理方法及电子设备通过融合主体区域及第二场景图像来得到目标图像,由于第一场景图像的主体区域位于第一场景图像的景深区域,清晰度较高,呈现给用户的视觉感受是清晰图像,而第二场景图像的远景深不大于第一场景图像的近景深,第二场景图像的清晰度较低,呈现给用户的视觉感受是模糊图像,即合成是清晰主体区域与直接由摄像头拍摄的模糊的第二场景图像,由此避免采用软件算法处理实现背景虚化,由此得到的目标图像的光学虚化效果好。In order to obtain a bokeh image, the usual practice is to first take a scene image, then distinguish the foreground part and the background part in the scene image, and finally use software to bokeh the background part to achieve the optical bokeh effect of the image. However, this blurring processing method is obtained through software processing, and the effect of optical blurring is not good. The image processing method and the electronic device according to the embodiments of the present application obtain the target image by fusing the subject area and the second scene image. Since the subject area of the first scene image is located in the depth-of-field area of the first scene image, the definition is high and is presented to the user. The visual experience of the second scene image is a clear image, and the far-field depth of the second scene image is not greater than the near-field depth of the first scene image. area and the blurred second scene image directly captured by the camera, thereby avoiding the use of software algorithm processing to achieve background blur, and the obtained target image has a good optical blur effect.
请参阅图3,在某些实施方式中,该图像处理方法还包括:Referring to FIG. 3, in some embodiments, the image processing method further includes:
07:处理第一场景图像以获得主体区域和背景掩膜区域。07: Process the first scene image to obtain the subject area and the background mask area.
请参阅图2,在某些实施方式中,一个或多个处理器320还用于执行07中的方法。即,一个或多个处理器320用于处理第一场景图像以获得主体区域和背景掩膜区域。Referring to FIG. 2 , in some embodiments, one or more processors 320 are further configured to perform the method in 07 . That is, one or more processors 320 are used to process the first scene image to obtain the subject area and the background mask area.
如上文所述,体区域是指所获取的第一场景图像中的感兴趣区域,在一实施方式中,主体区域是指根据通过预设的主体识别模型、预设的主体识别神经网络、机器学习获取的主体识别模型、或机器学习获取的主体识别神经网络来确定的第一场景图像中的感兴趣区域,第一场景图像中除主体区域之外的其他区域即可划定为背景掩膜区域。As mentioned above, the body region refers to the region of interest in the acquired first scene image. In one embodiment, the body region refers to a subject recognition model based on a preset subject recognition model, a preset subject recognition neural network, a machine The area of interest in the first scene image determined by the subject recognition model acquired by learning or the subject recognition neural network acquired by machine learning, and other areas in the first scene image except the subject area can be delineated as the background mask area.
请参阅图4,在某些实施方式中,07:处理第一场景图像以获得主体区域和背景掩膜区域,包括:Referring to FIG. 4, in some embodiments, 07: Process the first scene image to obtain the subject area and the background mask area, including:
071:通过主体识别检测网络处理第一场景图像,以获取第一场景图像的初始前景区域与初始背景区域;071: Process the first scene image through the subject recognition detection network to obtain an initial foreground area and an initial background area of the first scene image;
073:获取初始前景区域与初始背景区域交界处的色彩溢出区域,色彩溢出区域包括至少一个色彩溢出像素;及073: Obtain a color overflow area at the junction of the initial foreground area and the initial background area, where the color overflow area includes at least one color overflow pixel; and
075:对色彩溢出像素进行色彩校正,以获取主体区域和背景掩膜区域。075: Color-corrects color-bleached pixels for subject and background mask areas.
请参阅图2,在某些实施方式中,一个或多个处理器320还用于执行071、073、及075中的方法。即,一个或多个处理器320还可用于通过主体识别检测网络处理第一场景图像,以获取第一场景图像的初始前景区域与初始背景区域;获取初始前景区域与初始背景区域交界处的色彩溢出区域,色彩溢出区域包括至少一个色彩溢出像素;及对色彩溢出像素进行色彩校正,以获取主体区域和背景掩膜区域。Referring to FIG. 2 , in some embodiments, one or more processors 320 are further configured to perform the methods in 071 , 073 , and 075 . That is, one or more processors 320 can also be used to process the first scene image through the subject recognition detection network to obtain the initial foreground area and the initial background area of the first scene image; obtain the color at the junction of the initial foreground area and the initial background area an overflow area, the color overflow area includes at least one color overflow pixel; and performing color correction on the color overflow pixel to obtain the main body area and the background mask area.
其中,主体识别检测网络可以预存在存储器中的,也可以是后期通过机器学习获取的。如图14所示,将第一场景图像输入进主体识别检测网络,即可输出初始前景区域BG与初始背景区域FG。初始前景区域BG与初始背景区域FG存在交界,处理器可以:将交界处划分为多个子区域Ai,每个子区域Ai包括一定数量的像素;及获取每个子区域Ai的清晰度,当子区域Ai的清晰度大于第三预定清晰度,则该子区域Ai不属于色彩溢出区域,例如图13(2)所示;当子区域Ai的清晰度小于第三预定清晰度,则该子区域Ai属于色彩溢出区域,例如图13(1)所示。其中,色彩溢出区域包括至少一个色彩溢出像素,第三预定清晰度小于第一预定清晰度。Among them, the subject recognition detection network may be pre-stored in the memory, or may be acquired later through machine learning. As shown in FIG. 14 , by inputting the first scene image into the subject recognition detection network, the initial foreground area BG and the initial background area FG can be output. There is a boundary between the initial foreground area BG and the initial background area FG, and the processor may: divide the boundary into a plurality of sub-areas Ai, and each sub-area Ai includes a certain number of pixels; and obtain the definition of each sub-area Ai, when the sub-area Ai The resolution of the sub-area Ai is greater than the third predetermined resolution, then the sub-area Ai does not belong to the color overflow area, such as shown in Figure 13 (2); when the resolution of the sub-area Ai is less than the third predetermined resolution, then the sub-area Ai belongs to The color overflow area, for example, is shown in Figure 13(1). Wherein, the color overflow area includes at least one color overflow pixel, and the third predetermined definition is smaller than the first predetermined definition.
获取每个子区域Ai的清晰度具体可以包括:先获取子区域Ai中高频信息的像素数量在整个第一场景图像的所有像素中的占比,并用该占比来表征该子区域Ai的清晰度,占比越高,图像清晰度越高。在一个例子中,先通过整形低通滤波对第一场景图像进行处理,以得到滤波图像。再根据第一场景图像与滤波图像得到高频信息,具体为用第一场景图像减去滤波图像即可得到高频信息。其中,高频信息为离散余弦变换系数中远离零频的部分,该部分用于描述第一场景图像的细节信息。最后,统计子区域Ai的高频信息的像素数量在该第一场景图像的所有像素中的占比。例如,子区域Ai中的高频信息的像素数量占第一场景图像的所有像素数量的10%,则用占比10%来表征该子区域Ai的清晰度。Acquiring the sharpness of each sub-area Ai may specifically include: first obtaining the ratio of the number of pixels of high-frequency information in the sub-area Ai to all the pixels of the entire first scene image, and using the ratio to characterize the sharpness of the sub-area Ai , the higher the ratio, the higher the image clarity. In one example, the first scene image is first processed by shaping low-pass filtering to obtain a filtered image. Then, high-frequency information is obtained according to the first scene image and the filtered image. Specifically, the high-frequency information can be obtained by subtracting the filtered image from the first scene image. The high-frequency information is a part of the discrete cosine transform coefficient far from zero frequency, and this part is used to describe the detailed information of the first scene image. Finally, the proportion of the number of pixels of high frequency information of the sub-region Ai in all the pixels of the first scene image is counted. For example, if the number of high-frequency information pixels in the sub-region Ai accounts for 10% of all the pixels in the first scene image, the ratio of 10% is used to represent the sharpness of the sub-region Ai.
在获取到初始前景区域与初始背景区域交界处的色彩溢出区域之后,需要对色彩溢出像素进行色彩校正,才能得到用于融合用的主体区域和背景掩膜区域。After obtaining the color overflow area at the junction of the initial foreground area and the initial background area, it is necessary to perform color correction on the color overflow pixels to obtain the main area and background mask area for fusion.
本申请实施方式的图像处理方法及电子设备通过融合主体区域及第二场景图像来得到目标图像,由于第一场景图像的主体区域是经过色彩溢出校正后获得的,清晰度进一步得到提高,合成后得到的目标 图像中主体区域的清晰度也较高,与模糊的第二场景图像形成鲜明对比,进一步提高目标图像的光学虚化效果。The image processing method and electronic device according to the embodiments of the present application obtain the target image by fusing the subject area and the second scene image. Since the subject area of the first scene image is obtained after color overflow correction, the clarity is further improved. The definition of the subject area in the obtained target image is also high, which is in sharp contrast with the blurred second scene image, and further improves the optical blurring effect of the target image.
请参阅图5,在某些实施方式中,071:通过主体识别检测网络处理第一场景图像,以获取第一场景图像的初始前景区域与初始背景区域,包括:Referring to FIG. 5, in some embodiments, 071: Process the first scene image through a subject recognition detection network to obtain an initial foreground area and an initial background area of the first scene image, including:
0711:获取第一场景图像的深度信息;0711: Obtain the depth information of the first scene image;
0713:根据深度信息,生成与第一场景图像对应的中心权重图,中心权重图所表示的权重值从中心向边缘逐渐减小;0713: According to the depth information, generate a center weight map corresponding to the first scene image, and the weight value represented by the center weight map gradually decreases from the center to the edge;
0715:将第一场景图像和中心权重图输入主体识别检测网络,获得第一场景图像的前景区域的置信度图;及0715: Input the first scene image and the center weight map into the subject recognition detection network to obtain a confidence map of the foreground region of the first scene image; and
0717:根据前景区域的置信度图确定初始前景区域和初始背景区域。0717: Determine the initial foreground area and the initial background area according to the confidence map of the foreground area.
请参阅图2,在某些实施方式中,一个或多个处理器320还用于执行0711、0713、0715、及0717中的方法。即,一个或多个处理器320还可用于:获取第一场景图像的深度信息;根据深度信息,生成与第一场景图像对应的中心权重图,中心权重图所表示的权重值从中心向边缘逐渐减小;将第一场景图像和中心权重图输入主体识别检测网络,获得第一场景图像的前景主体区域的置信度图;及根据前景主体区域的置信度图确定初始前景区域和初始背景区域。Referring to FIG. 2 , in some embodiments, one or more processors 320 are further configured to perform the methods in 0711 , 0713 , 0715 , and 0717 . That is, the one or more processors 320 may be further configured to: acquire depth information of the first scene image; generate a center weight map corresponding to the first scene image according to the depth information, and the weight values represented by the center weight map are from the center to the edge Gradually decrease; input the first scene image and the center weight map into the subject recognition detection network to obtain the confidence map of the foreground subject area of the first scene image; and determine the initial foreground area and the initial background area according to the confidence map of the foreground subject area .
在一个实施方式中,通过主体识别检测网络处理第一场景图像,具体地,可以先获取第一场景图像的深度信息,再根据第一场景图像的深度信息生成与第一场景图像对应的中心权重图,中心权重图所表示的权重值从中心向边缘逐渐递减,这样有利于突出处于中心位置的主体,同时也符合一般终端或者拍摄用户的操作习惯。在一个例子中,将第一场景图像和中心权重图输入主体识别监测网络,以获得第一场景图像的主体区域的置信度图。在置信度图中可能存在一些置信度较低或者零散的点,可通过ISP处理器或中央处理器对置信度图进行过滤处理及校正,从而根据前景区域的置信度图以获得初始前景区域与初始背景区域。在一个例子中,该过滤处理可采用配置置信度阈值,过滤置信度图中置信度值低于置信度阈值的像素点。在一个例子中,该置信度阈值可采用自适应置信度阈值,也可以采用固定阈值,也可以采用分区域配置对应的阈值。本实施例中,通过对第一场景图像的置信度图进行过滤处理及校正,提升了初始前景区域的可靠性,针对影响主体识别精度的初始前景区域、初始背景区域进行单独分割处理,有利于提升图像融合处理的精度和准确性。In one embodiment, the first scene image is processed through the subject recognition detection network. Specifically, depth information of the first scene image may be obtained first, and then center weights corresponding to the first scene image may be generated according to the depth information of the first scene image. Figure, the weight value represented by the center weight map gradually decreases from the center to the edge, which is conducive to highlighting the subject in the center position, and also conforms to the operating habits of general terminals or shooting users. In one example, the first scene image and the center weight map are input into the subject recognition monitoring network to obtain a confidence map of the subject area of the first scene image. There may be some points with low confidence or scattered points in the confidence map. The confidence map can be filtered and corrected by the ISP processor or the central processing unit, so as to obtain the initial foreground area and Initial background area. In one example, the filtering process may employ a configured confidence threshold, and filter pixels whose confidence values are lower than the confidence threshold in the confidence map. In an example, the confidence threshold can be an adaptive confidence threshold, a fixed threshold, or a corresponding threshold can be configured by region. In this embodiment, by filtering and correcting the confidence map of the first scene image, the reliability of the initial foreground area is improved, and separate segmentation processing is performed for the initial foreground area and the initial background area that affect the recognition accuracy of the subject, which is beneficial to Improve the precision and accuracy of image fusion processing.
在一个例子中,主体识别检测网络的预设检测模型是预先采集大量的训练数据,将训练数据输入到包含有初始网络权重的主体检测模型进行训练得到的。每组训练数据包括同一场景对应的可见光图、深度图、中心权重图及已标注的主体掩膜图。其中,可见光图和中心权重图作为训练的主体检测模型的输入,已标注的主体掩膜图作为训练的主体检测模型期望输出得到的真实值。主体掩膜图是用于识别图像中主体的图像滤镜模板,可以遮挡图像的其他部分,筛选出图像中的主体。主体检测模型可训练能够识别检测各种主体,如人、花、猫、狗、背景等。In one example, the preset detection model of the subject recognition detection network is obtained by collecting a large amount of training data in advance, and inputting the training data into the subject detection model including the initial network weights for training. Each set of training data includes the visible light map, depth map, center weight map and annotated subject mask map corresponding to the same scene. Among them, the visible light map and the center weight map are used as the input of the trained subject detection model, and the annotated subject mask map is used as the actual value that the trained subject detection model expects to output. The subject mask map is an image filter template used to identify the subject in the image, which can block other parts of the image and filter out the subject in the image. The subject detection model can be trained to recognize and detect various subjects, such as people, flowers, cats, dogs, backgrounds, etc.
在一个例子中,主体识别检测网络的预设检测模型是根据与第一场景图像对应的中心权重图和第一场景图像的深度信息训练获得。本实施例中,将深度图和中心权重图作为预设检测模型的输入,可以利用深度图的深度信息让距离摄像头更近的对象更容易被检测,也可以利用中心权重图的中心注意力机制(中心权重大、周围权重小),让图像中心的对象更容易被检测;此外,引入深度图实现对主体做深度特征增强,引入中心权重图对主体做中心注意力特征增强,不仅可以准确识别简单场景(主体单一,背景区域对比度不高的场景)下的目标主体,更大大提高了复杂场景下的主体识别准确度;并且,引入深度图还可以解决传统目标检测方法对自然图像千变万化的目标鲁棒性较差的问题。In one example, the preset detection model of the subject recognition detection network is obtained by training according to the center weight map corresponding to the first scene image and the depth information of the first scene image. In this embodiment, the depth map and the center weight map are used as the input of the preset detection model. The depth information of the depth map can be used to make objects closer to the camera easier to be detected, and the center attention mechanism of the center weight map can also be used. (The center weight is large and the surrounding weight is small), which makes the object in the center of the image easier to detect; in addition, the introduction of the depth map to enhance the depth feature of the subject, and the introduction of the center weight map to enhance the central attention feature of the subject, not only can accurately identify The target subject in a simple scene (a scene with a single subject and low contrast in the background area) greatly improves the accuracy of subject recognition in complex scenes; and the introduction of depth maps can also solve the ever-changing targets of natural images by traditional target detection methods. less robust problem.
在一个实施例中,上述图像处理方法还包括:当存在多个主体时,根据每个主体所属类别的优先级、每个主体所占的面积、每个主体的位置中的至少一种,确定第一场景图像的前景主体区域。In one embodiment, the above image processing method further includes: when there are multiple subjects, determining according to at least one of the priority of the category to which each subject belongs, the area occupied by each subject, and the position of each subject. The foreground subject area of the first scene image.
在某些实施方式中,获取第一场景图像的深度信息是通过双目视觉系统获取得到;In some embodiments, acquiring the depth information of the first scene image is acquired through a binocular vision system;
在某些实施方式中,获取第一场景图像的深度信息是通过单目视觉系统获取得到;In some embodiments, acquiring the depth information of the first scene image is acquired through a monocular vision system;
在某些实施方式中,获取第一场景图像的深度信息是通过结构光相机模组获取得到;In some embodiments, acquiring the depth information of the first scene image is acquired by a structured light camera module;
在某些实施方式中,获取第一场景图像的深度信息是通过飞行时间相机模组获取得到。In some embodiments, the depth information of the first scene image is obtained through a time-of-flight camera module.
在一个实施例中,通过双目视觉系统获得双目视差值,以获取第一场景图像的深度信息。具体地,通过双目视觉系统的第一摄像头和第二摄像头,分别获取与第一场景图像对应的第一深度图像和第二深 度图像,以获取第一深度图像的像素与第二深度图像的像素之间的相对几何位置关系。具体地,利用第一摄像头和第二摄像头从多个角度拍摄棋盘格标定板图像,分别计算出第一摄像头和第二摄像头的内部参数、外部参数及畸变系数,以及第一摄像头和第二摄像头之间的几何位置关系。优选地,第一摄像头和第二摄像头是性能指标相同(相同的光学透镜和图像传感器)、独立的两个摄像头,其光轴互相平行、并处于同一基线上。在实际应用中,可以根据不同的需求对两个第一摄像头和第二摄像头之间的基线进行调整,也可采用两个不同焦距或型号的摄像头,以满足不同的功能;第一摄像头和第二摄像头之间可水平放置、也可以垂直放置,其基线距离也可以根据需求进行调整,其中,第一摄像头和第二摄像头可以是同型号的彩色摄像头,也可以是一个彩色摄像头、一个黑白摄像头,也可以是一个高分辨率可变焦彩色摄像头、一个低分辨率彩色摄像头,还可以是一个带OIS光学防抖彩色摄像头、一个定焦彩色摄像头等不受上述限制。In one embodiment, the binocular disparity value is obtained through a binocular vision system to obtain the depth information of the first scene image. Specifically, through the first camera and the second camera of the binocular vision system, the first depth image and the second depth image corresponding to the first scene image are obtained respectively, so as to obtain the difference between the pixels of the first depth image and the second depth image. Relative geometric position relationship between pixels. Specifically, the first camera and the second camera are used to capture images of the checkerboard calibration board from multiple angles, and the internal parameters, external parameters and distortion coefficients of the first camera and the second camera are calculated respectively, as well as the first camera and the second camera. geometrical relationship between them. Preferably, the first camera and the second camera are two independent cameras with the same performance index (same optical lens and image sensor), and their optical axes are parallel to each other and on the same baseline. In practical applications, the baseline between the two first cameras and the second camera can be adjusted according to different requirements, and two cameras with different focal lengths or models can be used to meet different functions; The two cameras can be placed horizontally or vertically, and the baseline distance can also be adjusted as required. The first camera and the second camera can be color cameras of the same model, or a color camera, a black-and-white camera , it can also be a high-resolution zoom color camera, a low-resolution color camera, or a color camera with OIS optical image stabilization, a fixed-focus color camera, etc., without the above-mentioned restrictions.
根据相对几何位置关系,确定第一深度图像和第二深度图像对应像素之间的双目视差值,从而获得第一深度图像和第二深度图像相应像素的坐标,进一步获得稀疏视差图。根据稀疏视差图,从稀疏视差图的左上角开始,按逐行从左到右、从上到下,逐个像素点进行计算;如果该像素点是参考视差点,则跳过;如果该像素点不是参考视差点,则选取距离该像素点最近的参考视差点做参考,对该像素的视差点进行计算,同样在左摄像头的图像中,以该像素点为中心,提取一个图像块,以参考视差点在右摄像头的图像中对应点做中心,提取搜索窗,然后以块匹配的方法,计算该像素点的视差;逐个像素点计算完成后即可得到整幅图像的视差值,最终获取第一场景图像的深度信息。According to the relative geometric position relationship, the binocular disparity value between the corresponding pixels of the first depth image and the second depth image is determined, so as to obtain the coordinates of the corresponding pixels of the first depth image and the second depth image, and further obtain a sparse disparity map. According to the sparse disparity map, starting from the upper left corner of the sparse disparity map, the calculation is performed line by line from left to right, from top to bottom, pixel by pixel; if the pixel is a reference disparity point, skip it; if the pixel point If it is not a reference parallax point, select the reference parallax point closest to the pixel point as a reference, and calculate the parallax point of the pixel. The parallax point is centered at the corresponding point in the image of the right camera, the search window is extracted, and then the parallax of the pixel is calculated by the method of block matching; after the calculation of each pixel is completed, the parallax value of the entire image can be obtained, and finally obtained Depth information of the first scene image.
在一个实施例中,通过单目视觉系统进行算法计算,以获取第一场景图像的深度信息。具体地,通过单目视觉系统的摄像头获取至少两帧图像,通过预设深度预测模型获取第一场景图像的深度信息。在一个例子中,可以使用超像素(Superpixel)等方法预先将获取到的图像分割为多个块,并假设该多个图像块的深度值相同,再分别选取绝对的深度特征和相对的深度特征,对应估计每个块的绝对深度,及对应估计相邻块的相对深度(即深度差值),构建马尔可夫随机场模型(Markov Random Field,MRF)等后端模型从而建立局部特征和深度之间的关联关系及多个块之间的深度的关联关系,训练得到深度预测模型。In one embodiment, algorithm calculation is performed by a monocular vision system to obtain the depth information of the first scene image. Specifically, at least two frames of images are acquired through the camera of the monocular vision system, and depth information of the first scene image is acquired through a preset depth prediction model. In one example, the acquired image can be pre-divided into multiple blocks using methods such as superpixels, and it is assumed that the depth values of the multiple image blocks are the same, and then absolute depth features and relative depth features are selected respectively. , corresponding to estimating the absolute depth of each block, and correspondingly estimating the relative depth of adjacent blocks (ie depth difference), and building back-end models such as Markov Random Field (MRF) to establish local features and depths The correlation relationship between them and the depth correlation relationship between multiple blocks are trained to obtain a depth prediction model.
在一个实施例中,通过结构光相机模组,以获取第一场景图像的深度信息,即基于结构光相机模组中的结构光图像传感器获取第一场景图像,该第一场景图像为结构光图像。具体地,结构光图像传感器可以包括镭射灯以及激光摄像头。脉冲宽度调制(Pulse Width Modulation,简称PWM)可以调制镭射灯以发出结构光,结构光照射至成像对象,激光摄像头可以捕获由成像对象反射的结构光进行成像,得到第一场景图像。深度引擎可以根据第一场景图像,计算获得其对应的深度信息,具体而言,深度引擎解调第一场景图像中变形位置像素对应的相位信息,将相位信息转化为高度信息,根据高度信息确定对应的深度信息。In one embodiment, the depth information of the first scene image is acquired through the structured light camera module, that is, the first scene image is acquired based on the structured light image sensor in the structured light camera module, and the first scene image is structured light image. Specifically, the structured light image sensor may include a laser light and a laser camera. Pulse Width Modulation (PWM for short) can modulate the laser light to emit structured light, the structured light is irradiated to the imaging object, and the laser camera can capture the structured light reflected by the imaging object for imaging to obtain the first scene image. The depth engine can calculate and obtain the corresponding depth information according to the first scene image. Specifically, the depth engine demodulates the phase information corresponding to the deformed position pixels in the first scene image, converts the phase information into height information, and determines according to the height information. corresponding depth information.
在一个实施例中,通过飞行时间(Time of Flight,ToF)相机模组,以获取第一场景图像的深度信息,该第一场景图像为飞行时间深度图像。具体地,控制ToF相机模组中的激光发射器开启以向场景发射激光,并同时控制ToF相机模组中的图像传感器的每个感光像素的计时电路开始计数,发射出的激光经场景中的物体反射回来后被图像采集器接收。由于图像采集器中每一个感光像素内的雪崩光电二极管均工作在盖革模式(反向偏置电压高于雪崩电压),吸收单个光子即会发生雪崩现象,使得输出电流瞬间(小于1ps)达到最大值,并反馈至各感光像素独立的计时电路以使计时电路终止计数。根据每一个计时电路将计数值和光速计算出飞行时间深度图像中各个像素点的深度。In one embodiment, a time of flight (ToF) camera module is used to obtain depth information of a first scene image, where the first scene image is a time of flight depth image. Specifically, the laser transmitter in the ToF camera module is controlled to be turned on to emit laser light to the scene, and at the same time, the timing circuit of each photosensitive pixel of the image sensor in the ToF camera module is controlled to start counting, and the emitted laser is passed through the scene. The object is reflected back and received by the image collector. Since the avalanche photodiode in each photosensitive pixel in the image collector works in Geiger mode (the reverse bias voltage is higher than the avalanche voltage), the avalanche phenomenon will occur when a single photon is absorbed, so that the output current instantaneously (less than 1ps) reaches The maximum value is fed back to the independent timing circuit of each photosensitive pixel to make the timing circuit stop counting. According to each timing circuit, the count value and the speed of light are used to calculate the depth of each pixel in the time-of-flight depth image.
请参阅图6,在某些实施方式中,075:对色彩溢出像素进行色彩校正,以获取主体区域和背景掩膜区域,包括:Referring to FIG. 6, in some embodiments, 075: Perform color correction on color bleed pixels to obtain a subject area and a background mask area, including:
07511:以每个色彩溢出像素为中心扩展预定范围以得到一个校正区域,校正区域包括前景区域像素及背景区域像素;07511: Extend a predetermined range with each color overflow pixel as the center to obtain a correction area, and the correction area includes pixels in the foreground area and pixels in the background area;
07513:获取校正区域内前景区域像素的像素值;07513: Get the pixel value of the foreground area pixel in the correction area;
07515:根据校正区域内前景区域像素的像素值对色彩溢出像素进行校正以得到校正像素;及07515: Correct the color overflow pixel according to the pixel value of the foreground area pixel within the correction area to obtain the corrected pixel; and
07517:归并校正像素到初始前景区域,以获取主体区域和背景掩膜区域。07517: Merge corrected pixels into the initial foreground area to obtain the subject area and background mask area.
请参阅图2,在某些实施方式中,一个或多个处理器320还用于执行07511、07513、07515、及07517中的方法。即,一个或多个处理器320还可用于:以每个色彩溢出像素为中心扩展预定范围以得到一个 校正区域,校正区域包括前景区域像素及背景区域像素;获取校正区域内前景区域像素的像素值;根据校正区域内前景区域像素的像素值对色彩溢出像素进行校正以得到校正像素;及归并校正像素到初始前景区域,以获取主体区域和背景掩膜区域。Referring to FIG. 2 , in some embodiments, one or more processors 320 are further configured to perform the methods in 07511 , 07513 , 07515 , and 07517 . That is, one or more processors 320 can also be used to: extend a predetermined range around each color overflow pixel to obtain a correction area, and the correction area includes pixels of the foreground area and pixels of the background area; obtain the pixels of the pixels of the foreground area in the correction area value; correct the color overflow pixels according to the pixel values of the foreground area pixels in the correction area to obtain corrected pixels; and merge the corrected pixels into the original foreground area to obtain the main area and the background mask area.
具体地,请结合图及图14,图14中两条黑色曲线所围成的区域即表示色彩溢出区域A1。色彩溢出区域A1中包括多个色彩溢出像素。假设色彩溢出区域A1中的一个色彩溢出像素为P,则第一ISP处理器可以以色彩溢出像素P为中心,向四周扩展预定范围以得到校正区域A2,第一ISP处理器可以以色彩溢出像素P为中心,按照预定形状向四周扩展预定范围以得到校正区域A2,其中,预定形状可以是圆形、三角形、四边形、五边形、六边形、八边形、十二边形等,也即,扩展预定范围后得到的校正区域A2可以是圆形、三角形、四边形、五边形、六边形、八边形、十二边形等,在此不作限制。校正区域A2中同时包括三类像素:前景区域像素、背景区域像素及色彩溢出像素P。在一个例子中,第一ISP处理器可以将校正区域A2中的所有前景区域像素选出来,并利用所有前景区域像素的像素值对色彩溢出像素P的像素值Pc进行校正。示例地,假设前景区域像素为N个,每个前景区域像素的像素值为Pi,i≤N,且i为正整数,则
Figure PCTCN2020102502-appb-000001
在另一个例子中,第一ISP处理器可以选取位于校正区域A2内的部分前景区域像素,其中,这部分选定的前景区域像素中,每个前景区域像素与色彩溢出像素P之间的空间距离小于或等于预定距离。随后,第一ISP利用选出来的这部分前景区域像素的像素值对色彩溢出像素P的像素值Pc进行校正。示例地,假设前景区域像素为N个,则第一ISP处理器可以从中选出M个前景区域像素,其中,M<N,且M个前景区域像素中,每个前景区域像素的坐标值Pxy与色彩溢出像素P的坐标值Puv之间的空间距离均小于或等于预定距离D,也即,
Figure PCTCN2020102502-appb-000002
若M个前景区域像素中,每个前景区域像素的像素值为Pi,i≤M,且i为正整数,则
Figure PCTCN2020102502-appb-000003
与利用校正区域A2中的所有前景区域像素的像素值来校正色彩溢出像素的像素值相比,仅利用部分距离色彩溢出像素较近的前景区域像素的像素值来校正色彩溢出像素的像素值,一方面可以消除色彩溢出现象,另一方面也可以使得校正后获得的校正像素的像素值更为准确。而与仅利用部分距离色彩溢出像素较近的前景区域像素的像素值来校正色彩溢出像素的像素值相比,利用校正区域A2中的所有前景区域像素的像素值来校正色彩溢出像素的像素值,可以减小第一ISP处理器的计算量。
Specifically, referring to FIG. 14 and FIG. 14 , the area enclosed by the two black curves in FIG. 14 represents the color overflow area A1 . The color overflow area A1 includes a plurality of color overflow pixels. Assuming that a color overflow pixel in the color overflow area A1 is P, the first ISP processor can take the color overflow pixel P as the center, and expand a predetermined range around to obtain the correction area A2, and the first ISP processor can use the color overflow pixel P as the center. P is the center, and a predetermined range is extended to the surrounding area according to a predetermined shape to obtain a correction area A2, wherein the predetermined shape can be a circle, a triangle, a quadrilateral, a pentagon, a hexagon, an octagon, a dodecagon, etc. That is, the correction area A2 obtained after expanding the predetermined range may be a circle, a triangle, a quadrangle, a pentagon, a hexagon, an octagon, a dodecagon, etc., which is not limited herein. The correction area A2 also includes three types of pixels: foreground area pixels, background area pixels, and color overflow pixels P. In one example, the first ISP processor may select all foreground area pixels in the correction area A2, and use the pixel values of all foreground area pixels to correct the pixel value Pc of the color overflow pixel P. For example, assuming that there are N pixels in the foreground area, the pixel value of each foreground area pixel is Pi, i≤N, and i is a positive integer, then
Figure PCTCN2020102502-appb-000001
In another example, the first ISP processor may select a part of the foreground area pixels located in the correction area A2, wherein, among the selected foreground area pixels, the space between each foreground area pixel and the color overflow pixel P The distance is less than or equal to the predetermined distance. Then, the first ISP corrects the pixel value Pc of the color overflow pixel P by using the pixel value of the selected part of the foreground area pixels. For example, assuming that there are N foreground area pixels, the first ISP processor may select M foreground area pixels from them, where M<N, and among the M foreground area pixels, the coordinate value Pxy of each foreground area pixel The spatial distance from the coordinate value Puv of the color overflow pixel P is less than or equal to the predetermined distance D, that is,
Figure PCTCN2020102502-appb-000002
If among the M foreground area pixels, the pixel value of each foreground area pixel is Pi, i≤M, and i is a positive integer, then
Figure PCTCN2020102502-appb-000003
Compared with using the pixel values of all foreground area pixels in the correction area A2 to correct the pixel values of the color overflow pixels, only the pixel values of some foreground area pixels that are closer to the color overflow pixels are used to correct the pixel values of the color overflow pixels, On the one hand, the color overflow phenomenon can be eliminated, and on the other hand, the pixel values of the corrected pixels obtained after correction can be made more accurate. In contrast to correcting the pixel values of the color overflow pixels using only some of the pixel values of the foreground area pixels that are closer to the color overflow pixels, the pixel values of the color overflow pixels are corrected by using the pixel values of all foreground area pixels in the correction area A2. , the calculation amount of the first ISP processor can be reduced.
在获得校正像素后,第一ISP处理器可以将校正像素归并到前景区域中。第一ISP处理器可以采用图6所示方式遍历校正区域中的所有色彩溢出像素,以得到多个校正像素。多个校正像素均被归并到初始前景区域,从而获得更新后的初始前景区域,也即主体区域。第一场景图像中除主体区域以外的区域即为背景掩膜区域。After obtaining the corrected pixels, the first ISP processor may merge the corrected pixels into the foreground region. The first ISP processor may use the manner shown in FIG. 6 to traverse all the color overflow pixels in the correction area to obtain a plurality of corrected pixels. A plurality of corrected pixels are merged into the initial foreground area, so as to obtain the updated initial foreground area, that is, the subject area. The area other than the subject area in the first scene image is the background mask area.
请参阅图7,在某些实施方式中,075:对色彩溢出像素进行色彩校正,以获取主体区域和背景掩膜区域,包括:Referring to FIG. 7, in some embodiments, 075: Perform color correction on color bleed pixels to obtain a subject area and a background mask area, including:
07521:以每个色彩溢出像素为中心扩展预定范围以得到一个校正区域,校正区域包括前景区域像素及背景区域像素;07521: Extend a predetermined range with each color overflow pixel as the center to obtain a correction area, and the correction area includes pixels in the foreground area and pixels in the background area;
07523:获取校正区域内背景区域像素的像素值;07523: Get the pixel value of the background area pixel in the correction area;
07525:根据校正区域内背景区域像素的像素值对色彩溢出像素进行校正以得到校正像素;及07525: Correct the color overflow pixels according to the pixel values of the background area pixels within the correction area to obtain corrected pixels; and
07527:归并校正像素到初始背景区域,以获取主体区域和背景掩膜区域。07527: Merge corrected pixels to the initial background area to obtain the subject area and background mask area.
请参阅图2,在某些实施方式中,一个或多个处理器320还用于执行07521、07523、07525、及07527中的方法。即,一个或多个处理器320还可用于:以每个色彩溢出像素为中心扩展预定范围以得到一个校正区域,校正区域包括前景区域像素及背景区域像素;获取校正区域内背景区域像素的像素值;根据校正区域内背景区域像素的像素值对色彩溢出像素进行校正以得到校正像素;及归并校正像素到初始背景区域,以获取主体区域和背景掩膜区域。Referring to FIG. 2, in some embodiments, one or more processors 320 are also used to perform the methods in 07521, 07523, 07525, and 07527. That is, one or more processors 320 can also be used to: extend a predetermined range around each color overflow pixel to obtain a correction area, and the correction area includes pixels of the foreground area and pixels of the background area; obtain the pixels of the pixels of the background area in the correction area value; correct the color overflow pixels according to the pixel values of the background area pixels in the correction area to obtain corrected pixels; and merge the corrected pixels into the original background area to obtain the main area and the background mask area.
具体地,请结合图及图14,图14中两条黑色曲线所围成的区域即表示色彩溢出区域A1。色彩溢出区域A1中包括多个色彩溢出像素。假设色彩溢出区域A1中的一个色彩溢出像素为P,则第一ISP处理器可以以色彩溢出像素P为中心,向四周扩展预定范围以得到校正区域A2。其中,第一ISP处理器可以以色彩溢出像素P为中心,按照预定形状向四周扩展预定范围以得到校正区域A2,其中,预定形状可以是圆形、三角形、四边形、五边形、六边形、八边形、十二边形等,也即,扩展预定范围后得到的校正区域A2可以是圆形、三角形、四边形、五边形、六边形、八边形、十二边形等,在此不作限制。校正区域中同时包括三类像素:前景区域像素、背景区域像素及色彩溢出像素P。在一个例子中,第一 ISP处理器可以将校正区域A2中的所有背景区域像素选出来,并利用所有背景区域像素的像素值对色彩溢出像素P的像素值Pc进行校正。示例地,假设背景区域像素为N个,每个背景区域像素的像素值为Pi,i≤N,且i为正整数,则
Figure PCTCN2020102502-appb-000004
在另一个例子中,第一ISP处理器可以选取位于校正区域A2内的部分背景区域像素,其中,这部分选定的背景区域像素中,每个背景区域像素与色彩溢出像素P之间的空间距离小于或等于预定距离。随后,第一ISP利用选出来的这部分背景区域像素的像素值对色彩溢出像素P的像素值Pc进行校正。示例地,假设背景区域像素为N个,则第一ISP处理器可以从中选出M个背景区域像素,其中,M<N,且M个背景区域像素中,每个背景区域像素的坐标值Pxy与色彩溢出像素P的坐标值Puv之间的空间距离均小于或等于预定距离D,也即,
Figure PCTCN2020102502-appb-000005
Figure PCTCN2020102502-appb-000006
若M个背景区域像素中,每个背景区域像素的像素值为Pi,i≤M,且i为正整数,则
Figure PCTCN2020102502-appb-000007
与利用校正区域A2中的所有背景区域像素的像素值来校正色彩溢出像素的像素值相比,仅利用部分距离色彩溢出像素较近的背景区域像素的像素值来校正色彩溢出像素的像素值,一方面可以消除色彩溢出现象,另一方面也可以使得校正后获得的校正像素的像素值更为准确。而与仅利用部分距离色彩溢出像素较近的背景区域像素的像素值来校正色彩溢出像素的像素值相比,利用校正区域A2中的所有背景区域像素的像素值来校正色彩溢出像素的像素值,可以减小第一ISP处理器的计算量。
Specifically, referring to FIG. 14 and FIG. 14 , the area enclosed by the two black curves in FIG. 14 represents the color overflow area A1 . The color overflow area A1 includes a plurality of color overflow pixels. Assuming that a color overflow pixel in the color overflow area A1 is P, the first ISP processor can take the color overflow pixel P as the center, and expand a predetermined range around to obtain the correction area A2. Wherein, the first ISP processor may take the color overflow pixel P as the center, and expand a predetermined range to the surrounding area according to a predetermined shape to obtain the correction area A2, wherein the predetermined shape may be a circle, a triangle, a quadrilateral, a pentagon, or a hexagon. , octagon, dodecagon, etc., that is, the correction area A2 obtained after expanding the predetermined range can be circle, triangle, quadrilateral, pentagon, hexagon, octagon, dodecagon, etc., There is no restriction here. The correction area also includes three types of pixels: foreground area pixels, background area pixels, and color overflow pixels P. In one example, the first ISP processor may select all background area pixels in the correction area A2, and use the pixel values of all background area pixels to correct the pixel value Pc of the color overflow pixel P. For example, assuming that there are N background area pixels, the pixel value of each background area pixel is Pi, i≤N, and i is a positive integer, then
Figure PCTCN2020102502-appb-000004
In another example, the first ISP processor may select a part of the background area pixels located in the correction area A2, wherein, among the selected background area pixels, the space between each background area pixel and the color overflow pixel P The distance is less than or equal to the predetermined distance. Then, the first ISP corrects the pixel value Pc of the color overflow pixel P by using the pixel value of the selected background area pixels. For example, assuming that there are N background area pixels, the first ISP processor may select M background area pixels from them, where M<N, and among the M background area pixels, the coordinate value Pxy of each background area pixel The spatial distance from the coordinate value Puv of the color overflow pixel P is less than or equal to the predetermined distance D, that is,
Figure PCTCN2020102502-appb-000005
Figure PCTCN2020102502-appb-000006
If among the M background area pixels, the pixel value of each background area pixel is Pi, i≤M, and i is a positive integer, then
Figure PCTCN2020102502-appb-000007
Compared with using the pixel values of all background area pixels in the correction area A2 to correct the pixel values of the color overflow pixels, the pixel values of the color overflow pixels are corrected only by using the pixel values of some background area pixels that are closer to the color overflow pixels, On the one hand, the color overflow phenomenon can be eliminated, and on the other hand, the pixel values of the corrected pixels obtained after correction can be made more accurate. In contrast to correcting the pixel values of the color overflow pixels by using only the pixel values of some background area pixels that are closer to the color overflow pixels, the pixel values of all background area pixels in the correction area A2 are used to correct the pixel values of the color overflow pixels. , the calculation amount of the first ISP processor can be reduced.
在获得校正像素后,第一ISP处理器可以将校正像素归并到背景区域中。第一ISP处理器可以采用图7所示方式遍历校正区域中的所有色彩溢出像素,以得到多个校正像素。多个校正像素均被归并到初始背景区域,从而获得更新后的初始背景区域,也即背景掩膜区域。第一场景图像中除背景掩膜区域以外的区域即为主体区域。After obtaining the corrected pixels, the first ISP processor may merge the corrected pixels into the background area. The first ISP processor may use the manner shown in FIG. 7 to traverse all the color overflow pixels in the correction area to obtain a plurality of corrected pixels. A plurality of corrected pixels are merged into the initial background area, so as to obtain the updated initial background area, that is, the background mask area. The area other than the background mask area in the first scene image is the main area.
请参阅图8,在某些实施方式中,第二场景图像为光学虚化图像,第一场景图像的清晰度高于第二场景图像。05:融合主体区域与第二场景图像,以获得目标图像,包括:Referring to FIG. 8 , in some embodiments, the second scene image is an optically blurred image, and the definition of the first scene image is higher than that of the second scene image. 05: Fusion of the subject area and the second scene image to obtain the target image, including:
051:将主体区域作为目标主体区域;051: Use the subject area as the target subject area;
053:融合背景掩膜区域及第二场景图像中的背景区域以得到目标背景区域;及053: Fusing the background mask area and the background area in the second scene image to obtain the target background area; and
055:根据目标主体区域及目标背景区域获取目标图像。055: Acquire a target image according to the target subject area and the target background area.
请参阅图2,在某些实施方式中,一个或多个处理器320还用于执行051、053及055中的方法。即,一个或多个处理器320还可用于:将主体区域作为目标主体区域;融合背景掩膜区域及第二场景图像中的背景区域以得到目标背景区域;及根据目标主体区域及目标背景区域获取目标图像。Referring to FIG. 2 , in some embodiments, one or more processors 320 are further configured to perform the methods in 051 , 053 and 055 . That is, one or more processors 320 may also be used to: take the subject area as the target subject area; fuse the background mask area and the background area in the second scene image to obtain the target background area; and obtain the target background area according to the target subject area and the target background area Get the target image.
具体地,请结合图2及图11,在本申请的一个实施例中,第二场景图像例如为采用微距拍摄方式获得的图像,此时,第二场景图像中大部分区域(包括第二场景图像中的至少部分主体区域及全部背景区域)均是模糊的,由此使得第二场景具有光学虚焦的效果,第二场景图像的清晰度低于第一场景图像。Specifically, referring to FIG. 2 and FIG. 11 , in an embodiment of the present application, the second scene image is, for example, an image obtained by macro shooting. At least part of the main body area and all the background areas in the scene image are blurred, so that the second scene has the effect of optical defocus, and the definition of the second scene image is lower than that of the first scene image.
在获得第一场景图像及第二场景图像后,第一ISP处理器或第二ISP处理器中的任意一个处理器可以将第一场景图像中的主体区域作为目标主体区域。并且,第一ISP处理器或第二ISP处理器中的任意一个处理器可以融合背景掩膜区域及第二场景图像中的背景区域以得到目标背景区域。作为一个示例,假设第一场景图像中背景掩膜区域中的一个背景区域像素的像素值为Pi,第二场景图像中背景区域内的一个背景区域像素的像素值为Pi’,且像素值为Pi的背景区域像素在第一场景图像中位置与像素值为Pi’的背景区域像素在第二场景图像中的位置对应,则可以通过以下方式计算出目标背景区域中一个目标背景像素的像素值Pi”:Pi”=a*Pi+b*Pi’,其中a和b为权重,且a+b=1。第一ISP处理器或第二ISP处理器中的任意一个处理器可以采用Pi”=a*Pi+b*Pi’的计算方式遍历背景掩膜区域及第二场景图像中背景区域内的所有背景区域像素,以得到多个目标背景像素。多个目标背景像素即组成目标背景区域。After obtaining the first scene image and the second scene image, any one of the first ISP processor or the second ISP processor may use the subject area in the first scene image as the target subject area. Moreover, any one of the first ISP processor or the second ISP processor can fuse the background mask area and the background area in the second scene image to obtain the target background area. As an example, it is assumed that the pixel value of a background area pixel in the background mask area in the first scene image is Pi, the pixel value of a background area pixel in the background area in the second scene image is Pi', and the pixel value is Pi'. The position of the background area pixel of Pi in the first scene image corresponds to the position of the background area pixel with the pixel value Pi' in the second scene image, then the pixel value of a target background pixel in the target background area can be calculated in the following way Pi": Pi"=a*Pi+b*Pi', where a and b are weights, and a+b=1. Any one of the first ISP processor or the second ISP processor can use the calculation method of Pi"=a*Pi+b*Pi' to traverse the background mask area and all backgrounds in the background area in the second scene image. area pixels to obtain multiple target background pixels. Multiple target background pixels constitute the target background area.
本申请实施方式的图像处理方法将主体区域作为目标主体区域,由于第一场景图像的清晰度较高,因此,将主体区域作为目标主体区域后,目标主体区域也可以有较高的清晰度。本申请实施方式的图像处理方法融合背景掩膜区域及第二场景图像中的背景区域以得到目标背景区域,可以借助第二场景图像的光学虚焦效果来对目标背景图像进行虚化,可以提升目标背景图像的虚化效果。The image processing method of the embodiment of the present application uses the subject area as the target subject area. Since the first scene image has high definition, after the subject area is used as the target subject area, the target subject area can also have high definition. The image processing method of the embodiment of the present application fuses the background mask area and the background area in the second scene image to obtain the target background area, and can blur the target background image with the help of the optical defocus effect of the second scene image, which can improve the Bokeh effect for the target background image.
进一步地,在某些实施方式中,可以确定出像素值为Pi的背景区域像素与像素值为Pi’的背景区域像素所对应的深度。当像素值为Pi的背景区域像素与像素值为Pi’的背景区域像素所对应的深度较小时,可以将a设置成大于b,当像素值为Pi的背景区域像素与像素值为Pi’的背景区域像素所对应的深度较大时,可以将b设置成大于a。如此,可以使得目标背景区域中深度较小的部分模糊程度较低,目标区域中深度较大的部分模糊程度较高,从而可以进一步地提升目标背景区域的虚化效果。Further, in some embodiments, the depth corresponding to the background area pixel with the pixel value Pi and the background area pixel with the pixel value Pi' may be determined. When the depth corresponding to the background area pixel with the pixel value of Pi and the background area pixel with the pixel value of Pi' is small, a can be set to be greater than b. When the depth corresponding to the pixels in the background area is large, b can be set to be larger than a. In this way, the part with a smaller depth in the target background area can be made to have a lower degree of blurring, and the part with a larger depth in the target area can be made to have a higher degree of blurring, so that the blurring effect of the target background area can be further improved.
请参阅图9,在某些实施方式中,该图像处理方法还包括:Referring to FIG. 9, in some embodiments, the image processing method further includes:
09:当检测到第二场景图像存在图像畸变时,获取第二场景图像对应的变换矩阵;及09: when it is detected that there is image distortion in the second scene image, obtain a transformation matrix corresponding to the second scene image; and
011:根据变换矩阵对第二场景图像进行校正处理,获得校正图像。011: Perform correction processing on the second scene image according to the transformation matrix to obtain a corrected image.
05:融合主体区域与第二场景图像,以获得目标图像,可包括:05: Fusion of the subject area and the second scene image to obtain the target image, which may include:
057:融合主体区域与校正图像,以获得目标图像。057: Fuse the subject area with the corrected image to obtain the target image.
请参阅图2,在某些实施方式中,一个或多个处理器320还用于执行09、011及057中的方法。即,一个或多个处理器320用于:当检测到第二场景图像存在图像畸变时,获取第二场景图像对应的变换矩阵;根据变换矩阵对第二场景图像进行校正处理,获得校正图像;及融合主体区域与校正图像,以获得目标图像。Referring to FIG. 2 , in some embodiments, one or more processors 320 are further configured to perform the methods in 09 , 011 and 057 . That is, the one or more processors 320 are configured to: obtain a transformation matrix corresponding to the second scene image when it is detected that there is image distortion in the second scene image; perform correction processing on the second scene image according to the transformation matrix to obtain a corrected image; And fuse the subject area with the corrected image to obtain the target image.
其中,图像畸变可以是图像的像素值、色度、深度值或曝光度等并列参数中的一种参数存在畸变或多种参数均存在畸变。具体地,可以通过获取第二场景图像的内容差,将内容差与预设阈值进行比较,判断是否在特定参数上存在畸变,上述内容差可以是相邻两个像素块(像素块可以包括一个或多个像素)之间的参数差值,或针对同一拍摄对象获取的不同帧图像间的相应位置处的像素块的参数之间的差值。例如获取第一像素块、第二像素块、第三像素块的相同参数的内容值,参数包括但不限于灰度值、色度、深度值等,其中,第一像素块第三像素块为同第二像素块分别相邻的像素块,第二像素块位于第一像素块与第三像素块之间,第一像素块和第二像素块、第三像素块的各个像素均包含深度值(即内容值为像素值)。可以确定每个第一像素块的第一内容均值与第二像素块的第二内容均值,并确定第一内容值和第二内容值的内容差。可以理解的,如果第一像素块和第二像素块之间的内容差较低(例如小于预设阈值),则表明第一像素块和第二像素块实际对应于被拍摄的物体的同一位置,第一像素块和第二像素块之间的深度值的误差较小,第一像素块与第二像素块的畸变较小。同理,可以确定第二像素块与第三像素块之间的内容差,第一像素块与第三像素块的内容差可以与预设阈值进行比较,若该内容差大于预设阈值,则存在图像畸变,若内容差小于预设阈值,则不存在图像畸变。需要说明的是,上述第一像素块、第二像素块或第三像素块相邻,也可以表示为三个像素块分别位于相邻的三帧图像内,且任意一个像素块在对应的图像内的位置与其余两个像素块在对应的图像内的位置是一样的,这根据具体的应用需求而定。Wherein, the image distortion may be that one of the parallel parameters such as pixel value, chromaticity, depth value or exposure of the image is distorted or multiple parameters are distorted. Specifically, the content difference of the second scene image can be obtained, and the content difference can be compared with a preset threshold to determine whether there is distortion in a specific parameter. The content difference may be two adjacent pixel blocks (a pixel block may include a or multiple pixels), or the difference between parameters of pixel blocks at corresponding positions between different frame images acquired for the same object. For example, the content values of the same parameters of the first pixel block, the second pixel block, and the third pixel block are obtained, and the parameters include but are not limited to gray value, chromaticity, depth value, etc. The first pixel block and the third pixel block are: Pixel blocks adjacent to the second pixel block, the second pixel block is located between the first pixel block and the third pixel block, and each pixel of the first pixel block, the second pixel block, and the third pixel block contains depth values. (i.e. the content value is the pixel value). The first content mean value of each first pixel block and the second content mean value of the second pixel block may be determined, and the content difference between the first content value and the second content value may be determined. Understandably, if the content difference between the first pixel block and the second pixel block is low (for example, less than a preset threshold), it means that the first pixel block and the second pixel block actually correspond to the same position of the object being photographed. , the error of the depth value between the first pixel block and the second pixel block is small, and the distortion of the first pixel block and the second pixel block is small. Similarly, the content difference between the second pixel block and the third pixel block can be determined, and the content difference between the first pixel block and the third pixel block can be compared with a preset threshold, if the content difference is greater than the preset threshold, then There is image distortion. If the content difference is less than the preset threshold, there is no image distortion. It should be noted that, the above-mentioned first pixel block, second pixel block or third pixel block is adjacent, it can also be expressed as three pixel blocks are located in three adjacent frames of images, and any pixel block is located in the corresponding image. The position of the pixel block is the same as the position of the other two pixel blocks in the corresponding image, which is determined according to the specific application requirements.
图12为一个示例的存在畸变的图像与不存在畸变的图像的比较示意图。图12示出了两幅摄像头获取的标定板的图像。其中,图12中的(1)为不存在图像畸变的标定板的图像,图像中一系列的点以相同间距在水平和垂直方向上整齐规律地排布,各个方格的形态都是正常的。而图12中的(2)为存在图像畸变的标定板的图像,标定板上的放个不再在水平和垂直方向上整齐规律地排布,且方格的形态发生了变化。FIG. 12 is a schematic diagram illustrating a comparison between an image with distortion and an image without distortion. Figure 12 shows the images of the calibration plate acquired by the two cameras. Among them, (1) in Figure 12 is the image of the calibration plate without image distortion. A series of points in the image are regularly arranged in the horizontal and vertical directions with the same spacing, and the shape of each square is normal. . While (2) in FIG. 12 is an image of the calibration plate with image distortion, the plates on the calibration plate are no longer arranged neatly and regularly in the horizontal and vertical directions, and the shape of the squares has changed.
在确定第二场景图像存在图像畸变时,可以获取第二场景图像对应的变换矩阵。在一个例子中,可以根据第二场景图像拍摄时,用于拍摄第二场景图像的摄像头的对焦段来确定与第二场景图像对应的变换矩阵。若摄像头的对焦段为F1~F2,则第二场景图像对应的变换矩阵为matrix1,若摄像头的对焦段为F2~F3,则第二场景图像对应的变换矩阵为matrix2,若摄像头对应的对焦段为F3~F4,则第二场景图像对应的变换矩阵为matrix3……依此类推,若摄像头对应的对焦段Fn-1~Fn,则第二场景图像对应的变换矩阵为matrix(n-1)。其中,对焦段与变换矩阵的对应关系是事先标定好,并存储在图2所示的图像存储器中的。可以理解的是,摄像头的对焦段不同时,其获得的图像的畸变形态也会不同。根据摄像头的对焦段来选定对应该对焦段的变换矩阵,可以更精准地对图像的畸变进行校正,获得畸变校正效果更好的校正图像。When it is determined that there is image distortion in the second scene image, a transformation matrix corresponding to the second scene image may be obtained. In one example, the transformation matrix corresponding to the second scene image may be determined according to the focus segment of the camera used for capturing the second scene image when the second scene image is captured. If the focus segment of the camera is F1 to F2, the transformation matrix corresponding to the second scene image is matrix1. If the focus segment of the camera is F2 to F3, the transformation matrix corresponding to the second scene image is matrix2. If the focus segment corresponding to the camera If it is F3~F4, the transformation matrix corresponding to the second scene image is matrix3... and so on, if the focus segment corresponding to the camera is Fn-1~Fn, then the transformation matrix corresponding to the second scene image is matrix(n-1) . The corresponding relationship between the focus segment and the transformation matrix is pre-calibrated and stored in the image memory shown in FIG. 2 . It can be understood that when the focus segment of the camera is different, the distortion form of the obtained image will also be different. According to the focus segment of the camera, the transformation matrix corresponding to the focus segment is selected, and the distortion of the image can be corrected more accurately, and the corrected image with better distortion correction effect can be obtained.
可以理解地,畸变图像校正的方法不限于上述通过对应的变换矩阵进行处理,还可以通过边缘腐蚀或形态学处理的方式进行畸变的校正等。具体地,形态学处理可包括腐蚀和膨胀。可先对第二场景图像进行腐蚀操作,再进行膨胀操作,随后对形态学处理后的得到的二值化掩膜图进行引导滤波处理以实现边缘滤波从而得到校正图像。通过形态学处理和引导滤波处理可以使得校正图像中边缘部分的噪点减少甚至是小时,校正图像的边缘更加柔和。It can be understood that the method of distorted image correction is not limited to the above-mentioned processing through the corresponding transformation matrix, and the distortion correction can also be performed by means of edge erosion or morphological processing. In particular, morphological treatments can include erosion and swelling. The second scene image may be eroded first, then expanded, and then the morphologically processed binarized mask image may be subjected to guided filtering to implement edge filtering to obtain a corrected image. Through morphological processing and guided filtering processing, the noise in the edge part of the corrected image can be reduced or even small, and the edge of the corrected image is softer.
在获得校正图像后,可以将第一场景图像的主体区域与校正图像进行融合以得到目标图像。由于目标图像是由第一场景图像的主体区域与校正后的第二场景图像融合得到的,目标图像中不存在畸变,图像质量更高。After the corrected image is obtained, the subject area of the first scene image can be fused with the corrected image to obtain the target image. Since the target image is obtained by fusing the subject area of the first scene image and the corrected second scene image, there is no distortion in the target image, and the image quality is higher.
请参阅图10,在某些实施方式中,第一场景图像及第二场景图像通过不同的摄像头获取,图像处理方法还可包括:Referring to FIG. 10, in some embodiments, the first scene image and the second scene image are acquired by different cameras, and the image processing method may further include:
013:获取第一场景图像中的至少一个第一特征点;013: Acquire at least one first feature point in the first scene image;
015:获取第二场景图像中的至少一个第二特征点;015: Acquire at least one second feature point in the second scene image;
017:将第一特征点和第二特征点进行匹配,获得至少一个特征点对;017: Match the first feature point and the second feature point to obtain at least one feature point pair;
019:根据特征点对确定映射矩阵;及019: Determine a mapping matrix from feature point pairs; and
021:根据映射矩阵对齐第一场景图像及第二场景图像。021: Align the first scene image and the second scene image according to the mapping matrix.
请参阅图2,在某些实施方式中,一个或多个处理器320还用于执行013、015、017、019及021中的方法。即,一个或多个处理器320还可用于:获取第一场景图像中的至少一个第一特征点;获取第二场景图像中的至少一个第二特征点;将第一特征点和第二特征点进行匹配,获得至少一个特征点对;根据特征点对确定映射矩阵;及根据映射矩阵对齐第一场景图像及第二场景图像。Referring to FIG. 2 , in some embodiments, one or more processors 320 are further configured to execute the methods in 013 , 015 , 017 , 019 and 021 . That is, one or more processors 320 may be further configured to: acquire at least one first feature point in the first scene image; acquire at least one second feature point in the second scene image; combine the first feature point with the second feature matching the points to obtain at least one feature point pair; determining a mapping matrix according to the feature point pair; and aligning the first scene image and the second scene image according to the mapping matrix.
当第一场景图像和第二场景图像通过不同的摄像头来获取时,在一个例子中,第一场景图像由图2所示的第一摄像头210获取,第二场景图像由图2所示的第二摄像头220获取。在另一个例子中,图2所示的电子设备还可以包括第三摄像头(图未示),第三摄像头可以包括第三透镜和第三图像传感器。第一场景图像例如可以由第一摄像头210获得,第二场景图像例如可以由第三摄像头获得,其中,第二摄像头220可以用于与第一摄像头210组成双目立体视觉系统以获取深度信息。When the first scene image and the second scene image are acquired by different cameras, in one example, the first scene image is acquired by the first camera 210 shown in FIG. 2 , and the second scene image is acquired by the first camera 210 shown in FIG. 2 . Two cameras 220 acquire. In another example, the electronic device shown in FIG. 2 may further include a third camera (not shown), and the third camera may include a third lens and a third image sensor. The first scene image may be obtained by, for example, the first camera 210 , and the second scene image may be obtained by, for example, a third camera, wherein the second camera 220 may be used to form a binocular stereo vision system with the first camera 210 to obtain depth information.
在获得第一场景图像和第二场景图像后,可以识别第一场景图像中的第一特征点以及第二场景图像中的第二特征点,第一特征点的个数可以是一个或多个,第二特征点的个数也可以是一个或多个。可以对第一特征点和第二特征点进行匹配,以获得一个或多个的特征点对。每对特征点对中的第一特征点与第二特征点指示的是被摄物体中的同一个位置。根据一个或多个的特征点对即可确定出第一摄像头与第三摄像头的映射矩阵,根据该映射矩阵可以对第一场景图像及第二场景图像进行对齐。After the first scene image and the second scene image are obtained, the first feature point in the first scene image and the second feature point in the second scene image can be identified, and the number of the first feature points can be one or more , the number of the second feature points may also be one or more. The first feature point and the second feature point may be matched to obtain one or more feature point pairs. The first feature point and the second feature point in each pair of feature points indicate the same position in the subject. The mapping matrix of the first camera and the third camera can be determined according to one or more feature point pairs, and the first scene image and the second scene image can be aligned according to the mapping matrix.
可以理解,当第一场景图像和第二场景由不同的摄像头获得时,由于不同的摄像头之间的视场不是完全重叠的,导致第一场景图像与第二场景图像中存在重叠区域及不重叠区域。对此,可以对第一场景图像及第二场景图像进行对齐以得到对齐后的第一场景图像和对齐后的第二场景图像,对齐后的第一场景图像与对齐后的第二场景图像完全重叠。如此,通过融合第一场景图像和第二场景图像而得到的目标图像可以具有更好的图像质量。It can be understood that when the first scene image and the second scene are obtained by different cameras, the fields of view between the different cameras are not completely overlapped, resulting in overlapping areas and non-overlapping areas in the first scene image and the second scene image. area. In this regard, the first scene image and the second scene image may be aligned to obtain the aligned first scene image and the aligned second scene image, and the aligned first scene image and the aligned second scene image are completely overlapping. In this way, the target image obtained by fusing the first scene image and the second scene image may have better image quality.
需要说明的是,在一个例子中,第一场景图像及第二场景图像的对齐处理可以在步骤07、步骤09及步骤011之前执行,此时,步骤07即为处理对齐后的第一场景图像以获得主体区域和背景掩膜区域,步骤09即为当检测到对齐后的第二场景图像存在图像畸变时,获取对齐后的第二场景图像对应的变换矩阵,步骤011即为根据变换矩阵对对齐后的第二场景图像进行校正处理,以获得校正图像,步骤05即为融合对齐且经色彩校正后的第一场景中的主体区域与对齐且经畸变校正后的第二场景图像,以获得目标图像。在另一个例子中,第一场景图像及第二场景图像的对齐处理可以在步骤07之后执行,且在步骤09及步骤011之前执行,此时,对齐第一场景图像及第二场景图像即为对齐经畸变校正后的第二场景图像及经色彩溢出校正后的第一场景图像,步骤05即为融合对齐且经色彩校正后的第一场景中的主体区域与对齐且经畸变校正后的第二场景图像,以获得目标图像。It should be noted that, in an example, the alignment processing of the first scene image and the second scene image may be performed before step 07, step 09 and step 011. In this case, step 07 is to process the aligned first scene image In order to obtain the main body area and the background mask area, step 09 is to acquire the transformation matrix corresponding to the aligned second scene image when it is detected that the aligned second scene image has image distortion, and step 011 is to compare the The aligned second scene image is subjected to correction processing to obtain a corrected image. Step 05 is to fuse the aligned and color corrected subject area in the first scene with the aligned and distortion corrected second scene image to obtain a corrected image. target image. In another example, the alignment process of the first scene image and the second scene image may be performed after step 07 and performed before step 09 and step 011. At this time, aligning the first scene image and the second scene image is Align the distortion-corrected second scene image and the color overflow-corrected first scene image, step 05 is to fuse the aligned and color-corrected subject area in the first scene with the aligned and distortion-corrected first scene image. Second scene images to obtain target images.
本申请实施方式的图像获取方法中,采用不同的摄像头来分别获取第一场景图像和第二场景图像,则第一场景图像和第二场景图像可以被同时获取,两帧图像不存在获取的时间差,可以避免两帧图像的获取时间存在时间差时,导致融合时出现鬼影的问题。In the image acquisition method of the embodiment of the present application, different cameras are used to acquire the first scene image and the second scene image respectively, then the first scene image and the second scene image can be acquired at the same time, and there is no time difference between the acquisition of the two frames of images , which can avoid the problem of ghost images during fusion when there is a time difference between the acquisition times of the two frames of images.
当然,在其他实施方式中,第一场景图像和第二场景图像也可以由同一摄像头(例如图2所示的第一摄像头210或第二摄像头220)分时获取。当采用同一摄像头来获取第一场景图像和第二场景图像时,两帧图像是完全重叠的,此时不需要进行对齐处理,可以减小计算量。Of course, in other embodiments, the first scene image and the second scene image may also be acquired by the same camera (eg, the first camera 210 or the second camera 220 shown in FIG. 2 ) in a time-sharing manner. When the same camera is used to acquire the first scene image and the second scene image, the two frames of images are completely overlapped, and in this case, alignment processing is not required, and the amount of calculation can be reduced.
请参阅图15,本申请还包括一种图像处理装置150,图像处理装置150包括第一获取模块1510、第二获取模块1512、及图像融合模块1514。第一获取模块1510用于获取第一场景图像,第一场景图像包括主体区域,主体区域位于第一场景图像的景深区域。第二获取模块1512用于获取第二场景图像,第二场景图像的远景深不大于第一场景图像的近景深。图像融合模块1514用于融合主体区域和第二场景图像,以获得目标图像。Referring to FIG. 15 , the present application further includes an image processing apparatus 150 . The image processing apparatus 150 includes a first acquisition module 1510 , a second acquisition module 1512 , and an image fusion module 1514 . The first acquisition module 1510 is configured to acquire a first scene image, where the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image. The second acquisition module 1512 is configured to acquire a second scene image, where the far-field depth of the second scene image is not greater than the near-field depth of the first scene image. The image fusion module 1514 is used to fuse the subject area and the second scene image to obtain the target image.
本申请实施方式的图像处理装置150通过融合主体区域及第二场景图像来得到目标图像,由于第一 场景图像的主体区域位于第一场景图像的景深区域,清晰度较高,呈现给用户的视觉感受是清晰图像,而第二场景图像的远景深不大于第一场景图像的近景深,第二场景图像的清晰度较低,呈现给用户的视觉感受是模糊图像,即合成是清晰主体区域与直接由摄像头拍摄的模糊的第二场景图像,由此避免采用软件算法处理实现背景虚化,由此得到的目标图像的光学虚化效果好。The image processing apparatus 150 of the embodiment of the present application obtains the target image by fusing the subject area and the second scene image. Since the subject area of the first scene image is located in the depth of field area of the first scene image, the definition is high, and the visual image presented to the user is high. The feeling is a clear image, and the distant depth of field of the second scene image is not greater than the near depth of field of the first scene image, the second scene image has a lower definition, and the visual experience presented to the user is a blurred image, that is, the combination is a clear subject area and The blurred second scene image is directly captured by the camera, thereby avoiding the use of software algorithm processing to achieve background blur, and the obtained target image has a good optical blur effect.
在某些实施方式中,请参阅图15,图像处理装置150还可包括处理模块1516,处理模块1516用于处理第一场景图像以获得主体区域和背景掩膜区域。更具体地,处理模块1516还可用于通过主体识别检测网络处理第一场景图像,以获取第一场景图像的初始前景区域与初始背景区域;获取初始前景区域与初始背景区域交界处的色彩溢出区域,色彩溢出区域包括至少一个色彩溢出像素;及对色彩溢出像素进行色彩校正,以获取主体区域和背景掩膜区域。更进一步地,处理模块1516还可用于获取第一场景图像的深度信息;根据深度信息,生成与第一场景图像对应的中心权重图,中心权重图所表示的权重值从中心向边缘逐渐减小;将第一场景图像和中心权重图输入主体识别检测网络,获得第一场景图像的前景主体区域的置信度图;及根据前景主体区域的置信度图确定初始前景区域和初始背景区域。再进一步地,处理模块1516还可用于以每个色彩溢出像素为中心扩展预定范围以得到一个校正区域,校正区域包括前景区域像素及背景区域像素;获取校正区域内前景区域像素的像素值;根据校正区域内前景区域像素的像素值对色彩溢出像素进行校正以得到校正像素;及归并校正像素到初始前景区域,以获取主体区域和背景掩膜区域。又进一步地,处理模块1516还可用于以每个色彩溢出像素为中心扩展预定范围以得到一个校正区域,校正区域包括前景区域像素及背景区域像素;获取校正区域内背景区域像素的像素值;根据校正区域内背景区域像素的像素值对色彩溢出像素进行校正以得到校正像素;及归并校正像素到初始背景区域,以获取主体区域和背景掩膜区域。In some embodiments, please refer to FIG. 15 , the image processing apparatus 150 may further include a processing module 1516, and the processing module 1516 is configured to process the first scene image to obtain the subject area and the background mask area. More specifically, the processing module 1516 can also be used to process the first scene image through the subject recognition detection network to obtain the initial foreground area and the initial background area of the first scene image; obtain the color overflow area at the junction of the initial foreground area and the initial background area. , the color overflow area includes at least one color overflow pixel; and perform color correction on the color overflow pixel to obtain the main body area and the background mask area. Further, the processing module 1516 can also be used to obtain the depth information of the first scene image; according to the depth information, a center weight map corresponding to the first scene image is generated, and the weight value represented by the center weight map gradually decreases from the center to the edge. ; Input the first scene image and the center weight map into the subject recognition detection network to obtain the confidence map of the foreground subject area of the first scene image; and determine the initial foreground area and the initial background area according to the confidence map of the foreground subject area. Still further, the processing module 1516 can also be used to expand a predetermined range around each color overflow pixel to obtain a correction area, and the correction area includes pixels in the foreground area and pixels in the background area; obtain the pixel value of the pixels in the foreground area in the correction area; The pixel values of the foreground area pixels in the correction area are corrected for color overflow pixels to obtain corrected pixels; and the corrected pixels are merged into the original foreground area to obtain the subject area and the background mask area. Still further, the processing module 1516 can also be used to extend a predetermined range around each color overflow pixel to obtain a correction area, and the correction area includes pixels in the foreground area and pixels in the background area; obtain the pixel value of the pixels in the background area in the correction area; The pixel values of the background area pixels in the correction area are used to correct the color overflow pixels to obtain corrected pixels; and merge the corrected pixels into the original background area to obtain the main area and the background mask area.
在某些实施方式中,请参阅图15,图像融合模块1514还可用于将主体区域作为目标主体区域;融合背景掩膜区域及第二场景图像中的背景区域以得到目标背景区域;及根据目标主体区域及目标背景区域获取目标图像。In some embodiments, referring to FIG. 15 , the image fusion module 1514 can also be used to use the subject area as the target subject area; fuse the background mask area and the background area in the second scene image to obtain the target background area; and according to the target The subject area and the target background area acquire the target image.
在某些实施方式中,请参阅图15,图像处理装置150还可包括第三获取模块1518及第四获取模块1520。第三获取模块1518用于当检测到第二场景图像存在图像畸变时,获取第二场景图像对应的变换矩阵。第四获取模块1520用于根据变换矩阵对第二场景图像进行校正处理,获得校正图像。更进一步地,图像融合模块1514还可用于融合主体区域与校正图像,以获得目标图像。In some embodiments, please refer to FIG. 15 , the image processing apparatus 150 may further include a third acquisition module 1518 and a fourth acquisition module 1520 . The third obtaining module 1518 is configured to obtain a transformation matrix corresponding to the second scene image when it is detected that there is image distortion in the second scene image. The fourth obtaining module 1520 is configured to perform correction processing on the second scene image according to the transformation matrix to obtain a corrected image. Furthermore, the image fusion module 1514 can also be used to fuse the subject area and the corrected image to obtain the target image.
在某些实施方式中,请参阅图15,图像处理装置150还可包括第五获取模块1522、第六获取模块1524、匹配模块1526、确定模块1528及对齐模块1530。第五获取模块1522用于获取第一场景图像中的至少一个第一特征点;第六获取模块1524用于获取第二场景图像中的至少一个第二特征点;匹配模块1526用于将第一特征点和第二特征点进行匹配,获得至少一个特征点对;确定模块1528用于根据特征点对确定映射矩阵;对齐模块1530用于根据映射矩阵对齐第一场景图像及第二场景图像。In some embodiments, referring to FIG. 15 , the image processing apparatus 150 may further include a fifth acquisition module 1522 , a sixth acquisition module 1524 , a matching module 1526 , a determination module 1528 and an alignment module 1530 . The fifth acquisition module 1522 is used to acquire at least one first feature point in the first scene image; the sixth acquisition module 1524 is used to acquire at least one second feature point in the second scene image; the matching module 1526 is used to The feature points and the second feature points are matched to obtain at least one feature point pair; the determining module 1528 is used for determining a mapping matrix according to the feature point pair; the aligning module 1530 is used for aligning the first scene image and the second scene image according to the mapping matrix.
请参阅图16,本申请实施方式还提供一种计算机可读存储介质160,其上存储有计算机程序162,程序被处理器320执行的情况下,实现上述任意一种实施方式的图像处理方法的步骤,例如执行01、03、05、07、071、073、075、0711、0713、0715、0717、07511、07513、07515、07517、07521、07523、07525、07527、051、053、055、09、011、057、013、015、017、019及021中的方法。Referring to FIG. 16 , an embodiment of the present application further provides a computer-readable storage medium 160 on which a computer program 162 is stored. When the program is executed by the processor 320, the image processing method of any of the above-mentioned embodiments can be implemented. Steps, such as 01, 03, 05, 07, 071, 073, 075, 0711, 0713, 0715, 0717, 07511, 07513, 07515, 07517, 07521, 07523, 07525, 07527, 051, 053, 055, 09, Methods in 011, 057, 013, 015, 017, 019 and 021.
更具体地,例如,程序被处理器320执行的情况下,可实现以下图像处理方法的步骤:More specifically, for example, when the program is executed by the processor 320, the following steps of the image processing method can be implemented:
01:获取第一场景图像,第一场景图像包括主体区域,主体区域位于第一场景图像的景深区域;01: Acquire a first scene image, where the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image;
03:获取第二场景图像,第二场景图像的远景深不大于第一场景图像的近景深;及03: Acquire a second scene image, the far-field depth of the second scene image is not greater than the near-field depth of the first scene image; and
05:融合主体区域与第二场景图像,以获得目标图像。05: Fusion of the subject area and the second scene image to obtain the target image.
计算机可读存储介质160可设置在图像处理装置150或者电子设备200内,也可设置在云端服务器内,此时,图像处理装置100或者电子设备200能够与云端服务器进行通讯来获取到相应的计算机程序162。The computer-readable storage medium 160 may be set in the image processing apparatus 150 or the electronic device 200, or may be set in the cloud server. At this time, the image processing apparatus 100 or the electronic device 200 can communicate with the cloud server to obtain the corresponding computer. program 162.
可以理解,计算机程序162包括计算机程序代码。计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读存储介质可以包括:能够携带计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、以及软件分发介质等。It is understood that the computer program 162 includes computer program code. The computer program code may be in source code form, object code form, an executable file or some intermediate form, or the like. Computer-readable storage media may include: any entity or device capable of carrying computer program codes, recording media, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random storage Access memory (RAM, Random Access Memory), and software distribution media, etc.
在本说明书的描述中,参考术语“一个实施方式”、“一些实施方式”.“示意性实施方式”、“示例”、“具 体示例”、或“一些示例”等的描述意指结合所述实施方式或示例描述的具体特征.结构.材料或者特点包含于本申请的至少一个实施方式或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施方式或示例。而且,描述的具体特征.结构.材料或者特点可以在任何的一个或多个实施方式或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, reference is made to the terms "one embodiment", "some embodiments". The description of "exemplary embodiment", "example", "specific example", or "some examples" etc. is intended to incorporate the A particular feature, structure, material or characteristic described by an embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine the different embodiments or examples described in this specification, as well as the features of the different embodiments or examples, without conflicting each other.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块.片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any description of a process or method in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing a specified logical function or step of the process , and the scope of the preferred embodiments of the present application includes alternative implementations in which the functions may be performed out of the order shown or discussed, including performing the functions substantially concurrently or in the reverse order depending upon the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present application belong.
尽管上面已经示出和描述了本申请的实施方式,可以理解的是,上述实施方式是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施方式进行变化修改.替换和变型。Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limitations to the present application. Variations in the implementation. Modifications. Substitutions and variations.

Claims (22)

  1. 一种图像处理方法,其特征在于,包括:An image processing method, comprising:
    获取第一场景图像,所述第一场景图像包括主体区域,所述主体区域位于所述第一场景图像的景深区域;acquiring a first scene image, where the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image;
    获取第二场景图像,所述第二场景图像的远景深不大于所述第一场景图像的近景深;及acquiring a second scene image, the far depth of field of the second scene image is not greater than the near depth of field of the first scene image; and
    融合所述主体区域与所述第二场景图像,以获得目标图像。The subject area and the second scene image are fused to obtain a target image.
  2. 根据权利要求1所述的图像处理方法,其特征在于,还包括:The image processing method according to claim 1, further comprising:
    处理所述第一场景图像以获得所述主体区域和背景掩膜区域。The first scene image is processed to obtain the subject region and background mask region.
  3. 根据权利要求2所述的图像处理方法,其特征在于,所述处理所述第一场景图像,以获得所述主体区域和背景掩膜区域,包括:The image processing method according to claim 2, wherein the processing of the first scene image to obtain the subject area and the background mask area comprises:
    通过主体识别检测网络处理所述第一场景图像,以获取所述第一场景图像的初始前景区域与初始背景区域;Process the first scene image through a subject recognition detection network to obtain an initial foreground area and an initial background area of the first scene image;
    获取所述初始前景区域与所述初始背景区域交界处的色彩溢出区域,所述色彩溢出区域包括至少一个色彩溢出像素;及obtaining a color overflow area at the junction of the initial foreground area and the initial background area, the color overflow area including at least one color overflow pixel; and
    对所述色彩溢出像素进行色彩校正,以获取所述主体区域和背景掩膜区域。The color bleed pixels are color corrected to obtain the subject area and the background mask area.
  4. 根据权利要求3所述的图像处理方法,其特征在于,所述通过主体识别检测网络处理所述第一场景图像,以获取所述第一场景图像的初始前景区域与初始背景区域,包括:The image processing method according to claim 3, wherein the processing of the first scene image through a subject recognition detection network to obtain an initial foreground area and an initial background area of the first scene image includes:
    获取所述第一场景图像的深度信息;acquiring depth information of the first scene image;
    根据所述深度信息,生成与所述第一场景图像对应的中心权重图,所述中心权重图所表示的权重值从中心向边缘逐渐减小;According to the depth information, a center weight map corresponding to the first scene image is generated, and the weight value represented by the center weight map gradually decreases from the center to the edge;
    将所述第一场景图像和所述中心权重图输入所述主体识别检测网络,获得所述第一场景图像的前景区域的置信度图;及Inputting the first scene image and the center weight map into the subject recognition detection network to obtain a confidence map of the foreground region of the first scene image; and
    根据所述前景区域的置信度图确定初始前景区域和初始背景区域。An initial foreground area and an initial background area are determined according to the confidence map of the foreground area.
  5. 根据权利要求4所述的图像处理方法,其特征在于,The image processing method according to claim 4, wherein,
    所述获取第一场景图像的深度信息是通过双目视觉系统获取得到;或/和The depth information of the obtained first scene image is obtained through a binocular vision system; or/and
    所述获取第一场景图像的深度信息是通过单目视觉系统获取得到;或/和The obtained depth information of the first scene image is obtained through a monocular vision system; or/and
    所述获取第一场景图像的深度信息是通过结构光相机模组获取得到;或/和The depth information for obtaining the first scene image is obtained through a structured light camera module; or/and
    所述获取第一场景图像的深度信息是通过飞行时间相机模组获取得到。The acquired depth information of the first scene image is acquired through a time-of-flight camera module.
  6. 根据权利要求3所述的图像处理方法,其特征在于,所述对所述色彩溢出像素进行色彩校正,以获取所述主体区域和背景掩膜区域,包括:The image processing method according to claim 3, wherein the performing color correction on the color overflow pixels to obtain the main body area and the background mask area, comprising:
    以每个所述色彩溢出像素为中心扩展预定范围以得到一个校正区域,所述校正区域包括前景区域像素及背景区域像素;Extending a predetermined range around each of the color overflow pixels to obtain a correction area, the correction area includes pixels in the foreground area and pixels in the background area;
    获取所述校正区域内所述前景区域像素的像素值;obtaining the pixel value of the foreground area pixel in the correction area;
    根据所述校正区域内所述前景区域像素的像素值对所述色彩溢出像素进行校正以得到校正像素;及归并所述校正像素到所述初始前景区域,以获取所述主体区域和背景掩膜区域。Correcting the color overflow pixels according to the pixel values of the foreground area pixels in the correction area to obtain corrected pixels; and merging the corrected pixels into the initial foreground area to obtain the subject area and background mask area.
  7. 根据权利要求3所述的图像处理方法,其特征在于,所述对所述色彩溢出像素进行色彩校正,以获取所述主体区域和背景掩膜区域,包括:The image processing method according to claim 3, wherein the performing color correction on the color overflow pixels to obtain the main body area and the background mask area, comprising:
    以每个所述色彩溢出像素为中心扩展预定范围以得到一个校正区域,所述校正区域包括前景区域像素及背景区域像素;Extending a predetermined range around each of the color overflow pixels to obtain a correction area, the correction area includes pixels in the foreground area and pixels in the background area;
    获取所述校正区域内所述背景区域像素的像素值;obtaining the pixel value of the background area pixel in the correction area;
    根据所述校正区域内所述背景区域像素的像素值对所述色彩溢出像素进行校正以得到校正像素;及归并所述校正像素到所述初始背景区域,以获取所述主体区域和背景掩膜区域。Correcting the color overflow pixels according to the pixel values of the background area pixels in the correction area to obtain corrected pixels; and merging the corrected pixels into the initial background area to obtain the subject area and background mask area.
  8. 权利要求2所述的图像处理方法,其特征在于,所述第二场景图像为光学虚化图像,所述第一场景图像的清晰度高于所述第二场景图像;The image processing method of claim 2, wherein the second scene image is an optically blurred image, and the first scene image has a higher definition than the second scene image;
    所述融合所述主体区域与所述第二场景图像,以获得目标图像,包括:The fusion of the subject area and the second scene image to obtain a target image includes:
    将所述主体区域作为目标主体区域;融合所述背景掩膜区域及所述第二场景图像中的背景区域以得到目标背景区域;及using the subject area as a target subject area; fusing the background mask area and the background area in the second scene image to obtain a target background area; and
    根据所述目标主体区域及所述目标背景区域获取所述目标图像。The target image is acquired according to the target subject area and the target background area.
  9. 根据权利要求1至8任意一项所述的图像处理方法,其特征在于,还包括:The image processing method according to any one of claims 1 to 8, further comprising:
    当检测到所述第二场景图像存在图像畸变时,获取所述第二场景图像对应的变换矩阵;及When it is detected that there is image distortion in the second scene image, acquiring a transformation matrix corresponding to the second scene image; and
    根据所述变换矩阵对所述第二场景图像进行校正处理,获得校正图像;Perform correction processing on the second scene image according to the transformation matrix to obtain a corrected image;
    所述融合所述主体区域与所述第二场景图像,以获得目标图像,包括:The fusion of the subject area and the second scene image to obtain a target image includes:
    融合所述主体区域与所述校正图像,以获得所述目标图像。The subject region is fused with the corrected image to obtain the target image.
  10. 根据权利要求1-9任意一项所述的图像处理方法,其特征在于,所述第一场景图像及所述第二场景图像通过不同的摄像头获取,所述图像处理方法还包括:The image processing method according to any one of claims 1-9, wherein the first scene image and the second scene image are acquired by different cameras, and the image processing method further comprises:
    获取所述第一场景图像中的至少一个第一特征点;acquiring at least one first feature point in the first scene image;
    获取所述第二场景图像中的至少一个第二特征点;acquiring at least one second feature point in the second scene image;
    将所述第一特征点和所述第二特征点进行匹配,获得至少一个特征点对;Matching the first feature point and the second feature point to obtain at least one feature point pair;
    根据所述特征点对确定映射矩阵;及determining a mapping matrix from the pair of feature points; and
    根据所述映射矩阵对齐所述第一场景图像及所述第二场景图像。The first scene image and the second scene image are aligned according to the mapping matrix.
  11. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    存储器;及memory; and
    一个或多个处理器,一个或多个所述处理器与所述存储连接,一个或多个所述处理器用于:one or more processors, one or more of the processors connected to the storage, one or more of the processors for:
    获取第一场景图像,所述第一场景图像包括主体区域,所述主体区域位于所述第一场景图像的景深区域;acquiring a first scene image, where the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image;
    获取第二场景图像,所述第二场景图像的远景深不大于所述第一场景图像的近景深;及acquiring a second scene image, the far depth of field of the second scene image is not greater than the near depth of field of the first scene image; and
    融合所述主体区域与所述第二场景图像,以获得目标图像。The subject area and the second scene image are fused to obtain a target image.
  12. 根据权利要求11所述的电子设备,其特征在于,所述处理器还用于:The electronic device according to claim 11, wherein the processor is further configured to:
    处理所述第一场景图像以获得所述主体区域和背景掩膜区域。The first scene image is processed to obtain the subject region and background mask region.
  13. 根据权利要求12所述的电子设备,其特征在于,所述处理器还用于:The electronic device according to claim 12, wherein the processor is further configured to:
    通过主体识别检测网络处理所述第一场景图像,以获取所述第一场景图像的初始前景区域与初始背景区域;Process the first scene image through a subject recognition detection network to obtain an initial foreground area and an initial background area of the first scene image;
    获取所述初始前景区域与所述初始背景区域交界处的色彩溢出区域,所述色彩溢出区域包括至少一个色彩溢出像素;及obtaining a color overflow area at the junction of the initial foreground area and the initial background area, the color overflow area including at least one color overflow pixel; and
    对所述色彩溢出像素进行色彩校正,以获取所述主体区域和背景掩膜区域。The color bleed pixels are color corrected to obtain the subject area and the background mask area.
  14. 根据权利要求13所述的电子设备,其特征在于,所述处理器还用于:The electronic device according to claim 13, wherein the processor is further configured to:
    获取所述第一场景图像的深度信息;acquiring depth information of the first scene image;
    根据所述深度信息,生成与所述第一场景图像对应的中心权重图,所述中心权重图所表示的权重值从中心向边缘逐渐减小;According to the depth information, a center weight map corresponding to the first scene image is generated, and the weight value represented by the center weight map gradually decreases from the center to the edge;
    将所述第一场景图像和所述中心权重图输入所述主体识别检测网络,获得所述第一场景图像的前景区域的置信度图;及Inputting the first scene image and the center weight map into the subject recognition detection network to obtain a confidence map of the foreground region of the first scene image; and
    根据所述前景区域的置信度图确定所述初始前景区域和初始背景区域。The initial foreground area and the initial background area are determined according to the confidence map of the foreground area.
  15. 根据权利要求14所述的电子设备,其特征在于,所述电子设备还包括:The electronic device according to claim 14, wherein the electronic device further comprises:
    双目视觉系统,所述双目视觉系统用于获取第一场景图像的深度信息;或/和A binocular vision system for acquiring depth information of the first scene image; or/and
    单目视觉系统,所述单目视觉系统用于获取第一场景图像的深度信息;或/和A monocular vision system for acquiring depth information of the first scene image; or/and
    结构光相机模组,所述结构光相机模组用于获取第一场景图像的深度信息;或/和A structured light camera module, the structured light camera module is used to obtain the depth information of the first scene image; or/and
    飞行时间相机模组,所述飞行时间相机模组用于获取第一场景图像的深度信息。A time-of-flight camera module, the time-of-flight camera module is used to obtain depth information of the first scene image.
  16. 根据权利要求13所述的电子设备,其特征在于,所述处理器还用于:The electronic device according to claim 13, wherein the processor is further configured to:
    以每个所述色彩溢出像素为中心扩展预定范围以得到一个校正区域,所述校正区域包括前景区域像素及背景区域像素;Extending a predetermined range around each of the color overflow pixels to obtain a correction area, the correction area includes pixels in the foreground area and pixels in the background area;
    获取所述校正区域内所述前景区域像素的像素值;obtaining the pixel value of the foreground area pixel in the correction area;
    根据所述校正区域内所述前景区域像素的像素值对所述色彩溢出像素进行校正以得到校正像素;及归并所述校正像素到所述初始前景区域,以获取所述主体区域和背景掩膜区域。Correcting the color overflow pixels according to the pixel values of the foreground area pixels in the correction area to obtain corrected pixels; and merging the corrected pixels into the initial foreground area to obtain the subject area and background mask area.
  17. 根据权利要求13所述的电子设备,其特征在于,所述处理器还用于:The electronic device according to claim 13, wherein the processor is further configured to:
    以每个所述色彩溢出像素为中心扩展预定范围以得到一个校正区域,所述校正区域包括前景区域像素及背景区域像素;Extending a predetermined range around each of the color overflow pixels to obtain a correction area, the correction area includes pixels in the foreground area and pixels in the background area;
    获取所述校正区域内所述背景区域像素的像素值;obtaining the pixel value of the background area pixel in the correction area;
    根据所述校正区域内所述背景区域像素的像素值对所述色彩溢出像素进行校正以得到校正像素;及归并所述校正像素到所述初始背景区域,以获取所述主体区域和背景掩膜区域。Correcting the color overflow pixels according to the pixel values of the background area pixels in the correction area to obtain corrected pixels; and merging the corrected pixels into the initial background area to obtain the subject area and background mask area.
  18. 权利要求12所述的电子设备,其特征在于,所述第二场景图像为光学虚化图像,所述第一场景图像的清晰度高于所述第二场景图像;所述处理器还用于:The electronic device according to claim 12, wherein the second scene image is an optical blurred image, and the definition of the first scene image is higher than that of the second scene image; the processor is further configured to :
    将所述主体区域作为目标主体区域;融合所述背景掩膜区域及所述第二场景图像中的背景区域以得到目标背景区域;及using the subject area as a target subject area; fusing the background mask area and the background area in the second scene image to obtain a target background area; and
    根据所述目标主体区域及所述目标背景区域获取所述目标图像。The target image is acquired according to the target subject area and the target background area.
  19. 根据权利要求11至18任意一项所述的电子设备,其特征在于,所述处理器还用于:The electronic device according to any one of claims 11 to 18, wherein the processor is further configured to:
    当检测到所述第二场景图像存在图像畸变时,获取所述第二场景图像对应的变换矩阵;及When it is detected that there is image distortion in the second scene image, acquiring a transformation matrix corresponding to the second scene image; and
    根据所述变换矩阵对第二场景图像进行校正处理,获得校正图像;Perform correction processing on the second scene image according to the transformation matrix to obtain a corrected image;
    所述融合所述主体区域与所述第二场景图像,以获得目标图像,包括:The fusion of the subject area and the second scene image to obtain a target image includes:
    融合所述主体区域与所述校正图像,以获得所述目标图像。The subject region is fused with the corrected image to obtain the target image.
  20. 根据权利要求11-19任意一项所述的电子设备,其特征在于,所述第一场景图像及所述第二场景图像通过不同的摄像头获取,所述处理器还用于:The electronic device according to any one of claims 11-19, wherein the first scene image and the second scene image are acquired by different cameras, and the processor is further configured to:
    获取所述第一场景图像中的至少一个第一特征点;acquiring at least one first feature point in the first scene image;
    获取所述第二场景图像中的至少一个第二特征点;acquiring at least one second feature point in the second scene image;
    将所述第一特征点和所述第二特征点进行匹配,获得至少一个特征点对;Matching the first feature point and the second feature point to obtain at least one feature point pair;
    根据所述特征点对确定映射矩阵;及determining a mapping matrix from the pair of feature points; and
    根据所述映射矩阵对齐所述第一场景图像及所述第二场景图像。The first scene image and the second scene image are aligned according to the mapping matrix.
  21. 一种图像处理装置,其特征在于,包括:An image processing device, comprising:
    第一获取模块,用于获取第一场景图像,所述第一场景图像包括主体区域,所述主体区域位于所述第一场景图像的景深区域;a first acquisition module, configured to acquire a first scene image, where the first scene image includes a subject area, and the subject area is located in a depth-of-field area of the first scene image;
    第二获取模块,用于获取第二场景图像,所述第二场景图像的远景深不大于所述第一场景图像的近景深;及a second acquisition module, configured to acquire a second scene image, the far depth of field of the second scene image is not greater than the near depth of field of the first scene image; and
    图像融合模块,用于融合所述主体区域和所述第二场景图像,以获得目标图像。An image fusion module, configured to fuse the subject area and the second scene image to obtain a target image.
  22. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现根据权利要求1至10中任一项所述的方法的步骤。A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
PCT/CN2020/102502 2020-07-16 2020-07-16 Image processing method and apparatus, electronic device, and computer-readable storage medium WO2022011657A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/102502 WO2022011657A1 (en) 2020-07-16 2020-07-16 Image processing method and apparatus, electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/102502 WO2022011657A1 (en) 2020-07-16 2020-07-16 Image processing method and apparatus, electronic device, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
WO2022011657A1 true WO2022011657A1 (en) 2022-01-20

Family

ID=79554436

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/102502 WO2022011657A1 (en) 2020-07-16 2020-07-16 Image processing method and apparatus, electronic device, and computer-readable storage medium

Country Status (1)

Country Link
WO (1) WO2022011657A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114862735A (en) * 2022-05-23 2022-08-05 Oppo广东移动通信有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050047672A1 (en) * 2003-06-17 2005-03-03 Moshe Ben-Ezra Method for de-blurring images of moving objects
CN105847674A (en) * 2016-03-25 2016-08-10 维沃移动通信有限公司 Preview image processing method based on mobile terminal, and mobile terminal therein
CN106791416A (en) * 2016-12-29 2017-05-31 努比亚技术有限公司 A kind of background blurring image pickup method and terminal
CN107707809A (en) * 2017-08-17 2018-02-16 捷开通讯(深圳)有限公司 A kind of method, mobile device and the storage device of image virtualization
CN110428366A (en) * 2019-07-26 2019-11-08 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment, computer readable storage medium
CN110969595A (en) * 2019-12-02 2020-04-07 成都索贝数码科技股份有限公司 Pure-color background matting and synthesizing method based on real-time background color overflow inhibition
CN111212231A (en) * 2020-01-16 2020-05-29 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050047672A1 (en) * 2003-06-17 2005-03-03 Moshe Ben-Ezra Method for de-blurring images of moving objects
CN105847674A (en) * 2016-03-25 2016-08-10 维沃移动通信有限公司 Preview image processing method based on mobile terminal, and mobile terminal therein
CN106791416A (en) * 2016-12-29 2017-05-31 努比亚技术有限公司 A kind of background blurring image pickup method and terminal
CN107707809A (en) * 2017-08-17 2018-02-16 捷开通讯(深圳)有限公司 A kind of method, mobile device and the storage device of image virtualization
CN110428366A (en) * 2019-07-26 2019-11-08 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment, computer readable storage medium
CN110969595A (en) * 2019-12-02 2020-04-07 成都索贝数码科技股份有限公司 Pure-color background matting and synthesizing method based on real-time background color overflow inhibition
CN111212231A (en) * 2020-01-16 2020-05-29 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114862735A (en) * 2022-05-23 2022-08-05 Oppo广东移动通信有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
KR102278776B1 (en) Image processing method, apparatus, and apparatus
CN107977940B (en) Background blurring processing method, device and equipment
WO2018201809A1 (en) Double cameras-based image processing device and method
US10825146B2 (en) Method and device for image processing
CN107945105B (en) Background blurring processing method, device and equipment
CN110691193B (en) Camera switching method and device, storage medium and electronic equipment
CN107509031B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
WO2019105261A1 (en) Background blurring method and apparatus, and device
WO2019105214A1 (en) Image blurring method and apparatus, mobile terminal and storage medium
CN108076278B (en) Automatic focusing method and device and electronic equipment
US9313419B2 (en) Image processing apparatus and image pickup apparatus where image processing is applied using an acquired depth map
US8335393B2 (en) Image processing apparatus and image processing method
WO2021057474A1 (en) Method and apparatus for focusing on subject, and electronic device, and storage medium
WO2019109805A1 (en) Method and device for processing image
EP3480784B1 (en) Image processing method, and device
US9131145B2 (en) Image pickup apparatus and control method therefor
KR20130061636A (en) System and method for generating robust depth maps utilizing a multi-resolution procedure
US9619886B2 (en) Image processing apparatus, imaging apparatus, image processing method and program
WO2019105254A1 (en) Background blur processing method, apparatus and device
WO2018228329A1 (en) Focusing control method and device, computer storable medium and mobile terminal
WO2019105260A1 (en) Depth of field obtaining method, apparatus and device
JP2014138290A (en) Imaging device and imaging method
CN110365897B (en) Image correction method and device, electronic equipment and computer readable storage medium
WO2022011657A1 (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
CN117058183A (en) Image processing method and device based on double cameras, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20945041

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20945041

Country of ref document: EP

Kind code of ref document: A1