Photographing processing method and device, equipment and storage medium

Through virtual exposure and edge fusion processing technology, the problems of ghosting and faults caused by the HDR algorithm in moving scenes are solved, and the photo quality and user experience are improved.

CN118574010APending Publication Date: 2024-08-30WINGTECH COMM
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410577565.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-10
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing HDR algorithms are prone to ghosting and brightness gaps when processing scenes with moving objects, because the brightness reference frame of the moving object cannot be appropriately selected when synthesizing different exposure frames.

Method used

By judging whether the shooting scene is an HDR scene, the basic image frame is obtained and virtual exposed, and multiple image sequence frames with different exposure values ​​are generated. The Laplacian operator and pyramid edge fusion processing technology are used to synthesize the final target image frame. Avoid movement differences.

Benefits of technology

It effectively avoids ghosting caused by moving objects, improves photo quality and user experience, and ensures brightness consistency and clarity of images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118574010A
    Figure CN118574010A
Patent Text Reader

Abstract

The invention relates to the field of photographing processing, and provides a photographing processing method and device, equipment and a storage medium, and the method comprises the steps: responding to a photographing instruction, and judging whether a current photographing scene is a high dynamic range (HDR) scene or not; under the condition that the current shooting scene is the HDR scene, obtaining a basic image frame; performing virtual exposure on the basic image frame to obtain a plurality of image sequence frames with different exposure values; and synthesizing the image sequence frame to obtain a target image frame and outputting the target image frame. The technical problems that in the processing process of an existing HDR algorithm, the background is highlighted, and ghosting and faults are encountered during foreground motion scene synthesis are solved. HDR image exposure fusion is performed by using virtual exposure to avoid motion differences prior to the frame, so that there is no motion-induced ghosting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of photographic processing technology, and in particular to a photographic processing method, device, equipment and storage medium. Background Art

[0002] At present, the HDR (High Dynamic Range) algorithm is already a mature solution in mobile phone cameras. In daily shooting, many outdoor scenes meet the use scenarios of the HDR algorithm. The HDR algorithm is already a basic algorithm in mobile phone cameras. The HDR algorithm is used to process overexposed areas to be not overexposed, and underexposed areas to be not underexposed. The final image has a wider dynamic range of brightness and can contain more brightness information.

[0003] Existing HDR algorithms are generally synthesis algorithms. The existing technology will give a sequence of multiple frames with different exposure values ​​(EV List, Exposure Value sequence) according to the HDR detection algorithm. For example, a sequence of 2-5 frames with different exposure compensations. The number of frames and compensation values ​​are determined according to the current shooting scene. The HDR algorithm will synthesize these different frames so that the brightness of the final output image has no over-exposure or under-exposure areas.

[0004] However, there is an unavoidable problem in the current HDR algorithm. If there are moving objects in the HDR scene, the final synthesized image will have ghosts. This is because HDR images are synthesized with different exposure frames, and the moving foreground layer will also have different exposures. During synthesis, it is impossible to select a suitable reference frame for the brightness of the moving object, which ultimately results in obvious ghosts and brightness discontinuities in the foreground of the synthesized image. Summary of the invention

