Image processing method, device and electronic system
By acquiring multiple initial images and their mask images collected at different exposures, and integrating brightness and color information, the problem of low contrast in HDR image synthesis is solved, and the naturalness of the image and the visual effect of the foreground area are improved.
Patent Information
- Application Number
- CN202110122061.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-28
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2041-01-28
AI Technical Summary
Existing HDR image synthesis methods use a linear fusion method, which results in low contrast of the synthesized image, the portrait area is visually gray, and the overall effect is not natural enough.
By acquiring multiple initial images collected at different exposures and their mask images, the brightness information and the pixel brightness information of the reference frame image are fused and processed to generate the final brightness information, combined with the color information to generate the target image, and the mask image is used to indicate the foreground. area to improve image quality.
The visual effect and overall effect of the portrait area in the fused image are improved, the foreground area matches the foreground area in the reference frame image, and the naturalness of the image is enhanced.
Smart Images

Figure CN113012081B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, device and electronic system. Background Art
[0002] HDR (High-Dynamic Range) images can provide more dynamic range and image details than ordinary images. HDR images use multiple pictures with different exposures and then use software to combine these images with different exposures into one image. This image can better reflect the visual effects in the real environment.
[0003] In the related art, the HDR image synthesis method usually adopts a linear fusion method, but the synthetic image obtained by this method has a low contrast and tends to appear gray visually, causing the portrait area of the synthesized image to look gray visually, making the overall image effect unnatural. Summary of the invention
[0004] The object of the present invention is to provide an image processing method, device and electronic system to improve the effect of the portrait area in the composite image and improve the overall effect of the composite image.
[0005] In a first aspect, the present invention provides an image processing method, the method comprising: acquiring multiple initial images captured at different exposure levels, and mask images corresponding to the multiple initial images; wherein the mask image is generated based on at least a portion of the multiple initial images; the mask image is used to indicate a foreground area in the multiple initial images; fusing the brightness information of the multiple initial images to obtain initial brightness information; based on the mask image, fusing the initial brightness information with pixel brightness information of a reference frame image in the multiple initial images to obtain final brightness information; and obtaining a target image based on the final brightness information and the color information of the reference frame image.
[0006] 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 includes: alpha fusing the initial brightness information with the pixel brightness information of the reference frame image through the mask image to obtain the final brightness information.
[0007] In an optional implementation, the pixel value of each pixel in the mask image is 0 or 255; the step of performing 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 includes: calculating the final brightness information through the following formula: new_res=ev0*(M / 255)+(1-M / 255)*res;
[0008] 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; and res represents the initial brightness information.
[0009] In an optional embodiment, the above-mentioned step of obtaining multiple initial images captured at different exposures, and mask images corresponding to the multiple initial images, includes: obtaining multiple initial images captured at different exposures; wherein each initial image corresponds to an exposure; selecting a specified number of initial images from the multiple initial images; fusing the brightness information of the specified number of initial images to obtain a fused image; and binarizing the fused image to obtain a mask image.
[0010] In an optional embodiment, the specified number is two; the step of selecting a specified number of initial images from the multiple initial images includes: selecting an initial image with the highest exposure and an initial image with the lowest exposure from the multiple initial images.
[0011] In an optional embodiment, the step of fusing the brightness information of a specified number of initial images to obtain a fused image includes: for each pair of two initial images with adjacent exposure levels among the specified number of initial images, fusing the two initial images with adjacent current exposure levels to obtain a first fused image of the two initial images with adjacent current exposure levels; for each pair of two first fused images with adjacent exposure levels among the multiple first fused images obtained from the specified number of initial images, fusing the two first fused images with adjacent current exposure levels to obtain a second fused image of the two first fused images with adjacent current exposure levels; using the second fused image as a new first fused image, continuing to perform the step of fusing the two first fused images with adjacent current exposure levels for each pair of two first fused images with adjacent exposure levels to obtain a second fused image of the two first fused images with adjacent current exposure levels, until a final fused image is obtained.
[0012] In an optional embodiment, the above-mentioned step of fusing two initial images with adjacent current exposure levels to obtain a first fused image of the two initial images with adjacent current exposure levels includes: for each pixel point in the two initial images with adjacent current exposure levels, performing the following operations: searching for weighted weights from a preset weight matrix based on the brightness value of the current pixel point in the two initial images with adjacent current exposure levels; wherein the weight matrix includes weighted weights corresponding to any two brightness values; and determining the brightness value corresponding to the current pixel point in the first fused image based on the found weighted weights and the brightness value of the current pixel point in the two initial images with adjacent current exposure levels.
[0013] In an optional embodiment, the step of searching for weighted weights from a preset weight matrix based on the brightness value of the current pixel in two initial images adjacent to the current exposure level includes: determining, from the two initial images adjacent to the current exposure level, a first brightness value of the current pixel in the first initial image and a second brightness value of the current pixel in the second initial image; determining the sum of the first brightness value and one as the target number of columns; determining the sum of the second brightness value and one as the target number of rows; determining the position of the weighted weight in the weight matrix based on the target number of columns and the target number of rows, and determining the value corresponding to the position in the weight matrix as the searched weighted weight.
[0014] In an optional embodiment, the step of determining the brightness value corresponding to the current pixel in the first fused image according to the weighted weight and the brightness value of the current pixel in the two initial images adjacent to the current exposure includes: determining the brightness value corresponding to the current pixel in the first fused image by the following formula: i =w1 i *A1 i +w2 i *A2 i Among them, B i w1 represents the brightness value of the i-th pixel in the first fused image, where the i-th pixel is the current pixel; i w2 represents the weighted weight found in the weight matrix, which is the weighted weight corresponding to the i-th pixel in the first initial image A1 of the two initial images with adjacent current exposures; i represents the weighted weight corresponding to the i-th pixel in the second initial image A2 of the two initial images with adjacent current exposure, where 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 i-th pixel in the second initial image A2.
[0015] In an optional implementation, the step of binarizing the fused image to obtain the mask image includes: performing guided filtering on the binarized fused image to obtain a filtered mask image.
[0016] In an optional embodiment, the step of fusing the brightness information of the multiple initial images to obtain the initial brightness information includes: for each pair of two initial images with adjacent exposures in the multiple initial images, fusing the two initial images with adjacent current exposures to obtain a first brightness map of the two initial images with adjacent current exposures; for each pair of two first brightness maps with adjacent exposures in the multiple first brightness maps obtained from the multiple initial images, fusing the two first brightness maps with adjacent current exposures to obtain a second brightness map of the two first brightness maps with adjacent current exposures; using the second brightness map as a new first brightness map, continuing to perform the step of fusing the two first brightness maps with adjacent current exposures for each pair of two first brightness maps with adjacent exposures to obtain a second brightness map of the two first brightness maps with adjacent current exposures, until a brightness map is obtained; and determining the brightness information of the obtained brightness map as the initial brightness information.
[0017] In an optional implementation, the color space of the initial image is in YUV format, the brightness information is in the Y channel, and the color information is in the UV channel.
[0018] In a second aspect, the present invention provides an image processing device, which includes: an image acquisition module, used to acquire multiple initial images collected at different exposure levels, and mask images corresponding to the multiple initial images; wherein the mask image is generated based on at least a portion of the multiple initial images; the mask image is used to indicate the foreground area in the multiple initial images; a first fusion module, used to fuse the brightness information of the multiple initial images to obtain initial brightness information; a second fusion module, used to fuse the initial brightness information and the pixel brightness information of the reference frame image in the multiple initial images based on the mask image to obtain final brightness information; an information integration module, used to obtain a target image based on the final brightness information and the color information of the reference frame image.
[0019] In a third aspect, the present invention provides an electronic system, comprising: an image acquisition device, a processing device and a storage device; the image acquisition device is used to obtain preview video frames or image data; the storage device stores a computer program, and the computer program executes the image processing method described in any one of the aforementioned embodiments when the processed device is running.
[0020] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processing device, the image processing method described in any one of the aforementioned embodiments is executed.
[0021] The embodiments of the present invention bring the following beneficial effects:
[0022] The present invention provides an image processing method, device and electronic system, which first obtains multiple initial images collected at different exposures, and mask images corresponding to the multiple initial images; wherein the mask image is generated based on at least a portion of the multiple 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 pixel brightness information of the reference frame image 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 image, the target image, that is, the fused image, is obtained. This method 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 area in the initial brightness information through the mask image. Since the foreground area in the reference frame image has a better effect, it ensures 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 overall effect of the fused image.
[0023] Other features and advantages of the present invention will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present invention.
[0024] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 A schematic diagram of the structure of an electronic system provided by an embodiment of the present invention;
[0027] Figure 2A flowchart of an image processing method provided by an embodiment of the present invention;
[0028] Figure 3 A flowchart of another image processing method provided by an embodiment of the present invention;
[0029] Figure 4 A schematic diagram of a mask image provided by an embodiment of the present invention;
[0030] Figure 5 A flowchart of another image processing method provided by an embodiment of the present invention;
[0031] Figure 6 A schematic diagram of the structure of an image processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0033] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] As mobile phone functions continue to improve, users have higher and higher demands for mobile phone functions 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 allow cameras to see the characteristics of images 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 exist in the image at the same time, the image output by the camera will appear to be overexposed and white in bright areas, while dark areas are underexposed and black, which seriously affects the image quality. The camera has limitations in its performance of the brightest area and the darker area in the same scene. This limitation is usually referred to as "dynamic range". HDR images use multiple pictures with different exposures, and then use software to combine them into one picture. Its advantage is that it can eventually get a picture with details in both the shadow part and the highlight part.
[0035] The HDR image synthesis method in the related art usually adopts a linear fusion method, but the synthetic image obtained by this method has a low contrast and tends to appear gray visually, causing the portrait area of the synthesized image to appear gray visually, making the overall image effect unnatural.
[0036] Embodiment 1:
[0037] First, refer to Figure 1 An exemplary electronic system 100 for implementing the image processing method, apparatus, and electronic system according to the embodiments of the present invention is described.
[0038] like Figure 1 The electronic system 100 includes 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 are interconnected via a bus system 112 and / or other forms of connection mechanisms (not shown). It should be noted that Figure 1 The components and structure of the electronic system 100 shown are merely exemplary and non-limiting. The electronic system may also have other components and structures as required.
[0039] The processing device 102 may be a gateway, or an intelligent terminal, or a device including a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities. It may process data of other components in the electronic system 100, and may also control other components in the electronic system 100 to perform desired functions.
[0040] The storage device 104 may include one or more computer program products, and the computer program product 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 (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processing device 102 may run the program instructions to implement the client functions and / or other desired functions in the embodiments of the present invention (implemented by the processing device) described below. Various applications and various data, such as various data used and / or generated by the application, may also be stored in the computer-readable storage medium.
[0041] The input device 106 may be a device used by a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like.
[0042] 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.
[0043] The image acquisition device 110 may acquire preview video frames or image data, and store the acquired preview video frames or image data in the storage device 104 for use by other components.
[0044] Exemplarily, the components in the example electronic system for implementing the image processing method, text recognition method, device and electronic system according to the embodiments of the present invention can be integrated or dispersed, such as integrating the processing device 102, storage device 104, input device 106 and output device 108 into one, and setting the image acquisition device 110 at a specified position where the target image can be acquired. When the components 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, etc.
[0045] Embodiment 2:
[0046] This embodiment provides an image processing method, which is executed by a processing device in the above electronic system; the processing device can be any device or chip with data processing capabilities. The processing device can process the received information independently, or it can be connected to a server to jointly analyze and process the information. Figure 2 As shown, the image processing method includes the following specific steps:
[0047] Step S202, obtaining multiple initial images captured at different exposures, and mask images corresponding to the multiple initial images; wherein the mask image is generated based on at least a portion of the multiple initial images; and the mask image is used to indicate a foreground area in the multiple initial images.
[0048] The above-mentioned initial image may be a picture or a photo taken by a camera or a camera. In specific implementation, the initial image may be transmitted after being photographed by a camera or a camcorder connected by communication, or may be obtained from a storage device storing images to be processed that have been photographed. The scene captured by each of the multiple initial images obtained is the same, but the exposure corresponding to each initial image is different. The exposure refers to the intensity and duration of the light. Generally, the higher the exposure, the whiter the image obtained; the lower the exposure, the darker the image obtained.
[0049] The above-mentioned mask image is generated based on at least a part of the multiple initial images, and the at least a part of the images can be at least two images of the multiple initial images. In a specific implementation, at least a part of the images can be selected from the multiple initial images, and then the grayscale images corresponding to the selected initial images are fused to obtain the mask image. The mask image is used to indicate the foreground area in the multiple images. The pixel value of the image area corresponding to the foreground area in the mask image is different from the pixel value of the image area other than the foreground area, so that the foreground area and the non-foreground area can be distinguished. The foreground area usually refers to the image area containing a portrait.
[0050] Step S204, performing fusion processing on the brightness information of multiple initial images to obtain initial brightness information.
[0051] The brightness information of the initial image generally refers to the brightness corresponding to each pixel in the initial image, which may also be called grayscale value, gray value or brightness value, and is used to indicate the brightness of the image; the value range of the brightness is 0 to 255. In some embodiments, the color space of the initial image may be in the form of YUV (Y represents brightness, 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.
[0052] In a specific implementation, the brightness information of multiple initial images with different exposures is fused together to obtain brightness information corresponding to a fused image, which is also the initial brightness information; the initial brightness information contains the brightness corresponding to each pixel in the fused image.
[0053] Step S206 , 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.
[0054] The reference frame image may be an initial image specified by the user from multiple initial images according to a preset rule. For example, the reference frame image may be an initial image with a specified exposure value (the specified value may be set according to user requirements, such as 0 or 1), or may be an image with the best foreground area effect among multiple initial images. The pixel brightness information of the reference frame image includes the brightness corresponding to each pixel in the reference frame image.
[0055] 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 brightness of each pixel point corresponding to the foreground area in the final brightness information; the brightness information corresponding to the image area except the foreground area is obtained from the initial brightness information through the foreground area indicated by the mask image, so that the brightness information corresponding to the image area except the foreground area in the initial brightness information is used as the brightness corresponding to each pixel point in the image area except the foreground area in the final brightness information.
[0056] Step S208, obtaining a target image based on the final brightness information and the color information of the reference frame image.
[0057] The color information of the reference frame image may refer to the chromaticity corresponding to each pixel in the initial image, and the chromaticity is used to describe the color and saturation of the reference frame image and is used to specify the color of the pixel. In some embodiments, the color space of the reference frame image may be in YUV format, and the color information of the reference frame image is the data corresponding to the reference frame image on the UV channel.
[0058] 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 is determined by the brightness of each pixel in the final brightness information and the chromaticity of each pixel in the reference frame image.
[0059] An image processing method provided by an embodiment of the present invention first obtains multiple initial images captured at different exposures, and mask images corresponding to the multiple initial images; wherein the mask image is generated based on at least a portion of the multiple 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 initial brightness information; then based on the mask image, the initial brightness information and the pixel brightness information of the reference frame image in the multiple initial images are fused to obtain final brightness information; then based on the final brightness information and the color information of the reference frame image, a target image, i.e., a fused image, is obtained. This method 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 area in the initial brightness information through the mask image. Since the foreground area in the reference frame image has a better effect, it ensures 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 overall effect of the fused image.
[0060] Embodiment three:
[0061] The embodiment of the present invention also provides another image processing method, which is implemented on the basis of the method described in the above embodiment; the method focuses on the specific process of obtaining multiple initial images collected at different exposure levels and mask images corresponding to the multiple initial images (implemented by the following steps S302-S308); Figure 3 As shown, the method comprises the following specific steps:
[0062] Step S302, obtaining a plurality of initial images captured at different exposure levels; wherein each initial image corresponds to an exposure level.
[0063] Step S304: selecting a specified number of initial images from the multiple initial images.
[0064] The above-mentioned designated number is at least two, and the specific value of the designated number can be set according to research and development requirements, for example, it can be set to two or three, etc. In some embodiments, in order to improve calculation efficiency, the designated number can be set to two, that is, two initial images can be randomly selected from multiple initial images, or the initial image with the largest exposure and the initial image with the smallest exposure can be selected from multiple initial images.
[0065] Step S306, performing fusion processing on the brightness information of a specified number of initial images to obtain a fused image.
[0066] The brightness information of the specified number of initial images is merged into a merged image, and the merged image only contains the brightness value corresponding to each pixel. In specific implementation, if the specified number is greater than two, the above step S306 can be implemented by the following steps 10-12:
[0067] Step 10: For each pair of two initial images with adjacent exposure levels in the specified number of initial images, two initial images with adjacent current exposure levels are fused to obtain a first fused image of the two initial images with adjacent current exposure levels.
[0068] In a specific implementation, the above-mentioned specified number of initial images can 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 fused images can be obtained; if the specified number is two, then there is only one pair of two initial images with adjacent exposures in the specified number of initial images, that is, one first fused image can be obtained, and the first fused image is also the fused image obtained in step S306.
[0069] Specifically, the specific process of fusing two initial images with adjacent current exposure levels to obtain a first fused image of the two initial images with adjacent current exposure levels is as follows: for each pixel point in the two initial images with adjacent current exposure levels, the following steps 20-21 are performed to obtain a first fused image:
[0070] Step 20, searching for weighted weights from a preset weight matrix according to the brightness value of the current pixel in two initial images with adjacent current exposures; wherein the weight matrix includes weighted weights corresponding to any two brightness values.
[0071] The above brightness value is equivalent to the brightness on the Y channel, which can also be called the grayscale value. The brightness value is an integer between 0 and 255. The above weight matrix is set in advance by R&D personnel according to R&D needs. The weight matrix contains weighted weights corresponding to any two grayscale values. Each value contained in the weight matrix is a positive number less than 1, that is, the weighted weight is a positive number less than 1. The weight matrix is a 256*256 matrix, that is, the weight matrix has 256 rows and 256 columns, of which 256 rows correspond to rows corresponding to integers between 0 and 255; 256 columns correspond to columns corresponding to integers between 0 and 255.
[0072] In some embodiments, the above step 20 may be implemented by the following steps 30-32:
[0073] Step 30 , determining a first brightness value of a current pixel in the first initial image and a second brightness value of the current pixel in the second initial image from two initial images with adjacent current exposure levels.
[0074] The first initial image may be the image with greater exposure or the image with less exposure of the two initial images.
[0075] Step 31, the sum of the first brightness value and 1 is determined as the target number of columns; the sum of the second brightness value and 1 is determined as the target number of rows.
[0076] 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 column number to be queried, and the sum of the second brightness value and one can be determined as the target row number to be searched.
[0077] Step 32, determining the position of the weighted weight in the weight matrix according to the target number of columns and the target number of rows, and determining the value corresponding to the position in the weight matrix as the found weighted weight.
[0078] According to the target number of rows and the target number of columns, the position of the weighted weight to be found can be located in the weight matrix, and the value corresponding to the position is determined as the weighted weight to be found.
[0079] Step 21, 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.
[0080] In specific implementation, the brightness value corresponding to the current pixel in the first fused image can be determined by the following formula:
[0081] B i =w1 i *A1 i +w2 i *A2 i ;
[0082] Among them, B i w1 represents the brightness value of the i-th pixel in the first fused image, where the i-th pixel is the current pixel; i w2 represents the weighted weight found in the weight matrix, which is the weighted weight corresponding to the i-th pixel in the first initial image A1 of the two initial images with adjacent current exposures; i represents the weighted weight corresponding to the i-th pixel in the second initial image A2 of the two initial images with adjacent current exposure, where 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 i-th pixel in the second initial image A2.
[0083] Step 11, for each pair of two first fused images with adjacent exposure levels among the multiple first fused images obtained from the specified number of initial images, two first fused images with adjacent current exposure levels are fused to obtain a second fused image of the two first fused images with adjacent current exposure levels.
[0084] Step 12, taking the second fused image as the new first fused image, continuing to execute each pair of two first fused images with adjacent exposures, fusing the two first fused images with adjacent current exposures, and obtaining the second fused image of the two first fused images with adjacent current exposures, until a final fused image is obtained.
[0085] If the specified number is three or more, then there are at least two pairs of two initial images with adjacent exposures in the specified number of initial images, that is, at least two first fused images can be obtained; then it is necessary to continue to fuse each pair of two first fused images with adjacent exposures in the multiple first fused images in the manner of steps 20-21 (replacing the initial images in steps 20-21 with the first fused images) to obtain the second fused image corresponding to each pair of two first fused images with adjacent exposures. If the specified number is three, then the obtained second fused image is the fused image obtained in step S306; if the specified number exceeds three, then the second fused images obtained in step 11 are at least two, not one, so it is still necessary to continue to fuse the multiple second fused images corresponding to the specified number of initial images until a final fused image is obtained. Among them, the specific process of fusing the multiple second fused images corresponding to the specified number of initial images is the same as the process of fusing the first fused image.
[0086] Step S308: binarize the fused image to obtain a mask image.
[0087] The fused image only contains the brightness value of each pixel, so the fused image can also be called a grayscale image. The brightness value (or grayscale value) of each pixel in the grayscale image is between 0 and 255. Therefore, the brightness value less than the set value in the fused image can be set as the first pixel value, and the brightness value greater than or equal to the set value can be set as the second pixel value to complete the binarization of the fused image and obtain a mask image containing only two values. In some embodiments, the first pixel value can be set to 0, and the second pixel value can be set to 255 to obtain a mask image with only black and white colors, such as Figure 4 Shown is a schematic diagram of a mask image. Figure 4 The white area (pixel value is 255) refers to the foreground area, which includes the image area where the portrait is located, that is, the mask image can deduct the area where the portrait is located and separate the portrait area from other areas. Therefore, in some embodiments, the mask image can also be called a pseudo-cutout image. Although a part of the background in the mask image will also be judged as the Qinjing area, as long as the portrait area in the foreground area is accurate, it will be fine.
[0088] In some embodiments, the specific process of binarizing the fused image to obtain the mask image may also be: performing guided filtering on the binarized fused image to obtain a filtered mask image, so that the foreground area in the obtained mask image and the image area outside the foreground area in the mask image are oversmoothed. That is, through guided filtering, a mask image with oversmoothed foreground area and background area (equivalent to the image area outside the foreground area) can be obtained, which is beneficial to subsequent fusion processing and improves the overall effect of the image. In specific implementation, the foreground area may refer to Figure 4 The white area in the background area refers to Figure 4 The black area in .
[0089] Step S310, performing fusion processing on the brightness information of multiple initial images to obtain initial brightness information.
[0090] Step S312: 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.
[0091] Step S314, obtaining a target image based on the final brightness information and the color information of the reference frame image.
[0092] The above image processing method can obtain a mask image based on the light and dark characteristics between images with different exposures. The mask image can better segment the foreground area in the original image, that is, the portrait area; then the foreground area in the mask image is fused with the reference frame image with a better foreground area, which can well protect the portrait 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 image processing efficiency.
[0093] Embodiment 4:
[0094] The embodiment of the present invention also provides another image processing method, which is implemented on the basis of the method described in the above embodiment; the method focuses on describing the specific process of fusing the brightness information of the multiple initial images to obtain the initial brightness information (implemented by the following steps S504-S510), and fusing the initial brightness information and the pixel brightness information of the reference frame image in the multiple initial images based on the mask image to obtain the specific process of final brightness information (implemented by the following step S512); Figure 5 As shown, the method comprises the following specific steps:
[0095] Step S502, obtaining a plurality of initial images captured at different exposure levels and mask images corresponding to the plurality of initial images; the mask image is used to indicate a foreground area in the plurality of initial images.
[0096] Step S504 , for each pair of two initial images with adjacent exposure levels among the multiple initial images, two initial images with adjacent current exposure levels are fused to obtain a first brightness map of the two initial images with adjacent current exposure levels.
[0097] The specific implementation of step S504 is the same as the implementation of 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 fused image, which is the implementation of step S504. Specifically, the method of obtaining the first brightness map of two initial images with adjacent current exposure levels can refer to steps 20-21, which will not be repeated here.
[0098] Step S506, for each pair of two first brightness images with adjacent exposure levels among the multiple first brightness images obtained from the multiple initial images, two first brightness images with adjacent exposure levels are fused to obtain a second brightness image of the two first brightness images with adjacent exposure levels.
[0099] Step S508, taking the second brightness map as the new first brightness map, continuing to perform the step of fusing the two first brightness maps with adjacent exposure levels for each pair of two first brightness maps with adjacent exposure levels, and obtaining the second brightness map of the two first brightness maps with adjacent exposure levels, until a brightness map is obtained.
[0100] In the specific implementation, the specific process of the above steps S506-S508 can refer to steps 11-12 in the third embodiment, which will not be repeated here.
[0101] Step S510: determine the brightness information of a brightness image obtained as initial brightness information.
[0102] Step S512, alpha fusion is performed on the initial brightness information and the pixel brightness information of the reference frame image through the mask image to obtain final brightness information.
[0103] In a specific implementation, the specific process of alpha fusion can be: 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 first brightness information corresponding to the foreground area in the final brightness information; according to the image area excluding the foreground area in the mask image, determine the brightness information corresponding to the image area excluding the foreground area in the initial brightness information, and then determine the brightness information corresponding to the image area excluding the foreground area in the initial brightness information as the second brightness information corresponding to the image area excluding the foreground area in the final brightness information; integrate the first brightness information and the second brightness information to obtain the final brightness information.
[0104] In some embodiments, the pixel value of each pixel in the mask image is 0 or 255; wherein, when the pixel value is 0, the corresponding image area is black, that is, Figure 4 The black area in the image; when the pixel value is 255, the corresponding image area is white, that is, Figure 4 The white area in is the foreground area, so the final brightness information can be calculated by the following formula:
[0105] new_res=ev0*(M / 255)+(1-M / 255)*res;
[0106] Among them, new_res represents the final brightness information; ev0 represents the pixel brightness information of the reference frame image, which 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 pixel value is 0 or 255); res represents the initial brightness information, which includes the brightness value of each pixel in the image after the fusion of multiple initial images.
[0107] Step S514, obtaining a target image based on the final brightness information and the color information of the reference frame image.
[0108] In order to facilitate the understanding of the embodiment of the present invention, the present invention is further introduced below by taking three initial images with different exposures as an example. First, three initial images with different exposures in the YUV color space are obtained, namely ev+1, ev0 and ev-2; wherein, the exposure of ev+1 is +1, the exposure of ev0 is 0, and the exposure of ev-2 is -2; then the three initial images are split and processed on the Y channel and the UV channel, and 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, ev+1 and ev-2 selected from the three initial images are fused (also referred to as filter fusion processing) to obtain a fused image, and then the fused image is binarized to obtain a mask image (also referred to as an image mask); then the obtained mask image is subjected to guided filtering processing to make the foreground area and the background area in the mask image over-smoothed to obtain the final mask image. Then, the three initial images with different exposures obtained are fused on the Y channel to obtain the initial brightness information. Then, the final brightness information is obtained by the above formula for calculating the final brightness information. At this time, the reference frame image refers to ev0, which is the 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.
[0109] The above-mentioned image processing method obtains a mask image for indicating the foreground area of the image based on multiple images with different exposure degrees, 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 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 also improving the overall effect of the fused image.
[0110] Embodiment five:
[0111] Corresponding to the above-mentioned image processing method embodiment, the embodiment of the present invention provides an image processing device, such as Figure 6 As shown, the device comprises:
[0112] The image acquisition module 60 is used to acquire multiple initial images captured at different exposure levels, and mask images corresponding to the multiple initial images; wherein the mask image is generated based on at least a portion of the multiple initial images; the mask image is used to indicate the foreground area in the multiple initial images.
[0113] The first fusion module 61 is used to fuse the brightness information of the above-mentioned multiple initial images to obtain initial brightness information.
[0114] The second fusion module 62 is used to fuse the initial brightness information with 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.
[0115] The information integration module 63 is used to obtain a target image based on the final brightness information and the color information of the reference frame image.
[0116] The color space of the initial image is in YUV format, the brightness information is in the Y channel, and the color information is in the UV channel.
[0117] Furthermore, the second fusion module 62 is used to perform alpha fusion on the initial brightness information and the pixel brightness information of the reference frame image through the mask image to obtain final brightness information.
[0118] In a specific implementation, the pixel value of each pixel in the mask image is 0 or 255; the second fusion module 62 is further used to calculate the final brightness information through the following formula:
[0119] new_res=ev0*(M / 255)+(1-M / 255)*res;
[0120] 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; and res represents the initial brightness information.
[0121] Specifically, the above-mentioned image acquisition module 60 includes: an initial image acquisition module, which is used to acquire multiple initial images collected at different exposure levels; wherein each initial image corresponds to an exposure level; an image selection module, which is used to select a specified number of initial images from multiple initial images; a fusion processing module, which is used to fuse the brightness information of the specified number of initial images to obtain a fused image; and a binarization processing module, which is used to binarize the fused image to obtain a mask image.
[0122] Furthermore, the above-mentioned fusion processing module is used to: for each pair of two initial images with adjacent exposure levels in a specified number of initial images, perform fusion processing on two initial images with adjacent current exposure levels to obtain a first fused image of two initial images with adjacent current exposure levels; for each pair of two first fused images with adjacent exposure levels in a plurality of first fused images obtained from a specified number of initial images, perform fusion processing on two first fused images with adjacent current exposure levels to obtain a second fused image of two first fused images with adjacent current exposure levels; use the second fused image as a new first fused image, and continue to execute the steps of, for each pair of two first fused images with adjacent exposure levels, performing fusion processing on two first fused images with adjacent current exposure levels to obtain a second fused image of two first fused images with adjacent current exposure levels, until a final fused image is obtained.
[0123] Furthermore, the above-mentioned specified number may be two; and the above-mentioned image selection module is used to select an initial image with the largest exposure and an initial image with the smallest exposure from multiple initial images.
[0124] Specifically, the above-mentioned fusion processing module is also used to: perform the following operations for each pixel point in the two initial images with adjacent current exposure levels: search for weighted weights from a preset weight matrix based on the brightness value of the current pixel point in the two initial images with adjacent current exposure levels; wherein the weight matrix includes weighted weights corresponding to any two brightness values; determine the brightness value corresponding to the current pixel point in the first fused image based on the found weighted weights and the brightness value of the current pixel point in the two initial images with adjacent current exposure levels.
[0125] In a specific implementation, the above-mentioned fusion processing module is also used to: 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 two initial images with adjacent current exposure levels; determine the sum of the first brightness value and one as the target number of columns; determine the sum of the second brightness value and one as the target number of rows; determine the position of the weighted weight in the weight matrix based on the target number of columns and the target number of rows, and determine the value corresponding to the position in the weight matrix as the found weighted weight.
[0126] In some embodiments, the fusion processing module is further used to determine the brightness value corresponding to the current pixel in the first fused image by the following formula:
[0127] B i =w1 i *A1 i +w2 i *A2 i ;
[0128] Among them, B iw1 represents the brightness value of the i-th pixel in the first fused image, where the i-th pixel is the current pixel; i w2 represents the weighted weight found in the weight matrix, which is the weighted weight corresponding to the i-th pixel in the first initial image A1 of the two initial images with adjacent current exposures; i represents the weighted weight corresponding to the i-th pixel in the second initial image A2 of the two initial images with adjacent current exposure, where 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 i-th pixel in the second initial image A2.
[0129] Furthermore, the binarization processing module is also used to: perform guided filtering on the binarized fused image to obtain a filtered mask image.
[0130] Furthermore, the first fusion module 61 is used to: for each pair of two initial images with adjacent exposures in the multiple initial images, fuse the two initial images with adjacent current exposures to obtain a first brightness map of the two initial images with adjacent current exposures; for each pair of two first brightness maps with adjacent exposures in the multiple first brightness maps obtained from the multiple initial images, fuse the two first brightness maps with adjacent current exposures to obtain a second brightness map of the two first brightness maps with adjacent current exposures; use the second brightness map as a new first brightness map, and continue to perform the steps of fusing the two first brightness maps with adjacent current exposures for each pair of two first brightness maps with adjacent exposures to obtain a second brightness map of the two first brightness maps with adjacent current exposures, until a brightness map is obtained; and determine the brightness information of the obtained brightness map as the initial brightness information.
[0131] The above-mentioned image processing device first obtains multiple initial images collected at different exposures, and mask images corresponding to the multiple initial images; wherein the mask image is generated based on at least a portion of the multiple 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 pixel brightness information of the reference frame image 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 image, the target image, that is, the fused image, is obtained. This method 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 area in the initial brightness information through the mask image. Since the foreground area in the reference frame image has a better effect, it ensures 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 overall effect of the fused image.
[0132] Embodiment six:
[0133] An embodiment of the present invention provides an electronic system, which includes: an image acquisition device, a processing device and a storage device; the image acquisition device is used to obtain preview video frames or image data; a computer program is stored on the storage device, and the computer program executes the above-mentioned image processing method, or the steps of the above-mentioned image processing method when the processed device is running.
[0134] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0135] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processing device, the image processing method described above is executed.
[0136] The computer program products of the image processing methods, devices, and electronic systems provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0137] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and / or device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0138] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; 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 it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0139] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0140] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0141] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; 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 of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire a plurality of initial images captured at different exposures, and mask images corresponding to the plurality of initial images; wherein the mask image is generated based on at least a portion of the plurality of initial images; the mask image is used to indicate a foreground area in the plurality of initial images; and a pixel value of an image area corresponding to the foreground area in the mask image is different from a pixel value of an image area other than the foreground area; Performing fusion processing on the brightness information of the multiple 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 brightness information and the color information of the reference frame image.
2. The method according to claim 1, characterized in that The 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 comprises: 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. The method according to claim 2, characterized in that The pixel value of each pixel in the mask image is 0 or 255; the step of performing alpha fusion on the initial brightness information and the pixel brightness information of the reference frame image through the mask image to obtain the final brightness information comprises: The final brightness information is calculated by the following formula: new_res=ev0*(M / 255)+(1-M / 255)*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; and res represents the initial brightness information.
4. The method according to any one of claims 1 to 3, characterized in that: The step of obtaining a plurality of initial images collected at different exposures and mask images corresponding to the plurality of initial images comprises: Acquire a plurality of initial images collected at different exposure levels, wherein each of the initial images corresponds to an exposure level; Selecting a specified number of the initial images from the multiple initial images; Performing fusion processing on the brightness information of the specified number of the initial images to obtain a fused image; The fused image is binarized to obtain the mask image.
5. The method according to claim 4, characterized in that The specified number is two; the step of selecting a specified number of the initial images from the multiple initial images comprises: From the multiple initial images, an initial image with the highest exposure and an initial image with the lowest exposure are selected.
6. The method according to claim 4, characterized in that The step of fusing the brightness information of the specified number of initial images to obtain a fused image comprises: For each pair of two initial images with adjacent exposure levels in the specified number of initial images, fusing two initial images with adjacent current exposure levels to obtain a first fused image of the two initial images with adjacent current exposure levels; For each pair of two first fused images with adjacent exposure levels among the plurality of first fused images obtained from the specified number of initial images, fusing two first fused images with adjacent current exposure levels to obtain a second fused image of the two first fused images with adjacent current exposure levels; The second fused image is used as a new first fused image, and the step of fusing the two first fused images with adjacent exposure levels for each pair of two first fused images with adjacent exposure levels to obtain a second fused image of the two first fused images with adjacent exposure levels, is continued, until a final fused image is obtained.
7. The method according to claim 6, characterized in that The step of fusing two initial images with adjacent current exposure levels to obtain a first fused image of the two initial images with adjacent current exposure levels includes: For each pixel in the two initial images with adjacent current exposures, perform the following operations: According to the brightness value of the current pixel point in the two initial images adjacent to the current exposure, searching for weighted weights from a preset weight matrix; wherein the weight matrix includes weighted weights corresponding to any two brightness values; The brightness value corresponding to the current pixel in the first fused image is determined according to the found weighted weight and the brightness value of the current pixel in the two initial images adjacent to the current exposure.
8. The method according to claim 7, characterized in that The 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 comprises: Determine, from two initial images with adjacent current exposures, a first brightness value of a current pixel in a first initial image and a second brightness value of a current pixel in a second initial image; The sum of the first brightness value and 1 is determined as the target number of columns; the sum of the second brightness value and 1 is determined as the target number of rows; According to the target number of columns and the target number of 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 the found weighted weight.
9. The method according to claim 7, characterized in that: The step of determining 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 level comprises: The brightness value corresponding to the current pixel in the first fused image is determined by the following formula: <h2 style=";text-align:left;direction:ltr">B<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> =w1<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> *A1<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> +w2<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> *A2<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> ; Among them, B i w1 represents the brightness value of the i-th pixel in the first fused image, where the i-th pixel is the current pixel; i w2 represents the weighted weight found from the weight matrix, which is the weighted weight corresponding to the i-th pixel in the first of the two initial images with adjacent current exposures; i represents the weighted weight corresponding to the i-th pixel in the second initial image A2 of the two initial images with adjacent current exposure levels, where 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 i-th pixel in the second initial image A2.
10. The method according to claim 4, characterized in that The step of performing binarization processing on the fused image to obtain the mask image comprises: The fused image after the binarization process is subjected to guided filtering to obtain the filtered mask image.
11. The method according to any one of claims 1 to 10, characterized in that: The step of fusing the brightness information of the plurality of initial images to obtain initial brightness information comprises: For each pair of two initial images with adjacent exposure levels among the multiple initial images, performing fusion processing on two initial images with adjacent current exposure levels to obtain a first brightness map of the two initial images with adjacent current exposure levels; For each pair of two first brightness images with adjacent exposure levels among the multiple first brightness images obtained from the multiple initial images, two first brightness images with adjacent current exposure levels are fused to obtain a second brightness image of the two first brightness images with adjacent current exposure levels; Taking the second brightness map as a new first brightness map, and continuing to perform the step of fusing the two first brightness maps with adjacent exposure levels for each pair of two first brightness maps with adjacent exposure levels to obtain a second brightness map of the two first brightness maps with adjacent exposure levels, until a brightness map is obtained; The brightness information of the obtained brightness image is determined as the initial brightness information.
12. The method according to any one of claims 1 to 11, characterized in that: The color space of the initial image is in YUV format, the brightness information is in the Y channel, and the color information is in the UV channel.
13. An image processing device, characterized in that: The device comprises: An image acquisition module, used to acquire a plurality of initial images captured at different exposures, and mask images corresponding to the plurality of initial images; wherein the mask image is generated based on at least a portion of the plurality of initial images; the mask image is used to indicate a foreground area in the plurality of initial images; and the pixel value of an image area corresponding to the foreground area in the mask image is different from the pixel value of an image area other than the foreground area; A first fusion module is used to fuse the brightness information of the multiple initial images to obtain initial brightness information; A second fusion module is used to fuse 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 is used to obtain a target image based on the final brightness information and the color information of the reference frame image.
14. An electronic system, characterized in that: The electronic system includes: an image acquisition device, a processing device and a storage device; The image acquisition device is used to obtain preview video frames or image data; The storage device stores a computer program, which, when executed by the processing device, executes the image processing method according to any one of claims 1 to 12.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the image processing method according to any one of claims 1 to 12 is executed.
