WO2021115179A1 - 图像处理方法、图像处理装置、存储介质与终端设备 - Google Patents

图像处理方法、图像处理装置、存储介质与终端设备 Download PDF

Info

Publication number
WO2021115179A1
WO2021115179A1 PCT/CN2020/133407 CN2020133407W WO2021115179A1 WO 2021115179 A1 WO2021115179 A1 WO 2021115179A1 CN 2020133407 W CN2020133407 W CN 2020133407W WO 2021115179 A1 WO2021115179 A1 WO 2021115179A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
camera
area
foreground area
foreground
Prior art date
Application number
PCT/CN2020/133407
Other languages
English (en)
French (fr)
Inventor
江波
Original Assignee
RealMe重庆移动通信有限公司
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 RealMe重庆移动通信有限公司 filed Critical RealMe重庆移动通信有限公司
Publication of WO2021115179A1 publication Critical patent/WO2021115179A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/45Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from two or more image sensors being of different type or operating in different modes, e.g. with a CMOS sensor for moving images in combination with a charge-coupled device [CCD] for still images
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/951Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • the present disclosure relates to the field of image processing technology, and in particular to an image processing method, an image processing device, a computer-readable storage medium, and terminal equipment.
  • high-definition cameras cameras with millions or even tens of millions of pixels (referred to as high-definition cameras) are usually used on mobile phones, which can support the shooting of ultra-high-definition photos.
  • the present disclosure provides an image processing method, an image processing device, a computer-readable storage medium, and a terminal device, thereby improving the quality of images captured by an existing high-definition camera at least to a certain extent.
  • an image processing method is provided, which is applied to a terminal device.
  • the terminal device at least includes a first camera and a second camera with different numbers of pixels, and the number of pixels of the first camera is higher than that of the A second camera; the method includes: acquiring a first image collected by the first camera and a second image collected by the second camera; identifying the foreground area in the first image, and receiving the data from the first image Extracting a foreground area image from the image; obtaining a target image according to the foreground area image and the second image.
  • an image processing device configured in a terminal device.
  • the terminal device includes at least a first camera and a second camera with different numbers of pixels, and the number of pixels of the first camera is higher than that of the second camera.
  • the device includes a processor; the processor is used to execute the following program modules stored in the memory: an image acquisition module for acquiring the first image collected by the first camera and the first image collected by the second camera Two images; the foreground area recognition module, used to identify the foreground area in the first image, and extract the foreground area image from the first image; the target image acquisition module, used to identify the foreground area image according to the foreground area image and the The second image is to obtain the target image.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned image processing method is realized.
  • a terminal device including: a processor; a memory for storing executable instructions of the processor; a first camera; and a second camera; wherein the processor is configured to The above-mentioned image processing method is executed by executing the executable instruction.
  • the first image and the second image are respectively collected by the first camera and the second camera of the terminal device, and the foreground area image is extracted from the first image, according to the The foreground area image and the second image obtain the final target image.
  • the first camera is a high-definition camera with a higher number of pixels than the second camera. Therefore, the first image has a higher definition and contains more detailed information. It retains the foreground part and merges with the second image.
  • the processing of images is a software algorithm process, which can be realized by using the camera configuration of the existing terminal equipment without changing the hardware, thereby saving costs and having high practicability.
  • Fig. 1 shows a flowchart of an image processing method in this exemplary embodiment
  • Fig. 2 shows a sub-flow chart of image processing in this exemplary embodiment
  • FIG. 3 shows another sub-flow chart of image processing in this exemplary embodiment
  • FIG. 4 shows a schematic diagram of a color filter array in this exemplary embodiment
  • FIG. 5 shows a schematic diagram of acquiring a first image in this exemplary embodiment
  • FIG. 6 shows a schematic flowchart of image processing in this exemplary embodiment
  • Fig. 7 shows a structural block diagram of an image processing device in this exemplary embodiment
  • Fig. 8 shows a structural block diagram of another image processing device in this exemplary embodiment
  • FIG. 9 shows a computer-readable storage medium for implementing the above-mentioned method in this exemplary embodiment
  • Fig. 10 shows a terminal device for implementing the above method in this exemplary embodiment.
  • High-definition cameras have certain limitations, such as: the amount of image data captured is large, and they occupy more storage space; the requirements for the lighting conditions when taking pictures are higher, and they are susceptible to crosstalk under non-high light conditions, resulting in the shooting There is more noise in the image of.
  • exemplary embodiments of the present disclosure provide an image processing method, which can be applied to terminal devices such as mobile phones, tablet computers, and digital cameras.
  • the terminal device is configured with at least two cameras with different pixel numbers, including a first camera and a second camera.
  • the first camera is a high-definition camera, and its number of pixels is higher than that of the second camera.
  • Figure 1 shows a flow of the method, which may include the following steps S110 to S130:
  • Step S110 Acquire a first image collected by the first camera and a second image collected by the second camera.
  • the first image and the second image are images collected at the same time for the same scene or the same target (there may also be a time difference of milliseconds, which is not limited in this disclosure).
  • the number of pixels (or resolution) of the first image is ) Is higher than the second image.
  • the first camera and the second camera can capture images at the same time.
  • the main content of the first image and the second image are the same, but the viewing ranges of the first camera and the second camera may be different, resulting in different background ranges of the first image and the second image.
  • the second camera is a wide-angle camera, its viewing range is larger, and a larger area of background image around the target can be captured.
  • the first image has a smaller range and usually corresponds to the middle area of the second image.
  • Step S120 Identify the foreground area in the first image, and extract the foreground area image from the first image.
  • an image contains foreground and background areas, and the foreground area is generally the part that needs to be highlighted when taking pictures. After identifying the foreground area in the first image, it can be cut out from the first image to obtain the foreground area image.
  • the foreground area may be identified through the following steps S210 and S220:
  • Step S210 detecting whether the first image contains a human face area
  • Step S220 When it is detected that the first image contains a human face area, the human face area is taken as the foreground area.
  • the detection of the face area can be realized by color and shape detection, for example, the color range and the shape range of the face part are preset to detect whether there is a partial area that satisfies both the color range and the shape range in the first image.
  • Deep learning techniques can also be used, such as YOLO (You Look Only Once, an algorithm framework for real-time target detection, including v1, v2, v3, etc.), and this disclosure can use any one of them), SSD (Single Shot) Multibox Detector, single-step multi-frame target detection), R-CNN (Region-Convolutional Neural Network, regional convolutional neural network, or improved versions such as Fast R-CNN, Faster R-CNN) and other neural networks for face region detection .
  • the face area can be marked with a rectangular frame and extracted as the foreground area.
  • the present disclosure does not limit the specific shape of the foreground area.
  • step S230 may be performed.
  • the foreground area is determined according to the depth information of the first image.
  • the depth of field information can be used to determine the distance range between each area in the first image and the camera, and the important part (or the part with higher definition) is determined as the foreground area, such as the area on the depth of focus plane, or in the allowable The area within the circle of confusion, etc.
  • the depth information of the first image can be calculated based on the parallax between the first image and the second image, combined with the inherent parameters of the first camera and the second camera, and the photographing parameters, and the result obtained is more accurate.
  • the face when recognizing the foreground area, the face is detected first, and the face area is used as the foreground area. This is because when the image contains a face, the face is generally the part that needs to be presented, and face detection Compared with general target detection, it is easier to implement; when the first image does not contain a human face, the foreground area is determined according to the depth information, so that the detected foreground area is more complete and accurate.
  • the foreground area can also be identified based on user operations. Specifically, when taking a photo and previewing it, the user usually needs to click on a specific location (such as a face, a target object, etc.) in the screen to focus. It can record the user's click position. After the first image is collected, the recognition is performed based on the position. The detection frame can be gradually enlarged with this position as the center until a complete target, such as a human face or a complete object, is detected in the detection frame And so on, regard the area within the detection frame as the foreground area.
  • a specific location such as a face, a target object, etc.
  • Step S130 Obtain a target image according to the foreground area image and the second image.
  • the foreground area image is extracted from the first image, and its pixel count is relatively high and the detailed information is rich. In comparison, although the second image has a lower number of pixels, the amount of data is smaller and there is less noise.
  • the two images can be fused, and the respective advantages of the two images can be integrated to output a higher quality target image.
  • step S130 may be specifically implemented by the following steps S310 to S330:
  • Step S310 Determine the corresponding area of the foreground area in the second image according to the mapping relationship between the first image and the second image;
  • Step S320 removing the above-mentioned corresponding area from the second image to obtain a background area image
  • step S330 the foreground area image and the background area image are spliced to output the target image.
  • the mapping relationship mainly refers to the mapping of pixel positions, for example, which pixel point in the first image corresponds to which pixel point or points in the second image.
  • the number of pixels of the first camera can be set to be an integer multiple of the second camera, for example, the first camera has 64 million pixels, the second camera has 16 million pixels, and two If the ratio is 4:1, the 2*2 pixel in the first image corresponds to one pixel in the second image.
  • the mapping relationship between the first image and the second image can be determined according to the parameters of the first camera and the second camera: if the number of wide angles of the first camera and the second camera are the same (or the first camera and the second camera are both non-wide-angle cameras) Generally, the viewing area of the two is the same, the mapping relationship can be determined according to the ratio of the number of pixels of the two; if the number of wide angles of the first camera and the second camera are different (or one is a wide-angle camera and the other is a non-wide-angle camera), two The viewing area of the person is different. Usually the viewing area of the non-wide-angle camera is in the middle of the wide-angle camera.
  • the first camera is a non-wide-angle camera and the second camera is a wide-angle camera
  • the corresponding area of the foreground area in the second image can be determined. For example, each pixel at the boundary of the foreground area in the first image is mapped to the second image to form the corresponding area in the second image. After removing the corresponding area from the second image, the remaining part is the background area image, for example, the background area image may be a border shape. Then the foreground area image and the background area image are stitched together to synthesize an image, which is the final output target image.
  • the first image and the second image when acquiring the first image and the second image, the first image and the second image can be registered, and the mapping relationship between the first image and the second image can be determined. Due to the positional difference between the first camera and the second camera, the first image and the second image have a viewing angle deviation. After registration, the target in the first image and the second image can be better matched, thereby achieving more Accurate mapping is conducive to subsequent image fusion.
  • the telephoto camera may be set as the first camera, and the wide-angle (or ultra-wide-angle) camera may be set as the second camera.
  • the telephoto camera to shoot the first image can capture the image of the foreground area more clearly and collect richer detailed information, which is especially suitable for shooting human faces or distant scenes.
  • Using a wide-angle camera to take a second image can capture a larger range of scenes and make the image content more complete. In this way, when fusing the foreground area image and the second image, the advantages of telephoto shooting the foreground and the wide-angle shooting of the large-area background can be integrated, and the quality of the target image is higher.
  • the terminal device may include three or more than three cameras.
  • the terminal equipment is equipped with a wide-angle camera, a telephoto camera, and a macro camera; when shooting a long view, the telephoto camera can be set as the first camera, and the wide-angle camera can be set as the second camera; when shooting close-up shots, the macro can be set The camera is set as the first camera, the wide-angle camera is set as the second camera, and so on. This disclosure does not limit this.
  • the present disclosure provides the following exemplary solutions:
  • Solution 1 Store the foreground area image and the second image in the background. When the user views the image, the two images are merged into the target image and displayed.
  • Solution 2 Store the foreground area image and the background area image in the background.
  • the background area image can be encoded using predictive coding and other methods, with a small amount of data.
  • the two images are spliced into the target image and displayed.
  • Solution three directly encode the target image and store it. Since there are two pixel parameters in the target image, a flag bit can be added before the encoding of each pixel to mark which pixel parameter the pixel is, or nested In this way, the second image or the background area image in the target image is the main image, and the foreground area image is nested into it for encoding.
  • the first camera may be a camera based on a Quad Bayer color filter array.
  • the left figure shows the standard Bayer color filter array
  • the unit array of the filter is GRBG (or BGGR, GBRG, RGGB)
  • most cameras (or image sensors) use standard Bayer color filters Array
  • the right picture in Figure 4 shows a four-Bayer color filter array.
  • the four adjacent cells in the filter unit array are of the same color.
  • some high-pixel cameras (or image sensors) use a four-Bayer color filter array . Based on this, acquiring the first image collected by the first camera may specifically include:
  • De-mosaic processing and demosaic processing are performed on the original Bayer image to obtain the first image.
  • the Bayer image refers to an image in RAW format, which is image data after the image sensor converts the collected light signal into a digital signal.
  • each pixel has only one color in RGB.
  • the original image data obtained after the image is captured by the first camera is the original Bayer image.
  • the color arrangement of the pixels in the image is as shown in the right figure in Figure 4, and the four adjacent pixels are of the same color. .
  • Remosaic refers to fusing the original Bayer image based on the four Bayer color filter array into a Bayer image based on the standard Bayer color filter array; demosaic refers to fusing the Bayer image into a complete RGB image.
  • the original Bayer image E can be demosaiced to obtain the Bayer image F based on the standard Bayer color filter array; then the Bayer image F based on the standard Bayer color filter array can be demosaiced to obtain the RGB format The first image K.
  • Demosaicing and demosaicing can be implemented by different interpolation algorithms, and can also be implemented by other related algorithms such as neural networks, which are not limited in the present disclosure.
  • the terminal device is usually equipped with an ISP (Image Signal Processing, image signal processing) unit that is matched with the camera to perform the above-mentioned demosaic and demosaic processing process.
  • ISP Image Signal Processing, image signal processing
  • Each pixel of the first image K has pixel values of three channels of RGB, denoted by C.
  • the process of demosaicing and demosaicing can also be combined into one interpolation process, that is, based on the pixel data in the original Bayer image, each pixel is directly interpolated to obtain the pixel value of the missing color channel. For example, you can Use linear interpolation, mean interpolation and other algorithms to achieve, so as to obtain the first image.
  • Fig. 6 shows a schematic flow of image processing.
  • the 64-megapixel telephoto camera is activated as the first camera
  • the 16-megapixel ultra-wide-angle camera is activated as the second camera. Both cameras collect images at the same time to execute step S601 and step S601.
  • Step S601 the first image is acquired by the first camera
  • Step S602 the second image is acquired by the second camera
  • Step S603 detecting whether the first image contains a face area, if yes, execute step S604, if not, execute steps S605 and S606;
  • Step S604 extract a face area from the first image
  • Step S605 detecting the depth information of the first image
  • Step S606 Determine the foreground area according to the depth of field information, and extract it from the first image
  • Step S607 Obtain the foreground area image in the first image by extracting the face area described above, or extracting the foreground area according to the depth of field information;
  • Step S608 is executed again to fuse the foreground area image into the second image
  • step S609 is executed to output the target image.
  • the target image can be displayed.
  • the first image and the second image are respectively collected by the first camera and the second camera of the terminal device, and the foreground area image is extracted from the first image and merged into the second image To output the final target image.
  • the first camera is a high-definition camera with a higher number of pixels than the second camera. Therefore, the first image has a higher definition and contains more detailed information. It retains the foreground part and merges with the second image.
  • the processing of images is a software algorithm process, which can be realized by using the camera configuration of the existing terminal equipment without changing the hardware, thereby saving costs and having high practicability.
  • Exemplary embodiments of the present disclosure also provide another image processing device that can be configured in a terminal device.
  • the terminal device at least includes a first camera and a second camera with different numbers of pixels.
  • the number of pixels of the first camera is higher than that of the second camera.
  • the image processing apparatus 700 may include a processor 710 and a memory 720; wherein, the memory 720 stores the following program modules:
  • the image acquisition module 721 is configured to acquire the first image collected by the first camera and the second image collected by the second camera;
  • the foreground area recognition module 722 is used to recognize the foreground area in the first image and extract the foreground area image from the first image;
  • the target image obtaining module 723 is configured to obtain a target image according to the foreground area image and the second image;
  • the processor 710 is configured to execute the foregoing program modules.
  • the foreground area recognition module 722 is configured to:
  • the face area is taken as the foreground area.
  • the foreground area recognition module 722 is configured to:
  • the foreground area is determined according to the depth information of the first image.
  • the target image obtaining module 723 may include:
  • a corresponding area determining unit configured to determine the corresponding area of the foreground area in the second image according to the mapping relationship between the first image and the second image;
  • the corresponding area removing unit is configured to remove the above-mentioned corresponding area from the second image to obtain a background area image
  • the image stitching unit is used to stitch the foreground area image and the background area image to output the target image.
  • the image acquisition module 721 is configured to:
  • the first image and the second image are acquired, the first image and the second image are registered, and the mapping relationship between the first image and the second image is determined.
  • the memory 720 further stores an image storage module for storing the foreground area image and the second image.
  • the target image obtaining module 723 is configured to:
  • the foreground area image and the second image are merged into the target image and displayed.
  • the first camera is a camera based on a four-Bayer color filter array.
  • the image acquisition module 721 is configured to:
  • De-mosaic processing and demosaic processing are performed on the original Bayer image to obtain the first image.
  • the first camera may be a telephoto camera
  • the second camera may be a wide-angle camera
  • Exemplary embodiments of the present disclosure also provide another image processing device, which can be configured in a terminal device.
  • the terminal device at least includes a first camera and a second camera with different numbers of pixels.
  • the number of pixels of the first camera is higher than that of the second camera.
  • the image processing apparatus 800 may include:
  • the image acquisition module 810 is configured to acquire a first image collected by a first camera and a second image collected by a second camera;
  • the foreground area recognition module 820 is used to recognize the foreground area in the first image and extract the foreground area image from the first image;
  • the target image obtaining module 830 is configured to obtain a target image according to the foreground area image and the second image.
  • the foreground area recognition module 820 is configured to:
  • the face area is taken as the foreground area.
  • the foreground area recognition module 820 is configured to:
  • the foreground area is determined according to the depth information of the first image.
  • the target image obtaining module 830 may include:
  • a corresponding area determining unit configured to determine the corresponding area of the foreground area in the second image according to the mapping relationship between the first image and the second image;
  • the corresponding area removing unit is configured to remove the above-mentioned corresponding area from the second image to obtain a background area image
  • the image stitching unit is used to stitch the foreground area image and the background area image to output the target image.
  • the image acquisition module 810 is configured to:
  • the first image and the second image are acquired, the first image and the second image are registered, and the mapping relationship between the first image and the second image is determined.
  • the image processing device 800 further includes an image storage module for storing the foreground area image and the second image.
  • the target image obtaining module 830 is configured to:
  • the foreground area image and the second image are merged into the target image and displayed.
  • the first camera is a camera based on a four-Bayer color filter array.
  • the image acquisition module 810 is configured to:
  • De-mosaic processing and demosaic processing are performed on the original Bayer image to obtain the first image.
  • the first camera may be a telephoto camera
  • the second camera may be a wide-angle camera
  • the number of pixels of the first camera may be an integer multiple of that of the second camera.
  • Exemplary embodiments of the present disclosure also provide a computer-readable storage medium, which can be implemented in the form of a program product, which includes program code.
  • program product runs on a terminal device
  • program code is used to make the terminal device Perform the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.
  • a program product 900 for implementing the above method according to an exemplary embodiment of the present disclosure may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be used in a terminal Running on equipment, such as a personal computer.
  • CD-ROM compact disk read-only memory
  • the program product of the present disclosure is not limited thereto.
  • the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device, or device.
  • the program product can adopt any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device.
  • the program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
  • the program code for performing the operations of the present disclosure can be written in any combination of one or more programming languages.
  • the programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural programming. Language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on.
  • the remote computing device can be connected to a user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (for example, using Internet service providers). Business to connect via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service providers for example, using Internet service providers
  • Exemplary embodiments of the present disclosure also provide a terminal device capable of implementing the above method.
  • the terminal device may be a mobile phone, a tablet computer, a digital camera, or the like.
  • the terminal device 1000 according to this exemplary embodiment of the present disclosure will be described below with reference to FIG. 10.
  • the terminal device 1000 shown in FIG. 10 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
  • the terminal device 1000 may be represented in the form of a general-purpose computing device.
  • the components of the terminal device 1000 may include but are not limited to: at least one processing unit 1010, at least one storage unit 1020, a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010), a display unit 1040, and an image acquisition unit 1070,
  • the image acquisition unit 1070 includes a first camera and a second camera, which can be used to acquire images, and the number of pixels of the first camera is higher than that of the second camera.
  • the storage unit 1020 stores program codes, and the program codes can be executed by the processing unit 1010, so that the processing unit 1010 executes the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Method" section of this specification.
  • the processing unit 1010 may execute the method steps shown in FIG. 1, FIG. 2 or FIG. 3.
  • the storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 1021 and/or a cache storage unit 1022, and may further include a read-only storage unit (ROM) 1023.
  • RAM random access storage unit
  • ROM read-only storage unit
  • the storage unit 1020 may also include a program/utility tool 1024 having a set (at least one) program module 1025.
  • program module 1025 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples or some combination may include the implementation of a network environment.
  • the bus 1030 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure among multiple bus structures. bus.
  • the terminal device 1000 can also communicate with one or more external devices 1100 (such as keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable users to interact with the terminal device 1000, and/or communicate with Any device (such as a router, modem, etc.) that enables the terminal device 1000 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 1050.
  • the terminal device 1000 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 1060. As shown in the figure, the network adapter 1060 communicates with other modules of the terminal device 1000 through the bus 1030.
  • LAN local area network
  • WAN wide area network
  • public network such as the Internet
  • terminal device 1000 can be used in conjunction with the terminal device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
  • the example embodiments described here can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the exemplary embodiment of the present disclosure.
  • a computing device which may be a personal computer, a server, a terminal device, or a network device, etc.
  • modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory.
  • the features and functions of two or more modules or units described above may be embodied in one module or unit.
  • the features and functions of a module or unit described above can be further divided into multiple modules or units to be embodied.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Studio Devices (AREA)

Abstract

一种图像处理方法、图像处理装置、存储介质与终端设备。所述方法应用于终端设备,所述终端设备至少包括像素数不同的第一摄像头和第二摄像头,所述第一摄像头的像素数高于所述第二摄像头;所述方法包括:获取由所述第一摄像头采集的第一图像和所述第二摄像头采集的第二图像(S110);识别所述第一图像中的前景区域,并从所述第一图像中提取前景区域图像(S120);根据所述前景区域图像及所述第二图像,获得目标图像(S130)。融合了终端设备上不同摄像头的优势,改善了高清摄像头拍摄图像的质量。

Description

图像处理方法、图像处理装置、存储介质与终端设备
本申请要求于2019年12月13日提交的,申请号为201911286079.8,名称为“图像处理方法、图像处理装置、存储介质与终端设备”的中国专利申请的优先权,该中国专利申请的全部内容通过引用结合在本文中。
技术领域
本公开涉及图像处理技术领域,尤其涉及一种图像处理方法、图像处理装置、计算机可读存储介质与终端设备。
背景技术
目前,提高图像传感器的像素是业界普遍的发展方向,例如手机上通常采用百万甚至千万级别像素的摄像头(简称为高清摄像头),可以支持拍摄出超高清的照片。
发明内容
本公开提供了一种图像处理方法、图像处理装置、计算机可读存储介质与终端设备,进而至少在一定程度上改善现有的高清摄像头所拍摄图像的质量。
根据本公开的第一方面,提供一种图像处理方法,应用于终端设备,所述终端设备至少包括像素数不同的第一摄像头和第二摄像头,所述第一摄像头的像素数高于所述第二摄像头;所述方法包括:获取由所述第一摄像头采集的第一图像和所述第二摄像头采集的第二图像;识别所述第一图像中的前景区域,并从所述第一图像中提取前景区域图像;根据所述前景区域图像及所述第二图像,获得目标图像。
根据本公开的第二方面,提供图像处理装置,配置于终端设备,所述终端设备至少包括像素数不同的第一摄像头和第二摄像头,所述第一摄像头的像素数高于所述第二摄像头;所述装置包括处理器;所述处理器用于执行存储器中存储的以下程序模块:图像获取模块,用于获取由所述第一摄像头采集的第一图像和所述第二摄像头采集的第二图像;前景区域识别模块,用于识别所述第一图像中的前景区域,并从所述第一图像中提取前景区域图像;目标图像获得模块,用于根据所述前景区域图像及所述第二图像,获得目标图像。
根据本公开的第三方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述图像处理方法。
根据本公开的第四方面,提供一种终端设备,包括:处理器;存储器,用于存储所述处理器的可执行指令;第一摄像头;以及第二摄像头;其中,所述处理器配置为经由执行所述可执行指令来执行上述图像处理方法。
本公开的技术方案具有以下有益效果:
根据上述图像处理方法、图像处理装置、存储介质和终端设备,通过终端设备的 第一摄像头和第二摄像头分别采集得到第一图像和第二图像,从第一图像中提取前景区域图像,根据该前景区域图像及第二图像获得最终的目标图像。一方面,第一摄像头为高清摄像头,其像素数高于第二摄像头,因此第一图像的清晰度较高,包含更多的细节信息,保留其中的前景部分,与第二图像进行融合,可以保证目标图像中前景部分具有高清晰度和丰富的细节,背景部分噪点较低,且目标图像整体的数据量低于第一图像,从而融合第一摄像头和第二摄像头各自的优势,改善高清摄像头拍摄图像的质量,提高用户体验。另一方面,对图像的处理属于软件算法过程,可以利用现有终端设备的摄像头配置实现,无需对硬件进行改动,从而节约成本,具有较高的实用性。
附图说明
图1示出本示例性实施方式中一种图像处理方法的流程图;
图2示出本示例性实施方式中图像处理的子流程图;
图3示出本示例性实施方式中图像处理的另一子流程图;
图4示出本示例性实施方式中滤色阵列的示意图;
图5示出本示例性实施方式中获取第一图像的示意图;
图6示出本示例性实施方式中图像处理的示意性流程图;
图7示出本示例性实施方式中一种图像处理装置的结构框图;
图8示出本示例性实施方式中另一种图像处理装置的结构框图;
图9示出本示例性实施方式中一种用于实现上述方法的计算机可读存储介质;
图10示出本示例性实施方式中一种用于实现上述方法的终端设备。
具体实施方式
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
高清摄像头具有一定的局限性,例如:所拍摄出的图像数据量较大,占用存储空间较多;对于拍照时光照条件的要求较高,在非强光照情况下,容易受到串扰,导致所拍摄的图像中噪点较多。
鉴于上述问题,本公开的示例性实施方式提供一种图像处理方法,可以应用于手机、平板电脑、数码相机等终端设备。该终端设备配置有至少两个像素数不同的摄像头,包括第一摄像头和第二摄像头。第一摄像头为高清摄像头,其像素数高于第二摄像头。
图1示出了该方法的一种流程,可以包括以下步骤S110至S130:
步骤S110,获取由第一摄像头采集的第一图像和第二摄像头采集的第二图像。
其中,第一图像和第二图像为针对同一场景或同一目标,同时采集的图像(也可能存在毫秒级的时间差,本公开对此不做限定),通常第一图像的像素数(或分辨率)高于第二图像。用户在拍照按下快门键时,第一摄像头和第二摄像头可以同时采集图像。通常第一图像和第二图像中的主要内容是相同的,但是第一摄像头和第二摄像头的取景范围可能不同,导致第一图像和第二图像的背景范围不同。例如第二摄像头为广角摄像头时,其取景范围较大,可以拍摄到目标周围较大面积的背景图像,相比而言第一图像的范围较小,通常对应于第二图像的中间区域。
步骤S120,识别第一图像中的前景区域,并从第一图像中提取前景区域图像。
通常图像包含前景和背景区域,前景区域一般是拍照时需要重点呈现的部分。在识别第一图像中的前景区域后,可以将其从第一图像中裁剪出来,得到前景区域图像。
关于如何识别第一图像中的前景区域,下面提供几个具体示例:
在一种实施方式中,参考图2所示,可以通过以下步骤S210和S220识别前景区域:
步骤S210,检测第一图像中是否包含人脸区域;
步骤S220,当检测到第一图像中包含人脸区域时,将人脸区域作为前景区域。
其中,人脸区域的检测可以通过颜色与形状检测实现,例如预先设定人脸部分的颜色范围和形状范围,检测第一图像中是否存在同时满足颜色范围和形状范围的局部区域。也可以采用深度学习技术,例如通过YOLO(You Look Only Once,一种实时目标检测的算法框架,包括v1、v2、v3等多个版本,本公开可以采用其中任一个版本)、SSD(Single Shot Multibox Detector,单步多框目标检测)、R-CNN(Region-Convolutional Neural Network,区域卷积神经网络,或Fast R-CNN、Faster R-CNN等改进版本)等神经网络进行人脸区域的检测。当检测到人脸区域时,可以将人脸区域用矩形框进行标注,并提取出来作为前景区域,当然本公开对于前景区域的具体形状不做限定。
进一步的,还可以执行步骤S230,当检测到第一图像中不包含人脸区域时,根据第一图像的景深信息确定前景区域。其中,通过景深信息可以确定第一图像中各个区域和摄像头的距离范围,将其中重要的部分(或清晰度较高的部分)确定为前景区域,例如在焦点深度平面上的区域,或者在容许弥散圆范围内的区域等。需要说明的是, 可以根据第一图像和第二图像之间的视差,结合第一摄像头、第二摄像头的固有参数以及拍照参数,计算第一图像的景深信息,所得到的结果更为精确。
基于图2的方式,在识别前景区域时,先检测人脸,将人脸区域作为前景区域,这是由于当图像中包含人脸时,人脸一般是需要重点呈现的部分,且人脸检测相比于一般的目标检测更易于实现;当第一图像中不包含人脸时,再根据景深信息确定前景区域,使检测到的前景区域更加完整、准确。
在另一种实施方式中,也可以根据用户操作识别前景区域。具体而言,在拍照预览时,用户通常需要点击画面中的特定位置(如人脸、目标物体等)以进行聚焦。可以记录用户的点击位置,在采集第一图像后,基于该位置进行识别,可以以该位置为中心,逐步放大检测框,直到在检测框内检测到完整的目标,如人脸或完整的物体等,将检测框内的区域作为前景区域。
步骤S130,根据前景区域图像及第二图像,获得目标图像。
前景区域图像从第一图像中提取出来的,其像素数较高,细节信息丰富。相比而言,第二图像虽然像素数较低,但数据量较小,且噪点更少。可以将两图像进行融合,综合两图像各自的优势,以输出质量较高的目标图像。
在一种可选的实施方式中,参考图3所示,步骤S130可以具体通过以下步骤S310至S330实现:
步骤S310,根据第一图像和第二图像的映射关系,确定前景区域在第二图像中的对应区域;
步骤S320,从第二图像中移除上述对应区域,得到背景区域图像;
步骤S330,拼接前景区域图像和背景区域图像,以输出目标图像。
其中,映射关系主要指像素位置的映射,例如第一图像中的像素点对应于第二图像中的哪个或哪些像素点。在一种可选的实施方式中,为了便于确定映射关系,可以设置第一摄像头的像素数为第二摄像头的整数倍,例如第一摄像头为6400万像素,第二摄像头为1600万像素,两者是4:1的比例关系,则第一图像中2*2的像素对应于第二图像中的一个像素。第一图像和第二图像的映射关系可以根据第一摄像头和第二摄像头的参数确定:如果第一摄像头和第二摄像头的广角度数相同(或者第一摄像头和第二摄像头均为非广角摄像头),一般二者的取景面积相同,则可以根据二者的像素数比例确定映射关系;如果第一摄像头和第二摄像头的广角度数不同(或者一个为广角摄像头,另一个为非广角摄像头),二者的取景面积不同,通常非广角摄像头的取景范围在广角摄像头的中间部分,假设第一摄像头为非广角摄像头,第二摄像头为广角摄像头,则可以确定第一图像对应于第二图像中间的哪个位置,并根据两摄像头的像素数,具体计算出像素级的映射关系。
基于上述映射关系,可以确定前景区域在第二图像中的对应区域,例如将第一图像中前景区域边界的每个像素对应到第二图像中,形成第二图像中的对应区域。从第二图像中移除对应区域后,剩余的部分为背景区域图像,例如背景区域图像可以是边 框形状。然后将前景区域图像和背景区域图像进行拼接,以合成为一张图像,即最终输出的目标图像。
进一步的,在获取第一图像和第二图像时,可以对第一图像和第二图像进行配准,并确定第一图像和第二图像的映射关系。由于第一摄像头和第二摄像头存在位置差,导致第一图像和第二图像存在视角偏差,进行配准后,可以将第一图像和第二图像中的目标更好地对应起来,从而实现更加精准的映射,有利于后续的图像融合。
在一种可选的实施方式中,为了实现更好的拍照质量,可以将长焦摄像头设置为第一摄像头,将广角(或超广角)摄像头设置为第二摄像头。使用长焦摄像头拍摄第一图像,可以更加清晰地拍摄到前景区域的图像,采集较为丰富的细节信息,特别适合于拍摄人脸或远景。使用广角摄像头拍摄第二图像,可以拍摄到较大范围内的景象,使图像内容更加完整。这样在融合前景区域图像和第二图像时,可以综合长焦拍前景的优势以及广角拍大面积背景的优势,目标图像的质量较高。
在一种可选的实施方式中,终端设备可以包括三个甚至三个以上的摄像头。在进行拍照时,可以根据实际需求选择其中一个作为第一摄像头,选择另一个作为第二摄像头。例如:终端设备配备广角摄像头、长焦摄像头、微距摄像头;当拍摄远景时,可以将长焦摄像头设置为第一摄像头,将广角摄像头设置为第二摄像头;当拍摄近景时,可以将微距摄像头设置为第一摄像头,将广角摄像头设置为第二摄像头,等等。本公开对此不做限定。
对于目标图像的存储,本公开提供以下几种示例性方案:
方案一、在后台存储前景区域图像和第二图像,当用户查看图像时,将两图像融合为目标图像后显示。
方案二、在后台存储前景区域图像和背景区域图像,背景区域图像可以采用预测编码等方式进行编码,具有很小的数据量,当用户查看图像时,将两图像拼接为目标图像后显示。
方案三、直接对目标图像进行编码后存储,由于目标图像中存在两种像素参数,可以在每个像素的编码前增加一个标志位用于标志该像素是哪种像素参数,或者采用嵌套的方式,以目标图像中的第二图像或背景区域图像为主图像,将前景区域图像嵌套至其中进行编码。
需要说明的是,无论采用上述哪种方案,由于不需要存储整个第一图像,因而所占用的存储空间明显减少。
在一种可选的实施方式中,第一摄像头可以是基于四拜耳(Quad Bayer)滤色阵列的摄像头。参考图4所示,左图示出了标准拜耳滤色阵列,其滤光片的单元阵列排布为GRBG(或BGGR、GBRG、RGGB),大部分摄像头(或图像传感器)采用标准拜耳滤色阵列;图4中右图示出了四拜耳滤色阵列,其滤光片的单元阵列中相邻四个单元为相同颜色,目前一部分高像素的摄像头(或图像传感器)采用四拜耳滤色阵列。基于此,获取由第一摄像头采集的第一图像,可以具体包括:
通过第一摄像头采集基于四拜耳滤色阵列的原始拜耳图像;
对原始拜耳图像进行解马赛克处理和去马赛克处理,得到第一图像。
其中,拜耳图像是指RAW格式的图像,是图像传感器将采集到的光信号转化为数字信号后的图像数据,在拜耳图像中,每个像素点只有RGB中的一种颜色。本示例性实施方式中,利用第一摄像头采集图像后,得到的原始图像数据即上述原始拜耳图像,该图像中像素的颜色排列如图4中右图所示,相邻四个像素为相同颜色。
解马赛克处理(Remosaic)是指将基于四拜耳滤色阵列的原始拜耳图像融合为基于标准拜耳滤色阵列的拜耳图像;去马赛克处理(Demosaic)是指将拜耳图像融合为完整的RGB图像。结合图5所示,可以对原始拜耳图像E进行解马赛克处理,得到基于标准拜耳滤色阵列的拜耳图像F;再对基于标准拜耳滤色阵列的拜耳图像F进行去马赛克处理,得到RGB格式的第一图像K。解马赛克和去马赛克可以通过不同的插值算法实现,也可以通过神经网络等其他相关算法实现,本公开对此不做限定。终端设备中通常配置和摄像头配套的ISP(Image Signal Processing,图像信号处理)单元,以执行上述解马赛克和去马赛克处理过程。第一图像K的每个像素都具有RGB三个通道的像素值,以C表示。此外,也可以将解马赛克和去马赛克的处理过程合并为一次插值过程,即基于原始拜耳图像中的像素数据,直接对每个像素点进行插值,以得到缺失的颜色通道的像素值,例如可以采用线性插值、均值插值等算法实现,从而获得第一图像。
图6示出图像处理的一种示意性流程。以手机为例,当用户开启拍照功能时,启动6400万像素的长焦摄像头作为第一摄像头,启动1600万像素的超广角摄像头作为第二摄像头,两摄像头同时采集图像,以执行步骤S601和步骤S602:
步骤S601,由第一摄像头采集得到第一图像;
步骤S602,由第二摄像头采集得到第二图像;
然后对第一图像进行以下处理:
步骤S603,检测第一图像中是否包含人脸区域,若是,执行步骤S604,若否,执行步骤S605和S606;
步骤S604,从第一图像中提取人脸区域;
步骤S605,检测第一图像的景深信息;
步骤S606,根据景深信息确定前景区域,并从第一图像中提取出来;
步骤S607,通过上述提取人脸区域,或根据景深信息提取前景区域,得到第一图像中的前景区域图像;
再执行步骤S608,将前景区域图像融合至第二图像中;
最后执行步骤S609,输出目标图像,例如当用户查看拍摄的图像时,可以显示目标图像。
综上所述,本示例性实施方式中,通过终端设备的第一摄像头和第二摄像头分别采集得到第一图像和第二图像,从第一图像中提取前景区域图像,并融合至第二图像 中,以输出最终的目标图像。一方面,第一摄像头为高清摄像头,其像素数高于第二摄像头,因此第一图像的清晰度较高,包含更多的细节信息,保留其中的前景部分,与第二图像进行融合,可以保证目标图像中前景部分具有高清晰度和丰富的细节,背景部分噪点较低,且目标图像整体的数据量低于第一图像,从而融合第一摄像头和第二摄像头各自的优势,改善高清摄像头拍摄图像的质量,提高用户体验。另一方面,对图像的处理属于软件算法过程,可以利用现有终端设备的摄像头配置实现,无需对硬件进行改动,从而节约成本,具有较高的实用性。
本公开的示例性实施方式还提供另一种图像处理装置,可以配置于终端设备,该终端设备至少包括像素数不同的第一摄像头和第二摄像头,第一摄像头的像素数高于第二摄像头。如图7所示,该图像处理装置700可以包括处理器710和存储器720;其中,存储器720存储有以下程序模块:
图像获取模块721,用于获取由第一摄像头采集的第一图像和第二摄像头采集的第二图像;
前景区域识别模块722,用于识别第一图像中的前景区域,并从第一图像中提取前景区域图像;
目标图像获得模块723,用于根据前景区域图像及第二图像,获得目标图像;
处理器710用于执行上述程序模块。
在一种可选的实施方式中,前景区域识别模块722,被配置为:
检测第一图像中是否包含人脸区域;
当检测到第一图像中包含人脸区域时,将人脸区域作为前景区域。
在一种可选的实施方式中,前景区域识别模块722,被配置为:
当检测到第一图像中不包含人脸区域时,根据第一图像的景深信息确定前景区域。
在一种可选的实施方式中,目标图像获得模块723,可以包括:
对应区域确定单元,用于根据第一图像和第二图像的映射关系,确定前景区域在第二图像中的对应区域;
对应区域移除单元,用于从第二图像中移除上述对应区域,得到背景区域图像;
图像拼接单元,用于拼接前景区域图像和背景区域图像,以输出目标图像。
在一种可选的实施方式中,图像获取模块721,被配置为:
在获取第一图像和第二图像时,对第一图像和第二图像进行配准,并确定第一图像和第二图像的映射关系。
在一种可选的实施方式中,存储器720还存储有图像存储模块,用于存述前景区域图像和第二图像。
目标图像获得模块723,被配置为:
当用户查看图像时,将前景区域图像和第二图像融合为目标图像并显示。
在一种可选的实施方式中,第一摄像头为基于四拜耳滤色阵列的摄像头。
图像获取模块721,被配置为:
通过所述第一摄像头采集基于四拜耳滤色阵列的原始拜耳图像;
对所述原始拜耳图像进行解马赛克处理和去马赛克处理,得到所述第一图像。
在一种可选的实施方式中,第一摄像头可以是长焦摄像头,第二摄像头可以是广角摄像头。
本公开的示例性实施方式还提供另一种图像处理装置,可以配置于终端设备,该终端设备至少包括像素数不同的第一摄像头和第二摄像头,第一摄像头的像素数高于第二摄像头。如图8所示,该图像处理装置800可以包括:
图像获取模块810,用于获取由第一摄像头采集的第一图像和第二摄像头采集的第二图像;
前景区域识别模块820,用于识别第一图像中的前景区域,并从第一图像中提取前景区域图像;
目标图像获得模块830,用于根据前景区域图像及第二图像,获得目标图像。
在一种可选的实施方式中,前景区域识别模块820,被配置为:
检测第一图像中是否包含人脸区域;
当检测到第一图像中包含人脸区域时,将人脸区域作为前景区域。
在一种可选的实施方式中,前景区域识别模块820,被配置为:
当检测到第一图像中不包含人脸区域时,根据第一图像的景深信息确定前景区域。
在一种可选的实施方式中,目标图像获得模块830,可以包括:
对应区域确定单元,用于根据第一图像和第二图像的映射关系,确定前景区域在第二图像中的对应区域;
对应区域移除单元,用于从第二图像中移除上述对应区域,得到背景区域图像;
图像拼接单元,用于拼接前景区域图像和背景区域图像,以输出目标图像。
在一种可选的实施方式中,图像获取模块810,被配置为:
在获取第一图像和第二图像时,对第一图像和第二图像进行配准,并确定第一图像和第二图像的映射关系。
在一种可选的实施方式中,图像处理装置800还包括图像存储模块,用于存述前景区域图像和第二图像。
目标图像获得模块830,被配置为:
当用户查看图像时,将前景区域图像和第二图像融合为目标图像并显示。
在一种可选的实施方式中,第一摄像头为基于四拜耳滤色阵列的摄像头。
图像获取模块810,被配置为:
通过所述第一摄像头采集基于四拜耳滤色阵列的原始拜耳图像;
对所述原始拜耳图像进行解马赛克处理和去马赛克处理,得到所述第一图像。
在一种可选的实施方式中,第一摄像头可以是长焦摄像头,第二摄像头可以是广角摄像头。
在一种可选的实施方式中,第一摄像头的像素数可以是第二摄像头的整数倍。
上述装置中各模块/单元的具体细节在方法部分实施方式中已经详细说明,未披露的细节内容可以参见方法部分的实施方式内容,因而不再赘述。
本公开的示例性实施方式还提供了一种计算机可读存储介质,可以实现为一种程序产品的形式,其包括程序代码,当程序产品在终端设备上运行时,程序代码用于使终端设备执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施方式的步骤。
参考图9所示,描述了根据本公开的示例性实施方式的用于实现上述方法的程序产品900,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本公开的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。
本公开的示例性实施方式还提供了一种能够实现上述方法的终端设备,该终端设备可以是手机、平板电脑、数码相机等。下面参照图10来描述根据本公开的这种示例性实施方式的终端设备1000。图10显示的终端设备1000仅仅是一个示例,不应对本 公开实施方式的功能和使用范围带来任何限制。
如图10所示,终端设备1000可以以通用计算设备的形式表现。终端设备1000的组件可以包括但不限于:至少一个处理单元1010、至少一个存储单元1020、连接不同系统组件(包括存储单元1020和处理单元1010)的总线1030、显示单元1040和图像采集单元1070,图像采集单元1070包括第一摄像头和第二摄像头,可用于采集图像,第一摄像头的像素数高于第二摄像头。
存储单元1020存储有程序代码,程序代码可以被处理单元1010执行,使得处理单元1010执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施方式的步骤。例如,处理单元1010可以执行图1、图2或图3所示的方法步骤。
存储单元1020可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)1021和/或高速缓存存储单元1022,还可以进一步包括只读存储单元(ROM)1023。
存储单元1020还可以包括具有一组(至少一个)程序模块1025的程序/实用工具1024,这样的程序模块1025包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。
总线1030可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。
终端设备1000也可以与一个或多个外部设备1100(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该终端设备1000交互的设备通信,和/或与使得该终端设备1000能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口1050进行。并且,终端设备1000还可以通过网络适配器1060与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器1060通过总线1030与终端设备1000的其它模块通信。应当明白,尽管图中未示出,可以结合终端设备1000使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本公开示例性实施方式的方法。
本技术领域的技术人员能够理解,本公开的各个方面可以实现为系统、方法或程序产品。因此,本公开的各个方面可以具体实现为以下形式,即:完全的硬件实施方 式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。
此外,上述附图仅是根据本公开示例性实施方式的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的示例性实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其他实施方式。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施方式仅被视为示例性的,本公开的真正范围和精神由权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限定。

Claims (20)

  1. 一种图像处理方法,应用于终端设备,其特征在于,所述终端设备至少包括像素数不同的第一摄像头和第二摄像头,所述第一摄像头的像素数高于所述第二摄像头;所述方法包括:
    获取由所述第一摄像头采集的第一图像和所述第二摄像头采集的第二图像;
    识别所述第一图像中的前景区域,并从所述第一图像中提取前景区域图像;
    根据所述前景区域图像及所述第二图像,获得目标图像。
  2. 根据权利要求1所述的方法,其特征在于,所述识别所述第一图像中的前景区域,包括:
    检测所述第一图像中是否包含人脸区域;
    当检测到所述第一图像中包含人脸区域时,将所述人脸区域作为所述前景区域。
  3. 根据权利要求2所述的方法,其特征在于,所述识别所述第一图像中的前景区域,还包括:
    当检测到所述第一图像中不包含人脸区域时,根据所述第一图像的景深信息确定所述前景区域。
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述前景区域图像及所述第二图像,获得目标图像,包括:
    根据所述第一图像和所述第二图像的映射关系,确定所述前景区域在所述第二图像中的对应区域;
    从所述第二图像中移除所述对应区域,得到背景区域图像;
    拼接所述前景区域图像和所述背景区域图像,以输出所述目标图像。
  5. 根据权利要求4所述的方法,其特征在于,在获取所述第一图像和所述第二图像时,所述方法还包括:
    对所述第一图像和所述第二图像进行配准,并确定所述第一图像和所述第二图像的映射关系。
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    存储所述前景区域图像和所述第二图像;
    所述根据所述前景区域图像及所述第二图像,获得目标图像,包括:
    当用户查看图像时,将所述前景区域图像和所述第二图像融合为所述目标图像并显示。
  7. 根据权利要求1至6任一项所述的方法,其特征在于,所述第一摄像头为基于四拜耳滤色阵列的摄像头;
    所述获取由所述第一摄像头采集的第一图像,包括:
    通过所述第一摄像头采集基于四拜耳滤色阵列的原始拜耳图像;
    对所述原始拜耳图像进行解马赛克处理和去马赛克处理,得到所述第一图像。
  8. 根据权利要求1至6任一项所述的方法,其特征在于,所述第一摄像头为长焦 摄像头,所述第二摄像头为广角摄像头。
  9. 根据权利要求1至6任一项所述的方法,其特征在于,所述第一摄像头的像素数为所述第二摄像头的整数倍。
  10. 一种图像处理装置,配置于终端设备,其特征在于,所述终端设备至少包括像素数不同的第一摄像头和第二摄像头,所述第一摄像头的像素数高于所述第二摄像头;所述装置包括处理器;所述处理器用于执行存储器中存储的以下程序模块:
    图像获取模块,用于获取由所述第一摄像头采集的第一图像和所述第二摄像头采集的第二图像;
    前景区域识别模块,用于识别所述第一图像中的前景区域,并从所述第一图像中提取前景区域图像;
    目标图像获得模块,用于根据所述前景区域图像及所述第二图像,获得目标图像。
  11. 根据权利要求10所述的装置,其特征在于,所述前景区域识别模块,被配置为:
    检测所述第一图像中是否包含人脸区域;
    当检测到所述第一图像中包含人脸区域时,将所述人脸区域作为所述前景区域。
  12. 根据权利要求11所述的装置,其特征在于,所述前景区域识别模块,被配置为:
    当检测到所述第一图像中不包含人脸区域时,根据所述第一图像的景深信息确定所述前景区域。
  13. 根据权利要求10所述的装置,其特征在于,所述目标图像获得模块,包括:
    对应区域确定单元,用于根据所述第一图像和所述第二图像的映射关系,确定所述前景区域在所述第二图像中的对应区域;
    对应区域移除单元,用于从所述第二图像中移除所述对应区域,得到背景区域图像;
    图像拼接单元,用于拼接所述前景区域图像和所述背景区域图像,以输出所述目标图像。
  14. 根据权利要求13所述的装置,其特征在于,所述图像获取模块,被配置为:
    在获取第一图像和第二图像时,对所述第一图像和所述第二图像进行配准,并确定所述第一图像和所述第二图像的映射关系。
  15. 根据权利要求10所述的装置,其特征在于,所述装置还包括图像存储模块,用于存储所述前景区域图像和所述第二图像;
    所述目标图像获得模块,被配置为:
    当用户查看图像时,将所述前景区域图像和所述第二图像融合为所述目标图像并显示。
  16. 根据权利要求10至15任一项所述的装置,其特征在于,所述第一摄像头为基于四拜耳滤色阵列的摄像头;
    所述图像获取模块,被配置为:
    通过所述第一摄像头采集基于四拜耳滤色阵列的原始拜耳图像;
    对所述原始拜耳图像进行解马赛克处理和去马赛克处理,得到所述第一图像。
  17. 根据权利要求10至15任一项所述的装置,其特征在于,所述第一摄像头为长焦摄像头,所述第二摄像头为广角摄像头。
  18. 根据权利要求10至15任一项所述的装置,其特征在于,所述第一摄像头的像素数为所述第二摄像头的整数倍。
  19. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至9任一项所述的方法。
  20. 一种终端设备,其特征在于,包括:
    处理器;
    存储器,用于存储所述处理器的可执行指令;
    第一摄像头;以及
    第二摄像头;
    其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1至9任一项所述的方法。
PCT/CN2020/133407 2019-12-13 2020-12-02 图像处理方法、图像处理装置、存储介质与终端设备 WO2021115179A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911286079.8A CN112991242A (zh) 2019-12-13 2019-12-13 图像处理方法、图像处理装置、存储介质与终端设备
CN201911286079.8 2019-12-13

Publications (1)

Publication Number Publication Date
WO2021115179A1 true WO2021115179A1 (zh) 2021-06-17

Family

ID=76329443

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/133407 WO2021115179A1 (zh) 2019-12-13 2020-12-02 图像处理方法、图像处理装置、存储介质与终端设备

Country Status (2)

Country Link
CN (1) CN112991242A (zh)
WO (1) WO2021115179A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114662592A (zh) * 2022-03-22 2022-06-24 小米汽车科技有限公司 车辆行驶控制方法、装置、存储介质、电子设备以及车辆
CN117132629A (zh) * 2023-02-17 2023-11-28 荣耀终端有限公司 图像处理方法和电子设备

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113438401B (zh) * 2021-06-30 2022-08-05 展讯通信(上海)有限公司 数字变焦方法、系统、存储介质及终端
CN113256499B (zh) * 2021-07-01 2021-10-08 北京世纪好未来教育科技有限公司 一种图像拼接方法及装置、系统
WO2023240489A1 (zh) * 2022-06-15 2023-12-21 北京小米移动软件有限公司 一种拍照方法、装置及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8406554B1 (en) * 2009-12-02 2013-03-26 Jadavpur University Image binarization based on grey membership parameters of pixels
CN108632512A (zh) * 2018-05-17 2018-10-09 Oppo广东移动通信有限公司 图像处理方法、装置、电子设备及计算机可读存储介质
CN109639997A (zh) * 2018-12-20 2019-04-16 Oppo广东移动通信有限公司 图像处理方法、电子装置及介质
CN110248081A (zh) * 2018-10-12 2019-09-17 华为技术有限公司 图像捕捉方法及电子设备

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090128644A1 (en) * 2007-11-15 2009-05-21 Camp Jr William O System and method for generating a photograph
US20180068473A1 (en) * 2016-09-06 2018-03-08 Apple Inc. Image fusion techniques
CN106375662B (zh) * 2016-09-22 2019-04-12 宇龙计算机通信科技(深圳)有限公司 一种基于双摄像头的拍摄方法、装置和移动终端
CN106791416A (zh) * 2016-12-29 2017-05-31 努比亚技术有限公司 一种背景虚化的拍摄方法及终端
CN107948500A (zh) * 2017-11-01 2018-04-20 广东欧珀移动通信有限公司 图像处理方法和装置
CN107833231B (zh) * 2017-11-22 2020-12-04 上海联影医疗科技股份有限公司 医学图像显示方法、装置和计算机存储介质
CN107948519B (zh) * 2017-11-30 2020-03-27 Oppo广东移动通信有限公司 图像处理方法、装置及设备
TW201947536A (zh) * 2018-05-08 2019-12-16 華晶科技股份有限公司 影像處理方法及影像處理裝置
CN108881730A (zh) * 2018-08-06 2018-11-23 成都西纬科技有限公司 图像融合方法、装置、电子设备及计算机可读存储介质
CN110139028B (zh) * 2019-03-25 2020-07-07 华为技术有限公司 一种图像处理的方法及头戴式显示设备
CN110177212B (zh) * 2019-06-26 2021-01-26 Oppo广东移动通信有限公司 图像处理方法和装置、电子设备、计算机可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8406554B1 (en) * 2009-12-02 2013-03-26 Jadavpur University Image binarization based on grey membership parameters of pixels
CN108632512A (zh) * 2018-05-17 2018-10-09 Oppo广东移动通信有限公司 图像处理方法、装置、电子设备及计算机可读存储介质
CN110248081A (zh) * 2018-10-12 2019-09-17 华为技术有限公司 图像捕捉方法及电子设备
CN109639997A (zh) * 2018-12-20 2019-04-16 Oppo广东移动通信有限公司 图像处理方法、电子装置及介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114662592A (zh) * 2022-03-22 2022-06-24 小米汽车科技有限公司 车辆行驶控制方法、装置、存储介质、电子设备以及车辆
CN114662592B (zh) * 2022-03-22 2023-04-07 小米汽车科技有限公司 车辆行驶控制方法、装置、存储介质、电子设备以及车辆
CN117132629A (zh) * 2023-02-17 2023-11-28 荣耀终端有限公司 图像处理方法和电子设备

Also Published As

Publication number Publication date
CN112991242A (zh) 2021-06-18

Similar Documents

Publication Publication Date Title
WO2021115179A1 (zh) 图像处理方法、图像处理装置、存储介质与终端设备
US10311649B2 (en) Systems and method for performing depth based image editing
US10313656B2 (en) Image stitching for three-dimensional video
JP6746607B2 (ja) パンニングショットの自動生成
EP3007038B1 (en) Interaction with three-dimensional video
KR20230013243A (ko) 프레임에서 타겟 오브젝트를 위한 고정된 크기 유지
CN108833785B (zh) 多视角图像的融合方法、装置、计算机设备和存储介质
WO2021047345A1 (zh) 图像降噪方法、装置、存储介质及电子设备
KR20180109918A (ko) 다중 카메라들을 사용하여 심리스 줌 기능을 구현하기 위한 시스템들 및 방법들
US9373187B2 (en) Method and apparatus for producing a cinemagraph
JP2018510324A (ja) 複数技術奥行きマップ取得および融合のための方法および装置
CN110809101B (zh) 图像变焦处理方法及装置、电子设备、存储介质
CN109286750B (zh) 一种基于智能终端的变焦方法及一种智能终端
US20150138309A1 (en) Photographing device and stitching method of captured image
US8896670B2 (en) Image processing device, image processing method, and program
US11812154B2 (en) Method, apparatus and system for video processing
CN110929615B (zh) 图像处理方法、图像处理装置、存储介质与终端设备
WO2021004237A1 (zh) 一种图像配准、融合、遮挡检测方法、装置和电子设备
CN114782296B (zh) 图像融合方法、装置及存储介质
CN107295261B (zh) 图像去雾处理方法、装置、存储介质和移动终端
JP2013251656A (ja) 画像処理装置
WO2023236162A1 (zh) 相机模组及图像处理方法、装置、终端、电子设备、介质
JP7468391B2 (ja) 撮像装置および撮像処理方法
WO2021212320A1 (zh) 图像缩小的方法和装置
WO2021135487A1 (zh) 一种摄像头光学变焦电子装置、方法、单元及存储器

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: 20897693

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: 20897693

Country of ref document: EP

Kind code of ref document: A1