WO2022160895A1 - Image processing method, image processing apparatus, electronic system and readable storage medium - Google Patents

Image processing method, image processing apparatus, electronic system and readable storage medium Download PDF

Info

Publication number
WO2022160895A1
WO2022160895A1 PCT/CN2021/132503 CN2021132503W WO2022160895A1 WO 2022160895 A1 WO2022160895 A1 WO 2022160895A1 CN 2021132503 W CN2021132503 W CN 2021132503W WO 2022160895 A1 WO2022160895 A1 WO 2022160895A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
initial
images
fusion
brightness
Prior art date
Application number
PCT/CN2021/132503
Other languages
French (fr)
Chinese (zh)
Inventor
蒋霆
饶青
韩明燕
刘帅成
Original Assignee
北京迈格威科技有限公司
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 北京迈格威科技有限公司 filed Critical 北京迈格威科技有限公司
Publication of WO2022160895A1 publication Critical patent/WO2022160895A1/en

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
    • 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/20172Image enhancement details
    • G06T2207/20208High dynamic range [HDR] image processing
    • 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 application relates to the technical field of image processing, and in particular, to an image processing method, an image processing device, an electronic system, and a readable storage medium.
  • HDR High-Dynamic Range, high dynamic range
  • HDR images can provide more dynamic range and image details than ordinary images.
  • HDR images use multiple images with different exposures, and then use software to convert these images with different exposures.
  • the combined image can better reflect the visual effect in the real environment.
  • the HDR image synthesis method usually adopts the method of linear fusion, but the contrast of the synthesized image obtained by this method is low, and the phenomenon of graying is easy to appear visually, so that the portrait area of the synthesized image also looks gray visually.
  • the overall effect of the image is not natural enough.
  • the present application provides an image processing method, an image processing device, an electronic system, and a readable storage medium, so as to at least improve the effect of a portrait area in a composite image, and at the same time improve the overall effect of the composite image.
  • Some embodiments of the present application provide an image processing method, the method may include: acquiring multiple initial images collected under different exposure degrees, and mask images corresponding to the multiple initial images, wherein the mask images are based on At least a part of the images in the multiple initial images are generated, and the mask image is used to indicate the foreground area in the multiple initial images; the brightness information of the multiple initial images is fused to obtain the initial brightness information; based on the mask image, the The initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images are fused to obtain the final brightness information; the target image is obtained based on the final brightness information and the color information of the reference frame images.
  • the above-mentioned step of fusing the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images based on the mask image to obtain the final brightness information may include: combining the initial brightness information with the reference frame image.
  • the pixel brightness information of the frame image is alpha-fused through the mask image to obtain the final brightness information.
  • the pixel value of each pixel in the mask image may be 0 or 255; the initial brightness information and the pixel brightness information of the reference frame image are alpha-fused through the mask image to obtain the final brightness
  • new_res represents the final brightness information
  • ev0 represents the pixel brightness information of the reference frame image
  • M represents the pixel value of each pixel in the mask image
  • res represents the initial brightness information
  • the above-mentioned step of acquiring multiple initial images collected under different exposure degrees and mask images corresponding to the multiple initial images may include: acquiring multiple initial images collected under different exposure degrees, Among them, each initial image corresponds to one exposure; select a specified number of initial images from multiple initial images; perform fusion processing on the brightness information of the specified number of initial images to obtain a fusion image; binarize the fusion image Process to get the mask image.
  • the above-mentioned designated number may be two; the above-mentioned step of selecting a designated number of initial images from a plurality of initial images may include: selecting an initial image with a maximum exposure and an exposure Minimum initial image.
  • the above-mentioned step of obtaining a fused image by fusing the brightness information of a specified number of initial images may include: for each pair of two adjacent initial images in the specified number of initial images, for The two initial images adjacent to the current exposure are fused to obtain the first fusion image of the two adjacent initial images at the current exposure; each pair of exposures in the multiple first fusion images obtained for the specified number of initial images For two adjacent first fusion images, perform fusion processing on the two first fusion images adjacent to the current exposure degree to obtain a second fusion image of the two adjacent first fusion images at the current exposure degree; The image is used as a new first fusion image, continue to perform fusion processing for each pair of adjacent first fusion images with exposure, and perform fusion processing on the two adjacent first fusion images at the current exposure to obtain the adjacent current exposure. The steps of the second fused image of the two first fused images until a final fused image is obtained.
  • the above-mentioned step of fusing two initial images adjacent to the current exposure to obtain a first fusion image of the two initial images adjacent to the current exposure may include: For each pixel in the two adjacent initial images, perform the following operations: according to the brightness value of the current pixel in the two adjacent initial images at the current exposure, find the weighted weight from the preset weight matrix, where, The weight matrix includes weighted weights corresponding to any two brightness values; according to the found weighted weights and the brightness values of the current pixel points in the two initial images adjacent to the current exposure, it is determined that the current pixel point in the first fusion image corresponds to brightness value.
  • the above-mentioned step of searching for a weighted weight from a preset weight matrix according to the brightness value of the current pixel in the two initial images adjacent to the current exposure may include: In the two initial images, the first brightness value of the current pixel in the first initial image and the second brightness value of the current pixel in the second initial image are determined; the sum of the first brightness value and one is determined as The number of target columns; the sum of the second brightness value and one is determined as the number of target rows; according to the number of target columns and the number of target rows, the position of the weighted weight in the weight matrix is determined, and the value corresponding to the position in the weight matrix is determined as Find the weighted weight.
  • A1 i represents the brightness value of the ith pixel in the first initial image A1;
  • A2 i represents the brightness value of the ith pixel in the second initial image A2.
  • the above-mentioned step of performing binarization processing on the fusion image to obtain a mask image may include: performing guided filtering processing on the fusion image after the binarization processing to obtain a filtered mask image.
  • the above-mentioned step of fusing the brightness information of the multiple initial images to obtain the initial brightness information may include: for each pair of adjacent initial images in the multiple initial images, for the current The two initial images with adjacent exposure degrees are fused to obtain the first brightness map of the two initial images adjacent to the current exposure degree; each pair of adjacent exposure degrees in the multiple first brightness maps obtained for the multiple initial images The two first luminance maps of For the new first brightness map, continue to execute the two adjacent first brightness maps for each pair of exposure degrees, and perform fusion processing on the two adjacent first brightness maps of the current exposure degree to obtain two adjacent current exposure degrees. The steps of the second brightness map of the first brightness map are until a brightness map is obtained; the brightness information of the obtained brightness map is determined as the initial brightness information.
  • the color space of the above-mentioned initial image may be in the form of YUV
  • the luminance information may be the Y channel
  • the color information may be the UV channel.
  • an image processing apparatus may include: an image acquisition module, the image acquisition module is configured to acquire a plurality of initial images collected under different exposure degrees, and a plurality of initial images a mask image corresponding to the image, wherein the mask image is generated based on at least a part of the multiple initial images, and the mask image is used to indicate the foreground area in the multiple initial images; the first fusion module, the first The fusion module is configured to perform fusion processing on brightness information of multiple initial images to obtain initial brightness information; a second fusion module, the second fusion module is configured to combine the initial brightness information with the multiple images based on the mask image.
  • the pixel brightness information of the reference frame image in the initial image is fused to obtain final brightness information; the information integration module is configured to obtain the target image based on the final brightness information and the color information of the reference frame image.
  • the second fusion module may be configured to perform alpha fusion of the initial brightness information and the pixel brightness information of the reference frame image through the mask image to obtain the final brightness information.
  • new_res ev0*(M/255)+(1-M/255)*res
  • new_res represents the final brightness information
  • ev0 represents the pixel brightness information of the reference frame image
  • M represents the pixel value of each pixel in the mask image
  • res represents the initial brightness information
  • the image acquisition module may include: an initial image acquisition module, the initial image acquisition module is configured to acquire a plurality of initial images collected under different exposure degrees, wherein each of the initial images The initial image corresponds to a kind of exposure; an image selection module, the image selection module is configured to select a specified number of the initial images from the plurality of initial images; a fusion processing module, the fusion processing module is configured to for performing fusion processing on the brightness information of the specified number of the initial images to obtain a fusion image; and a binarization processing module, the binarization processing module is configured to binarize the fusion image processing to obtain the mask image.
  • the electronic system may include an image capture device, a processing device and a storage device, the image capture device may be used to acquire preview video frames or image data; the storage device may store There is a computer program that can execute the image processing method described in any one of the foregoing embodiments when the computer program is run by the processing device.
  • Still other embodiments of the present application provide a computer-readable storage medium, where a computer program may be stored thereon, and when the computer program is run by a processing device, the image described in any one of the foregoing embodiments may be executed.
  • Approach
  • an image processing device In an image processing method, an image processing device, an electronic system and a readable storage medium provided by the present application, a plurality of initial images collected under different exposure degrees and a mask image corresponding to the plurality of initial images are first obtained, wherein the The mask image is generated based on at least a part of the multiple initial images; the mask image is used to indicate the foreground area in the multiple initial images; further, the brightness information of the multiple initial images is fused to obtain the initial brightness information; Based on the mask image, the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images are fused to obtain the final brightness information; then based on the final brightness information and the color information of the reference frame images, the target image is obtained, and also That is, the fused image.
  • This method obtains a mask image indicating the foreground area of the image based on multiple images with different exposures, and then fuses the brightness information of the foreground area in the reference frame image and the non-foreground area in the initial brightness information through the mask image.
  • the effect of the foreground area in the image is better, thus ensuring that the foreground area in the fused image matches the foreground area in the reference frame image, thereby improving the visual effect of the foreground area in the fused image, and also improving the fusion image. overall effect.
  • FIG. 1 is a schematic structural diagram of an electronic system according to an embodiment of the present application.
  • FIG. 2 is a flowchart of an image processing method provided by an embodiment of the present application.
  • FIG. 3 is a flowchart of another image processing method provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a mask image provided by an embodiment of the present application.
  • FIG. 5 is a flowchart of another image processing method provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
  • HDR also known as wide dynamic range technology
  • HDR is a technology used to let the camera see the characteristics of the image under very strong contrast.
  • strong light sources unsunlight, lamps or reflections, etc.
  • relatively low-brightness areas such as shadows and backlights coexist in the image
  • the image output by the camera will appear bright areas that become white due to overexposure.
  • the dark areas become black due to underexposure, which seriously affects the image quality.
  • the HDR image synthesis method in the related art usually adopts the method of linear fusion, but the contrast of the synthesized image obtained by this method is low, and the phenomenon of graying is easy to appear visually, so that the portrait area of the synthesized image also looks gray visually. , so that the overall effect of the image is not natural enough.
  • FIG. 1 First, an example electronic system 100 , and a readable storage medium for implementing an image processing method, an image processing apparatus, and an electronic system for implementing an embodiment of the present application will be described with reference to FIG. 1 .
  • the electronic system 100 may include one or more processing devices 102, one or more storage devices 104, an input device 106, an output device 108, and one or more image acquisition devices 110, these components may be interconnected by a bus system 112 and/or other form of connection mechanism (not shown). It should be noted that the components and structures of the electronic system 100 shown in FIG. 1 are only exemplary and not limiting, and the electronic system may also have other components and structures as required.
  • the processing device 102 may be a gateway or an intelligent terminal, or may be a device including a central processing unit (CPU) or other forms of processing units with data processing capability and/or instruction execution capability, and may The data of other components in the system 100 are processed and other components in the electronic system 100 may also be controlled to perform desired functions.
  • CPU central processing unit
  • the data of other components in the system 100 are processed and other components in the electronic system 100 may also be controlled to perform desired functions.
  • the storage device 104 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
  • the volatile memory may include, for example, random access memory (RAM) and/or cache memory, or the like.
  • the non-volatile memory may include, for example, read only memory (ROM), hard disk, flash memory, and the like.
  • One or more computer program instructions may be stored on the computer-readable storage medium, and the processing device 102 may execute the program instructions to implement the client functions (implemented by the processing device) in the embodiments of the present application described below. and/or other desired functionality.
  • Various application programs and various data such as various data used and/or generated by the application program, etc. may also be stored in the computer-readable storage medium.
  • the input device 106 may be a device used by a user to input instructions, and may include one or more of a keyboard, mouse, microphone, touch screen, and the like.
  • the output device 108 may output various information (eg, images or sounds) to the outside (eg, a user), and may include one or more of a display, a speaker, and the like.
  • the image capturing device 110 may capture preview video frames or image data, and may store the captured preview video frames or image data in the storage device 104 for use by other components.
  • each device in the example electronic system for implementing the image processing method, text recognition method, apparatus, and electronic system may be integrated or distributed, such as the processing device 102, the storage device 104.
  • the input device 106 and the output device 108 are integrated and arranged into one body, and the image capturing device 110 is arranged at a designated position where the target image can be captured.
  • the electronic system can be implemented as a smart terminal such as a camera, a smart phone, a tablet computer, a computer, a vehicle-mounted terminal, and the like.
  • Another embodiment of the present application provides an image processing method, which can be executed by a processing device in the above electronic system; the processing device can be any device or chip with data processing capability.
  • the processing device can independently process the received information, or can be connected with a server to jointly analyze and process the information.
  • the image processing method may include the following specific steps:
  • Step S202 obtaining a plurality of initial images collected under different exposure degrees, and a mask image corresponding to the plurality of initial images; wherein, the mask image is generated based on at least a part of the images in the plurality of initial images; to indicate foreground regions in multiple initial images.
  • the above-mentioned initial image may be a picture or photo taken by a camera or a camera.
  • the camera, camera and other devices connected through communication can be used to transfer the image after shooting, or the initial image can be obtained from a storage device that stores images that have been captured and to be processed.
  • the scene captured by each initial image in the obtained multiple initial images may be the same, but the exposure corresponding to each initial image may be different, and the exposure refers to the intensity of the light and the length of time. Generally, the higher the exposure, the whiter the captured image; the lower the exposure, the darker the captured image.
  • the above-mentioned mask image may be generated based on at least a part of the plurality of initial images, and the at least part of the images may be at least two images of the plurality of initial images.
  • at least a part of images can be selected from multiple initial images, and then the grayscale images corresponding to the selected initial images are fused to obtain a mask image.
  • the mask image can be used to indicate the foreground area in multiple images, and the pixel value of the image area corresponding to the foreground area in the mask image can be different from the pixel value of the image area other than the foreground area, so that the foreground area can be distinguished and non-foreground areas.
  • the foreground area usually refers to the area of the image that contains a human figure.
  • Step S204 performing fusion processing on the brightness information of the multiple initial images to obtain initial brightness information.
  • the brightness information of the above-mentioned initial image can usually refer to the brightness corresponding to each pixel in the initial image, and the brightness can also be called a grayscale value, a grayscale value or a brightness value, which is used to indicate the brightness and darkness of the image;
  • the value of the brightness can range from 0 to 255.
  • the color space of the initial image may be in the form of YUV (Y represents brightness, and U and V represent chromaticity), and the brightness information of the initial image is the data corresponding to the Y channel of the initial image.
  • the brightness information of multiple initial images with different exposure degrees is fused together, and the brightness information corresponding to a fused image can be obtained, and the brightness information is also the initial brightness information; the initial brightness information can include The brightness corresponding to each pixel in the fused image.
  • Step S206 based on the above-mentioned mask image, perform fusion processing on the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images to obtain final brightness information.
  • the above-mentioned reference frame image may be an initial image specified by a user from a plurality of initial images according to preset rules, for example, the reference frame image may be a specified value of exposure (the specified value can be set according to user requirements, for example, it can be set to 0. Or the initial image of 1, etc.), or it may be the image with the best foreground area effect among multiple initial images, etc.
  • the pixel brightness information of the reference frame image may include the brightness corresponding to each pixel in the reference frame image.
  • the foreground area in the reference frame image is obtained through the foreground area indicated by the mask image, so that the pixel brightness information of the foreground area in the reference frame image is used as the final brightness information.
  • the brightness of each pixel corresponding to the foreground area; through the foreground area indicated by the mask image, the brightness information corresponding to the image area except the foreground area is obtained from the initial brightness information, so that the initial brightness information except the foreground area is obtained.
  • the brightness information corresponding to the other image areas is used as the brightness corresponding to each pixel in the image areas other than the foreground area in the final brightness information.
  • step S208 a target image is obtained based on the final brightness information and the color information of the reference frame image.
  • the color information of the reference frame image may refer to the chromaticity corresponding to each pixel in the initial image, and the function of the chromaticity may be to describe the color and saturation of the reference frame image and to specify the color of the pixel.
  • the color space of the reference frame image may be in the form of YUV, and the color information of the reference frame image is the data corresponding to the reference frame image on the UV channel.
  • the final brightness information and the color information of the reference frame image are fused to obtain the target image, that is, the pixel value corresponding to each pixel in the target image can be determined by each pixel in the final brightness information. It is determined by the brightness of each pixel and the chromaticity of each pixel in the reference frame image.
  • a plurality of initial images collected under different exposure degrees and a mask image corresponding to the plurality of initial images are first obtained; wherein, the mask image is based on the At least a part of the image is generated; the mask image is used to indicate the foreground area in the multiple initial images; then the brightness information of the multiple initial images is fused to obtain the initial brightness information; based on the mask image, the initial brightness information and the The pixel brightness information of the reference frame images in the multiple initial images is fused to obtain the final brightness information; then based on the final brightness information and the color information of the reference frame images, the target image, that is, the fused image, is obtained.
  • This method obtains a mask image indicating the foreground area of the image based on multiple images with different exposures, and then fuses the brightness information of the foreground area in the reference frame image and the non-foreground area in the initial brightness information through the mask image.
  • the effect of the foreground area in the image is better, thus ensuring that the foreground area in the fused image matches the foreground area in the reference frame image, thereby improving the visual effect of the foreground area in the fused image, and also improving the fusion image. overall effect.
  • Yet another embodiment of the present application also provides another image processing method, which can be implemented on the basis of the methods described in the above embodiments; the method focuses on the acquisition of multiple initial images collected under different exposures, and the Describe the specific process of the mask images corresponding to the multiple initial images (implemented through the following steps S302-S308); as shown in Figure 3, the method may include the following specific steps:
  • Step S302 acquiring a plurality of initial images collected under different exposure degrees; wherein each initial image corresponds to one exposure degree.
  • step S304 a specified number of initial images are selected from the plurality of initial images.
  • the above specified number may be at least two, and the specific value of the specified number may be set according to research and development requirements, for example, may be set to two or three, etc.
  • the specified number in order to improve computational efficiency, may be set to two, that is, two initial images may be randomly selected from multiple initial images, or the one with the highest exposure may be selected from multiple initial images The initial image and the initial image with minimal exposure.
  • Step S306 performing fusion processing on the brightness information of a specified number of initial images to obtain a fusion image.
  • the brightness information of a specified number of initial images can be fused into a fused image, and the fused image can only contain the brightness value corresponding to each pixel.
  • the above step S306 can be implemented through the following steps 10-12:
  • Step 10 For each pair of two adjacent initial images in the specified number of exposures, perform fusion processing on the two adjacent initial images at the current exposure to obtain the first image of the two adjacent initial images at the current exposure. a fused image.
  • the above-mentioned specified number of initial images may be sorted in order of exposure from large to small or from small to large. If the specified number is three, then there are two pairs of two initial images with adjacent exposures in the specified number of initial images, that is, two first fusion images can be obtained; if the specified number is two, then the specified number In the initial image of , there are only one pair of two initial images with adjacent exposure degrees, that is, a first fused image can be obtained, and the first fused image is also the fused image obtained in step S306 .
  • the specific process of performing fusion processing on two initial images adjacent to the current exposure to obtain the first fusion image of the two adjacent initial images at the current exposure may be: for the two initial images adjacent to the current exposure For each pixel in the image, perform the following steps 20-21 to obtain the first fused image:
  • Step 20 Search for weighting weights from a preset weighting matrix according to the brightness values of the current pixels in the two initial images adjacent to the current exposure; wherein the weighting matrix includes weighting weights corresponding to any two brightness values.
  • the above-mentioned brightness value may be equivalent to the brightness on the Y channel, and may also be referred to as a grayscale value, and the value of the brightness value may be an integer between 0 and 255.
  • the above weight matrix can be set in advance by the research and development personnel according to the research and development requirements.
  • the weight matrix can contain weighting weights corresponding to any two gray values, and each value contained in the weight matrix can be a positive value less than 1. number, that is, a positive number with a weighted weight less than 1.
  • the weight matrix can be a 256*256 matrix, that is, the weight matrix has 256 rows and 256 columns, wherein, 256 rows can correspond to the rows corresponding to integers between 0-255 respectively; 256 columns can respectively correspond to 0- The integers between 255 correspond to the columns in order.
  • the above step 20 can be implemented by the following steps 30-32:
  • Step 30 Determine the first brightness value of the current pixel in the first initial image and the second brightness value of the current pixel in the second initial image from the two initial images adjacent to the current exposure.
  • the above-mentioned first initial image may be an image with a larger exposure among the two initial images, or an image with a smaller exposure.
  • Step 31 the sum of the first brightness value and one is determined as the target number of columns; the sum of the second brightness value and one is determined as the target number of rows.
  • the sum of the first brightness value and one can be determined as the target number of columns to be queried, and the second brightness can be The sum of the value and one determines the number of target rows to find.
  • Step 32 Determine the position of the weighted weight in the weight matrix according to the target number of columns and the target row, and determine the value corresponding to the position in the weight matrix as the found weighted weight.
  • the position of the weighted weight to be searched can be located in the weight matrix according to the number of target rows and the number of target columns, and the value corresponding to the position is determined as the weighted weight to be searched for.
  • Step 21 Determine the brightness value corresponding to the current pixel point in the first fused image according to the found weighted weight and the brightness value of the current pixel point in the two initial images adjacent to the current exposure.
  • the luminance value corresponding to the current pixel in the first fused image can be determined by the following formula:
  • B i represents the brightness value of the ith pixel in the first fusion image, where the ith pixel is the current pixel;
  • w1 i represents the weighted weight found from the weight matrix, which is the adjacent current exposure.
  • the weighted weight corresponding to the i -th pixel in the first initial image A1 in the two initial images of , where w2 i 1-w1 i ;
  • A1 i represents the brightness value of the ith pixel in the first initial image A1;
  • A2 i represents the brightness of the ith pixel in the second initial image A2 value.
  • Step 11 Perform fusion processing on the two adjacent first fusion images of the current exposure for each pair of two adjacent first fusion images in the multiple first fusion images obtained from the specified number of initial images, to obtain: The second fused image of the two first fused images adjacent to the current exposure.
  • Step 12 take the second fused image as a new first fused image, continue to execute the two adjacent first fused images for each pair of exposure degrees, and perform fusion processing on the two adjacent first fused images of the current exposure degree to obtain: The steps of the second fusion image of the two first fusion images adjacent to the current exposure, until a final fusion image is obtained.
  • step 20-21 replace the initial image in step 20-21 with the first fusion image
  • step 20-21 continue to perform fusion processing on two adjacent first fusion images of each pair of exposure degrees in the plurality of first fusion images, A second fusion image corresponding to the two adjacent first fusion images of each pair of exposure degrees is obtained.
  • the obtained second fusion image is also the fusion image obtained in step S306; if the specified number exceeds three, then the second fusion image obtained in step 11 is at least two, not one , so it is still necessary to continue to fuse multiple second fused images corresponding to the specified number of initial images until a final fused image is obtained.
  • the specific process of performing fusion processing on the plurality of second fusion images corresponding to the specified number of initial images may be the same as the process of performing fusion processing on the first fusion images.
  • Step S308 perform binarization processing on the fusion image to obtain a mask image.
  • the fused image can only contain the brightness value of each pixel, so the fused image can also be called a grayscale image, and the brightness value (or grayscale value) of each pixel in the grayscale image can be at 0. -255, so you can set the brightness value less than the set value in the fused image as the first pixel value, and set the brightness value greater than or equal to the set value as the second pixel value to complete the second pixel value of the fused image.
  • the above-mentioned first pixel value may be set to 0, and the second pixel value may be set to 255, so as to obtain a mask image with only black and white colors, as shown in FIG.
  • the white area (with a pixel value of 255) in FIG. 4 may refer to the foreground area, and the foreground area may include the image area where the portrait is located, that is, the mask image can deduct the area of the portrait, and the portrait area can be deducted. It is segmented from other regions. Therefore, in some embodiments, the masked image can also be called a pseudo-keyed image. Although a part of the background in the masked image is also judged to be the Qinjing region, as long as the portrait region of the foreground region is accurate, Can.
  • the specific process of performing binarization processing on the fusion image to obtain the mask image may also be: performing guided filtering processing on the fusion image after the binarization processing to obtain the filtered mask image, so that the The foreground areas in the resulting mask image are oversmoothed with areas of the image outside the foreground areas in the mask image. That is to say, the over-smoothed mask image of the foreground area and the background area (equivalent to the image area other than the foreground area) can be obtained through the guided filtering process, which is beneficial to the subsequent fusion processing and improves the overall effect of the image.
  • the foregoing foreground area may refer to the white area in FIG. 4
  • the background area may refer to the black area in FIG. 4 .
  • Step S310 performing fusion processing on the brightness information of the multiple initial images to obtain initial brightness information.
  • Step S312 based on the mask image, perform fusion processing on the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images to obtain final brightness information.
  • step S314 a target image is obtained based on the final luminance information and the color information of the reference frame image.
  • the light and dark characteristics between images with different exposure degrees can obtain a mask image, and the mask image can better segment the foreground area in the original image, that is, the portrait area is better.
  • the foreground area in the mask image is fused with the reference frame image with better foreground area, which can protect the portrait well and make the portrait area of the fused image perform better.
  • this method does not need to segment the foreground area through a pre-trained model, which can effectively reduce the running time and improve the efficiency of image processing.
  • Another embodiment of the present application also provides another image processing method, which can be implemented on the basis of the methods described in the above embodiments; the method focuses on the fusion processing of the brightness information of the plurality of initial images to obtain
  • the specific process of the initial brightness information (implemented by the following steps S504-S510), and based on the mask image, the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images are fused to obtain the final brightness information.
  • the specific process (implemented by the following step S512); as shown in Figure 5, the method may include the following specific steps:
  • Step S502 acquiring a plurality of initial images collected under different exposure degrees, and a mask image corresponding to the plurality of initial images; the mask image is used to indicate a foreground area in the plurality of initial images.
  • Step S504 for each pair of adjacent two initial images of the exposure degree in the multiple initial images, perform fusion processing on the two adjacent initial images of the current exposure degree to obtain the first two initial images adjacent to the current exposure degree. Brightness map.
  • the specific implementation of the above step S504 may be the same as the implementation of the above step 10, that is, the specified number of initial images in step 10 are replaced by multiple initial images, and the first brightness map is replaced by the first fusion image, that is, The implementation of the above step S504. Specifically, for the manner of obtaining the first luminance maps of the two initial images adjacent to the current exposure, reference may be made to the foregoing steps 20-21, which will not be repeated here.
  • Step S506 for each pair of two adjacent first brightness maps in the multiple first brightness maps obtained from the multiple initial images, perform fusion processing on the two adjacent first brightness maps at the current exposure to obtain the current exposure.
  • the second brightness map of the two first brightness maps with adjacent exposures for each pair of two adjacent first brightness maps in the multiple first brightness maps obtained from the multiple initial images, perform fusion processing on the two adjacent first brightness maps at the current exposure to obtain the current exposure.
  • Step S508 taking the second brightness map as the new first brightness map, and continuing to perform fusion processing for the two adjacent first brightness maps of each pair of exposure degrees, and performing fusion processing on the two adjacent first brightness maps of the current exposure degree, The step of obtaining the second brightness map of the two first brightness maps adjacent to the current exposure, until one brightness map is obtained.
  • Step S510 determining the brightness information of the obtained brightness map as the initial brightness information.
  • step S512 the initial brightness information and the pixel brightness information of the reference frame image are alpha-fused through the mask image to obtain the final brightness information.
  • the specific process of alpha fusion may be as follows: according to the foreground area in the mask image, determine the foreground area in the reference frame image, and then determine the pixel brightness information corresponding to the foreground area in the reference frame image as the final The first brightness information corresponding to the foreground area in the brightness information; according to the image area except the foreground area in the mask image, the brightness information corresponding to the image area except the foreground area in the initial brightness information is determined, and then the initial brightness information The brightness information corresponding to the image area except the foreground area is determined as the second brightness information corresponding to the image area except the foreground area in the final brightness information; the first brightness information and the second brightness information are integrated to obtain the final brightness information.
  • the pixel value of each pixel in the above-mentioned mask image may be 0 or 255; wherein, when the pixel value is 0, the corresponding image area may be black, that is, the black area in FIG. 4; When the value is 255, the corresponding image area can be white, that is, the white area in Figure 4, and the white area can be the foreground area, so the final brightness information can be calculated by the following formula:
  • new_res ev0*(M/255)+(1-M/255)*res
  • new_res represents the final brightness information
  • ev0 represents the pixel brightness information of the reference frame image
  • the pixel brightness information includes the brightness value of each pixel in the reference frame image
  • M represents the pixel value of each pixel in the mask image (the The pixel value is 0 or 255);
  • res represents the initial brightness information, and the initial brightness information includes the brightness value of each pixel in the image after the fusion of multiple initial images.
  • step S51 a target image is obtained based on the final brightness information and the color information of the reference frame image.
  • the present application will be further introduced below by taking the acquisition of three initial images with different exposure degrees as an example.
  • obtain three initial images with different exposures in the form of YUV in the color space which are ev+1, ev0 and ev-2 respectively; among them, the exposure of ev+1 is +1, the exposure of ev0 is 0, and the exposure of ev-
  • the exposure of 2 is -2; then the three initial images are split on the Y channel and the UV channel.
  • the brightness information of the initial image is obtained on the Y channel, and the color information of the initial image is obtained on the UV channel. .
  • the ev+1 and ev-2 selected from the three initial images are fused (also called filter fusion) to obtain a fused image, and then the fused image is binarized , to obtain a mask image (also known as an image mask); then perform guided filtering on the obtained mask image to over-smooth the foreground and background areas in the mask image to obtain the final mask image.
  • the obtained three initial images with different exposure degrees are fused on the Y channel to obtain the initial brightness information.
  • the final luminance information is obtained through the above formula for calculating the final luminance information.
  • the above reference frame image refers to ev0, that is, an initial image with an exposure of 0.
  • the final brightness information obtained in the Y channel is combined with the color information of the reference frame image on the UV channel to obtain the target image.
  • the above image processing method which obtains a mask image for indicating the foreground area of the image based on multiple images with different exposures, and then fuses the brightness information of the foreground area in the reference frame image and the non-foreground in the initial brightness information through the mask image. area to ensure that the foreground area in the fused image is consistent with that in the reference frame image, thereby improving the visual effect of the foreground area in the fused image and improving the overall effect of the fused image.
  • yet another embodiment of the present application provides an image processing apparatus, as shown in FIG. 6 , the apparatus may include:
  • the image acquisition module 60 can be configured to acquire multiple initial images collected under different exposure degrees, and mask images corresponding to the multiple initial images; wherein, the mask image is based on at least a part of the multiple initial images Generated; this mask image is used to indicate foreground areas in multiple initial images.
  • the first fusion module 61 may be configured to perform fusion processing on the brightness information of the above-mentioned multiple initial images to obtain initial brightness information.
  • the second fusion module 62 may be configured to perform fusion processing on the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images based on the mask image to obtain final brightness information.
  • the information integration module 63 may be configured to obtain the target image based on the final luminance information and the color information of the reference frame image.
  • the color space of the above-mentioned initial image may be in the form of YUV
  • the luminance information may be the Y channel
  • the color information may be the UV channel.
  • the above-mentioned second fusion module 62 may be configured to: perform alpha fusion of the initial brightness information and the pixel brightness information of the reference frame image through the mask image to obtain the final brightness information.
  • the pixel value of each pixel in the above-mentioned mask image may be 0 or 255; the above-mentioned second fusion module 62 may also be configured to: obtain the final brightness information by calculating the following formula:
  • new_res ev0*(M/255)+(1-M/255)*res
  • new_res represents the final brightness information
  • ev0 represents the pixel brightness information of the reference frame image
  • M represents the pixel value of each pixel in the mask image
  • res represents the initial brightness information
  • the above-mentioned image acquisition module 60 may include: an initial image acquisition module, configured to acquire a plurality of initial images collected under different exposure degrees, wherein each initial image corresponds to one exposure degree; an image selection module, configured is used to select a specified number of initial images from a plurality of initial images; the fusion processing module is configured to perform fusion processing on the brightness information of the specified number of initial images to obtain a fusion image; the binarization processing module is configured to It is used to binarize the fused image to obtain a mask image.
  • the above-mentioned fusion processing module can be configured to: for each pair of two adjacent initial images of exposure in a specified number of initial images, perform fusion processing on the two adjacent initial images of the current exposure to obtain the current exposure.
  • the two first fused images obtained are fused to obtain the second fused image of the two first fused images adjacent to the current exposure; the second fused image is taken as the new first fused image, and the execution of each pair of exposures is continued.
  • the two adjacent first fusion images are fused to the two adjacent first fusion images of the current exposure, and the second fusion image of the two adjacent first fusion images of the current exposure is obtained.
  • the above-mentioned designated number may be two; the above-mentioned image selection module may be configured to: select the initial image with the maximum exposure and the initial image with the minimum exposure from the plurality of initial images.
  • the above-mentioned fusion processing module may also be configured to perform the following operation for each pixel in the two adjacent initial images with the current exposure: according to the current exposure, the current pixel in the two adjacent initial images Find the weighted weight from the preset weight matrix, where the weight matrix includes weighted weights corresponding to any two brightness values; according to the found weighted weights and the two initial images adjacent to the current exposure The brightness value of the current pixel point determines the brightness value corresponding to the current pixel point in the first fusion image.
  • the above-mentioned fusion processing module may also be configured to: from two initial images adjacent to the current exposure, determine the first brightness value of the current pixel in the first initial image and the second initial image The second brightness value of the current pixel in the The number of rows, determine the position of the weighted weight in the weight matrix, and determine the value corresponding to the position in the weight matrix as the found weighted weight.
  • the above-mentioned fusion processing module may also be configured to: determine the brightness value corresponding to the current pixel in the first fusion image by the following formula:
  • B i represents the brightness value of the ith pixel in the first fusion image, where the ith pixel is the current pixel;
  • w1 i represents the weighted weight found from the weight matrix, which is the adjacent current exposure.
  • the weighted weight corresponding to the i -th pixel in the first initial image A1 in the two initial images of , where w2 i 1-w1 i ;
  • A1 i represents the brightness value of the ith pixel in the first initial image A1;
  • A2 i represents the brightness of the ith pixel in the second initial image A2 value.
  • the above binarization processing module may also be configured to: perform guided filtering processing on the binarized fusion image to obtain a filtered mask image.
  • the above-mentioned first fusion module 61 can also be configured to: for each pair of two initial images adjacent to the exposure degree in the plurality of initial images, perform fusion processing on the two adjacent initial images of the current exposure degree, The first brightness maps of the two initial images adjacent to the current exposure are obtained; for each pair of two adjacent first brightness maps in the multiple first brightness maps obtained from the multiple initial images, the current exposure is determined relative to the current exposure.
  • the two adjacent first brightness maps are fused to obtain the second brightness map of the two first brightness maps adjacent to the current exposure; the second brightness map is used as the new first brightness map, and the execution of each pair of exposures is continued.
  • the above-mentioned image processing apparatus may first acquire a plurality of initial images collected under different exposure degrees, and a mask image corresponding to the plurality of initial images, wherein the mask image is generated based on at least a part of the plurality of initial images, and the mask image is generated based on at least a part of the initial images.
  • the mask image is used to indicate the foreground area in the multiple initial images; then the brightness information of the multiple initial images is fused to obtain the initial brightness information; then based on the mask image, the initial brightness information and the reference in the multiple initial images are combined.
  • the pixel brightness information of the frame image is fused to obtain the final brightness information; then based on the final brightness information and the color information of the reference frame image, the target image, that is, the fused image, is obtained.
  • This method obtains a mask image indicating the foreground area of the image based on multiple images with different exposures, and then fuses the brightness information of the foreground area in the reference frame image and the non-foreground area in the initial brightness information through the mask image.
  • the effect of the foreground area in the image is better, thus ensuring that the foreground area in the fused image matches the foreground area in the reference frame image, thereby improving the visual effect of the foreground area in the fused image, and also improving the fusion image. overall effect.
  • the electronic system may include: an image acquisition device, a processing device, and a storage device, the image acquisition device may be used to acquire preview video frames or image data, and the storage device may store There is a computer program that, when run by a processing device, can execute the image processing method as described above, or the steps of the image processing method described above.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program may be stored on the computer-readable storage medium, and when the computer program is run by a processing device, the above-mentioned image processing method may be executed.
  • the image processing method, the image processing apparatus, and the computer program product of the electronic system provided by the embodiments of the present application may include a computer-readable storage medium storing program codes, and the instructions included in the program codes may be used to execute the preceding
  • a computer-readable storage medium storing program codes
  • the instructions included in the program codes may be used to execute the preceding
  • the terms “installed”, “connected” and “connected” should be understood in a broad sense, for example, it may be a fixed connection or a detachable connection , or integrally connected; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or the internal communication between the two components.
  • installed should be understood in a broad sense, for example, it may be a fixed connection or a detachable connection , or integrally connected; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or the internal communication between the two components.
  • the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
  • the present application provides an image processing method, an image processing device, an electronic system and a readable storage medium for obtaining multiple initial images collected under different exposure degrees and mask images corresponding to the multiple initial images, and the mask images are used for Indicate the foreground area in the multiple initial images; fuse the brightness information of the multiple initial images to obtain the initial brightness information; based on the mask image, fuse the initial brightness information and the brightness information of the reference frame images in the multiple initial images to obtain the final brightness information; The target image is obtained based on the final luminance information and the color information of the reference frame image.
  • This method obtains a mask image indicating the foreground area of the image based on multiple images with different exposures, and then uses the mask image to fuse the brightness information of the foreground area in the reference frame image and the non-foreground area in the initial brightness information to ensure the image after fusion.
  • the foreground area in the image is matched with the reference frame image, thereby improving the visual effect of the foreground area in the fused image and the overall effect of the fused image.
  • the image processing method, image processing apparatus, electronic system and readable storage medium of the present application are reproducible and can be applied in various applications.
  • the image processing method, image processing apparatus, electronic system, and readable storage medium of the present application can be applied to the field of image processing technology and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