[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a photo processing method, device, equipment and storage medium.

[0006] The present application provides a photo processing method, the method comprising:

[0007] In response to a shooting instruction, determining whether a current shooting scene is a high dynamic range (HDR) scene;

[0008] When the current shooting scene is an HDR scene, obtaining a basic image frame;

[0009] Virtually exposing the basic image frame to obtain multiple image sequence frames with different exposure values;

[0010] The image sequence frames are synthesized to obtain a target image frame and output it.

[0011] In one embodiment, determining whether the current shooting scene is an HDR scene includes:

[0012] Obtaining a YUV image of the current shooting scene;

[0013] Performing brightness channel histogram statistics on the YUV image to obtain a brightness histogram;

[0014] Based on the brightness histogram, obtaining brightness quantities corresponding to different brightness levels;

[0015] Calculating a dark rate and a bright rate according to the brightness quantities corresponding to the different brightness levels and the total number of pixels of the YUV image;

[0016] Whether it is the HDR scene is determined according to the dark rate, the bright rate, and a preset underexposure threshold and overexposure threshold.

[0017] In one embodiment, judging whether it is the HDR scene according to the dark rate, the bright rate, and a preset underexposure threshold and overexposure threshold includes:

[0018] Obtaining a ratio of the dark rate to the bright rate;

[0019] Calculating according to the ratio to obtain an exposure difference value;

[0020] It is determined whether it is the HDR scene by judging whether the exposure difference value is greater than or equal to a preset exposure difference threshold and the brightness ratio is greater than or equal to the overexposure threshold of a preset first multiple, or the brightness ratio is greater than or equal to the overexposure threshold of a preset second multiple, or the darkness ratio is greater than or equal to the underexposure threshold of the first multiple.

[0021] In one embodiment, the obtaining of the basic image frame includes:

[0022] Get the preset exposure step length;

[0023] Calculate based on the brightness ratio, the exposure step length and the overexposure threshold to obtain a negative exposure value;

[0024] The image frame corresponding to the minimum negative exposure value among the negative exposure values ​​is used as the basic image frame.

[0025] In one embodiment, the photo processing method further includes:

[0026] Calculate based on the dark rate, the exposure step length and the underexposure threshold to obtain a positive exposure value;

[0027] The step of performing virtual exposure on the basic image frame to obtain a plurality of image sequence frames with different exposure values ​​includes:

[0028] Based on a preset exposure value and index correspondence table, the negative exposure value and the positive exposure value are matched to obtain a plurality of exposure indices;

[0029] The basic image frame is virtually exposed according to the multiple exposure indices to obtain the multiple image sequence frames with different exposure values.

[0030] In one embodiment, the photo processing method further includes:

[0031] Obtaining absolute values ​​corresponding to the negative exposure value and the positive exposure value;

[0032] When the absolute value is greater than the exposure step, the negative exposure value or the positive exposure value corresponding to the absolute value is scored according to a preset scoring rule.

[0033] In one embodiment, the synthesizing process of the image sequence frames to obtain and output the target image frame includes:

[0034] Acquire a chrominance image and a luminance image frame corresponding to the image sequence frame;

[0035] Perform edge detection on image frames with zero exposure value in the image sequence frames by using Laplace operator, and identify edge image frames;

[0036] Performing global brightness average fusion processing on the brightness image frame to obtain a first image frame;

[0037] Performing Laplacian pyramid edge fusion processing on the edge image frame and the first image frame to obtain the second image frame;

[0038] The chrominance image and the second image frame are superimposed and combined into the target image frame and output.

[0039] The present application provides a photograph processing device, the device comprising:

[0040] A response judgment module, used to respond to a shooting instruction and judge whether the current shooting scene is a high dynamic range HDR scene;

[0041] An acquisition module, used for acquiring a basic image frame when the current shooting scene is an HDR scene;

[0042] An exposure module, used for performing virtual exposure on the basic image frame to obtain a plurality of image sequence frames with different exposure values;

[0043] The processing module is used to perform synthesis processing on the image sequence frames to obtain the target image frame and output it.

[0044] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the photo processing method provided in any embodiment of the present application are implemented.

[0045] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the photo processing method provided in any embodiment of the present application are implemented.

[0046] The photographing processing method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application respond to the photographing instruction to determine whether the current photographing scene is a high dynamic range HDR scene; when the current photographing scene is an HDR scene, obtain the basic image frame; virtually expose the basic image frame to obtain multiple frames of image sequence frames with different exposure values; synthesize the image sequence frames to obtain and output the target image frame. The technical problems of ghosting and faults encountered when synthesizing background highlights and foreground motion scenes in the existing HDR algorithm processing are solved. By using virtual exposure to perform HDR image exposure fusion to avoid motion differences between frames, ghosting caused by motion does not exist, thereby effectively improving the quality of photographing and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

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

[0049] Figure 1a This is an application scenario diagram of a photo processing method in an embodiment;

[0050] Figure 1b A schematic diagram of ghosting in an HDR scene in an embodiment;

[0051] Figure 2 A schematic diagram of a process flow of a photo processing method in one embodiment;

[0052] Figure 3 It is a flowchart of a photo processing method in another embodiment;

[0053] Figure 4 A schematic diagram of a process flow of a photo processing method in yet another embodiment;

[0054] Figure 5 A schematic diagram of a process flow of a photo processing method in another embodiment;

[0055] Figure 6 A schematic diagram of a process flow of a photo processing method in another embodiment;

[0056] Figure 7 is an example diagram of a Laplacian pyramid in one embodiment;

[0057] Figure 8 is a schematic diagram of virtual exposure in one embodiment;

[0058] Fig. 9 This is a scene example diagram of a photo processing method in an embodiment;

[0059] Fig.10 is a structural block diagram of a photo processing device in an embodiment;

[0060] Fig.11 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0061] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0062] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.

[0063] The photo processing method of the present application can be applied to Figure 1aIn the application environment shown. The photo processing method is applied to a photo processing system. The photo processing system includes a terminal device 102 and an image acquisition device 104. The terminal device 102 and the image acquisition device 104 communicate through a network. In response to a shooting instruction, determine whether the current shooting scene is a high dynamic range HDR scene; when the current shooting scene is an HDR scene, obtain a basic image frame; perform virtual exposure on the basic image frame to obtain multiple frames of image sequence frames with different exposure values; perform synthesis processing on the image sequence frames to obtain a target image frame and output it. The terminal device 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the image acquisition device 104 may be, but is not limited to, various cameras, cameras on the terminal device 102, and the image acquisition device 104 may be set on the terminal device 102, or may be an independent device with an image acquisition function.

[0064] HDR (High Dynamic Range) is a technology and image processing method that aims to provide a wider brightness range and richer color details to present more realistic and lifelike images. Traditional image technology has certain limitations in brightness range and color details, and cannot fully capture the brightness differences in real scenes. However, HDR technology can capture and present a wider brightness range by using special sensors, algorithms and display technologies in cameras, displays and image processing.

[0065] Motion Detection is a computer vision technique used to detect moving objects in a video or image sequence. It determines whether there is motion by identifying pixel-level changes or differences in objects between consecutive frames.

[0066] A camera (camera or webcam), also known as a computer camera, computer eye, electronic eye, etc., is a video input device that is widely used in video conferencing, telemedicine, and real-time monitoring. Users can also use the camera to communicate with each other over the Internet with images and sounds. In addition, users can also use it for various popular digital images, audio and video processing, etc.

