Image processing method and device, driving device and medium
By calculating the fusion coefficient and color value of multi-frame continuous images, the fusion image is generated, and the image overexposure caused by long exposure is solved, and a high-quality long-ray effect is achieved.
Patent Information
- Application Number
- CN202310474111.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2024-11-01
AI Technical Summary
The image overexposure caused by long exposure time reduces the quality of the long-light rail effect image.
By obtaining the color value of the target pixel point in a multi-frame continuous image, calculating the fusion coefficient and color value, generating a fusion image, and using images with a shorter exposure time to form a continuous light track effect to reduce overexposure.
Improve image quality, retain the continuity of the light rail area, and reduce the image overexposure phenomenon.
Smart Images

Figure CN118887097A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and specifically provides an image processing method, device, driving device and medium. Background Art
[0002] Long light trail effects are common in photography works, such as busy traffic, star trails and other scene effects, all of which require long light trails.
[0003] Typically, the long light trail effect is achieved by capturing a single frame of image using a long exposure. This long exposure time allows the movement of bright areas to be recorded, resulting in an image with a long light trail effect. However, long exposure times can easily lead to overexposure of large areas of the image, reducing image quality. Summary of the Invention
[0004] In order to overcome the above-mentioned defects, the present invention is proposed to provide an image processing method, device, driving device and medium that solve or at least partially solve the technical problem that when obtaining images with long light trail effects, the long exposure time easily leads to large-scale overexposure of the picture, thereby reducing the image quality.
[0005] In a first aspect, the present invention provides an image processing method, comprising:
[0006] Step 100: Obtain a first color value of a target pixel in a current reference image and a second color value of a target pixel in a current image to be fused among N consecutive frames of images; wherein, if the current image to be fused is the second frame, the current reference image is the first frame of the current image to be fused; if the current image to be fused is an image after the second frame, the current reference image is an image obtained by fusing all images before the current image to be fused; N is an integer greater than 1;
[0007] Step 100: Determine a fusion coefficient of the current reference image at the target pixel point based on the first color value and the second color value;
[0008] Step 120: Obtain a fused color value of the target pixel according to the fusion coefficient, the first color value, and the second color value to obtain a current fused image;
[0009] Step 130: Detect whether the current image to be fused is the last frame of N consecutive images;
[0010] Step 140: If the current image to be fused is the last frame of N consecutive frames, generate a target fused image corresponding to the N consecutive frames based on the current fused image;
[0011] Step 150 : If the current image to be fused is not the last frame of the N consecutive frames, use the current fused image as the current reference image for the next fusion process, and return to step 100 .
[0012] In a second aspect, the present invention provides an image processing device, which includes a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and the program codes are suitable for being loaded and run by the processor to execute any of the above-mentioned image processing methods.
[0013] In a third aspect, a driving device is provided, comprising the image processing device as described above.
[0014] In a fourth aspect, a computer-readable storage medium is provided, the storage medium storing a plurality of program codes, wherein the program codes are suitable for being executed by a processor.
[0015] Solution 1. An image processing method, comprising:
[0016] Step 100: Obtain a first color value of a target pixel in a current reference image and a second color value of a target pixel in a current image to be fused among N consecutive frames of images; wherein, if the current image to be fused is the second frame, the current reference image is the first frame of the current image to be fused; if the current image to be fused is an image after the second frame, the current reference image is an image obtained by fusing all images before the current image to be fused; N is an integer greater than 1;
[0017] Step 110: Determine a fusion coefficient of the current reference image at the target pixel point based on the first color value and the second color value;
[0018] Step 120: Obtain a fused color value of the target pixel according to the fusion coefficient, the first color value, and the second color value to obtain a current fused image;
[0019] Step 130: Detect whether the current image to be fused is the last frame of N consecutive images;
[0020] Step 140: If the current image to be fused is the last frame of N consecutive frames, generate a target fused image corresponding to the N consecutive frames based on the current fused image;
[0021] Step 150 : If the current image to be fused is not the last frame of the N consecutive frames, use the current fused image as the current reference image for the next fusion process, and return to step 100 .
[0022] Solution 2. The image processing method according to Solution 1, characterized in that determining a fusion coefficient of the current reference image at the target pixel point based on the first color value and the second color value comprises:
[0023] Obtaining a first grayscale value corresponding to the first color value and a second grayscale value corresponding to the second color value;
[0024] Calculating a first difference between the first grayscale value and the second grayscale value, and determining a sensitivity adjustment coefficient corresponding to the fusion coefficient according to the first grayscale value and the second grayscale value;
[0025] The fusion coefficient is determined according to the first difference and the sensitivity adjustment coefficient.
[0026] Solution 3. The image processing method according to Solution 2, characterized in that determining the sensitivity adjustment coefficient corresponding to the fusion coefficient based on the first color value and the second color value includes:
[0027] Selecting the maximum value between the first grayscale value and the second grayscale value to obtain a target grayscale value;
[0028] Calculating a first product of the target grayscale value and a first preset constant;
[0029] A second difference between a second preset constant and the first product is used as the sensitivity adjustment coefficient; wherein the second preset constant is greater than a maximum range of color values of the current image to be fused.
[0030] Solution 4. The image processing method according to Solution 3, further comprising:
[0031] The first preset constant and the second preset constant are determined according to a preset image bright area display threshold, an image dark area display threshold, and the target color value.
[0032] Solution 5. The image processing method according to Solution 1, characterized in that obtaining the fused color value of the target pixel point based on the fusion coefficient, the first color value, and the second color value to obtain a current fused image includes:
[0033] Converting the fusion coefficient to a value within a preset coefficient range; wherein the lower limit value of the preset coefficient range is 0 and the upper limit value of the preset coefficient range is 1;
[0034] Calculating a second product of a value within the preset coefficient range and the first color value;
[0035] calculating a third difference between the value in the preset coefficient range and 1, and calculating a third product of the third difference and the second color value;
[0036] A sum of the second product and the third product is calculated as a fusion color value of the target pixel.
[0037] Solution 6. The image processing method according to Solution 1 is characterized in that, before obtaining the first color value of the target pixel in the current reference image and the second color value of the target pixel in the current image to be fused among N consecutive frames of images, the method further comprises:
[0038] If the N consecutive frames of images meet the preprocessing condition, preprocess the N consecutive frames of images to obtain N frames of processed images, select the current image to be fused from the N frames of processed images, and obtain the current reference image based on all processed images before the current image to be fused;
[0039] If the N consecutive image frames do not meet the preprocessing condition, the current image to be fused is selected from the N consecutive image frames, and the current reference image is obtained based on all images before the current image to be fused.
[0040] Solution 7. The image processing method according to Solution 6, wherein the preprocessing conditions include:
[0041] The N frames of continuous images are images processed by a gamma curve and have a bit width of a set value.
[0042] Solution 8. The image processing method according to any one of Solutions 1 to 7, characterized in that generating a target fused image corresponding to N consecutive frames of images based on the current fused image comprises:
[0043] Performing noise reduction on the current fused image to obtain a current noise-reduced fused image;
[0044] Based on the current fused image after noise reduction, a target fused image corresponding to N frames of continuous images is generated.
[0045] Solution 9. The image processing method according to Solution 8, characterized in that generating a target fused image corresponding to N consecutive frames of images based on the current denoised fused image comprises:
[0046] If the N consecutive frames of images are pre-processed images, performing inverse processing on the current denoised fused image to obtain the target fused image;
[0047] If the N consecutive frames of images are images that have not been preprocessed, the current fused image after noise reduction is used as the target fused image.
[0048] Solution 10. The image processing method according to any one of Solutions 1 to 7, characterized in that before obtaining the first color value of the target pixel in the current reference image and the second color value of the target pixel in the current image to be fused among N consecutive frames of images, the method further comprises:
[0049] Align the current reference image with the current image to be fused.
[0050] Solution 11. An image processing device, characterized in that it includes a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and the program codes are suitable for being loaded and run by the processor to execute the image processing method described in any one of Solutions 1 to 10.
[0051] Solution 12. A driving device, characterized in that it includes the image processing device as described in Solution 11.
[0052] Solution 13. A computer-readable storage medium, characterized in that it stores multiple program codes, and the program codes are suitable for being loaded and run by a processor to execute the image processing method according to any one of Solutions 1 to 10.
[0053] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:
[0054] In the technical solution of the present invention, the first color value of the target pixel point in the current reference image and the second color value of the target pixel point in the current image to be fused in N frames of continuous images are obtained; the fusion coefficient of the current reference image at the target pixel point is determined according to the first color value and the second color value; the fusion color value of the target pixel point is obtained according to the fusion coefficient, the first color value and the second color value to obtain the current fused image and when the current image to be fused is the last frame image in N frames of continuous images, based on the current fused image, the target fused image corresponding to the N frames of continuous images is generated, so that the final result retains the light track area of all images to form a continuous light track. In this way, a long light track effect can be obtained by using multiple images with shorter exposure times, thereby reducing the overexposure phenomenon of the picture and improving the image quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The disclosure of the present invention will be more easily understood with reference to the accompanying drawings. Those skilled in the art will readily appreciate that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. Furthermore, similar numbers in the drawings represent similar components, wherein:
[0056] Figure 1 is a flowchart of main steps of an image processing method according to one embodiment of the present invention;
[0057] Figure 2 It is a flow chart of the main steps in determining the fusion coefficient of the current reference image at the target pixel point;
[0058] Figure 3 It is a flow chart of the main steps of determining the sensitivity adjustment coefficient corresponding to the fusion coefficient;
[0059] Figure 4 It is a flow chart of the main steps of fusing the color value of the target pixel;
[0060] Figure 5 FIG. 4 is a main structural block diagram of an image processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0061] Some embodiments of the present invention are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0062] In the description of the present invention, "module" and "processor" may include hardware, software, or a combination of both. A module may include hardware circuitry, various suitable sensors, communication ports, and memory. It may also include software components, such as program code, or a combination of software and hardware. A processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. A processor has data and / or signal processing capabilities. A processor may be implemented in software, hardware, or a combination of both. Non-transitory computer-readable storage media include any suitable medium capable of storing program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, and the like. The term "A and / or B" refers to all possible combinations of A and B, such as only A, only B, or both A and B. The terms "at least one of A or B" or "at least one of A and B" have similar meanings to "A and / or B" and may include only A, only B, or both A and B. The singular forms "one" and "the" may also include the plural forms.
[0063] The long light trail effect is a unique photographic effect achieved by photographing moving, luminous objects. This effect is typically achieved by capturing a single frame with a long exposure. This long exposure time captures the movement of bright areas, creating an image with long light trails. However, long exposure times can easily lead to overexposure of large areas of the image, reducing image quality.
[0064] Therefore, in order to solve the above technical problems, the present invention provides the following technical solutions:
[0065] See attached Figure 1 , Figure 1FIG. 1 is a flow chart showing the main steps of an image processing method according to an embodiment of the present invention. Figure 1 As shown, the image processing method in the embodiment of the present invention mainly includes the following steps 100 to 150.
[0066] Step 100: Obtain a first color value of a target pixel in a current reference image and a second color value of a target pixel in a current image to be fused among N consecutive frames of images;
[0067] In a specific implementation, a certain area of the current scene can be continuously photographed using an image capture device such as a mobile phone or a camera to obtain N consecutive image frames. If the N consecutive image frames meet a preprocessing condition, the N consecutive image frames are preprocessed to obtain N processed image frames. The current image to be fused is selected from the N processed image frames, and the current reference image is obtained based on all processed images before the current image to be fused. If the N consecutive image frames do not meet the preprocessing condition, the current image to be fused is selected from the N consecutive image frames, and the current reference image is obtained based on all images before the current image to be fused. The preprocessing condition includes that the N consecutive image frames are images processed by a gamma curve and have a bit width of a set value. N is an integer greater than 1. If the current image to be fused is the second frame, the current reference image is the first frame of the current image to be fused. If the current image to be fused is an image after the second frame, the current reference image is the image obtained by fusing all images before the current image to be fused.
[0068] In a specific implementation process, when N frames of continuous images are images that have been processed by a gamma curve and have a bit width of a set value (8 bits), the image can be globally multiplied by a coefficient (such as 4) to widen the bit width to a larger value (10 bits), and then processed by an inverse gamma curve. The purpose of the inverse gamma curve processing is to improve the overall contrast of the image, making the difference between the bright area and the dark area of the image more obvious, and the purpose of widening the bit width is to prevent the inverse gamma from flattening the dark area of the image and causing loss of details. The inverse gamma curve processing and the gamma curve may or may not correspond to each other, and this embodiment does not impose specific restrictions.
[0069] In a specific implementation, all pixels in the current reference image or the pixels in the light track area can be used as target pixels, and the first color value of the target pixel is obtained from the current reference image, and the second color value of the target pixel is obtained from the current image to be fused. For a grayscale image, the color value here can be a grayscale value, and for a color image, the color value here can be the value of each channel, such as an RGB value.
[0070] It should be noted that before obtaining the first color value of the target pixel in the current reference image and the second color value of the target pixel in the current image to be fused in N frames of continuous images, the current reference image and the current image to be fused may be aligned before performing step 100, wherein the image alignment method includes an optical flow method, a scale-invariant feature transform (SIFT) method, a mesh flow method, and the like.
[0071] Step 110: Determine a fusion coefficient of the current reference image at the target pixel point based on the first color value and the second color value;
[0072] In a specific implementation process, Figure 2 The step of determining the fusion coefficient of the current reference image at the target pixel point, Figure 2 It is a flow chart of the main steps for determining the fusion coefficient of the current reference image at the target pixel point.
[0073] Step 200: Obtain a first grayscale value corresponding to the first color value and a second grayscale value corresponding to the second color value;
[0074] In a specific implementation, for a grayscale image, the first color value can be used as the first grayscale value, and the second color value can be used as the second grayscale value. For a color image, the first color value and the second color value can be mapped to obtain the corresponding first grayscale value and second grayscale value.
[0075] Step 210: Calculate a first difference between the first grayscale value and the second grayscale value;
[0076] Step 220: Determine a sensitivity adjustment coefficient corresponding to the fusion coefficient according to the first grayscale value and the second grayscale value.
[0077] In a specific implementation process, Figure 3 The sensitivity adjustment coefficient corresponding to the fusion coefficient is determined by the step of Figure 3 It is a flow chart of the main steps for determining the sensitivity adjustment coefficient corresponding to the fusion coefficient.
[0078] Step 300: Select the maximum value between the first grayscale value and the second grayscale value to obtain a target grayscale value;
[0079] Step 310: Calculate a first product of the target grayscale value and a first preset constant;
[0080] Step 320: Use a second difference between a second preset constant and the first product as the sensitivity adjustment coefficient.
[0081] In a specific implementation process, the second preset constant is greater than the color value of the maximum range of the current image to be fused. The above steps 300-step 320 can be implemented by the calculation formula (1):
[0082] b
[0084] , (x,y) , (x,y) ,
[0085] , (x,y) ,
[0086] , , , (x,y) , , (x,y) , (x,y) = v base - k base × max(p1 (x,y) , p2[[ID=1=516-2×t, that is, v base =516,k base =2.
[0087] It should be noted that when h2<t (x,y) You can gradually transition from 16 to 116.
[0088] Step 230: Determine the fusion coefficient according to the first difference and the sensitivity adjustment coefficient.
[0089] In a specific implementation process, steps 210 to 230 can be implemented according to the following calculation formula (2):
[0090]
[0091] Among them, a (x,y) Indicates the grayscale difference of the target pixel, r1 (x,y) represents the fusion coefficient.
[0092] From the above calculation formulas (1) and (2), it can be seen that when p1 (x,y) Much larger than p2 (x,y) , r1 (x,y) 1, indicating that p1 (x,y) As the result of target pixel fusion; when p2 (x,y) Much larger than p1 (x,y) , r1 (x,y) -1 means p2 (x,y) As the result of target pixel fusion; when p1 (x,y) Approximate p2 (x,y) When r1 (x,y) Approximately 0, indicating that p1 (x,y) and p2 (x,y) The mean of the target pixels is taken as the result of fusion.
[0093] Step 120: Obtain a fused color value of the target pixel according to the fusion coefficient, the first color value, and the second color value to obtain a current fused image;
[0094] In a specific implementation process, Figure 4 The fusion color value of the target pixel is determined by the steps of Figure 4 It is a flow chart of the main steps of fusing the color value of the target pixel.
[0095] Step 400: transform the fusion coefficient to a value within a preset coefficient range;
[0096] In a specific implementation process, the fusion coefficient can be transformed to a value within a preset coefficient range; wherein the lower limit value of the preset coefficient range is 0 and the upper limit value of the preset coefficient range is 1. The specific transformation process can be referred to calculation formula (3):
[0097] r1′ (x,y) =(r1 (x,y) +1) / 2 (3)
[0098] Among them, r1′ (x,y) A numeric value representing the preset coefficient range.
[0099] Step 410: Calculate a second product of the value within the preset coefficient range and the first color value;
[0100] Step 420: Calculate a third difference between the value in the preset coefficient range and 1, and calculate a third product of the third difference and the second color value;
[0101] Step 430: Calculate the sum of the second product and the third product as the fused color value of the target pixel.
[0102] In a specific implementation process, steps 410 to 430 can be implemented according to the following calculation formula (4):
[0103] p (x,y) =p1′ (x,y) ×r1′ (x,y) +p2′ (x,y) ×(1-r1′ (x,y) ) (4)
[0104] Among them, p (x,y) Indicates the fused color value of the target pixel, p1′ (x,y) Indicates the first color value of the target pixel, p2′ (x,y) Indicates the second color value of the target pixel.
[0105] Step 130: Detect whether the current image to be fused is the last frame of N consecutive frames; if so, execute step 140; if not, execute step 150;
[0106] Step 140: Generate a target fused image corresponding to N consecutive frames of images based on the current fused image;
[0107] In a specific implementation process, if the current image to be fused is the last frame of N consecutive frames of images, a target fused image corresponding to the N consecutive frames of images may be generated based on the current fused image.
[0108] Specifically, to eliminate small, isolated noise points on the image, the current fused image can be denoised to obtain a current denoised fused image; and based on the current denoised fused image, a target fused image corresponding to N consecutive frames of images is generated. The denoising process for the current fused image can first be performed through a morphological erosion operation, then a morphological dilation operation, and finally a Gaussian filter. This can convert smaller fusion coefficients in the current fused image from +1 or -1 regions to values closer to 0, making the result closer to the mean fusion result, thereby eliminating smaller light track regions in the current fused image and making the light tracks cleaner and less cluttered. In a specific implementation, when generating a target fused image corresponding to N consecutive frames of images based on the current denoised fused image, if the N consecutive frames of images are preprocessed images, the current denoised fused image can be inversely processed to obtain the target fused image; if the N consecutive frames of images are not preprocessed images, the current denoised fused image is used as the target fused image.
[0109] Step 150: Use the current fused image as the current reference image for the next fusion process.
[0110] In a specific implementation process, if the current image to be fused is not the last frame of N consecutive images, the current fused image can be used as the current reference image for the next fusion process, and the process returns to step 100 .
[0111] The image processing method of this embodiment obtains the first color value of the target pixel point in the current reference image and the second color value of the target pixel point in the current image to be fused in N frames of continuous images; determines the fusion coefficient of the current reference image at the target pixel point according to the first color value and the second color value; obtains the fusion color value of the target pixel point according to the fusion coefficient, the first color value and the second color value to obtain the current fused image and when the current image to be fused is the last frame image in N frames of continuous images, generates the target fused image corresponding to the N frames of continuous images based on the current fused image, so that the final result retains the light track area of all images to form a continuous light track. In this way, a long light track effect can be obtained by using multiple images with shorter exposure times, reducing the overexposure phenomenon of the picture, and thus improving the image quality.
[0112] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.
[0113] Those skilled in the art will appreciate that all or part of the processes in the method for implementing the above-mentioned embodiment of the present invention may also be accomplished by instructing the relevant hardware through a computer program. The computer program may be stored in a computer-readable storage medium. When the computer program is executed by a processor, it may implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal, and software distribution medium capable of carrying the computer program code. It should be noted that the content contained in the computer-readable storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0114] Furthermore, the present invention also provides an image processing device.
[0115] See attached Figure 5 , Figure 5 FIG. 1 is a block diagram of the main structure of an image processing device according to an embodiment of the present invention. Figure 5 As shown, the image processing device in the embodiment of the present invention may include a processor 51 and a storage device 52.
[0116] The storage device 52 may be configured to store a program for executing the image processing method of the above-described method embodiment, and the processor 51 may be configured to execute the program in the storage device 52, including but not limited to a program for executing the image processing method of the above-described method embodiment. For ease of illustration, only the portion relevant to the embodiment of the present invention is shown. For specific technical details not disclosed, please refer to the method section of the embodiment of the present invention. The image processing device may be a control device formed by various electronic devices.
[0117] In a specific implementation process, the number of the storage device 52 and the processor 51 can be multiple. The program for executing the image processing method of the above-mentioned method embodiment can be divided into multiple subroutines, and each subroutine can be loaded and run by the processor 51 to execute different steps of the image processing method of the above-mentioned method embodiment. Specifically, each subroutine can be stored in a different storage device 52, and each processor 51 can be configured to execute the program in one or more storage devices 52 to jointly implement the image processing method of the above-mentioned method embodiment, that is, each processor 51 executes different steps of the image processing method of the above-mentioned method embodiment to jointly implement the image processing method of the above-mentioned method embodiment.
[0118] The multiple processors 51 may be processors deployed on the same device. For example, the device may be a high-performance device composed of multiple processors, and the multiple processors 51 may be processors configured on the high-performance device. Furthermore, the multiple processors 51 may be processors deployed on different devices. For example, the device may be a server cluster, and the multiple processors 51 may be processors on different servers in the server cluster.
[0119] Furthermore, the present invention also provides a driving device, which includes the image processing device of the above embodiment.
[0120] Furthermore, the present invention also provides a computer-readable storage medium. In one embodiment of a computer-readable storage medium according to the present invention, the computer-readable storage medium can be configured to store a program for executing the control method of the smart home device of the above-mentioned method embodiment. The program can be loaded and executed by the processor to implement the above-mentioned image processing method. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present invention is a non-transitory computer-readable storage medium.
[0121] Furthermore, it should be understood that since the configuration of each module is merely for the purpose of illustrating the functional units of the apparatus of the present invention, the physical devices corresponding to these modules may be the processor itself, or a portion of the software in the processor, a portion of the hardware, or a combination of software and hardware. Therefore, the number of modules in the figure is merely illustrative.
[0122] Those skilled in the art will appreciate that the various modules in the device can be adaptively split or merged. Such splitting or merging of specific modules does not cause the technical solution to deviate from the principles of the present invention. Therefore, the technical solutions after splitting or merging will fall within the scope of protection of the present invention.
[0123] It should be noted that we process these image data strictly in accordance with the principle of "minimum use and in-vehicle processing", and these image data will only be uploaded to the required cloud in limited scenarios permitted by laws and regulations.
[0124] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.
Claims
1. An image processing method, characterized in that: include: Step 100, obtaining a first color value of a target pixel in a current reference image and a second color value of a target pixel in a current image to be fused among N consecutive frames of images; wherein, if the current image to be fused is the second frame of image, the current reference image is the first frame of image to be fused; if the current image to be fused is an image after the second frame of image, the current reference image is an image obtained by fusing all images before the current image to be fused; N is an integer greater than 1; Step 110: determining a fusion coefficient of the current reference image at the target pixel point according to the first color value and the second color value; Step 120: Obtain a fused color value of the target pixel according to the fusion coefficient, the first color value, and the second color value to obtain a current fused image; Step 130, detecting whether the current image to be fused is the last frame image among N frames of continuous images; Step 140: if the current image to be fused is the last frame of N consecutive images, generate a target fused image corresponding to the N consecutive images based on the current fused image; Step 150 : If the current image to be fused is not the last frame of the N consecutive images, use the current fused image as the current reference image for the next fusion process, and return to step 100 .
2. The image processing method according to claim 1, characterized in that: Determining a fusion coefficient of the current reference image at the target pixel point according to the first color value and the second color value includes: Obtaining a first grayscale value corresponding to the first color value and a second grayscale value corresponding to the second color value; Calculating a first difference between the first grayscale value and the second grayscale value, and determining a sensitivity adjustment coefficient corresponding to the fusion coefficient according to the first grayscale value and the second grayscale value; The fusion coefficient is determined according to the first difference and the sensitivity adjustment coefficient.
3. The image processing method according to claim 2, characterized in that: Determining a sensitivity adjustment coefficient corresponding to the fusion coefficient according to the first color value and the second color value includes: Selecting the maximum value between the first grayscale value and the second grayscale value to obtain a target grayscale value; Calculating a first product of the target grayscale value and a first preset constant; A second difference between a second preset constant and the first product is used as the sensitivity adjustment coefficient; wherein the second preset constant is greater than a maximum range of color values of the current image to be fused.
4. The image processing method according to claim 3, characterized in that: Also includes: The first preset constant and the second preset constant are determined according to a preset image bright area display threshold, an image dark area display threshold and the target color value.
5. The image processing method according to claim 1, characterized in that: Obtaining a fused color value of the target pixel according to the fusion coefficient, the first color value, and the second color value to obtain a current fused image, including: Transforming the fusion coefficient to a value within a preset coefficient range; wherein the lower limit value of the preset coefficient range is 0 and the upper limit value of the preset coefficient range is 1; Calculating a second product of a value within the preset coefficient range and the first color value; Calculating a third difference between the value of the preset coefficient range and 1, and calculating a third product of the third difference and the second color value; A sum of the second product and the third product is calculated as a fused color value of the target pixel.
6. The image processing method according to claim 1, characterized in that: Before obtaining the first color value of the target pixel in the current reference image and the second color value of the target pixel in the current image to be fused among N consecutive frames of images, the method further includes: If the N frames of continuous images meet the preprocessing condition, preprocess the N frames of continuous images to obtain N frames of processed images, select the current image to be fused from the N frames of processed images, and obtain the current reference image based on all processed images before the current image to be fused; If the N consecutive image frames do not meet the preprocessing condition, the current image to be fused is selected from the N consecutive image frames, and the current reference image is obtained based on all images before the current image to be fused.
7. The image processing method according to claim 6, characterized in that: The pretreatment conditions include: The N frames of continuous images are images that have been processed by a gamma curve and have a bit width that is a set value.
8. The image processing method according to any one of claims 1 to 7, characterized in that: Generating a target fused image corresponding to N consecutive frames of images based on the current fused image includes: De-noising the current fused image to obtain a current de-noised fused image; Based on the current denoised fused image, a target fused image corresponding to N frames of continuous images is generated.
9. The image processing method according to claim 8, characterized in that: Generating a target fused image corresponding to N frames of continuous images based on the current denoised fused image includes: If the N consecutive frames of images are preprocessed images, reverse processing is performed on the current denoised fused image to obtain the target fused image; If the N consecutive image frames are images that have not been preprocessed, the current fused image after noise reduction is used as the target fused image.
10. The image processing method according to any one of claims 1 to 7, characterized in that: Before obtaining the first color value of the target pixel in the current reference image and the second color value of the target pixel in the current image to be fused among N consecutive frames of images, the method further includes: The current reference image is aligned with the current image to be fused.