Provided are an image processing method, an image processing apparatus, an electronic system and a readable storage medium. The image processing method comprises: acquiring a plurality of initial images collected under different exposures, and a mask image corresponding to the plurality of initial images, wherein the mask image is used for indicating a foreground region in the plurality of initial images; fusing brightness information of the plurality of initial images to obtain initial brightness information; on the basis of the mask image, fusing the initial brightness information and brightness information of a reference frame image in the plurality of initial images to obtain final brightness information; and obtaining a target image on the basis of the final brightness information and color information of the reference frame image. According to the method, a mask image indicating a foreground region of a plurality of images with different exposures is obtained on the basis of the images, and then brightness information of a foreground region in a reference frame image and a non-foreground region in initial brightness information are fused by means of the mask image to ensure matching of a foreground region in a fused image and the foreground region in the reference frame image, thereby improving the visual effect of the foreground region in the fused image and also improving the overall effect of the fused image.

Description

图像处理方法、图像处理装置、电子系统及可读存储介质Image processing method, image processing device, electronic system and readable storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2021年01月28日提交中国国家知识产权局的申请号为202110122061.5、名称为“图像处理方法、装置和电子系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application No. 202110122061.5 and entitled "Image Processing Method, Device and Electronic System" filed with the State Intellectual Property Office of China on January 28, 2021, the entire contents of which are incorporated herein by reference Applying.
技术领域technical field
本申请涉及图像处理技术领域,尤其是涉及一种图像处理方法、图像处理装置、电子系统及可读存储介质。The present application relates to the technical field of image processing, and in particular, to an image processing method, an image processing device, an electronic system, and a readable storage medium.
背景技术Background technique
HDR(High-Dynamic Range,高动态范围)图像,相比普通的图像,可以提供更多的动态范围和图像细节,HDR图像是使用多张不同曝光的图片,然后利用软件将这些不同曝光的图像组合成的一张图像,该图像能够更好的反映出真实环境中的视觉效果。HDR (High-Dynamic Range, high dynamic range) images can provide more dynamic range and image details than ordinary images. HDR images use multiple images with different exposures, and then use software to convert these images with different exposures. The combined image can better reflect the visual effect in the real environment.
相关技术中,HDR图像合成方法通常采用线性融合的方式,但是该方式得到的合成图像对比度偏低,视觉上容易出现发灰的现象,导致合成的图像的人像区域视觉上看起来也发灰,使得图像整体的效果不够自然。In the related art, the HDR image synthesis method usually adopts the method of linear fusion, but the contrast of the synthesized image obtained by this method is low, and the phenomenon of graying is easy to appear visually, so that the portrait area of the synthesized image also looks gray visually. The overall effect of the image is not natural enough.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种图像处理方法、图像处理装置、电子系统及可读存储介质,以至少提高合成图像中人像区域的效果,同时提升合成图像的整体效果。The present application provides an image processing method, an image processing device, an electronic system, and a readable storage medium, so as to at least improve the effect of a portrait area in a composite image, and at the same time improve the overall effect of the composite image.
本申请的一些实施方式提供了一种图像处理方法,该方法可以包括:获取在不同曝光度下采集的多张初始图像,以及多张初始图像对应的蒙版图像,其中,该蒙版图像基于多张初始图像中的至少一部分图像生成,该蒙版图像用于指示多张初始图像中的前景区域;对多张初始图像的亮度信息进行融合处理,得到初始亮度信息;基于蒙版图像,将初始亮度信息和多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终亮度信息;基于最终亮度信息和参考帧图像的色彩信息,得到目标图像。Some embodiments of the present application provide an image processing method, the method may include: acquiring multiple initial images collected under different exposure degrees, and mask images corresponding to the multiple initial images, wherein the mask images are based on At least a part of the images in the multiple initial images are generated, and the mask image is used to indicate the foreground area in the multiple initial images; the brightness information of the multiple initial images is fused to obtain the initial brightness information; based on the mask image, the The initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images are fused to obtain the final brightness information; the target image is obtained based on the final brightness information and the color information of the reference frame images.
在可选的实施方式中,上述基于蒙版图像将初始亮度信息和多张初始图像中的参考帧图像的像素亮度信息进行融合处理而得到最终亮度信息的步骤可以包括:将初始亮度信息与参考帧图像的像素亮度信息,通过蒙版图像进行alpha融合,得到最终亮度信息。In an optional embodiment, the above-mentioned step of fusing the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images based on the mask image to obtain the final brightness information may include: combining the initial brightness information with the reference frame image. The pixel brightness information of the frame image is alpha-fused through the mask image to obtain the final brightness information.
在可选的实施方式中,上述蒙版图像中每个像素点的像素值可以为0或者255;上述将初始亮度信息与参考帧图像的像素亮度信息通过蒙版图像进行alpha融合而得到最终亮度信息的步骤可以包括:通过下述算式,计算得到最终亮度信息:new_res=ev0*(M/255)+(1-M/255)*res;In an optional implementation manner, the pixel value of each pixel in the mask image may be 0 or 255; the initial brightness information and the pixel brightness information of the reference frame image are alpha-fused through the mask image to obtain the final brightness The information step may include: calculating the final brightness information by the following formula: new_res=ev0*(M/255)+(1-M/255)*res;
其中,new_res表示最终亮度信息;ev0表示参考帧图像的像素亮度信息;M表示蒙版图像中每个像素点的像素值;res表示初始亮度信息。Among them, new_res represents the final brightness information; ev0 represents the pixel brightness information of the reference frame image; M represents the pixel value of each pixel in the mask image; res represents the initial brightness information.
在可选的实施方式中,上述获取在不同曝光度下采集的多张初始图像、以及多张初始图像对应的蒙版图像的步骤可以包括:获取在不同曝光度下采集的多张初始图像,其中,每张初始图像对应一种曝光度;从多张初始图像中,选取指定数量的初始图像;对指定数量的初始图像的亮度信息进行融合处理,得到融合图像;对融合图像进行二值化处理,得到蒙版图像。In an optional embodiment, the above-mentioned step of acquiring multiple initial images collected under different exposure degrees and mask images corresponding to the multiple initial images may include: acquiring multiple initial images collected under different exposure degrees, Among them, each initial image corresponds to one exposure; select a specified number of initial images from multiple initial images; perform fusion processing on the brightness information of the specified number of initial images to obtain a fusion image; binarize the fusion image Process to get the mask image.
在可选的实施方式中,上述指定数量可以为两个;上述从多张初始图像中选取指定数量的初始图像的步骤可以包括:从多张初始图像中,选取曝光度最大的初始图像和曝光度最小的初始图像。In an optional implementation manner, the above-mentioned designated number may be two; the above-mentioned step of selecting a designated number of initial images from a plurality of initial images may include: selecting an initial image with a maximum exposure and an exposure Minimum initial image.
在可选的实施方式中,上述对指定数量的初始图像的亮度信息进行融合处理而得到融合图像的步骤可以包括:针对指定数量的初始图像中每对曝光度相邻的两张初始图像,对当前曝光度相邻的两张初始图像进行融合处理,得到当前曝光度相邻的两张初始图像的第一融合图像;针对指定数量的初始图像得到的多张第一融合图像中每对曝光度相邻的两张第一融合图像,对当前曝光度相邻的两张第一融合图像进行融合处理,得到当前曝光度相邻的两张第一融合图像的第二融合图像;将第二融合图像作为新的第一融合图像,继续执行针对每对曝光度相邻的两张第一融合图像,对当前曝光度相邻的两张第一融合图像进行融合处理,得到当前曝光度相邻的两张第一融合图像的第二融合图像的步骤,直到得到一张最终的融合图像。In an optional embodiment, the above-mentioned step of obtaining a fused image by fusing the brightness information of a specified number of initial images may include: for each pair of two adjacent initial images in the specified number of initial images, for The two initial images adjacent to the current exposure are fused to obtain the first fusion image of the two adjacent initial images at the current exposure; each pair of exposures in the multiple first fusion images obtained for the specified number of initial images For two adjacent first fusion images, perform fusion processing on the two first fusion images adjacent to the current exposure degree to obtain a second fusion image of the two adjacent first fusion images at the current exposure degree; The image is used as a new first fusion image, continue to perform fusion processing for each pair of adjacent first fusion images with exposure, and perform fusion processing on the two adjacent first fusion images at the current exposure to obtain the adjacent current exposure. The steps of the second fused image of the two first fused images until a final fused image is obtained.
在可选的实施方式中,上述对当前曝光度相邻的两张初始图像进行融合处理而得到当前曝光度相邻的两张初始图像的第一融合图像的步骤可以包括:针对当前曝光度相邻的两张初始图像中的每个像素点,执行下述操作:根据当前曝光度相邻的两张初始图像中当前像素点的亮度值,从预设的权重矩阵中查找加权权重,其中,该权重矩阵中包括任意两个亮度值对应的加权权重;根据查到的加权权重和当前曝光度相邻的两张初始图像中当前像素点的亮度值,确定第一融合图像中当前像素点对应的亮度值。In an optional embodiment, the above-mentioned step of fusing two initial images adjacent to the current exposure to obtain a first fusion image of the two initial images adjacent to the current exposure may include: For each pixel in the two adjacent initial images, perform the following operations: according to the brightness value of the current pixel in the two adjacent initial images at the current exposure, find the weighted weight from the preset weight matrix, where, The weight matrix includes weighted weights corresponding to any two brightness values; according to the found weighted weights and the brightness values of the current pixel points in the two initial images adjacent to the current exposure, it is determined that the current pixel point in the first fusion image corresponds to brightness value.
在可选的实施方式中,上述根据当前曝光度相邻的两张初始图像中当前像素点的亮度值而从预设的权重矩阵中查找加权权重的步骤可以包括:从当前曝光度相邻的两张初始图像中,确定第一个初始图像中当前像素点的第一亮度值和第二个初始图像中当前像素点的第二亮度值;将第一亮度值与一的加和,确定为目标列数;将第二亮度值与一的加和,确定为目标行数;根据目标列数和目标行数,确定加权权重在权重矩阵中的位置,将权重矩阵中位置对应的数值确定为查找到的加权权重。In an optional implementation manner, the above-mentioned step of searching for a weighted weight from a preset weight matrix according to the brightness value of the current pixel in the two initial images adjacent to the current exposure may include: In the two initial images, the first brightness value of the current pixel in the first initial image and the second brightness value of the current pixel in the second initial image are determined; the sum of the first brightness value and one is determined as The number of target columns; the sum of the second brightness value and one is determined as the number of target rows; according to the number of target columns and the number of target rows, the position of the weighted weight in the weight matrix is determined, and the value corresponding to the position in the weight matrix is determined as Find the weighted weight.
在可选的实施方式中,上述根据查到的加权权重和当前曝光度相邻的两张初始图像中 当前像素点的亮度值而确定第一融合图像中当前像素点对应的亮度值的步骤可以包括:通过下述算式确定第一融合图像中当前像素点对应的亮度值:B i=w1 i*A1 i+w2 i*A2 i;其中,B i表示第一融合图像中第i个像素点的亮度值,其中,第i个像素点为当前像素点;w1 i表示从权重矩阵中查到的加权权重,为当前曝光度相邻的两张初始图像中第一个初始图像A1中第i个像素点对应的加权权重;w2 i表示当前曝光度相邻的两张初始图像中第二个初始图像A2中第i个像素点对应的加权权重,其中,w2 i=1-w1 i;A1 i表示第一个初始图像A1中第i个像素点的亮度值;A2 i表示第二个初始图像A2中第i个像素点的亮度值。 In an optional embodiment, the above step of determining the brightness value corresponding to the current pixel in the first fused image according to the found weighted weight and the brightness value of the current pixel in the two initial images adjacent to the current exposure may be: Including: determining the brightness value corresponding to the current pixel in the first fusion image by the following formula: B i =w1 i *A1 i +w2 i *A2 i ; wherein, B i represents the i-th pixel in the first fusion image , where the i-th pixel is the current pixel; w1 i represents the weighted weight found from the weight matrix, which is the i-th pixel in the first initial image A1 of the two adjacent initial images at the current exposure. The weighted weight corresponding to each pixel; w2 i represents the weighted weight corresponding to the i-th pixel in the second initial image A2 in the two initial images adjacent to the current exposure, where w2 i =1-w1 i ; A1 i represents the brightness value of the ith pixel in the first initial image A1; A2 i represents the brightness value of the ith pixel in the second initial image A2.
在可选的实施方式中,上述对融合图像进行二值化处理而得到蒙版图像的步骤可以包括:对二值化处理后的融合图像进行引导滤波处理,得到滤波后的蒙版图像。In an optional embodiment, the above-mentioned step of performing binarization processing on the fusion image to obtain a mask image may include: performing guided filtering processing on the fusion image after the binarization processing to obtain a filtered mask image.
在可选的实施方式中,上述对多张初始图像的亮度信息进行融合处理而得到初始亮度信息的步骤可以包括:针对多张初始图像中每对曝光度相邻的两张初始图像,对当前曝光度相邻的两张初始图像进行融合处理,得到当前曝光度相邻的两张初始图像的第一亮度图;针对多张初始图像得到的多张第一亮度图中每对曝光度相邻的两张第一亮度图,对当前曝光度相邻的两张第一亮度图进行融合处理,得到当前曝光度相邻的两张第一亮度图的第二亮度图;将第二亮度图作为新的第一亮度图,继续执行针对每对曝光度相邻的两张第一亮度图,对当前曝光度相邻的两张第一亮度图进行融合处理,得到当前曝光度相邻的两张第一亮度图的第二亮度图的步骤,直到得到一张亮度图为止;将得到的一张亮度图的亮度信息确定为初始亮度信息。In an optional embodiment, the above-mentioned step of fusing the brightness information of the multiple initial images to obtain the initial brightness information may include: for each pair of adjacent initial images in the multiple initial images, for the current The two initial images with adjacent exposure degrees are fused to obtain the first brightness map of the two initial images adjacent to the current exposure degree; each pair of adjacent exposure degrees in the multiple first brightness maps obtained for the multiple initial images The two first luminance maps of For the new first brightness map, continue to execute the two adjacent first brightness maps for each pair of exposure degrees, and perform fusion processing on the two adjacent first brightness maps of the current exposure degree to obtain two adjacent current exposure degrees. The steps of the second brightness map of the first brightness map are until a brightness map is obtained; the brightness information of the obtained brightness map is determined as the initial brightness information.
在可选的实施方式中,上述初始图像的颜色空间可以为YUV形式,亮度信息可以为Y通道,色彩信息可以为UV通道。In an optional implementation manner, the color space of the above-mentioned initial image may be in the form of YUV, the luminance information may be the Y channel, and the color information may be the UV channel.
本申请的另一些实施方式提供了一种图像处理装置,该装置可以包括:图像获取模块,所述图像获取模块配置成用于获取在不同曝光度下采集的多张初始图像,以及多张初始图像对应的蒙版图像,其中,该蒙版图像基于多张初始图像中的至少一部分图像生成,该蒙版图像用于指示多张初始图像中的前景区域;第一融合模块,所述第一融合模块配置成用于对多张初始图像的亮度信息进行融合处理,得到初始亮度信息;第二融合模块,所述第二融合模块配置成用于基于蒙版图像,将初始亮度信息和多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终亮度信息;信息整合模块,所述信息整合模块配置成用于基于最终亮度信息和参考帧图像的色彩信息,得到目标图像。Other embodiments of the present application provide an image processing apparatus, the apparatus may include: an image acquisition module, the image acquisition module is configured to acquire a plurality of initial images collected under different exposure degrees, and a plurality of initial images a mask image corresponding to the image, wherein the mask image is generated based on at least a part of the multiple initial images, and the mask image is used to indicate the foreground area in the multiple initial images; the first fusion module, the first The fusion module is configured to perform fusion processing on brightness information of multiple initial images to obtain initial brightness information; a second fusion module, the second fusion module is configured to combine the initial brightness information with the multiple images based on the mask image. The pixel brightness information of the reference frame image in the initial image is fused to obtain final brightness information; the information integration module is configured to obtain the target image based on the final brightness information and the color information of the reference frame image.
在可选的实施方式中,所述第二融合模块可以配置成用于将初始亮度信息与参考帧图像的像素亮度信息,通过蒙版图像进行alpha融合,得到最终亮度信息。In an optional embodiment, the second fusion module may be configured to perform alpha fusion of the initial brightness information and the pixel brightness information of the reference frame image through the mask image to obtain the final brightness information.
在可选的实施方式中,所述蒙版图像中每个像素点的像素值可以为0或者255;所述第二融合模块可以配置成用于通过下述算式,计算得到所述最终亮度信息:In an optional implementation manner, the pixel value of each pixel in the mask image may be 0 or 255; the second fusion module may be configured to obtain the final brightness information by calculating the following formula :
new_res=ev0*(M/255)+(1-M/255)*res;new_res=ev0*(M/255)+(1-M/255)*res;
其中,new_res表示所述最终亮度信息;ev0表示所述参考帧图像的像素亮度信息;M表示所述蒙版图像中每个像素点的像素值;res表示所述初始亮度信息。Wherein, new_res represents the final brightness information; ev0 represents the pixel brightness information of the reference frame image; M represents the pixel value of each pixel in the mask image; res represents the initial brightness information.
在可选的实施方式中,所述图像获取模块可以包括:初始图像获取模块,所述初始图像获取模块配置成用于获取在不同曝光度下采集的多张初始图像,其中,每张所述初始图像对应一种曝光度;图像选取模块,所述图像选取模块配置成用于从所述多张初始图像中,选取指定数量的所述初始图像;融合处理模块,所述融合处理模块配置成用于对所述指定数量的所述初始图像的亮度信息进行融合处理,得到融合图像;以及二值化处理模块,所述二值化处理模块配置成用于对所述融合图像进行二值化处理,得到所述蒙版图像。In an optional implementation manner, the image acquisition module may include: an initial image acquisition module, the initial image acquisition module is configured to acquire a plurality of initial images collected under different exposure degrees, wherein each of the initial images The initial image corresponds to a kind of exposure; an image selection module, the image selection module is configured to select a specified number of the initial images from the plurality of initial images; a fusion processing module, the fusion processing module is configured to for performing fusion processing on the brightness information of the specified number of the initial images to obtain a fusion image; and a binarization processing module, the binarization processing module is configured to binarize the fusion image processing to obtain the mask image.
本申请的再一些实施方式提供了一种电子系统,该电子系统可以包括图像采集设备、处理设备和存储装置,该图像采集设备可以用于获取预览视频帧或图像数据;该存储装置上可以存储有计算机程序,该计算机程序在被处理设备运行时可以执行前述实施方式任一项所述的图像处理方法。Still other embodiments of the present application provide an electronic system, the electronic system may include an image capture device, a processing device and a storage device, the image capture device may be used to acquire preview video frames or image data; the storage device may store There is a computer program that can execute the image processing method described in any one of the foregoing embodiments when the computer program is run by the processing device.
本申请的又一些实施方式提供了一种计算机可读存储介质,该计算机可读存储介质上可以存储有计算机程序,该计算机程序被处理设备运行时可以执行前述实施方式任一项所述的图像处理方法。Still other embodiments of the present application provide a computer-readable storage medium, where a computer program may be stored thereon, and when the computer program is run by a processing device, the image described in any one of the foregoing embodiments may be executed. Approach.
本申请实施例至少带来了以下有益效果:The embodiments of the present application bring at least the following beneficial effects:
本申请提供的一种图像处理方法、图像处理装置、电子系统及可读存储介质,首先获取在不同曝光度下采集的多张初始图像,以及多张初始图像对应的蒙版图像,其中,该蒙版图像基于多张初始图像中的至少一部分图像生成;该蒙版图像用于指示多张初始图像中的前景区域;进而对多张初始图像的亮度信息进行融合处理,得到初始亮度信息;再基于蒙版图像,将初始亮度信息和多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终亮度信息;然后基于最终亮度信息和参考帧图像的色彩信息,得到目标图像,也即是融合后的图像。该方式基于不同曝光度的多张图像得到用于指示图像前景区域的蒙版图像,进而通过蒙版图像融合参考帧图像中前景区域的亮度信息和初始亮度信息中的非前景区域,由于参考帧图像中的前景区域效果较好,从而确保了融合后图像中的前景区域与参考帧图像中的前景区域相匹配,从而提高了融合后图像中前景区域的视觉效果,也提升了融合后图像的整体效果。In an image processing method, an image processing device, an electronic system and a readable storage medium provided by the present application, a plurality of initial images collected under different exposure degrees and a mask image corresponding to the plurality of initial images are first obtained, wherein the The mask image is generated based on at least a part of the multiple initial images; the mask image is used to indicate the foreground area in the multiple initial images; further, the brightness information of the multiple initial images is fused to obtain the initial brightness information; Based on the mask image, the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images are fused to obtain the final brightness information; then based on the final brightness information and the color information of the reference frame images, the target image is obtained, and also That is, the fused image. This method obtains a mask image indicating the foreground area of the image based on multiple images with different exposures, and then fuses the brightness information of the foreground area in the reference frame image and the non-foreground area in the initial brightness information through the mask image. The effect of the foreground area in the image is better, thus ensuring that the foreground area in the fused image matches the foreground area in the reference frame image, thereby improving the visual effect of the foreground area in the fused image, and also improving the fusion image. overall effect.
本申请的其他特征和优点将在随后的说明书中阐述,或者,部分特征和优点可以从说 明书推知或毫无疑义地确定,或者通过实施本申请的上述技术即可得知。Other features and advantages of the present application will be set forth in the description that follows, or some of the features and advantages may be inferred or unambiguously determined from the description, or may be learned by practicing the above-described techniques of the present application.
为使本申请的上述目的、特征和优点能更明显易懂,下文特举较佳实施方式,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the preferred embodiments are exemplified below, and are described in detail as follows in conjunction with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本申请具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the specific embodiments or the prior art will be briefly introduced below. The drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1为本申请实施例提供的一种电子系统的结构示意图;1 is a schematic structural diagram of an electronic system according to an embodiment of the present application;
图2为本申请实施例提供的一种图像处理方法的流程图;FIG. 2 is a flowchart of an image processing method provided by an embodiment of the present application;
图3为本申请实施例提供的另一种图像处理方法的流程图;FIG. 3 is a flowchart of another image processing method provided by an embodiment of the present application;
图4为本申请实施例提供的一种蒙版图像的示意图;4 is a schematic diagram of a mask image provided by an embodiment of the present application;
图5为本申请实施例提供的另一种图像处理方法的流程图;5 is a flowchart of another image processing method provided by an embodiment of the present application;
图6为本申请实施例提供的一种图像处理装置的结构示意图。FIG. 6 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of the present application, but not all of the embodiments. The components of the embodiments of the present application generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations.
因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。Thus, the following detailed description of the embodiments of the application provided in the accompanying drawings is not intended to limit the scope of the application as claimed, but is merely representative of selected embodiments of the application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
随着手机功能不断完善,用户对手机如相机的功能的需求越来越高,HDR作为手机的一项功能性应用,得到了非常广泛的应用。HDR又称宽动态范围技术,是在非常强烈的对比下让摄像机看到影像的特色而运用的一种技术。当在强光源(日光、灯具或反光等)照射下的高亮度区域及阴影、逆光等相对亮度较低的区域在图像中同时存在时,摄像机输出的图像会出现明亮区域因曝光过度成为白色,而黑暗区域因曝光不足成为黑色,严重影响图像质量。摄像机在同一场景中对最亮区域及较暗区域的表现是存在局限的,这种局限就是通常所讲的“动态范围”。HDR图像是使用多张不同曝光的图片,然后再用软件它们组合成一张图片。它的优势是最终可以得到一张无论在阴影部分还是高光部分都有细节的图片。With the continuous improvement of the functions of mobile phones, users have higher and higher demands for the functions of mobile phones such as cameras. As a functional application of mobile phones, HDR has been widely used. HDR, also known as wide dynamic range technology, is a technology used to let the camera see the characteristics of the image under very strong contrast. When high-brightness areas under strong light sources (sunlight, lamps or reflections, etc.) and relatively low-brightness areas such as shadows and backlights coexist in the image, the image output by the camera will appear bright areas that become white due to overexposure. The dark areas become black due to underexposure, which seriously affects the image quality. There is a limit to how a camera can perform in the brightest and darkest areas of the same scene, and this limitation is commonly referred to as "dynamic range". An HDR image uses multiple images with different exposures and then combines them into a single image using software. Its advantage is that you end up with a picture with details in both shadows and highlights.
相关技术中的HDR图像合成方法,通常采用线性融合的方式,但是该方式得到的合成图像对比度偏低,视觉上容易出现发灰的现象,导致合成的图像的人像区域视觉上看起来 也发灰,使得图像整体的效果不够自然。The HDR image synthesis method in the related art usually adopts the method of linear fusion, but the contrast of the synthesized image obtained by this method is low, and the phenomenon of graying is easy to appear visually, so that the portrait area of the synthesized image also looks gray visually. , so that the overall effect of the image is not natural enough.
首先,参照图1来描述用于实现本申请的一实施例的图像处理方法、图像处理装置、电子系统的示例电子系统100、及可读存储介质。First, an example electronic system 100 , and a readable storage medium for implementing an image processing method, an image processing apparatus, and an electronic system for implementing an embodiment of the present application will be described with reference to FIG. 1 .
如图1所示的一种电子系统的结构示意图,电子系统100可以包括一个或多个处理设备102、一个或多个存储装置104、输入装置106、输出装置108以及一个或多个图像采集设备110,这些组件可以通过总线系统112和/或其它形式的连接机构(未示出)互连。应当注意,图1所示的电子系统100的组件和结构只是示例性的,而非限制性的,根据需要,所述电子系统也可以具有其他组件和结构。As shown in FIG. 1 is a schematic structural diagram of an electronic system, the electronic system 100 may include one or more processing devices 102, one or more storage devices 104, an input device 106, an output device 108, and one or more image acquisition devices 110, these components may be interconnected by a bus system 112 and/or other form of connection mechanism (not shown). It should be noted that the components and structures of the electronic system 100 shown in FIG. 1 are only exemplary and not limiting, and the electronic system may also have other components and structures as required.
所述处理设备102可以是网关,也可以为智能终端,或者可以是包含中央处理单元(CPU)或者具有数据处理能力和/或指令执行能力的其它形式的处理单元的设备,可以对所述电子系统100中的其它组件的数据进行处理,还可以控制所述电子系统100中的其它组件以执行期望的功能。The processing device 102 may be a gateway or an intelligent terminal, or may be a device including a central processing unit (CPU) or other forms of processing units with data processing capability and/or instruction execution capability, and may The data of other components in the system 100 are processed and other components in the electronic system 100 may also be controlled to perform desired functions.
所述存储装置104可以包括一个或多个计算机程序产品,所述计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。所述易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。所述非易失性存储器例如可以包括只读存储器(ROM)、硬盘、闪存等。在所述计算机可读存储介质上可以存储一个或多个计算机程序指令,处理设备102可以运行所述程序指令,以实现下文所述的本申请实施例中(由处理设备实现)的客户端功能以及/或者其它期望的功能。在所述计算机可读存储介质中还可以存储各种应用程序和各种数据,例如所述应用程序使用和/或产生的各种数据等。The storage device 104 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and/or cache memory, or the like. The non-volatile memory may include, for example, read only memory (ROM), hard disk, flash memory, and the like. One or more computer program instructions may be stored on the computer-readable storage medium, and the processing device 102 may execute the program instructions to implement the client functions (implemented by the processing device) in the embodiments of the present application described below. and/or other desired functionality. Various application programs and various data, such as various data used and/or generated by the application program, etc. may also be stored in the computer-readable storage medium.
所述输入装置106可以是用户用来输入指令的装置,并且可以包括键盘、鼠标、麦克风和触摸屏等中的一个或多个。The input device 106 may be a device used by a user to input instructions, and may include one or more of a keyboard, mouse, microphone, touch screen, and the like.
所述输出装置108可以向外部(例如,用户)输出各种信息(例如,图像或声音),并且可以包括显示器、扬声器等中的一个或多个。The output device 108 may output various information (eg, images or sounds) to the outside (eg, a user), and may include one or more of a display, a speaker, and the like.
所述图像采集设备110可以采集预览视频帧或图像数据,并且可以将采集到的预览视频帧或图像数据存储在所述存储装置104中以供其它组件使用。The image capturing device 110 may capture preview video frames or image data, and may store the captured preview video frames or image data in the storage device 104 for use by other components.
示例性地,用于实现根据本申请实施例的图像处理方法、文本识别方法、装置和电子系统的示例电子系统中的各器件可以集成设置,也可以分散设置,诸如将处理设备102、存储装置104、输入装置106和输出装置108集成设置于一体,而将图像采集设备110设置于可以采集到目标图像的指定位置。当上述电子系统中的各器件集成设置时,该电子系统可以被实现为诸如相机、智能手机、平板电脑、计算机、车载终端等智能终端。Exemplarily, each device in the example electronic system for implementing the image processing method, text recognition method, apparatus, and electronic system according to the embodiments of the present application may be integrated or distributed, such as the processing device 102, the storage device 104. The input device 106 and the output device 108 are integrated and arranged into one body, and the image capturing device 110 is arranged at a designated position where the target image can be captured. When the various devices in the above electronic system are integrated, the electronic system can be implemented as a smart terminal such as a camera, a smart phone, a tablet computer, a computer, a vehicle-mounted terminal, and the like.
本申请的另一实施例提供了一种图像处理方法,该方法可以由上述电子系统中的处理 设备执行;该处理设备可以是具有数据处理能力的任何设备或芯片。该处理设备可以独立对接收到的信息进行处理,也可以与服务器相连,共同对信息进行分析处理。如图2所示,该图像处理方法可以包括如下具体步骤:Another embodiment of the present application provides an image processing method, which can be executed by a processing device in the above electronic system; the processing device can be any device or chip with data processing capability. The processing device can independently process the received information, or can be connected with a server to jointly analyze and process the information. As shown in Figure 2, the image processing method may include the following specific steps:
步骤S202,获取在不同曝光度下采集的多张初始图像,以及多张初始图像对应的蒙版图像;其中,该蒙版图像基于多张初始图像中的至少一部分图像生成;该蒙版图像用于指示多张初始图像中的前景区域。Step S202, obtaining a plurality of initial images collected under different exposure degrees, and a mask image corresponding to the plurality of initial images; wherein, the mask image is generated based on at least a part of the images in the plurality of initial images; to indicate foreground regions in multiple initial images.
上述初始图像可以是通过摄像装置或者照相机拍摄的图片或者照片。在具体实现时,可以通过通信连接的照相机、摄像头等设备拍摄后传入,或者从存储有已经拍摄完成的待处理的图像的存储设备中获取初始图像。获取到的多张初始图像中每张初始图像所拍摄的场景可以是相同的,但是每张初始图像对应的曝光度可以不同,该曝光度指的是感受到光亮的强弱及时间的长短,通常曝光度越高,拍摄得到的图像越发白;曝光度越低,拍摄得到的图像越黑暗。The above-mentioned initial image may be a picture or photo taken by a camera or a camera. During specific implementation, the camera, camera and other devices connected through communication can be used to transfer the image after shooting, or the initial image can be obtained from a storage device that stores images that have been captured and to be processed. The scene captured by each initial image in the obtained multiple initial images may be the same, but the exposure corresponding to each initial image may be different, and the exposure refers to the intensity of the light and the length of time. Generally, the higher the exposure, the whiter the captured image; the lower the exposure, the darker the captured image.
上述蒙版图像可以是基于多张初始图像中的至少一部分图像生成的,该至少一部分图像可以是多张初始图像中的至少两张图像。在具体实现时,可以从多张初始图像中选取至少一部分图像,然后将选取的初始图像对应的灰度图像进行融合处理,可以得到蒙版图像。该蒙版图像可以用于指示多张图像中的前景区域,在蒙版图像中前景区域对应的图像区域的像素值可以与除前景区域之外的图像区域的像素值不同,从而可以区分前景区域和非前景区域。该前景区域通常是指包含有人像的图像区域。The above-mentioned mask image may be generated based on at least a part of the plurality of initial images, and the at least part of the images may be at least two images of the plurality of initial images. During specific implementation, at least a part of images can be selected from multiple initial images, and then the grayscale images corresponding to the selected initial images are fused to obtain a mask image. The mask image can be used to indicate the foreground area in multiple images, and the pixel value of the image area corresponding to the foreground area in the mask image can be different from the pixel value of the image area other than the foreground area, so that the foreground area can be distinguished and non-foreground areas. The foreground area usually refers to the area of the image that contains a human figure.
步骤S204,对多张初始图像的亮度信息进行融合处理,得到初始亮度信息。Step S204, performing fusion processing on the brightness information of the multiple initial images to obtain initial brightness information.
上述初始图像的亮度信息通常可以是指该初始图像中每个像素点对应的明亮度,该明亮度也可以称为灰阶值、灰度值或者亮度值,用于指示图像的亮暗程度;该明亮度的取值范围可以为0~255。在一些实施例中,上述初始图像的颜色空间可以为YUV(Y表示明亮度,U和V表示色度)形式,该初始图像的亮度信息也即是初始图像在Y通道上对应的数据。The brightness information of the above-mentioned initial image can usually refer to the brightness corresponding to each pixel in the initial image, and the brightness can also be called a grayscale value, a grayscale value or a brightness value, which is used to indicate the brightness and darkness of the image; The value of the brightness can range from 0 to 255. In some embodiments, the color space of the initial image may be in the form of YUV (Y represents brightness, and U and V represent chromaticity), and the brightness information of the initial image is the data corresponding to the Y channel of the initial image.
在具体实现时,将多张不同曝光度的初始图像的亮度信息融合在一起,可以得到一张融合的图像对应的亮度信息,该亮度信息也即是初始亮度信息;该初始亮度信息中可以包含有融合的图像中每个像素点对应的明亮度。In the specific implementation, the brightness information of multiple initial images with different exposure degrees is fused together, and the brightness information corresponding to a fused image can be obtained, and the brightness information is also the initial brightness information; the initial brightness information can include The brightness corresponding to each pixel in the fused image.
步骤S206,基于上述蒙版图像,将初始亮度信息和多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终亮度信息。Step S206, based on the above-mentioned mask image, perform fusion processing on the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images to obtain final brightness information.
上述参考帧图像可以是用户按照预设规则从多张初始图像中指定的初始图像,例如,该参考帧图像可以是曝光度为指定值(该指定值可以根据用户需求设置,例如可以设置为0或者1等)的初始图像,也可以是多张初始图像中前景区域效果最好的图像等。上述参 考帧图像的像素亮度信息可以包括该参考帧图像中每个像素点对应的明亮度。The above-mentioned reference frame image may be an initial image specified by a user from a plurality of initial images according to preset rules, for example, the reference frame image may be a specified value of exposure (the specified value can be set according to user requirements, for example, it can be set to 0. Or the initial image of 1, etc.), or it may be the image with the best foreground area effect among multiple initial images, etc. The pixel brightness information of the reference frame image may include the brightness corresponding to each pixel in the reference frame image.
由于参考帧图像中的前景区域效果最好,因而,通过蒙版图像指示的前景区域得到参考帧图像中的前景区域,从而将参考帧图像中的前景区域的像素亮度信息,作为最终亮度信息中前景区域对应的每个像素点的明亮度;通过蒙版图像指示的前景区域,从初始亮度信息中得到除前景区域之外的图像区域对应的亮度信息,从而将初始亮度信息中除前景区域之外的图像区域对应的亮度信息,作为最终亮度信息中除前景区域之外的图像区域中每个像素点对应的明亮度。Since the foreground area in the reference frame image has the best effect, the foreground area in the reference frame image is obtained through the foreground area indicated by the mask image, so that the pixel brightness information of the foreground area in the reference frame image is used as the final brightness information. The brightness of each pixel corresponding to the foreground area; through the foreground area indicated by the mask image, the brightness information corresponding to the image area except the foreground area is obtained from the initial brightness information, so that the initial brightness information except the foreground area is obtained. The brightness information corresponding to the other image areas is used as the brightness corresponding to each pixel in the image areas other than the foreground area in the final brightness information.
步骤S208,基于最终亮度信息和参考帧图像的色彩信息,得到目标图像。In step S208, a target image is obtained based on the final brightness information and the color information of the reference frame image.
上述参考帧图像的色彩信息可以是指该初始图像中每个像素点对应的色度,该色度的作用可以是描述参考帧图像的色彩及饱和度,用于指定像素的颜色。在一些实施例中,上述参考帧图像的颜色空间可以是YUV形式,该参考帧图像的色彩信息也即是参考帧图像在UV通道上对应的数据。The color information of the reference frame image may refer to the chromaticity corresponding to each pixel in the initial image, and the function of the chromaticity may be to describe the color and saturation of the reference frame image and to specify the color of the pixel. In some embodiments, the color space of the reference frame image may be in the form of YUV, and the color information of the reference frame image is the data corresponding to the reference frame image on the UV channel.
在具体实现时,将最终亮度信息和参考帧图像的色彩信息进行融合,可以得到目标图像,也即是目标图像中的每个像素点对应的像素值可以是由最终亮度信息中每个像素点的明亮度和参考帧图像中每个像素点的色度决定的。In the specific implementation, the final brightness information and the color information of the reference frame image are fused to obtain the target image, that is, the pixel value corresponding to each pixel in the target image can be determined by each pixel in the final brightness information. It is determined by the brightness of each pixel and the chromaticity of each pixel in the reference frame image.
本申请实施例提供的一种图像处理方法,首先获取在不同曝光度下采集的多张初始图像,以及多张初始图像对应的蒙版图像;其中,该蒙版图像基于多张初始图像中的至少一部分图像生成;该蒙版图像用于指示多张初始图像中的前景区域;进而对多张初始图像的亮度信息进行融合处理,得到初始亮度信息;再基于蒙版图像,将初始亮度信息和多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终亮度信息;然后基于最终亮度信息和参考帧图像的色彩信息,得到目标图像,也即是融合后的图像。该方式基于不同曝光度的多张图像得到用于指示图像前景区域的蒙版图像,进而通过蒙版图像融合参考帧图像中前景区域的亮度信息和初始亮度信息中的非前景区域,由于参考帧图像中的前景区域效果较好,从而确保了融合后图像中的前景区域与参考帧图像中的前景区域相匹配,从而提高了融合后图像中前景区域的视觉效果,也提升了融合后图像的整体效果。In an image processing method provided by an embodiment of the present application, a plurality of initial images collected under different exposure degrees and a mask image corresponding to the plurality of initial images are first obtained; wherein, the mask image is based on the At least a part of the image is generated; the mask image is used to indicate the foreground area in the multiple initial images; then the brightness information of the multiple initial images is fused to obtain the initial brightness information; based on the mask image, the initial brightness information and the The pixel brightness information of the reference frame images in the multiple initial images is fused to obtain the final brightness information; then based on the final brightness information and the color information of the reference frame images, the target image, that is, the fused image, is obtained. This method obtains a mask image indicating the foreground area of the image based on multiple images with different exposures, and then fuses the brightness information of the foreground area in the reference frame image and the non-foreground area in the initial brightness information through the mask image. The effect of the foreground area in the image is better, thus ensuring that the foreground area in the fused image matches the foreground area in the reference frame image, thereby improving the visual effect of the foreground area in the fused image, and also improving the fusion image. overall effect.
本申请的再一实施例还提供另一种图像处理方法,该方法可以在上述实施例所述方法的基础上实现;该方法重点描述获取在不同曝光度下采集的多张初始图像,以及所述多张初始图像对应的蒙版图像的具体过程(通过下述步骤S302-S308实现);如图3所示,该方法可以包括如下具体步骤:Yet another embodiment of the present application also provides another image processing method, which can be implemented on the basis of the methods described in the above embodiments; the method focuses on the acquisition of multiple initial images collected under different exposures, and the Describe the specific process of the mask images corresponding to the multiple initial images (implemented through the following steps S302-S308); as shown in Figure 3, the method may include the following specific steps:
步骤S302,获取在不同曝光度下采集的多张初始图像;其中,每张初始图像对应一种曝光度。Step S302, acquiring a plurality of initial images collected under different exposure degrees; wherein each initial image corresponds to one exposure degree.
步骤S304,从多张初始图像中,选取指定数量的初始图像。In step S304, a specified number of initial images are selected from the plurality of initial images.
上述指定数量可以为至少两个,该指定数量的具体数值可以根据研发需求设定,例如,可以设置为两个或者三个等。在一些实施例中,为了提高计算效率,可以将指定数量设置为两个,也即是可以随机从多张初始图像中选取两张初始图像,也可以从多张初始图像中选取曝光度最大的初始图像和曝光度最小的初始图像。The above specified number may be at least two, and the specific value of the specified number may be set according to research and development requirements, for example, may be set to two or three, etc. In some embodiments, in order to improve computational efficiency, the specified number may be set to two, that is, two initial images may be randomly selected from multiple initial images, or the one with the highest exposure may be selected from multiple initial images The initial image and the initial image with minimal exposure.
步骤S306,对指定数量的初始图像的亮度信息进行融合处理,得到融合图像。Step S306, performing fusion processing on the brightness information of a specified number of initial images to obtain a fusion image.
可以将指定数量的初始图像的亮度信息融合为一张融合图像,该融合图像中可以仅包含有每个像素点对应的亮度值。在具体实现时,如果指定数量大于两个,上述步骤S306可以通过下述步骤10-12实现:The brightness information of a specified number of initial images can be fused into a fused image, and the fused image can only contain the brightness value corresponding to each pixel. During specific implementation, if the specified number is greater than two, the above step S306 can be implemented through the following steps 10-12:
步骤10,针对指定数量的初始图像中每对曝光度相邻的两张初始图像,对当前曝光度相邻的两张初始图像进行融合处理,得到当前曝光度相邻的两张初始图像的第一融合图像。Step 10: For each pair of two adjacent initial images in the specified number of exposures, perform fusion processing on the two adjacent initial images at the current exposure to obtain the first image of the two adjacent initial images at the current exposure. a fused image.
在具体实现时,上述指定数量的初始图像可以是按照曝光度由大到小或者由小到大的顺序进行排序的。如果指定数量为三个,那么指定数量的初始图像中曝光度相邻的两张初始图像就有两对,也即是可以得到两张第一融合图像;如果指定数量为两个,那么指定数量的初始图像中曝光度相邻的两张初始图像只有一对,也即是可以得到一张第一融合图像,该张第一融合图像也即是步骤S306中得到的融合图像。During specific implementation, the above-mentioned specified number of initial images may be sorted in order of exposure from large to small or from small to large. If the specified number is three, then there are two pairs of two initial images with adjacent exposures in the specified number of initial images, that is, two first fusion images can be obtained; if the specified number is two, then the specified number In the initial image of , there are only one pair of two initial images with adjacent exposure degrees, that is, a first fused image can be obtained, and the first fused image is also the fused image obtained in step S306 .
具体地,对当前曝光度相邻的两张初始图像进行融合处理而得到当前曝光度相邻的两张初始图像的第一融合图像的具体过程可以为:针对当前曝光度相邻的两张初始图像中的每个像素点,执行下述步骤20-21,以得到第一融合图像:Specifically, the specific process of performing fusion processing on two initial images adjacent to the current exposure to obtain the first fusion image of the two adjacent initial images at the current exposure may be: for the two initial images adjacent to the current exposure For each pixel in the image, perform the following steps 20-21 to obtain the first fused image:
步骤20,根据当前曝光度相邻的两张初始图像中当前像素点的亮度值,从预设的权重矩阵中查找加权权重;其中,该权重矩阵中包括任意两个亮度值对应的加权权重。Step 20: Search for weighting weights from a preset weighting matrix according to the brightness values of the current pixels in the two initial images adjacent to the current exposure; wherein the weighting matrix includes weighting weights corresponding to any two brightness values.
上述亮度值可以相当于Y通道上的明亮度,也可以称为是灰度值,该亮度值的取值可以为0-255之间的整数。上述权重矩阵可以是研发人员根据研发需求提前设置好的,该权重矩阵中可以包含有任意两个灰度值对应的加权权重,该权重矩阵中所包含的每个数值可以均为小于1的正数,也即是加权权重为小于1的正数。该权重矩阵可以是一个256*256的矩阵,也即是权重矩阵具有256行和256列,其中,256行可以分别对应0-255之间的整数依次对应的行;256列可以分别对应0-255之间的整数依次对应的列。The above-mentioned brightness value may be equivalent to the brightness on the Y channel, and may also be referred to as a grayscale value, and the value of the brightness value may be an integer between 0 and 255. The above weight matrix can be set in advance by the research and development personnel according to the research and development requirements. The weight matrix can contain weighting weights corresponding to any two gray values, and each value contained in the weight matrix can be a positive value less than 1. number, that is, a positive number with a weighted weight less than 1. The weight matrix can be a 256*256 matrix, that is, the weight matrix has 256 rows and 256 columns, wherein, 256 rows can correspond to the rows corresponding to integers between 0-255 respectively; 256 columns can respectively correspond to 0- The integers between 255 correspond to the columns in order.
在一些实施例中,上述步骤20可以通过下述步骤30-32实现:In some embodiments, the above step 20 can be implemented by the following steps 30-32:
步骤30,从当前曝光度相邻的两张初始图像中,确定第一个初始图像中当前像素点的第一亮度值和第二个初始图像中当前像素点的第二亮度值。Step 30: Determine the first brightness value of the current pixel in the first initial image and the second brightness value of the current pixel in the second initial image from the two initial images adjacent to the current exposure.
上述第一个初始图像可以是两张初始图像中曝光度较大的图像,也可以是曝光度较小的图像。The above-mentioned first initial image may be an image with a larger exposure among the two initial images, or an image with a smaller exposure.
步骤31,将第一亮度值与一的加和,确定为目标列数;将第二亮度值与一的加和,确 定为目标行数。Step 31, the sum of the first brightness value and one is determined as the target number of columns; the sum of the second brightness value and one is determined as the target number of rows.
由于亮度值是从0开始的,而矩阵的行数或者列数都是从1开始的,所以可以将第一亮度值与一的加和确定为需要查询的目标列数,可以将第二亮度值与一的加和确定为需要查找的目标行数。Since the brightness value starts from 0, and the number of rows or columns of the matrix starts from 1, the sum of the first brightness value and one can be determined as the target number of columns to be queried, and the second brightness can be The sum of the value and one determines the number of target rows to find.
步骤32,根据目标列数和目标行数,确定加权权重在权重矩阵中的位置,将权重矩阵中该位置对应的数值确定为查找到的加权权重。Step 32: Determine the position of the weighted weight in the weight matrix according to the target number of columns and the target row, and determine the value corresponding to the position in the weight matrix as the found weighted weight.
根据目标行数和目标列数可以在权重矩阵中定位需要查找的加权权重的位置,并将该位置对应的数值确定为需要查找的加权权重。The position of the weighted weight to be searched can be located in the weight matrix according to the number of target rows and the number of target columns, and the value corresponding to the position is determined as the weighted weight to be searched for.
步骤21,根据查到的加权权重和当前曝光度相邻的两张初始图像中当前像素点的亮度值,确定第一融合图像中当前像素点对应的亮度值。Step 21: Determine the brightness value corresponding to the current pixel point in the first fused image according to the found weighted weight and the brightness value of the current pixel point in the two initial images adjacent to the current exposure.
在具体实现时,可以通过下述算式确定第一融合图像中当前像素点对应的亮度值:During specific implementation, the luminance value corresponding to the current pixel in the first fused image can be determined by the following formula:
B i=w1 i*A1 i+w2 i*A2 iB i =w1 i *A1 i +w2 i *A2 i ;
其中,B i表示第一融合图像中第i个像素点的亮度值,其中,第i个像素点为当前像素点;w1 i表示从权重矩阵中查到的加权权重,为当前曝光度相邻的两张初始图像中第一个初始图像A1中第i个像素点对应的加权权重;w2 i表示当前曝光度相邻的两张初始图像中第二个初始图像A2中第i个像素点对应的加权权重,其中,w2 i=1-w1 i;A1 i表示第一个初始图像A1中第i个像素点的亮度值;A2 i表示第二个初始图像A2中第i个像素点的亮度值。 Among them, B i represents the brightness value of the ith pixel in the first fusion image, where the ith pixel is the current pixel; w1 i represents the weighted weight found from the weight matrix, which is the adjacent current exposure. The weighted weight corresponding to the i -th pixel in the first initial image A1 in the two initial images of , where w2 i =1-w1 i ; A1 i represents the brightness value of the ith pixel in the first initial image A1; A2 i represents the brightness of the ith pixel in the second initial image A2 value.
步骤11,针对指定数量的初始图像得到的多张第一融合图像中每对曝光度相邻的两张第一融合图像,对当前曝光度相邻的两张第一融合图像进行融合处理,得到当前曝光度相邻的两张第一融合图像的第二融合图像。Step 11: Perform fusion processing on the two adjacent first fusion images of the current exposure for each pair of two adjacent first fusion images in the multiple first fusion images obtained from the specified number of initial images, to obtain: The second fused image of the two first fused images adjacent to the current exposure.
步骤12,将第二融合图像作为新的第一融合图像,继续执行每对曝光度相邻的两张第一融合图像,对当前曝光度相邻的两张第一融合图像进行融合处理,得到当前曝光度相邻的两张第一融合图像的第二融合图像的步骤,直到得到一张最终的融合图像。Step 12, take the second fused image as a new first fused image, continue to execute the two adjacent first fused images for each pair of exposure degrees, and perform fusion processing on the two adjacent first fused images of the current exposure degree to obtain: The steps of the second fusion image of the two first fusion images adjacent to the current exposure, until a final fusion image is obtained.
如果指定数量为三个或者三个以上,那么指定数量的初始图像中曝光度相邻的两张初始图像就有至少两对,也即是可以得到至少两张第一融合图像;那么需要按照上述步骤20-21的方式(将步骤20-21中的初始图像替换为第一融合图像),继续对多张第一融合图像中每对曝光度相邻的两张第一融合图像进行融合处理,得到每对曝光度相邻的两张第一融合图像对应的第二融合图像。如果指定数量为三个,那么得到的一张第二融合图像也即 是步骤S306得到的融合图像;如果指定数量超过三个,那么步骤11得到的第二融合图像至少为两张,不是一张,所以还是需要继续对指定数量的初始图像对应的多张第二融合图像进行融合处理,直到得到一张最终的融合图像。其中,对指定数量的初始图像对应的多张第二融合图像进行融合处理的具体过程与对第一融合图像进行融合处理的过程可以相同。If the specified number is three or more, then there are at least two pairs of two adjacent initial images in the specified number of initial images, that is, at least two first fusion images can be obtained; In the manner of step 20-21 (replace the initial image in step 20-21 with the first fusion image), continue to perform fusion processing on two adjacent first fusion images of each pair of exposure degrees in the plurality of first fusion images, A second fusion image corresponding to the two adjacent first fusion images of each pair of exposure degrees is obtained. If the specified number is three, then the obtained second fusion image is also the fusion image obtained in step S306; if the specified number exceeds three, then the second fusion image obtained in step 11 is at least two, not one , so it is still necessary to continue to fuse multiple second fused images corresponding to the specified number of initial images until a final fused image is obtained. The specific process of performing fusion processing on the plurality of second fusion images corresponding to the specified number of initial images may be the same as the process of performing fusion processing on the first fusion images.
步骤S308,对融合图像进行二值化处理,得到蒙版图像。Step S308, perform binarization processing on the fusion image to obtain a mask image.
融合图像中可以仅包含有每个像素点的亮度值,因而,该融合图像也可以称为灰度图,该灰度图中每个像素点的亮度值(或者灰度值)可以均在0-255之间,所以可以将融合图像中小于设定值的亮度值设置为第一像素值,将大于或者等于该设定值的亮度值设置为第二像素值,以完成对融合图像的二值化处理,得到仅包含有两个数值的蒙版图像。在一些实施例中,上述第一像素值可以设置为0,第二像素值可以设置为255,以得到只有黑白两个颜色的蒙版图像,如图4所示为蒙版图像的示意图。图4中的白色区域(像素值为255)可以是指前景区域,该前景区域中可以包含有人像所在的图像区域,也即是该蒙版图像可以扣去人像所述区域,并将人像区域与其他区域分割,因而,在一些实施例中该蒙版图像也可以称为伪抠像图像,虽然蒙版图像中有一部分背景也会判断为秦京区域,但是只要前景区域的人像区域准确即可。The fused image can only contain the brightness value of each pixel, so the fused image can also be called a grayscale image, and the brightness value (or grayscale value) of each pixel in the grayscale image can be at 0. -255, so you can set the brightness value less than the set value in the fused image as the first pixel value, and set the brightness value greater than or equal to the set value as the second pixel value to complete the second pixel value of the fused image. Value processing, resulting in a mask image containing only two values. In some embodiments, the above-mentioned first pixel value may be set to 0, and the second pixel value may be set to 255, so as to obtain a mask image with only black and white colors, as shown in FIG. 4 , which is a schematic diagram of the mask image. The white area (with a pixel value of 255) in FIG. 4 may refer to the foreground area, and the foreground area may include the image area where the portrait is located, that is, the mask image can deduct the area of the portrait, and the portrait area can be deducted. It is segmented from other regions. Therefore, in some embodiments, the masked image can also be called a pseudo-keyed image. Although a part of the background in the masked image is also judged to be the Qinjing region, as long as the portrait region of the foreground region is accurate, Can.
在一些实施例中,对融合图像进行二值化处理而得到蒙版图像的具体过程还可以为:对二值化处理后的融合图像进行引导滤波处理,得到滤波后的蒙版图像,以使得到的蒙版图像中的前景区域与蒙版图像中前景区域之外的图像区域过度平滑。也即是通过引导滤波处理可以得到前景区域和背景区域(相当于前景区域之外的图像区域)过度平滑的蒙版图像,有利于后续的融合处理,提升图像的整体效果。在具体实现时,上述前景区域可以是指图4中的白色区域,背景区域可以是指图4中的黑色区域。In some embodiments, the specific process of performing binarization processing on the fusion image to obtain the mask image may also be: performing guided filtering processing on the fusion image after the binarization processing to obtain the filtered mask image, so that the The foreground areas in the resulting mask image are oversmoothed with areas of the image outside the foreground areas in the mask image. That is to say, the over-smoothed mask image of the foreground area and the background area (equivalent to the image area other than the foreground area) can be obtained through the guided filtering process, which is beneficial to the subsequent fusion processing and improves the overall effect of the image. In specific implementation, the foregoing foreground area may refer to the white area in FIG. 4 , and the background area may refer to the black area in FIG. 4 .
步骤S310,对多张初始图像的亮度信息进行融合处理,得到初始亮度信息。Step S310, performing fusion processing on the brightness information of the multiple initial images to obtain initial brightness information.
步骤S312,基于蒙版图像,将初始亮度信息和多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终亮度信息。Step S312 , based on the mask image, perform fusion processing on the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images to obtain final brightness information.
步骤S314,基于最终亮度信息和参考帧图像的色彩信息,得到目标图像。In step S314, a target image is obtained based on the final luminance information and the color information of the reference frame image.
上述图像处理方法,该方式不同曝光度的图像之间的明暗特性,可以得到蒙版图像,该蒙版图像可以将原始图像中的前景区域比较好的分割出来,也即是将人像区域比较好的分割出来;然后将蒙版图像中的前景区域与前景区域较好的参考帧图像进行融合,能够对人像起到很好的保护,使融合后的图像的人像区域效果表现更好。同时,该方式无需通过预先训练的模型对前景区域进行分割,可以有效地减小运行时间,提高图像处理效率。In the above image processing method, the light and dark characteristics between images with different exposure degrees can obtain a mask image, and the mask image can better segment the foreground area in the original image, that is, the portrait area is better Then, the foreground area in the mask image is fused with the reference frame image with better foreground area, which can protect the portrait well and make the portrait area of the fused image perform better. At the same time, this method does not need to segment the foreground area through a pre-trained model, which can effectively reduce the running time and improve the efficiency of image processing.
本申请的又一实施例还提供另一种图像处理方法,该方法可以在上述实施例所述方法 的基础上实现;该方法重点描述对所述多张初始图像的亮度信息进行融合处理,得到初始亮度信息的具体过程(通过下述步骤S504-S510实现),以及基于蒙版图像,将初始亮度信息和多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终亮度信息的具体过程(通过下述步骤S512实现);如图5所示,该方法可以包括如下具体步骤:Another embodiment of the present application also provides another image processing method, which can be implemented on the basis of the methods described in the above embodiments; the method focuses on the fusion processing of the brightness information of the plurality of initial images to obtain The specific process of the initial brightness information (implemented by the following steps S504-S510), and based on the mask image, the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images are fused to obtain the final brightness information. The specific process (implemented by the following step S512); as shown in Figure 5, the method may include the following specific steps:
步骤S502,获取在不同曝光度下采集的多张初始图像,以及多张初始图像对应的蒙版图像;该蒙版图像用于指示多张初始图像中的前景区域。Step S502, acquiring a plurality of initial images collected under different exposure degrees, and a mask image corresponding to the plurality of initial images; the mask image is used to indicate a foreground area in the plurality of initial images.
步骤S504,针对多张初始图像中每对曝光度相邻的两张初始图像,对当前曝光度相邻的两张初始图像进行融合处理,得到当前曝光度相邻的两张初始图像的第一亮度图。Step S504, for each pair of adjacent two initial images of the exposure degree in the multiple initial images, perform fusion processing on the two adjacent initial images of the current exposure degree to obtain the first two initial images adjacent to the current exposure degree. Brightness map.
上述步骤S504的具体实现方式与上述步骤10的实现方式可以相同,也即是步骤10中的指定数量的初始图像替换为多张初始图像,将第一亮度图替换为第一融合图像,即为上述步骤S504的实现方式。具体地,得到当前曝光度相邻的两张初始图像的第一亮度图的方式可以参见上述步骤20-21,在此不再赘述。The specific implementation of the above step S504 may be the same as the implementation of the above step 10, that is, the specified number of initial images in step 10 are replaced by multiple initial images, and the first brightness map is replaced by the first fusion image, that is, The implementation of the above step S504. Specifically, for the manner of obtaining the first luminance maps of the two initial images adjacent to the current exposure, reference may be made to the foregoing steps 20-21, which will not be repeated here.
步骤S506,针对多张初始图像得到的多张第一亮度图中每对曝光度相邻的两张第一亮度图,对当前曝光度相邻的两张第一亮度图进行融合处理,得到当前曝光度相邻的两张第一亮度图的第二亮度图。Step S506, for each pair of two adjacent first brightness maps in the multiple first brightness maps obtained from the multiple initial images, perform fusion processing on the two adjacent first brightness maps at the current exposure to obtain the current exposure. The second brightness map of the two first brightness maps with adjacent exposures.
步骤S508,将第二亮度图作为新的第一亮度图,继续执行针对每对曝光度相邻的两张第一亮度图,对当前曝光度相邻的两张第一亮度图进行融合处理,得到当前曝光度相邻的两张第一亮度图的第二亮度图的步骤,直到得到一张亮度图为止。Step S508, taking the second brightness map as the new first brightness map, and continuing to perform fusion processing for the two adjacent first brightness maps of each pair of exposure degrees, and performing fusion processing on the two adjacent first brightness maps of the current exposure degree, The step of obtaining the second brightness map of the two first brightness maps adjacent to the current exposure, until one brightness map is obtained.
在具体实现时,上步骤S506-S508的具体过程可以参见上述再一实施例中的步骤11-12,在此不再赘述。During specific implementation, for the specific process of the above steps S506-S508, reference may be made to steps 11-12 in the above-mentioned still another embodiment, and details are not repeated here.
步骤S510,将得到的一张亮度图的亮度信息确定为初始亮度信息。Step S510, determining the brightness information of the obtained brightness map as the initial brightness information.
步骤S512,将初始亮度信息与参考帧图像的像素亮度信息,通过蒙版图像进行alpha融合,得到最终亮度信息。In step S512, the initial brightness information and the pixel brightness information of the reference frame image are alpha-fused through the mask image to obtain the final brightness information.
在具体实现时,alpha融合的具体过程可以为:根据蒙版图像中的前景区域,确定出参考帧图像中的前景区域,然后将该参考帧图像中的前景区域对应的像素亮度信息确定为最终亮度信息中前景区域对应的第一亮度信息;根据蒙版图像中除前景区域外的图像区域,确定出初始亮度信息中的除前景区域外的图像区域对应的亮度信息,然后将初始亮度信息中的除前景区域外的图像区域对应的亮度信息确定为最终亮度信息中除前景区域外的图像区域对应的第二亮度信息;整合第一亮度信息和第二亮度信息,得到最终亮度信息。In specific implementation, the specific process of alpha fusion may be as follows: according to the foreground area in the mask image, determine the foreground area in the reference frame image, and then determine the pixel brightness information corresponding to the foreground area in the reference frame image as the final The first brightness information corresponding to the foreground area in the brightness information; according to the image area except the foreground area in the mask image, the brightness information corresponding to the image area except the foreground area in the initial brightness information is determined, and then the initial brightness information The brightness information corresponding to the image area except the foreground area is determined as the second brightness information corresponding to the image area except the foreground area in the final brightness information; the first brightness information and the second brightness information are integrated to obtain the final brightness information.
在一些实施例中,上述蒙版图像中每个像素点的像素值可以为0或者255;其中,像素值为0时对应的图像区域可以为黑色,也即是图4中的黑色区域;像素值为255时对应的图像区域可以为白色,也即是图4中的白色区域,该白色区域可以为前景区域,从而可 以通过下述算式,计算得到最终亮度信息:In some embodiments, the pixel value of each pixel in the above-mentioned mask image may be 0 or 255; wherein, when the pixel value is 0, the corresponding image area may be black, that is, the black area in FIG. 4; When the value is 255, the corresponding image area can be white, that is, the white area in Figure 4, and the white area can be the foreground area, so the final brightness information can be calculated by the following formula:
new_res=ev0*(M/255)+(1-M/255)*res;new_res=ev0*(M/255)+(1-M/255)*res;
其中,new_res表示最终亮度信息;ev0表示参考帧图像的像素亮度信息,该像素亮度信息包括参考帧图像中每个像素点的亮度值;M表示蒙版图像中每个像素点的像素值(该像素值为0或者255);res表示初始亮度信息,该初始亮度信息包括多张初始图像融合后的图像中每个像素点的亮度值。Wherein, new_res represents the final brightness information; ev0 represents the pixel brightness information of the reference frame image, and the pixel brightness information includes the brightness value of each pixel in the reference frame image; M represents the pixel value of each pixel in the mask image (the The pixel value is 0 or 255); res represents the initial brightness information, and the initial brightness information includes the brightness value of each pixel in the image after the fusion of multiple initial images.
步骤S514,基于最终亮度信息和参考帧图像的色彩信息,得到目标图像。In step S514, a target image is obtained based on the final brightness information and the color information of the reference frame image.
为了便于对本申请实施例进行理解,下面以获取三张不同曝光度的初始图像为例,对本申请进行进一步介绍。首先获取颜色空间为YUV形式的三张不同曝光度的初始图像,分别为ev+1、ev0和ev-2;其中,ev+1的曝光度为+1,ev0的曝光度为0,ev-2的曝光度为-2;然后在Y通道和UV通道上对这三张初始图像进行拆分处理,Y通道上得到的是初始图像的亮度信息,UV通道上得到的是初始图像的色彩信息。进而,在Y通道上,对从三张初始图像中选取的ev+1和ev-2进行融合处理(也可以称为滤波器融合处理),得到融合图像,然后对融合图像进行二值化处理,得到蒙版图像(也可以称为图像掩膜);然后对得到的蒙版图像做引导滤波处理,使蒙版图像中的前景区域和背景区域过度平滑,得到最终蒙版图像。然后,在Y通道上对获取的三张不同曝光度的初始图像进行融合处理,得到初始亮度信息。进而,通过上述计算最终亮度信息的公式,得到最终亮度信息,此时,上述参考帧图像指的是ev0,也即是曝光度为0的初始图像。最后将Y通道中得到的最终亮度信息同UV通道上的参考帧图像的色彩信息进行结合,得到目标图像。In order to facilitate the understanding of the embodiments of the present application, the present application will be further introduced below by taking the acquisition of three initial images with different exposure degrees as an example. First, obtain three initial images with different exposures in the form of YUV in the color space, which are ev+1, ev0 and ev-2 respectively; among them, the exposure of ev+1 is +1, the exposure of ev0 is 0, and the exposure of ev- The exposure of 2 is -2; then the three initial images are split on the Y channel and the UV channel. The brightness information of the initial image is obtained on the Y channel, and the color information of the initial image is obtained on the UV channel. . Furthermore, on the Y channel, the ev+1 and ev-2 selected from the three initial images are fused (also called filter fusion) to obtain a fused image, and then the fused image is binarized , to obtain a mask image (also known as an image mask); then perform guided filtering on the obtained mask image to over-smooth the foreground and background areas in the mask image to obtain the final mask image. Then, the obtained three initial images with different exposure degrees are fused on the Y channel to obtain the initial brightness information. Furthermore, the final luminance information is obtained through the above formula for calculating the final luminance information. In this case, the above reference frame image refers to ev0, that is, an initial image with an exposure of 0. Finally, the final brightness information obtained in the Y channel is combined with the color information of the reference frame image on the UV channel to obtain the target image.
上述图像处理方法,该方式基于不同曝光度的多张图像得到用于指示图像前景区域的蒙版图像,进而通过蒙版图像融合参考帧图像中前景区域的亮度信息和初始亮度信息中的非前景区域,以确保融合后图像中的前景区域与参考帧图像中的一致,从而提高了融合后图像中前景区域的视觉效果,也提升了融合后图像的整体效果。The above image processing method, which obtains a mask image for indicating the foreground area of the image based on multiple images with different exposures, and then fuses the brightness information of the foreground area in the reference frame image and the non-foreground in the initial brightness information through the mask image. area to ensure that the foreground area in the fused image is consistent with that in the reference frame image, thereby improving the visual effect of the foreground area in the fused image and improving the overall effect of the fused image.
对应于上述图像处理方法实施例,本申请的又再一实施例提供了一种图像处理装置,如图6所示,该装置可以包括:Corresponding to the above image processing method embodiments, yet another embodiment of the present application provides an image processing apparatus, as shown in FIG. 6 , the apparatus may include:
图像获取模块60,可以配置成用于获取在不同曝光度下采集的多张初始图像,以及多张初始图像对应的蒙版图像;其中,该蒙版图像基于多张初始图像中的至少一部分图像生成;该蒙版图像用于指示多张初始图像中的前景区域。The image acquisition module 60 can be configured to acquire multiple initial images collected under different exposure degrees, and mask images corresponding to the multiple initial images; wherein, the mask image is based on at least a part of the multiple initial images Generated; this mask image is used to indicate foreground areas in multiple initial images.
第一融合模块61,可以配置成用于对上述多张初始图像的亮度信息进行融合处理,得到初始亮度信息。The first fusion module 61 may be configured to perform fusion processing on the brightness information of the above-mentioned multiple initial images to obtain initial brightness information.
第二融合模块62,可以配置成用于基于蒙版图像,将初始亮度信息和多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终亮度信息。The second fusion module 62 may be configured to perform fusion processing on the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images based on the mask image to obtain final brightness information.
信息整合模块63,可以配置成用于基于最终亮度信息和参考帧图像的色彩信息,得到目标图像。The information integration module 63 may be configured to obtain the target image based on the final luminance information and the color information of the reference frame image.
其中,上述初始图像的颜色空间可以为YUV形式,亮度信息可以为Y通道,色彩信息可以为UV通道。The color space of the above-mentioned initial image may be in the form of YUV, the luminance information may be the Y channel, and the color information may be the UV channel.
可选地,上述第二融合模块62可以配置成用于:将初始亮度信息与参考帧图像的像素亮度信息,通过蒙版图像进行alpha融合,得到最终亮度信息。Optionally, the above-mentioned second fusion module 62 may be configured to: perform alpha fusion of the initial brightness information and the pixel brightness information of the reference frame image through the mask image to obtain the final brightness information.
在具体实现时,上述蒙版图像中每个像素点的像素值可以为0或者255;上述第二融合模块62还可以配置成用于:通过下述算式,计算得到最终亮度信息:During specific implementation, the pixel value of each pixel in the above-mentioned mask image may be 0 or 255; the above-mentioned second fusion module 62 may also be configured to: obtain the final brightness information by calculating the following formula:
new_res=ev0*(M/255)+(1-M/255)*res;new_res=ev0*(M/255)+(1-M/255)*res;
其中,new_res表示最终亮度信息;ev0表示参考帧图像的像素亮度信息;M表示蒙版图像中每个像素点的像素值;res表示初始亮度信息。Among them, new_res represents the final brightness information; ev0 represents the pixel brightness information of the reference frame image; M represents the pixel value of each pixel in the mask image; res represents the initial brightness information.
具体地,上述图像获取模块60可以包括:初始图像获取模块,配置成用于获取在不同曝光度下采集的多张初始图像,其中,每张初始图像对应一种曝光度;图像选取模块,配置成用于从多张初始图像中,选取指定数量的初始图像;融合处理模块,配置成用于对指定数量的初始图像的亮度信息进行融合处理,得到融合图像;二值化处理模块,配置成用于对融合图像进行二值化处理,得到蒙版图像。Specifically, the above-mentioned image acquisition module 60 may include: an initial image acquisition module, configured to acquire a plurality of initial images collected under different exposure degrees, wherein each initial image corresponds to one exposure degree; an image selection module, configured is used to select a specified number of initial images from a plurality of initial images; the fusion processing module is configured to perform fusion processing on the brightness information of the specified number of initial images to obtain a fusion image; the binarization processing module is configured to It is used to binarize the fused image to obtain a mask image.
可选地,上述融合处理模块可以配置成用于:针对指定数量的初始图像中每对曝光度相邻的两张初始图像,对当前曝光度相邻的两张初始图像进行融合处理,得到当前曝光度相邻的两张初始图像的第一融合图像;针对指定数量的初始图像得到的多张第一融合图像中每对曝光度相邻的两张第一融合图像,对当前曝光度相邻的两张第一融合图像进行融合处理,得到当前曝光度相邻的两张第一融合图像的第二融合图像;将第二融合图像作为新的第一融合图像,继续执行针对每对曝光度相邻的两张第一融合图像,对当前曝光度相邻的两张第一融合图像进行融合处理,得到当前曝光度相邻的两张第一融合图像的第二融合图像的步骤,直到得到一张最终的融合图像。Optionally, the above-mentioned fusion processing module can be configured to: for each pair of two adjacent initial images of exposure in a specified number of initial images, perform fusion processing on the two adjacent initial images of the current exposure to obtain the current exposure. The first fusion image of the two initial images with adjacent exposures; the two first fusion images of each pair of adjacent exposures in the multiple first fusion images obtained for the specified number of initial images, the adjacent first fusion images for the current exposure The two first fused images obtained are fused to obtain the second fused image of the two first fused images adjacent to the current exposure; the second fused image is taken as the new first fused image, and the execution of each pair of exposures is continued. The two adjacent first fusion images are fused to the two adjacent first fusion images of the current exposure, and the second fusion image of the two adjacent first fusion images of the current exposure is obtained. A final fused image.
可选地,上述指定数量可以为两个;上述图像选取模块可以配置成用于:从多张初始图像中,选取曝光度最大的初始图像和曝光度最小的初始图像。Optionally, the above-mentioned designated number may be two; the above-mentioned image selection module may be configured to: select the initial image with the maximum exposure and the initial image with the minimum exposure from the plurality of initial images.
具体地,上述融合处理模块还可以配置成用于针对当前曝光度相邻的两张初始图像中的每个像素点执行下述操作:根据当前曝光度相邻的两张初始图像中当前像素点的亮度值,从预设的权重矩阵中查找加权权重,其中,该权重矩阵中包括任意两个亮度值对应的加权权重;根据查到的加权权重和当前曝光度相邻的两张初始图像中当前像素点的亮度值,确定第一融合图像中当前像素点对应的亮度值。Specifically, the above-mentioned fusion processing module may also be configured to perform the following operation for each pixel in the two adjacent initial images with the current exposure: according to the current exposure, the current pixel in the two adjacent initial images Find the weighted weight from the preset weight matrix, where the weight matrix includes weighted weights corresponding to any two brightness values; according to the found weighted weights and the two initial images adjacent to the current exposure The brightness value of the current pixel point determines the brightness value corresponding to the current pixel point in the first fusion image.
在具体实现时,上述融合处理模块还可以配置成用于:从当前曝光度相邻的两张初始 图像中,确定第一个初始图像中当前像素点的第一亮度值和第二个初始图像中当前像素点的第二亮度值;将第一亮度值与一的加和,确定为目标列数;将第二亮度值与一的加和,确定为目标行数;根据目标列数和目标行数,确定加权权重在权重矩阵中的位置,将权重矩阵中该位置对应的数值确定为查找到的加权权重。During specific implementation, the above-mentioned fusion processing module may also be configured to: from two initial images adjacent to the current exposure, determine the first brightness value of the current pixel in the first initial image and the second initial image The second brightness value of the current pixel in the The number of rows, determine the position of the weighted weight in the weight matrix, and determine the value corresponding to the position in the weight matrix as the found weighted weight.
在一些实施例中,上述融合处理模块还可以配置成用于:通过下述算式确定第一融合图像中当前像素点对应的亮度值:In some embodiments, the above-mentioned fusion processing module may also be configured to: determine the brightness value corresponding to the current pixel in the first fusion image by the following formula:
B i=w1 i*A1 i+w2 i*A2 iB i =w1 i *A1 i +w2 i *A2 i ;
其中,B i表示第一融合图像中第i个像素点的亮度值,其中,第i个像素点为当前像素点;w1 i表示从权重矩阵中查到的加权权重,为当前曝光度相邻的两张初始图像中第一个初始图像A1中第i个像素点对应的加权权重;w2 i表示当前曝光度相邻的两张初始图像中第二个初始图像A2中第i个像素点对应的加权权重,其中,w2 i=1-w1 i;A1 i表示第一个初始图像A1中第i个像素点的亮度值;A2 i表示第二个初始图像A2中第i个像素点的亮度值。 Among them, B i represents the brightness value of the ith pixel in the first fusion image, where the ith pixel is the current pixel; w1 i represents the weighted weight found from the weight matrix, which is the adjacent current exposure. The weighted weight corresponding to the i -th pixel in the first initial image A1 in the two initial images of , where w2 i =1-w1 i ; A1 i represents the brightness value of the ith pixel in the first initial image A1; A2 i represents the brightness of the ith pixel in the second initial image A2 value.
可选地,上述二值化处理模块还可以配置成用于:对二值化处理后的融合图像进行引导滤波处理,得到滤波后的蒙版图像。Optionally, the above binarization processing module may also be configured to: perform guided filtering processing on the binarized fusion image to obtain a filtered mask image.
可选地,上述第一融合模块61还可以配置成用于:针对多张初始图像中每对曝光度相邻的两张初始图像,对当前曝光度相邻的两张初始图像进行融合处理,得到当前曝光度相邻的两张初始图像的第一亮度图;针对多张初始图像得到的多张第一亮度图中每对曝光度相邻的两张第一亮度图,对当前曝光度相邻的两张第一亮度图进行融合处理,得到当前曝光度相邻的两张第一亮度图的第二亮度图;将第二亮度图作为新的第一亮度图,继续执行针对每对曝光度相邻的两张第一亮度图,对当前曝光度相邻的两张第一亮度图进行融合处理,得到当前曝光度相邻的两张第一亮度图的第二亮度图的步骤,直到得到一张亮度图为止;将得到的一张亮度图的亮度信息确定为初始亮度信息。Optionally, the above-mentioned first fusion module 61 can also be configured to: for each pair of two initial images adjacent to the exposure degree in the plurality of initial images, perform fusion processing on the two adjacent initial images of the current exposure degree, The first brightness maps of the two initial images adjacent to the current exposure are obtained; for each pair of two adjacent first brightness maps in the multiple first brightness maps obtained from the multiple initial images, the current exposure is determined relative to the current exposure. The two adjacent first brightness maps are fused to obtain the second brightness map of the two first brightness maps adjacent to the current exposure; the second brightness map is used as the new first brightness map, and the execution of each pair of exposures is continued. The steps of fusing the two adjacent first brightness maps of the current exposure to obtain the second brightness map of the two adjacent first brightness maps of the current exposure, until Until a brightness map is obtained; the brightness information of the obtained brightness map is determined as the initial brightness information.
上述图像处理装置可以首先获取在不同曝光度下采集的多张初始图像,以及多张初始图像对应的蒙版图像,其中,该蒙版图像基于多张初始图像中的至少一部分图像生成,该蒙版图像用于指示多张初始图像中的前景区域;进而对多张初始图像的亮度信息进行融合处理,得到初始亮度信息;再基于蒙版图像,将初始亮度信息和多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终亮度信息;然后基于最终亮度信息和参考帧图像的色彩信息,得到目标图像,也即是融合后的图像。该方式基于不同曝光度的多张图 像得到用于指示图像前景区域的蒙版图像,进而通过蒙版图像融合参考帧图像中前景区域的亮度信息和初始亮度信息中的非前景区域,由于参考帧图像中的前景区域效果较好,从而确保了融合后图像中的前景区域与参考帧图像中的前景区域相匹配,从而提高了融合后图像中前景区域的视觉效果,也提升了融合后图像的整体效果。The above-mentioned image processing apparatus may first acquire a plurality of initial images collected under different exposure degrees, and a mask image corresponding to the plurality of initial images, wherein the mask image is generated based on at least a part of the plurality of initial images, and the mask image is generated based on at least a part of the initial images. The mask image is used to indicate the foreground area in the multiple initial images; then the brightness information of the multiple initial images is fused to obtain the initial brightness information; then based on the mask image, the initial brightness information and the reference in the multiple initial images are combined. The pixel brightness information of the frame image is fused to obtain the final brightness information; then based on the final brightness information and the color information of the reference frame image, the target image, that is, the fused image, is obtained. This method obtains a mask image indicating the foreground area of the image based on multiple images with different exposures, and then fuses the brightness information of the foreground area in the reference frame image and the non-foreground area in the initial brightness information through the mask image. The effect of the foreground area in the image is better, thus ensuring that the foreground area in the fused image matches the foreground area in the reference frame image, thereby improving the visual effect of the foreground area in the fused image, and also improving the fusion image. overall effect.
本申请的再又一实施例提供了一种电子系统,该电子系统可以包括:图像采集设备、处理设备和存储装置,图像采集设备可以用于获取预览视频帧或图像数据,存储装置上可以存储有计算机程序,计算机程序在被处理设备运行时可以执行如上述图像处理方法、或者上述图像处理方法的步骤。Yet another embodiment of the present application provides an electronic system, the electronic system may include: an image acquisition device, a processing device, and a storage device, the image acquisition device may be used to acquire preview video frames or image data, and the storage device may store There is a computer program that, when run by a processing device, can execute the image processing method as described above, or the steps of the image processing method described above.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的电子系统的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the electronic system described above, reference may be made to the corresponding process in the foregoing method embodiments, which will not be repeated here.
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上可以存储有计算机程序,该计算机程序被处理设备运行时可以执行如上述图像处理方法。Embodiments of the present application further provide a computer-readable storage medium, where a computer program may be stored on the computer-readable storage medium, and when the computer program is run by a processing device, the above-mentioned image processing method may be executed.
本申请实施例所提供的图像处理方法、图像处理装置和电子系统的计算机程序产品,该计算机程序产品可以包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行前面方法实施例中所述的方法,具体实现可参见方法实施例,在此不再赘述。The image processing method, the image processing apparatus, and the computer program product of the electronic system provided by the embodiments of the present application may include a computer-readable storage medium storing program codes, and the instructions included in the program codes may be used to execute the preceding For the specific implementation of the method described in the method embodiment, reference may be made to the method embodiment, which will not be repeated here.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和/或装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the system and/or device described above, reference may be made to the corresponding process in the foregoing method embodiments, which will not be repeated here.
另外,在本申请实施例的描述中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本申请中的具体含义。In addition, in the description of the embodiments of the present application, unless otherwise expressly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it may be a fixed connection or a detachable connection , or integrally connected; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or the internal communication between the two components. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood in specific situations.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
在本申请的描述中,需要说明的是,术语“中心”、“上”、“下”、“左”、“右”、“竖直”、 “水平”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本申请和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本申请的限制。此外,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。In the description of this application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. The indicated orientation or positional relationship is based on the orientation or positional relationship shown in the accompanying drawings, which is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the indicated device or element must have a specific orientation or a specific orientation. construction and operation, and therefore should not be construed as limiting the application. Furthermore, the terms "first", "second", and "third" are used for descriptive purposes only and should not be construed to indicate or imply relative importance.
最后应说明的是:以上所述实施例,仅为本申请的具体实施方式,用以说明本申请的技术方案,而非对其限制,本申请的保护范围并不局限于此,尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本申请实施例技术方案的精神和范围,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that the above-mentioned embodiments are only specific implementations of the present application, and are used to illustrate the technical solutions of the present application, rather than limit them. The embodiments describe the application in detail, and those of ordinary skill in the art should understand that any person skilled in the art can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed in the application. Or can easily think of changes, or equivalently replace some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the application, and should be covered in this application. within the scope of protection. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
工业实用性Industrial Applicability
本申请提供了一种图像处理方法、图像处理装置、电子系统及可读存储介质,获取在不同曝光度下采集的多张初始图像和多张初始图像对应的蒙版图像,蒙版图像用于指示多张初始图像中的前景区域;融合多张初始图像的亮度信息得到初始亮度信息;基于蒙版图像,融合初始亮度信息和多张初始图像中的参考帧图像的亮度信息得到最终亮度信息;基于最终亮度信息和参考帧图像的色彩信息得到目标图像。该方式基于不同曝光度的多张图像得到指示图像前景区域的蒙版图像,进而通过蒙版图像融合参考帧图像中前景区域的亮度信息和初始亮度信息中的非前景区域,以确保融合后图像中的前景区域与参考帧图像中的匹配,从而提高了融合后图像中前景区域的视觉效果,也提升了融合后图像的整体效果。The present application provides an image processing method, an image processing device, an electronic system and a readable storage medium for obtaining multiple initial images collected under different exposure degrees and mask images corresponding to the multiple initial images, and the mask images are used for Indicate the foreground area in the multiple initial images; fuse the brightness information of the multiple initial images to obtain the initial brightness information; based on the mask image, fuse the initial brightness information and the brightness information of the reference frame images in the multiple initial images to obtain the final brightness information; The target image is obtained based on the final luminance information and the color information of the reference frame image. This method obtains a mask image indicating the foreground area of the image based on multiple images with different exposures, and then uses the mask image to fuse the brightness information of the foreground area in the reference frame image and the non-foreground area in the initial brightness information to ensure the image after fusion. The foreground area in the image is matched with the reference frame image, thereby improving the visual effect of the foreground area in the fused image and the overall effect of the fused image.
此外,可以理解的是,本申请的图像处理方法、图像处理装置、电子系统及可读存储介质是可以重现的,并且可以应用在多种应用中。例如,本申请的图像处理方法、图像处理装置、电子系统及可读存储介质可以应用于图像处理技术领域等。In addition, it can be understood that the image processing method, image processing apparatus, electronic system and readable storage medium of the present application are reproducible and can be applied in various applications. For example, the image processing method, image processing apparatus, electronic system, and readable storage medium of the present application can be applied to the field of image processing technology and the like.