[0067] YUV is a color encoding system used to represent and process color information in images or videos. Unlike the common RGB (red, green, and blue) color space, the YUV color space represents brightness (Y) and chrominance (U and V) separately. Brightness (Y) represents the black and white information in the image, while chrominance (U and V) represents the color information. Since the human eye is more sensitive to brightness and relatively less sensitive to chrominance, YUV encoding can reduce the amount of data while maintaining image quality. This makes YUV encoding widely used in image and video compression, transmission, and processing. In the YUV color space, the value range of brightness (Y) is 0 to 255 (or 0 to 1), and the value range of chrominance (U and V) is -128 to 127 (or -0.5 to 0.5). Common YUV formats include YUV420, YUV422, and YUV444, which represent and store color information in images or videos in different sampling methods and chrominance resolutions.

[0068] NV21 is an image format widely used in digital image and video processing. It is an encoding method based on the YUV color space, where Y represents the brightness component and UV represents the chrominance component. In the NV21 format, the U and V components are stored interleaved in a specific order. Specifically, the image data in the NV21 format is stored in the form of a continuous byte array, where the front part is the brightness component (Y) of the image and the back part is the chrominance component (UV) with half the resolution. This format has good compression performance and processing efficiency in some applications, and it is also widely supported and used in many cameras and video codecs.

[0069] EV List, Exposure Value List (sequence), in the HDR detection algorithm, a sequence of multiple frames with different exposure values ​​is given.

[0070] For example, in the current HDR algorithm, there is an unavoidable problem. If there is a moving object in the HDR scene, the final synthesized image will have ghosts. This is because the HDR image is synthesized with different exposure frames, and the moving foreground layer will also have different exposures. During synthesis, it is impossible to select a suitable reference frame for the brightness of the moving object, which ultimately leads to obvious ghosts and brightness faults in the foreground of the synthesized image, such as Figure 1b shown.

[0071] This application uses virtual exposure to perform HDR image exposure fusion, which can completely solve the ghosting and faulting problems encountered when synthesizing background highlights and foreground motion scenes during the HDR algorithm processing. Because this application does not have motion differences between frames, there are no ghosting caused by motion.

[0072] In one embodiment, Figure 2 As shown, a method for photographing is provided. This embodiment mainly applies the method to Figure 1a The terminal device 102 in FIG. 1 is used as an example. In this embodiment, the method includes the following steps:

[0073] Step 202: In response to a shooting instruction, determine whether the current shooting scene is a high dynamic range (HDR) scene.

[0074] In an embodiment of the present application, any scene can be photographed through the image acquisition device 104 (such as a camera) on the terminal device 102, and the shooting instruction can be obtained by triggering the relevant controls on the terminal device 102 or clicking the application logo corresponding to the image acquisition device 104.

[0075] The HDR scene of the present application refers to an HDR shooting scene with a motion scene. Exemplarily, the terminal device 102 receives a shooting instruction, obtains the current shooting scene, and determines whether the current shooting scene is a high dynamic range HDR scene. In some embodiments, a YUV image of the current shooting scene is obtained, and the brightness channel histogram statistics of the YUV image are performed to obtain a brightness histogram. Based on the brightness histogram, the brightness quantity corresponding to different brightness levels is obtained, and the dark rate and bright rate are calculated according to the brightness quantity corresponding to different brightness levels and the total number of pixels of the YUV image. It is determined whether it is an HDR scene based on the dark rate, bright rate, and preset underexposure thresholds and overexposure thresholds; in other embodiments, the shooting parameters of the current shooting scene are obtained, and it is determined whether it is an HDR scene based on the shooting parameters of the current shooting scene.

[0076] Step 204: when the current shooting scene is an HDR scene, a basic image frame is obtained.

[0077] Specifically, when the current shooting scene is an HDR scene, a basic image frame is obtained. In some embodiments, a preset exposure step is obtained, and a negative exposure value is calculated based on the brightness ratio, the exposure step, and the overexposure threshold; an image frame corresponding to the minimum negative exposure value among the negative exposure values ​​is used as the basic image frame; in other embodiments, an image frame corresponding to the minimum negative exposure value among the exposure values ​​is directly obtained as the basic image frame.

[0078] Step 206 , virtually expose the basic image frame to obtain a plurality of image sequence frames with different exposure values.

[0079] In the embodiment of the present application, virtual exposure is performed after acquiring the basic image frame to obtain multiple image sequence frames with different exposure values.

[0080] Exemplarily, negative exposure values ​​and positive exposure values ​​are processed to obtain multiple exposure indices, and the basic image frame is virtually exposed according to the multiple exposure indices to obtain multiple image sequence frames with different exposure values; but it is not limited to this and the present application does not specifically limit it.

[0081] Step 208: synthesize the image sequence frames to obtain the target image frame and output it.

[0082] Specifically, the image sequence frames after virtual exposure can be synthesized into a target image frame and output.

[0083] Exemplarily, the chromaticity image and luminance image frame corresponding to the image sequence frame are obtained, the luminance image frame is processed to obtain the image to be synthesized, and the chromaticity image is superimposed and combined into the target image frame and output, but it is not limited to this and the present application does not specifically limit it.

[0084] In the above-mentioned photo processing method, by responding to the shooting instruction, it is determined whether the current shooting scene is a high dynamic range HDR scene; when the current shooting scene is an HDR scene, a basic image frame is obtained; the basic image frame is virtually exposed to obtain multiple frames of image sequence frames with different exposure values; the image sequence frames are synthesized to obtain and output the target image frame. The technical problems of ghosting and faults encountered in the synthesis of background highlights and foreground motion scenes in the existing HDR algorithm processing are solved. By using virtual exposure for HDR image exposure fusion to avoid motion differences between frames, there is no ghosting caused by motion, thereby effectively improving the quality of photography and enhancing the user experience.