Claims (18)

  1. 一种图像处理方法,其特征在于,所述图像处理方法包括:An image processing method, characterized in that the image processing method comprises:
    获取在不同曝光度下采集的多张初始图像、以及所述多张初始图像对应的蒙版图像,其中,所述蒙版图像基于所述多张初始图像中的至少一部分图像生成,所述蒙版图像用于指示所述多张初始图像中的前景区域;Obtaining multiple initial images collected under different exposure degrees and mask images corresponding to the multiple initial images, wherein the mask images are generated based on at least a part of the multiple initial images, and the mask images are generated based on at least a part of the multiple initial images. The version image is used to indicate the foreground area in the plurality of initial images;
    对所述多张初始图像的亮度信息进行融合处理,得到初始亮度信息;Performing fusion processing on the brightness information of the plurality of initial images to obtain initial brightness information;
    基于所述蒙版图像,将所述初始亮度信息和所述多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终亮度信息;Based on the mask image, the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images are fused to obtain final brightness information;
    基于所述最终亮度信息和所述参考帧图像的色彩信息,得到目标图像。A target image is obtained based on the final luminance information and the color information of the reference frame image.
  2. 根据权利要求1所述的图像处理方法,其特征在于,所述基于所述蒙版图像将所述初始亮度信息和所述多张初始图像中的参考帧图像的像素亮度信息进行融合处理而得到最终亮度信息的步骤包括:The image processing method according to claim 1, wherein the initial luminance information is obtained by fusing the initial luminance information and pixel luminance information of reference frame images in the plurality of initial images based on the mask image. The steps for final luminance information include:
    将所述初始亮度信息与所述参考帧图像的像素亮度信息,通过所述蒙版图像进行alpha融合,得到最终亮度信息。The initial brightness information and the pixel brightness information of the reference frame image are alpha-fused through the mask image to obtain final brightness information.
  3. 根据权利要求2所述的图像处理方法,其特征在于,所述蒙版图像中每个像素点的像素值为0或者255;所述将所述初始亮度信息与所述参考帧图像的像素亮度信息通过所述蒙版图像进行alpha融合而得到最终亮度信息的步骤包括:The image processing method according to claim 2, wherein the pixel value of each pixel in the mask image is 0 or 255; The steps of obtaining final brightness information by performing alpha fusion on the mask image include:
    通过下述算式,计算得到所述最终亮度信息:Through the following formula, the final brightness information is obtained by calculation:
    new_res=ev0*(M/255)+(1-M/255)*res;new_res=ev0*(M/255)+(1-M/255)*res;
    其中,new_res表示所述最终亮度信息;ev0表示所述参考帧图像的像素亮度信息;M表示所述蒙版图像中每个像素点的像素值;res表示所述初始亮度信息。Wherein, new_res represents the final brightness information; ev0 represents the pixel brightness information of the reference frame image; M represents the pixel value of each pixel in the mask image; res represents the initial brightness information.
  4. 根据权利要求1至3中的任一项所述的图像处理方法,其特征在于,所述获取在不同曝光度下采集的多张初始图像、以及所述多张初始图像对应的蒙版图像的步骤包括:The image processing method according to any one of claims 1 to 3, wherein the acquiring a plurality of initial images collected under different exposure degrees and the mask images corresponding to the plurality of initial images Steps include:
    获取在不同曝光度下采集的多张初始图像,其中,每张所述初始图像对应一种曝光度;acquiring a plurality of initial images collected under different exposure degrees, wherein each of the initial images corresponds to one exposure degree;
    从所述多张初始图像中,选取指定数量的所述初始图像;From the plurality of initial images, select a specified number of the initial images;
    对所述指定数量的所述初始图像的亮度信息进行融合处理,得到融合图像;Perform fusion processing on the brightness information of the specified number of the initial images to obtain a fusion image;
    对所述融合图像进行二值化处理,得到所述蒙版图像。Binarization is performed on the fusion image to obtain the mask image.
  5. 根据权利要求4所述的图像处理方法,其特征在于,所述指定数量为两个;所述从所述多张初始图像中选取指定数量的所述初始图像的步骤包括:The image processing method according to claim 4, wherein the specified number is two; the step of selecting a specified number of the initial images from the plurality of initial images comprises:
    从所述多张初始图像中,选取曝光度最大的初始图像和曝光度最小的初始图像。From the plurality of initial images, the initial image with the maximum exposure and the initial image with the minimum exposure are selected.
  6. 根据权利要求4所述的图像处理方法,其特征在于,所述对所述指定数量的所述初始图像的亮度信息进行融合处理而得到融合图像的步骤包括:The image processing method according to claim 4, wherein the step of performing fusion processing on the brightness information of the specified number of the initial images to obtain a fusion image comprises:
    针对所述指定数量的所述初始图像中每对曝光度相邻的两张初始图像,对当前曝光度相邻的两张初始图像进行融合处理,得到所述当前曝光度相邻的两张初始图像的第一融合图像;For each pair of two adjacent initial images in the specified number of initial images, the two initial images adjacent to the current exposure are fused to obtain two initial images adjacent to the current exposure. the first fused image of the image;
    针对所述指定数量的初始图像得到的多张第一融合图像中每对曝光度相邻的两张第一融合图像,对当前曝光度相邻的两张第一融合图像进行融合处理,得到所述当前曝光度相邻的两张第一融合图像的第二融合图像;For each pair of two adjacent first fusion images in the multiple first fusion images obtained from the specified number of initial images, the two adjacent first fusion images at the current exposure degree are fused to obtain the obtained the second fusion image of the two adjacent first fusion images at the current exposure;
    将所述第二融合图像作为新的第一融合图像,继续执行针对每对曝光度相邻的两张第一融合图像,对当前曝光度相邻的两张第一融合图像进行融合处理,得到所述当前曝光度相邻的两张第一融合图像的第二融合图像的步骤,直到得到一张最终的融合图像。Using the second fusion image as a new first fusion image, continue to perform fusion processing for each pair of adjacent first fusion images with exposure, and perform fusion processing on the two adjacent first fusion images at the current exposure to obtain The step of the second fusion image of the two first fusion images adjacent to the current exposure degree is until a final fusion image is obtained.
  7. 根据权利要求6所述的图像处理方法,其特征在于,所述对当前曝光度相邻的两张初始图像进行融合处理而得到所述当前曝光度相邻的两张初始图像的第一融合图像的步骤包括:The image processing method according to claim 6, wherein the first fusion image of the two initial images adjacent to the current exposure is obtained by performing fusion processing on two initial images adjacent to the current exposure. The steps include:
    针对当前曝光度相邻的两张初始图像中的每个像素点,执行下述操作:For each pixel in the two initial images adjacent to the current exposure, do the following:
    根据所述当前曝光度相邻的两张初始图像中当前像素点的亮度值,从预设的权重矩阵中查找加权权重,其中,所述权重矩阵中包括任意两个亮度值对应的加权权重;According to the brightness value of the current pixel in the two initial images adjacent to the current exposure, the weighting weight is searched from a preset weight matrix, wherein the weight matrix includes weighting weights corresponding to any two brightness values;
    根据查到的所述加权权重和所述当前曝光度相邻的两张初始图像中当前像素点的亮度值,确定所述第一融合图像中所述当前像素点对应的亮度值。According to the found weighted weight and the brightness value of the current pixel in the two initial images adjacent to the current exposure, the brightness value corresponding to the current pixel in the first fused image is determined.
  8. 根据权利要求7所述的图像处理方法,其特征在于,所述根据所述当前曝光度相邻的两张初始图像中当前像素点的亮度值而从预设的权重矩阵中查找加权权重的步骤包括:The image processing method according to claim 7, wherein the step of searching the weighted weight from a preset weight matrix according to the brightness value of the current pixel in the two initial images adjacent to the current exposure degree include:
    从所述当前曝光度相邻的两张初始图像中,确定第一个所述初始图像中当前像素点的第一亮度值和第二个所述初始图像中当前像素点的第二亮度值;From two initial images adjacent to the current exposure, determine the first brightness value of the current pixel in the first initial image and the second brightness value of the current pixel in the second initial image;
    将所述第一亮度值与一的加和,确定为目标列数;将所述第二亮度值与一的加和,确定为目标行数;The addition of the first brightness value and one is determined as the target number of columns; the addition of the second brightness value and one is determined as the target number of rows;
    根据所述目标列数和目标行数,确定加权权重在所述权重矩阵中的位置,将所述权重矩阵中所述位置对应的数值确定为查找到的加权权重。The position of the weighted weight in the weight matrix is determined according to the target number of columns and the target row, and the value corresponding to the position in the weight matrix is determined as the found weighted weight.
  9. 根据权利要求7所述的图像处理方法,其特征在于,所述根据查到的所述加权权重和所述当前曝光度相邻的两张初始图像中当前像素点的亮度值而确定所述第一融合图像中所述当前像素点对应的亮度值的步骤包括:The image processing method according to claim 7, characterized in that, determining the first pixel according to the found weighted weight and the brightness value of the current pixel in the two initial images adjacent to the current exposure. The step of fusing the brightness value corresponding to the current pixel in the image includes:
    通过下述算式确定所述第一融合图像中所述当前像素点对应的亮度值:Determine the brightness value corresponding to the current pixel in the first fused image by the following formula:
    B i=w1 i*A1 i+w2 i*A2 iB i =w1 i *A1 i +w2 i *A2 i ;
    其中,B i表示所述第一融合图像中第i个像素点的亮度值,其中,第i个像素点为当前像素点;w1 i表示从所述权重矩阵中查到的加权权重,为所述当前曝光度相邻的两张初始图像中第一个所述初始图像A1中第i个像素点对应的加权权重;w2 i表示所述当前曝光度相邻的两张初始图像中第二个所述初始图像A2中第i个像素点对应的加权权重,其中,w2 i=1-w1 i;A1 i表示第一个所述初始图像A1中第i个像素点的亮度值;A2 i表示第二个所述初始图像A2中第i个像素点的亮度值。 Wherein, B i represents the brightness value of the ith pixel in the first fusion image, where the ith pixel is the current pixel; w1 i represents the weighted weight found from the weight matrix, which is the The weighted weight corresponding to the i-th pixel in the first two initial images adjacent to the current exposure degree; w2 i represents the second one in the two initial images adjacent to the current exposure degree The weighted weight corresponding to the i-th pixel in the initial image A2, wherein w2 i =1-w1 i ; A1 i represents the brightness value of the i-th pixel in the first initial image A1; A2 i represents The brightness value of the ith pixel in the second initial image A2.
  10. 根据权利要求4所述的图像处理方法,其特征在于,所述对所述融合图像进行二值化处理而得到所述蒙版图像的步骤包括:The image processing method according to claim 4, wherein the step of performing binarization processing on the fusion image to obtain the mask image comprises:
    对二值化处理后的所述融合图像进行引导滤波处理,得到滤波后的所述蒙版图像。A guided filtering process is performed on the binarized fused image to obtain the filtered mask image.
  11. 根据权利要求1至10中的任一项所述的图像处理方法,其特征在于,所述对所述多张初始图像的亮度信息进行融合处理而得到初始亮度信息的步骤包括:The image processing method according to any one of claims 1 to 10, wherein the step of obtaining the initial luminance information by fusing the luminance information of the plurality of initial images comprises:
    针对所述多张初始图像中每对曝光度相邻的两张初始图像,对当前曝光度相邻的两张初始图像进行融合处理,得到所述当前曝光度相邻的两张初始图像的第一亮度图;For each pair of two adjacent initial images in the multiple initial images, the two initial images adjacent to the current exposure are fused to obtain the first image of the two adjacent initial images at the current exposure. a luminance map;
    针对所述多张初始图像得到的多张第一亮度图中每对曝光度相邻的两张第一亮度图,对当前曝光度相邻的两张第一亮度图进行融合处理,得到所述当前曝光度相邻的两张第一亮度图的第二亮度图;For each pair of two first brightness maps adjacent to the exposure degree in the multiple first brightness maps obtained from the multiple initial images, perform fusion processing on the two adjacent first brightness maps at the current exposure degree to obtain the The second brightness map of the two first brightness maps adjacent to the current exposure;
    将所述第二亮度图作为新的第一亮度图,继续执行针对每对曝光度相邻的两张第一亮度图,对当前曝光度相邻的两张第一亮度图进行融合处理,得到所述当前曝光度相邻的两张第一亮度图的第二亮度图的步骤,直到得到一张亮度图为止;Taking the second brightness map as a new first brightness map, continue to perform fusion processing on the two adjacent first brightness maps for each pair of exposure degrees, and obtain The steps of the second brightness map of the two adjacent first brightness maps of the current exposure, until a brightness map is obtained;
    将得到的所述一张亮度图的亮度信息确定为所述初始亮度信息。The obtained luminance information of the one luminance map is determined as the initial luminance information.
  12. 根据权利要求1至11中的任一项所述的图像处理方法,其特征在于,所述初始图像的颜色空间为YUV形式,所述亮度信息为Y通道,所述色彩信息为UV通道。The image processing method according to any one of claims 1 to 11, wherein the color space of the initial image is a YUV form, the luminance information is a Y channel, and the color information is a UV channel.
  13. 一种图像处理装置,其特征在于,所述图像处理装置包括:An image processing device, characterized in that the image processing device comprises:
    图像获取模块,所述图像获取模块配置成用于获取在不同曝光度下采集的多张初始图像、以及所述多张初始图像对应的蒙版图像,其中,所述蒙版图像基于所述多张初始图像中的至少一部分图像生成;所述蒙版图像用于指示所述多张初始图像中的前景区域;An image acquisition module, the image acquisition module is configured to acquire multiple initial images collected under different exposure degrees, and mask images corresponding to the multiple initial images, wherein the mask images are based on the multiple initial images. at least a part of the initial images is generated; the mask image is used to indicate the foreground area in the plurality of initial images;
    第一融合模块,所述第一融合模块配置成用于对所述多张初始图像的亮度信息进行融合处理,得到初始亮度信息;a first fusion module, where the first fusion module is configured to perform fusion processing on the brightness information of the plurality of initial images to obtain initial brightness information;
    第二融合模块,所述第二融合模块配置成用于基于所述蒙版图像,将所述初始亮度信息和所述多张初始图像中的参考帧图像的像素亮度信息进行融合处理,得到最终 亮度信息;The second fusion module, the second fusion module is configured to perform fusion processing on the initial brightness information and the pixel brightness information of the reference frame images in the multiple initial images based on the mask image, to obtain a final brightness information;
    信息整合模块,所述信息整合模块配置成用于基于所述最终亮度信息和所述参考帧图像的色彩信息,得到目标图像。an information integration module, the information integration module is configured to obtain a target image based on the final luminance information and the color information of the reference frame image.
  14. 根据权利要求13所述的图像处理装置,其特征在于,所述第二融合模块配置成用于将初始亮度信息与参考帧图像的像素亮度信息,通过蒙版图像进行alpha融合,得到最终亮度信息。The image processing apparatus according to claim 13, wherein the second fusion module is configured to perform alpha fusion of the initial brightness information and the pixel brightness information of the reference frame image through the mask image to obtain the final brightness information .
  15. 根据权利要求14所述的图像处理装置,其特征在于,所述蒙版图像中每个像素点的像素值为0或者255;所述第二融合模块配置成用于通过下述算式,计算得到所述最终亮度信息:The image processing apparatus according to claim 14, wherein the pixel value of each pixel in the mask image is 0 or 255; the second fusion module is configured to obtain the following formula by calculating The final brightness information:
    new_res=ev0*(M/255)+(1-M/255)*res;new_res=ev0*(M/255)+(1-M/255)*res;
    其中,new_res表示所述最终亮度信息;ev0表示所述参考帧图像的像素亮度信息;M表示所述蒙版图像中每个像素点的像素值;res表示所述初始亮度信息。Wherein, new_res represents the final brightness information; ev0 represents the pixel brightness information of the reference frame image; M represents the pixel value of each pixel in the mask image; res represents the initial brightness information.
  16. 根据权利要求13至15中的任一项所述的图像处理装置,其特征在于,所述图像获取模块包括:The image processing device according to any one of claims 13 to 15, wherein the image acquisition module comprises:
    初始图像获取模块,所述初始图像获取模块配置成用于获取在不同曝光度下采集的多张初始图像,其中,每张所述初始图像对应一种曝光度;an initial image acquisition module, the initial image acquisition module is configured to acquire a plurality of initial images collected under different exposure degrees, wherein each of the initial images corresponds to one exposure degree;
    图像选取模块,所述图像选取模块配置成用于从所述多张初始图像中,选取指定数量的所述初始图像;an image selection module, the image selection module is configured to select a specified number of the initial images from the plurality of initial images;
    融合处理模块,所述融合处理模块配置成用于对所述指定数量的所述初始图像的亮度信息进行融合处理,得到融合图像;以及a fusion processing module, the fusion processing module is configured to perform fusion processing on the brightness information of the specified number of the initial images to obtain a fusion image; and
    二值化处理模块,所述二值化处理模块配置成用于对所述融合图像进行二值化处理,得到所述蒙版图像。A binarization processing module, the binarization processing module is configured to perform binarization processing on the fusion image to obtain the mask image.
  17. 一种电子系统,其特征在于,所述电子系统包括:图像采集设备、处理设备和存储装置;An electronic system, characterized in that the electronic system comprises: an image acquisition device, a processing device and a storage device;
    所述图像采集设备,用于获取预览视频帧或图像数据;The image acquisition device is used to acquire preview video frames or image data;
    所述存储装置上存储有计算机程序,所述计算机程序在被所述处理设备运行时执行权利要求1至12中的任一项所述的图像处理方法。A computer program is stored on the storage device, and the computer program executes the image processing method of any one of claims 1 to 12 when executed by the processing device.
  18. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其特征在于,所述计算机程序被处理设备运行时执行权利要求1至12中的任一项所述的图像处理方法。A computer-readable storage medium on which a computer program is stored, characterized in that the computer program executes the image processing described in any one of claims 1 to 12 when the computer program is run by a processing device method.