[0085] Figure 3 This is a flowchart of photo processing in another embodiment. Figure 3 is Figure 2 Based on the illustrated embodiment, a possible implementation of S202 is further described.

[0086] Step 202a, in response to the shooting instruction, obtain a YUV image of the current shooting scene, perform brightness channel histogram statistics on the YUV image, and obtain a brightness histogram.

[0087] Step 202b, based on the brightness histogram, obtain the brightness quantities corresponding to different brightness levels, and calculate the dark rate and the bright rate according to the brightness quantities corresponding to different brightness levels and the total number of pixels of the YUV image.

[0088] Step 202c, determining whether it is an HDR scene according to the dark rate, the bright rate, and the preset underexposure threshold and overexposure threshold.

[0089] Exemplarily, the ratio of the dark rate and the bright rate is obtained, and calculation is performed based on the ratio to obtain an exposure difference value. It is determined whether the exposure difference value is greater than or equal to a preset exposure difference threshold and the bright rate is greater than or equal to a preset first multiple of an overexposure threshold, or the bright rate is greater than or equal to a preset second multiple of an overexposure threshold, or the dark rate is greater than or equal to a first multiple of an underexposure threshold to determine whether it is an HDR scene.

[0090] Specifically, the Y channel histogram of the input YUV image is counted, and the statistical brightness histogram is recorded as HistY; for example, the bit of the YUV image is 8, so the brightness level is 0-255, and the brightness is divided into three levels, namely Dark, Mid, and Bright, where the Dark area corresponds to a brightness of 0-40, Mid corresponds to a brightness of 41-220, and Light corresponds to a brightness of 221-255. The number of brightness levels corresponding to the brightness histogram HistY is extracted and recorded as: DarkVal, MidVal, BrightVal; DarkRatio and BrightRatio are calculated: TotalPixel represents the total number of pixels of the input image (YUV image), DarkRatio = DarkVal / TotalPixel; BrightRatio = BrightVal / TotalPixel.

[0091] Further set two thresholds DarkRatilThd and BrightRatioThd, which represent the underexposure threshold and overexposure threshold respectively. Calculate EVDiff to represent the exposure difference, EVDiff = log(BrightRatio / DarkRatio)*log(2); Set EvDiffThd to perform HDR detection: If the following conditions are met: ((EVDiff>=EvdiffThd&&BrightRatio>=1.4*BrightRatioThd)||(BrightRatio>=2.0*BrightRatioThd||DarkRatio>=1.4*DarkRatioThd)), it is considered to be an HDR scene.

[0092] In this way, it is possible to quickly and accurately determine whether it is an HDR scene, thereby improving processing efficiency.

[0093] Figure 4 This is a flow chart of a photo processing method in another embodiment. Figure 4 is Figure 2 Based on the embodiment shown, a possible implementation of S204 is further described as follows: Figure 4 As shown:

[0094] Step 204a, when the current shooting scene is an HDR scene, obtain a preset exposure step, calculate based on the brightness, exposure step and overexposure threshold, obtain a negative exposure value, and use the image frame corresponding to the minimum negative exposure value among the negative exposure values ​​as the basic image frame.

[0095] In some embodiments, a positive exposure value is calculated based on the dark rate, the exposure step size, and the underexposure threshold.

[0096] Specifically, if the exposure compensation is EV = -5, it means that the exposure needs to be reduced by 5 stops (the exposure value drops by a certain value) so that the average brightness of the current scene is reasonable. Therefore, it is necessary to use the overexposed area to calculate EV- and the underexposed area to calculate Ev+. The calculations are as follows: For example, the exposure step length EVStep is set to 6, and you can also choose to set it according to application needs. Exposure negative value EvMinus = log10(1 / (BrightRatio / (0.85*BrightRatioThd))) / log10(2)*EVStep; exposure positive value EvPlus = log10(DarkRatio / (0.5*DarkRatioThd)) / log10(2)*EVStep.

[0097] In some embodiments, the absolute values ​​corresponding to the negative exposure value and the positive exposure value are obtained, and when the absolute value is greater than the exposure step length, the negative exposure value or the positive exposure value corresponding to the absolute value is scored according to a preset scoring rule.

[0098] Specifically, if the absolute value of EvMinus or EvPlus exceeds the exposure step length, for example, 6, it means that the span of the compensation is too large. In order to ensure the smoothness of the image brightness transition, Ev is divided into two values ​​for representation, such as EVMinux = -11, then EV1- = -11, EV2- = -6 (EVStep). EV2- can be about half of the Ev- value.

[0099] In this way, different reasonable exposure values ​​can be obtained to improve subsequent photographing effects.

[0100] Figure 5 This is a flow chart of a photo processing method in another embodiment. Figure 5 is Figure 2 Based on the embodiment shown, a possible implementation of S206 is further described as follows: Figure 5 As shown:

[0101] Step 206a, based on the preset exposure value and index correspondence table, the negative exposure value and the positive exposure value are matched to obtain multiple exposure indices, and the basic image frame is virtually exposed according to the multiple exposure indices to obtain multiple image sequence frames with different exposure values.

[0102] Specifically, during the HDR shooting process, it is necessary to take a frame with the minimum exposure negative value EVMinus as the base frame (BaseFrame). During the shooting process, it is necessary to use the frame obtained after compensating the EVMinus as the base frame for virtual exposure. The EV0 and EV+ required for HDR synthesis need to amplify the brightness of different brightness areas based on the BaseFrame.

[0103] In the process of constructing virtual exposure frames of different brightness, the Gamma function is used to map the brightness. Different EVs correspond to different power functions. For example, EV0 uses a smaller power: Gamma = 1.41, and EV- uses a larger power: Gamma = 2.5. The specific relationship between EV and Gamma is shown in Table 1 below (Table 1 is obtained from a large amount of fitting data).

[0104] Table 1 Correspondence between EV and index

[0105] EV -16 -8 -4 -2 0 2 4 6 8 16 γ 1 1.1 1.2 1.3 1.4 1.6 1.8 2 2.2 2.4

[0106] According to the above correspondence, if the EV value is in the middle of a given Index, linear interpolation can be used to find the gamma value, and the basic frame can be used as input to calculate the output frame corresponding to the EV List, which together constitute the EV List sequence frame.

[0107] Therefore, the basic image frame is virtually exposed to obtain multiple image sequence frames with different exposure values. The HDR image exposure fusion is performed using the virtually exposed image sequence frames, which can completely solve the ghosting and fault problems encountered in the synthesis of background highlights and foreground motion scenes during the HDR algorithm processing.

[0108] Figure 6 This is a flow chart of a photo processing method in another embodiment. Figure 6 is Figure 2 Based on the embodiment shown, another possible implementation of step 208 is further described as follows: Figure 6 As shown:

[0109] Step 208a, obtaining chrominance images and luminance image frames corresponding to the image sequence frames, performing edge detection on image frames with zero exposure value in the image sequence frames through Laplacian operator, and obtaining edge image frames.

[0110] Step 208b, performing global brightness average fusion processing on the brightness image frame to obtain a first image frame, and performing Laplacian pyramid edge fusion processing on the edge image frame and the first image frame to obtain a second image frame.

[0111] Step 208c: superimpose the chrominance image and the second image frame to form a target image frame and output it.

[0112] Specifically, in the image frame of EV0 (exposure value is zero), the Laplace operator is used for edge detection, the edge Edge image frame is saved, and the EV List sequence frame is globally fused according to the average brightness. At this time, there will be some faults in some areas with excessive brightness, which are recorded as the first image frame Img1; the Edge image frame is combined with the fused Img1 in the previous step as follows Figure 7 The Laplacian pyramid shown in the figure is used for edge fusion of the Laplacian pyramid to weaken the excessive brightness fault; the Edge image and Img1 are constructed into four layers of Gaussian pyramid respectively, and the fusion starts from the fourth layer. The edge information of the image can be found through the Edge image frame. The Edge image is taken as the center and the 5*5 window is used to perform Gaussian filtering on the image in the Img1 pyramid, so that the fused brightness fault can be smoothed. The image after the fourth layer is processed is upsacle (enhanced), recorded as ImgG1, and the third layer of the pyramid is started to be fused. Like the fourth layer, after Gaussian filtering, it is mean filtered with ImgG1, and then upsacle is performed, recorded as ImgG2, and so on, until the first layer of the image is achieved. After Gaussian filtering, the image Img2 is obtained, and finally the Edge image is superimposed on Img2 for edge enhancement; Img2 is superimposed and combined with the UV image into a YUV image for output.

[0113] As an example of a scenario, in the embodiment of the present application, when shooting an HDR scene, the HDR detection algorithm gives a frame of underexposure reference value, and the frame needs to ensure that the bright area is not overexposed. This frame is recorded as the base frame. Based on the base frame, a virtual exposure conversion is performed to generate an input frame with a certain sequence, and then HDR synthesis is performed on the input sequence frame, such as Figure 8 shown.

[0114] As an example scenario, Fig. 9 As shown, step 9.1 HDR algorithm detection; step 9.2 determines whether HDR scene photography is performed; step 9.3 constructs a virtual exposure EV List frame; and step 9.4 HDR synthesis.

[0115] Specifically, first, HDR scene detection will give the basic frame EV of the HDR scene and the reference EV List; then virtual exposure is performed, and virtual exposure of multiple EVs is performed on the basis of the basic frame according to the EV List to generate image sequence frames with different brightness; finally, HDR synthesis is performed to output high dynamic range images. It can also be understood as HDR detecting whether the current scene is an HDR scene and calculating the EVList; constructing virtual exposure, constructing the brightness frame corresponding to each EV according to the calculated EV List; HDR synthesis, because there is only a difference in brightness in the input frame sequence, there is no need to perform frame selection, frame alignment and other operations, only need to fuse according to different brightness, separate the YUV image into a Y image and a UV image, and the following will process the brightness Y image and superimpose it with the UV image to form a YUV image for output.

[0116] Therefore, using virtual exposure for HDR image exposure fusion can completely solve the ghosting and discontinuity problems encountered when synthesizing background highlights and foreground motion scenes during the HDR algorithm processing. Because this solution does not have motion differences between frames, there are no ghosting caused by motion.

[0117] It should be understood that, although each step in the flow chart of the above-described embodiment is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flow chart of the above-described embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0118] In one embodiment, Fig.10 As shown, a photographing processing device is provided, including: a response determination module 1002, an acquisition module 1004, an exposure module 1006 and a processing module 1008, wherein:

[0119] A response determination module 1002 is used to determine whether the current shooting scene is a high dynamic range HDR scene in response to a shooting instruction;

[0120] An acquisition module 1004 is used to acquire a basic image frame when the current shooting scene is an HDR scene;

[0121] An exposure module 1006 is used to perform virtual exposure on the basic image frame to obtain multiple image sequence frames with different exposure values;