PCT/CN2021/132503 2021-01-28 2021-11-23 Image processing method, image processing apparatus, electronic system and readable storage medium WO2022160895A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110122061.5 2021-01-28
CN202110122061.5A CN113012081A (en) 2021-01-28 2021-01-28 Image processing method, device and electronic system

Publications (1)

Publication Number Publication Date
WO2022160895A1 true WO2022160895A1 (en) 2022-08-04

Family

ID=76384946

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/132503 WO2022160895A1 (en) 2021-01-28 2021-11-23 Image processing method, image processing apparatus, electronic system and readable storage medium

Country Status (2)

Country Link
CN (1) CN113012081A (en)
WO (1) WO2022160895A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115953543A (en) * 2023-03-14 2023-04-11 北京天图万境科技有限公司 Method and device for consistency processing of pixel-by-pixel timing sequence containing analog
CN116579960A (en) * 2023-05-06 2023-08-11 广州纳诺科技股份有限公司 Geospatial data fusion method
CN116630220A (en) * 2023-07-25 2023-08-22 江苏美克医学技术有限公司 Fluorescent image depth-of-field fusion imaging method, device and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113012081A (en) * 2021-01-28 2021-06-22 北京迈格威科技有限公司 Image processing method, device and electronic system
CN114143517A (en) * 2021-10-26 2022-03-04 深圳华侨城卡乐技术有限公司 Fusion mask calculation method and system based on overlapping area and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140307117A1 (en) * 2013-04-15 2014-10-16 Htc Corporation Automatic exposure control for sequential images
CN108668093A (en) * 2017-03-31 2018-10-16 华为技术有限公司 The generation method and device of HDR image
CN110060213A (en) * 2019-04-09 2019-07-26 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN111028189A (en) * 2019-12-09 2020-04-17 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN113012081A (en) * 2021-01-28 2021-06-22 北京迈格威科技有限公司 Image processing method, device and electronic system

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105338338B (en) * 2014-07-17 2018-01-02 诺基亚技术有限公司 Method and apparatus for image-forming condition detection
CN111418201B (en) * 2018-03-27 2021-10-15 华为技术有限公司 Shooting method and equipment
CN109218628B (en) * 2018-09-20 2020-12-08 Oppo广东移动通信有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN110087003B (en) * 2019-04-30 2021-03-23 Tcl华星光电技术有限公司 Multi-exposure image fusion method
CN111986129B (en) * 2020-06-30 2024-03-19 普联技术有限公司 HDR image generation method, equipment and storage medium based on multi-shot image fusion
CN112132769A (en) * 2020-08-04 2020-12-25 绍兴埃瓦科技有限公司 Image fusion method and device and computer equipment
CN112215875A (en) * 2020-09-04 2021-01-12 北京迈格威科技有限公司 Image processing method, device and electronic system
CN112150399B (en) * 2020-09-27 2023-03-07 安谋科技(中国)有限公司 Image enhancement method based on wide dynamic range and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140307117A1 (en) * 2013-04-15 2014-10-16 Htc Corporation Automatic exposure control for sequential images
CN108668093A (en) * 2017-03-31 2018-10-16 华为技术有限公司 The generation method and device of HDR image
CN110060213A (en) * 2019-04-09 2019-07-26 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN111028189A (en) * 2019-12-09 2020-04-17 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN113012081A (en) * 2021-01-28 2021-06-22 北京迈格威科技有限公司 Image processing method, device and electronic system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115953543A (en) * 2023-03-14 2023-04-11 北京天图万境科技有限公司 Method and device for consistency processing of pixel-by-pixel timing sequence containing analog
CN116579960A (en) * 2023-05-06 2023-08-11 广州纳诺科技股份有限公司 Geospatial data fusion method
CN116579960B (en) * 2023-05-06 2023-12-08 广州纳诺科技股份有限公司 Geospatial data fusion method
CN116630220A (en) * 2023-07-25 2023-08-22 江苏美克医学技术有限公司 Fluorescent image depth-of-field fusion imaging method, device and storage medium
CN116630220B (en) * 2023-07-25 2023-11-21 江苏美克医学技术有限公司 Fluorescent image depth-of-field fusion imaging method, device and storage medium