[0122] The processing module 1008 is used to perform synthesis processing on the image sequence frames to obtain a target image frame and output it.

[0123] In the first embodiment of the present application, the response determination module 1002 is specifically used to:

[0124] In response to a shooting instruction, acquiring a YUV image of the current shooting scene;

[0125] Performing brightness channel histogram statistics on the YUV image to obtain a brightness histogram;

[0126] Based on the brightness histogram, obtaining brightness quantities corresponding to different brightness levels;

[0127] Calculating a dark rate and a bright rate according to the brightness quantities corresponding to the different brightness levels and the total number of pixels of the YUV image;

[0128] Whether it is the HDR scene is determined according to the dark rate, the bright rate, and a preset underexposure threshold and overexposure threshold.

[0129] In an implementation manner of the first embodiment of the present application, the determining whether it is the HDR scene according to the dark rate, the bright rate, and a preset underexposure threshold and overexposure threshold includes:

[0130] Obtaining a ratio of the dark rate to the bright rate;

[0131] Calculating according to the ratio to obtain an exposure difference value;

[0132] It is determined whether it is the HDR scene by judging whether the exposure difference value is greater than or equal to a preset exposure difference threshold and the brightness ratio is greater than or equal to the overexposure threshold of a preset first multiple, or the brightness ratio is greater than or equal to the overexposure threshold of a preset second multiple, or the darkness ratio is greater than or equal to the underexposure threshold of the first multiple.

[0133] In the first embodiment of the present application, the acquisition module 1004 is specifically used for:

[0134] Get the preset exposure step length;

[0135] Calculate based on the brightness ratio, the exposure step length and the overexposure threshold to obtain a negative exposure value;

[0136] The image frame corresponding to the minimum negative exposure value among the negative exposure values ​​is used as the basic image frame.

[0137] In the first embodiment of the present application, the acquisition module 1004 is further configured to:

[0138] Calculate based on the dark rate, the exposure step length and the underexposure threshold to obtain a positive exposure value;

[0139] The exposure module 1006 is specifically used for:

[0140] Based on a preset exposure value and index correspondence table, the negative exposure value and the positive exposure value are matched to obtain a plurality of exposure indices;

[0141] The basic image frame is virtually exposed according to the multiple exposure indices to obtain the multiple image sequence frames with different exposure values.

[0142] In the first embodiment of the present application, the acquisition module 1004 is further configured to:

[0143] Obtaining absolute values ​​corresponding to the negative exposure value and the positive exposure value;

[0144] When the absolute value is greater than the exposure step, the negative exposure value or the positive exposure value corresponding to the absolute value is scored according to a preset scoring rule.

[0145] In the first embodiment of the present application, the processing module 1008 is specifically used for:

[0146] Acquire a chrominance image and a luminance image frame corresponding to the image sequence frame;

[0147] Perform edge detection on image frames with zero exposure value in the image sequence frames by using Laplace operator, and identify edge image frames;

[0148] Performing global brightness average fusion processing on the brightness image frame to obtain a first image frame;

[0149] Performing Laplacian pyramid edge fusion processing on the edge image frame and the first image frame to obtain the second image frame;

[0150] The chrominance image and the second image frame are superimposed and combined into the target image frame and output.

[0151] The photographing processing device provided in the embodiment of the present application determines whether the current photographing scene is a high dynamic range HDR scene by responding to the photographing instruction; when the current photographing scene is an HDR scene, obtains the basic image frame; performs virtual exposure on the basic image frame to obtain multiple frames of image sequence frames with different exposure values; performs synthesis processing on the image sequence frames to obtain and output the target image frame. The technical problems of ghosting and faults encountered in the synthesis of background highlights and foreground motion scenes in the existing HDR algorithm processing are solved. By using virtual exposure to perform HDR image exposure fusion to avoid motion differences between frames, ghosting caused by motion does not exist, thereby effectively improving the quality of photographing and enhancing the user experience.

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

[0153] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Fig.11 As shown. The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for photographing is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

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

[0155] In one embodiment, the photographing processing device provided by the present application can be implemented in the form of a computer program. The computer program can be Fig.11 The memory of the electronic device may store various program modules constituting the photographing processing device, for example, Fig.10 The response determination module 1002, acquisition module 1004, exposure module 1006 and processing module 1008 are shown. The computer program composed of various program modules enables the processor to execute the steps of the photographing processing method of each embodiment of the present application described in this specification.

[0156] For example, Fig.11 The electronic device shown can be Fig.10 The response determination module 1002 in the photographing processing device shown executes step 202. The electronic device may execute step 204 through the acquisition module 1004. The electronic device may execute step 206 through the exposure module 1006. The electronic device may execute step 208 through the processing module 1008.

[0157] In one embodiment, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: step 202, in response to a shooting instruction, determining whether a current shooting scene is a high dynamic range (HDR) scene; step 204, when the current shooting scene is an HDR scene, acquiring a basic image frame; step 206, virtually exposing the basic image frame to obtain a plurality of image sequence frames with different exposure values; and step 208, synthesizing the image sequence frames to obtain a target image frame and output it.

[0158] In one embodiment, obtaining a YUV image of the current shooting scene;

[0159] Performing brightness channel histogram statistics on the YUV image to obtain a brightness histogram;

[0160] Based on the brightness histogram, obtaining brightness quantities corresponding to different brightness levels;

[0161] Calculating a dark rate and a bright rate according to the brightness quantities corresponding to the different brightness levels and the total number of pixels of the YUV image;

[0162] Whether it is the HDR scene is determined according to the dark rate, the bright rate, and a preset underexposure threshold and overexposure threshold.

[0163] In one embodiment, judging whether it is the HDR scene according to the dark rate, the bright rate, and a preset underexposure threshold and overexposure threshold includes:

[0164] Obtaining a ratio of the dark rate to the bright rate;

[0165] Calculating according to the ratio to obtain an exposure difference value;

[0166] It is determined whether it is the HDR scene by judging whether the exposure difference value is greater than or equal to a preset exposure difference threshold and the brightness ratio is greater than or equal to the overexposure threshold of a preset first multiple, or the brightness ratio is greater than or equal to the overexposure threshold of a preset second multiple, or the darkness ratio is greater than or equal to the underexposure threshold of the first multiple.

[0167] In one embodiment, the obtaining of the basic image frame includes:

[0168] Get the preset exposure step length;

[0169] Calculate based on the brightness ratio, the exposure step length and the overexposure threshold to obtain a negative exposure value;

[0170] The image frame corresponding to the minimum negative exposure value among the negative exposure values ​​is used as the basic image frame.

[0171] In one embodiment, the photo processing method further includes:

[0172] Calculate based on the dark rate, the exposure step length and the underexposure threshold to obtain a positive exposure value;

[0173] The step of performing virtual exposure on the basic image frame to obtain a plurality of image sequence frames with different exposure values ​​includes:

[0174] Based on a preset exposure value and index correspondence table, the negative exposure value and the positive exposure value are matched to obtain a plurality of exposure indices;

[0175] The basic image frame is virtually exposed according to the multiple exposure indices to obtain the multiple image sequence frames with different exposure values.

[0176] In one embodiment, the photo processing method further includes:

[0177] Obtaining absolute values ​​corresponding to the negative exposure value and the positive exposure value;

[0178] When the absolute value is greater than the exposure step, the negative exposure value or the positive exposure value corresponding to the absolute value is scored according to a preset scoring rule.

[0179] In one embodiment, the synthesizing process of the image sequence frames to obtain and output the target image frame includes:

[0180] Acquire a chrominance image and a luminance image frame corresponding to the image sequence frame;

[0181] Perform edge detection on image frames with zero exposure value in the image sequence frames by using Laplace operator, and identify edge image frames;

[0182] Performing global brightness average fusion processing on the brightness image frame to obtain a first image frame;

[0183] Performing Laplacian pyramid edge fusion processing on the edge image frame and the first image frame to obtain the second image frame;

[0184] The chrominance image and the second image frame are superimposed and combined into the target image frame and output.

[0185] By responding to the shooting instruction, it is determined whether the current shooting scene is a high dynamic range HDR scene; when the current shooting scene is an HDR scene, the basic image frame is obtained; the basic image frame is virtually exposed to obtain multiple image sequence frames with different exposure values; the image sequence frames are synthesized to obtain the target image frame and output it. The technical problems of ghosting and faults encountered when synthesizing background highlights and foreground motion scenes in the existing HDR algorithm processing are solved. By using virtual exposure for HDR image exposure fusion to avoid motion differences between frames, there is no ghosting caused by motion, which effectively improves the quality of photography and enhances the user experience.

[0186] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: Step 202, in response to a shooting instruction, determining whether the current shooting scene is a high dynamic range (HDR) scene; Step 204, when the current shooting scene is an HDR scene, acquiring a basic image frame; Step 206, virtually exposing the basic image frame to obtain a plurality of image sequence frames with different exposure values; Step 208, synthesizing the image sequence frames to obtain a target image frame and output it.

[0187] In one embodiment, obtaining a YUV image of the current shooting scene;

[0188] Performing brightness channel histogram statistics on the YUV image to obtain a brightness histogram;

[0189] Based on the brightness histogram, obtaining brightness quantities corresponding to different brightness levels;

[0190] Calculating a dark rate and a bright rate according to the brightness quantities corresponding to the different brightness levels and the total number of pixels of the YUV image;

[0191] Whether it is the HDR scene is determined according to the dark rate, the bright rate, and a preset underexposure threshold and overexposure threshold.

[0192] In one embodiment, judging whether it is the HDR scene according to the dark rate, the bright rate, and a preset underexposure threshold and overexposure threshold includes:

[0193] Obtaining a ratio of the dark rate to the bright rate;

[0194] Calculating according to the ratio to obtain an exposure difference value;

[0195] It is determined whether it is the HDR scene by judging whether the exposure difference value is greater than or equal to a preset exposure difference threshold and the brightness ratio is greater than or equal to the overexposure threshold of a preset first multiple, or the brightness ratio is greater than or equal to the overexposure threshold of a preset second multiple, or the darkness ratio is greater than or equal to the underexposure threshold of the first multiple.

[0196] In one embodiment, obtaining a basic image frame includes:

[0197] Get the preset exposure step length;

[0198] Calculate based on the brightness ratio, the exposure step length and the overexposure threshold to obtain a negative exposure value;

[0199] The image frame corresponding to the minimum negative exposure value among the negative exposure values ​​is used as the basic image frame.

[0200] In one embodiment, the photo processing method further includes:

[0201] Calculate based on the dark rate, the exposure step length and the underexposure threshold to obtain a positive exposure value;

[0202] The step of performing virtual exposure on the basic image frame to obtain a plurality of image sequence frames with different exposure values ​​includes:

[0203] Based on a preset exposure value and index correspondence table, the negative exposure value and the positive exposure value are matched to obtain a plurality of exposure indices;