Also Published As

Publication number Publication date
CN113012081A (en) 2021-06-22

Similar Documents

Publication Publication Date Title
WO2022160895A1 (en) Image processing method, image processing apparatus, electronic system and readable storage medium
CN111402135B (en) Image processing method, device, electronic equipment and computer readable storage medium
CN112150399B (en) Image enhancement method based on wide dynamic range and electronic equipment
US9451173B2 (en) Electronic device and control method of the same
US10021313B1 (en) Image adjustment techniques for multiple-frame images
CN104883504B (en) Open the method and device of high dynamic range HDR functions on intelligent terminal
US20210014411A1 (en) Method for image processing, electronic device, and computer readable storage medium
US11431915B2 (en) Image acquisition method, electronic device, and non-transitory computer readable storage medium
CN108810418B (en) Image processing method, image processing device, mobile terminal and computer readable storage medium
JP2021530911A (en) Night view photography methods, devices, electronic devices and storage media
CN108259770B (en) Image processing method, image processing device, storage medium and electronic equipment
CN108616700B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN108875619A (en) Method for processing video frequency and device, electronic equipment, computer readable storage medium
CN110213502A (en) Image processing method, device, storage medium and electronic equipment
CN108401110B (en) Image acquisition method and device, storage medium and electronic equipment
US10834329B2 (en) Method and device for balancing foreground-background luminosity
WO2022133382A1 (en) Semantic refinement of image regions
CN108717530A (en) Image processing method, device, computer readable storage medium and electronic equipment
EP4340383A1 (en) Image processing method and related device thereof
CN108848306B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN107682611B (en) Focusing method and device, computer readable storage medium and electronic equipment
CN113781370A (en) Image enhancement method and device and electronic equipment
CN108401109B (en) Image acquisition method and device, storage medium and electronic equipment
CN117274107B (en) End-to-end color and detail enhancement method, device and equipment under low-illumination scene
US20190286887A1 (en) Image Processing Method, Electronic Device 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: 21922485

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.11.2023)