[0204] The basic image frame is virtually exposed according to the multiple exposure indices to obtain the multiple image sequence frames with different exposure values.

[0205] In one embodiment, the photo processing method further includes:

[0206] Obtaining absolute values ​​corresponding to the negative exposure value and the positive exposure value;

[0207] When the absolute value is greater than the exposure step, the negative exposure value or the positive exposure value corresponding to the absolute value is scored according to a preset scoring rule.

[0208] In one embodiment, the synthesizing process of the image sequence frames to obtain and output the target image frame includes:

[0209] Acquire a chrominance image and a luminance image frame corresponding to the image sequence frame;

[0210] Perform edge detection on image frames with zero exposure value in the image sequence frames by using Laplace operator, and identify edge image frames;

[0211] Performing global brightness average fusion processing on the brightness image frame to obtain a first image frame;

[0212] Performing Laplacian pyramid edge fusion processing on the edge image frame and the first image frame to obtain the second image frame;

[0213] The chrominance image and the second image frame are superimposed and combined into the target image frame and output.

[0214] By responding to the shooting instruction, it is determined whether the current shooting scene is a high dynamic range HDR scene; when the current shooting scene is an HDR scene, the basic image frame is obtained; the basic image frame is virtually exposed to obtain multiple image sequence frames with different exposure values; the image sequence frames are synthesized to obtain the target image frame and output it. The technical problems of ghosting and faults encountered when synthesizing background highlights and foreground motion scenes in the existing HDR algorithm processing are solved. By using virtual exposure for HDR image exposure fusion to avoid motion differences between frames, there is no ghosting caused by motion, which effectively improves the quality of photography and enhances the user experience.

[0215] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM).

[0216] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

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

Claims

1. A photo processing method, characterized in that: include: In response to a shooting instruction, determining whether a current shooting scene is a high dynamic range (HDR) scene; When the current shooting scene is an HDR scene, obtaining a basic image frame; Virtually exposing the basic image frame to obtain multiple image sequence frames with different exposure values; The image sequence frames are synthesized to obtain a target image frame and output it.

2. The photographing processing method according to claim 1, characterized in that: The determining whether the current shooting scene is an HDR scene includes: Obtaining a YUV image of the current shooting scene; Performing brightness channel histogram statistics on the YUV image to obtain a brightness histogram; Based on the brightness histogram, obtaining brightness quantities corresponding to different brightness levels; Calculating a dark rate and a bright rate according to the brightness quantities corresponding to the different brightness levels and the total number of pixels of the YUV image; Whether it is the HDR scene is determined according to the dark rate, the bright rate, and a preset underexposure threshold and overexposure threshold.

3. The photographing processing method according to claim 2, characterized in that: The determining whether it is the HDR scene according to the dark rate, the bright rate, and a preset underexposure threshold and overexposure threshold includes: Obtaining a ratio of the dark rate to the bright rate; Calculating according to the ratio to obtain an exposure difference value; It is determined whether it is the HDR scene by judging whether the exposure difference value is greater than or equal to a preset exposure difference threshold and the brightness ratio is greater than or equal to the overexposure threshold of a preset first multiple, or the brightness ratio is greater than or equal to the overexposure threshold of a preset second multiple, or the darkness ratio is greater than or equal to the underexposure threshold of the first multiple.

4. The photographing processing method according to claim 2, characterized in that: The step of acquiring a basic image frame comprises: Get the preset exposure step length; Calculate based on the brightness ratio, the exposure step length and the overexposure threshold to obtain a negative exposure value; The image frame corresponding to the minimum negative exposure value among the negative exposure values ​​is used as the basic image frame.

5. The photographing processing method according to claim 4, characterized in that: Also includes: Calculate based on the dark rate, the exposure step length and the underexposure threshold to obtain a positive exposure value; The step of performing virtual exposure on the basic image frame to obtain a plurality of image sequence frames with different exposure values ​​includes: Based on a preset exposure value and index correspondence table, the negative exposure value and the positive exposure value are matched to obtain a plurality of exposure indices; The basic image frame is virtually exposed according to the multiple exposure indices to obtain the multiple image sequence frames with different exposure values.

6. The photographing processing method according to claim 5, characterized in that: Also includes: Obtaining absolute values ​​corresponding to the negative exposure value and the positive exposure value; When the absolute value is greater than the exposure step, the negative exposure value or the positive exposure value corresponding to the absolute value is scored according to a preset scoring rule.

7. The photographing processing method according to claim 5, characterized in that: The synthesizing process of the image sequence frames to obtain and output a target image frame includes: Acquire a chrominance image and a luminance image frame corresponding to the image sequence frame; Perform edge detection on image frames with zero exposure value in the image sequence frames by using Laplace operator, and identify edge image frames; Performing global brightness average fusion processing on the brightness image frame to obtain a first image frame; Performing Laplacian pyramid edge fusion processing on the edge image frame and the first image frame to obtain a second image frame; The chrominance image and the second image frame are superimposed and combined into the target image frame and output.

8. A photograph processing device, characterized in that: The device comprises: A response judgment module, used to respond to a shooting instruction and judge whether the current shooting scene is a high dynamic range HDR scene; An acquisition module, used for acquiring a basic image frame when the current shooting scene is an HDR scene; An exposure module, used for performing virtual exposure on the basic image frame to obtain a plurality of image sequence frames with different exposure values; The processing module is used to perform synthesis processing on the image sequence frames to obtain the target image frame and output it.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Image processing method, device and equipment and readable storage medium

    CN119603565A