WO2024051697A1 - Image fusion method and apparatus, electronic device, and storage medium - Google Patents

Image fusion method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2024051697A1
WO2024051697A1 PCT/CN2023/117064 CN2023117064W WO2024051697A1 WO 2024051697 A1 WO2024051697 A1 WO 2024051697A1 CN 2023117064 W CN2023117064 W CN 2023117064W WO 2024051697 A1 WO2024051697 A1 WO 2024051697A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
image
pixel group
pixels
target image
Prior art date
Application number
PCT/CN2023/117064
Other languages
French (fr)
Chinese (zh)
Inventor
赵志杰
王宇飞
Original Assignee
维沃移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2024051697A1 publication Critical patent/WO2024051697A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • G06T5/73
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • This application belongs to the field of photography technology, and specifically relates to an image fusion method, device, electronic equipment and storage medium.
  • the brightness of a photo is positively related to the amount of light entering the sensor.
  • the bright area will be overexposed due to the exposure time being too long, and the exposure time is too short will cause the dark area to be underexposed, resulting in a It is often difficult to ensure image quality in images captured using sexual exposure imaging.
  • the purpose of the embodiments of the present application is to provide an image fusion method, device, electronic device and storage medium to avoid the blurring problem in the fused image caused by the fusion of some pixels with other pixels that do not match the optical parameters, and to improve the The clarity of the final composite image.
  • embodiments of the present application provide an image fusion method, including: collecting N frames of first images, each frame of the first image including M pixels, N and M are both positive integers; dividing the first target image into is P first pixel groups, the first target image is any image in the N frames of first images, and P is a positive integer; obtain the optical parameters of the target pixel group in the P first pixel groups, and the target pixel group is P Any pixel group in the first pixel group; according to the optical parameters of the target pixel group, determine at least one frame of the second target image among the N frames of the first image, and the second target image includes the optical parameters that match the target pixel group.
  • the second pixel group, the second target image is an image in the first image of N frames, the target pixel group includes Q pixels, Q ⁇ M; the target pixel group and the second pixel group are fused, and the target pixel group is in the first
  • the position in the target image corresponds to the position of the second group of pixels in the second target image.
  • an image fusion device including: a collection module, used to collect N frames of first images, each frame of the first image includes M pixels, N and M are both positive integers; grouping Module, used to divide the first target image into P first pixel groups, the first target image is any image in N frames of first images, P is a positive integer; acquisition module, used to obtain P first pixels Optical parameters of the target pixel group in the group, the target pixel group is Any pixel group among the P first pixel groups; a determination module, configured to determine at least one second target image among the N frames of first images according to the optical parameters of the target pixel group, and the second target image includes the same target pixels.
  • the second pixel group whose optical parameters match the second group, the second target image is the image in the N-frame first image, and the target pixel group includes Q pixels; the fusion module is used to fuse the target pixel group with the second pixel group. Processing, the position of the target pixel group in the first target image corresponds to the position of the second pixel group in the second target image.
  • embodiments of the present application provide an electronic device, including a processor and a memory.
  • the memory stores programs or instructions that can be run on the processor.
  • the program or instructions are executed by the processor, the method of the first aspect is implemented. step.
  • embodiments of the present application provide a readable storage medium that stores a program or instructions, and when the program or instructions are executed by a processor, the steps of the method in the first aspect are implemented.
  • inventions of the present application provide a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run programs or instructions to implement the steps of the method in the first aspect. .
  • embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method of the first aspect.
  • the electronic device when the electronic device captures a subject in motion, multiple frames including the first image of the subject are collected, and the first target image in the N frames of first images is divided into a plurality of first pixels. group, and obtain a target pixel group in a plurality of first pixel groups.
  • a second pixel group in the second target image that can be fused with the target pixel group can be found. Since the The second pixel group is a pixel group found based on the optical parameters of the target pixel group, so it can be ensured that the optical parameters between the second pixel group for fusion and the target pixel group match.
  • the pixel group is used as the unit of image fusion, so that each target pixel group is fused with the matching second pixel group, which can avoid the existence of pixels in the fused image due to mismatch between some pixels and the optical parameters.
  • the blur caused by other pixel fusion improves the clarity of the final composite image.
  • the pixel group is used as the unit of image fusion, and only the optical parameters of the entire pixel group are calculated, without the need to fuse each pixel in the pixel group separately. Since the correlation between pixels in the target pixel group is strong, using the pixel group as the unit of image fusion can reduce the calculation amount of electronic equipment while ensuring the accuracy of image fusion processing. This method ensures the clarity of the fused image while also reducing the amount of data processing required for image fusion.
  • Figure 1 shows a schematic flow chart of the image fusion method provided by the embodiment of the present application
  • Figure 2 shows the luminous flux value change curve provided by the embodiment of the present application
  • Figure 3 shows one of the schematic diagrams of the pixel arrangement of the target pixel group provided by the embodiment of the present application
  • Figure 4 shows the second schematic diagram of the pixel arrangement of the target pixel group provided by the embodiment of the present application
  • Figure 5 shows the third schematic diagram of the pixel arrangement of the target pixel group provided by the embodiment of the present application.
  • Figure 6 shows one of the schematic diagrams of the first pixel group in the first target image provided by the embodiment of the present application
  • Figure 7 shows the second schematic diagram of the first pixel group in the first target image provided by the embodiment of the present application.
  • Figure 8 shows a schematic block diagram of an image fusion device provided by an embodiment of the present application.
  • Figure 9 shows a structural block diagram of an electronic device according to an embodiment of the present application.
  • FIG. 10 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
  • first, second, etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first,” “second,” etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple.
  • “and/or” in the description and claims indicates at least one of the connected objects, and the character “/" generally indicates that the related objects are in an "or” relationship.
  • an image fusion method is provided.
  • Figure 1 shows a schematic flowchart of an image fusion method provided by an embodiment of the present application. As shown in Figure 1, image fusion methods include:
  • Step 102 collect N frames of first images, each frame of the first image includes M pixels, and N and M are both positive integers;
  • the electronic device can collect N frames of the first image. Since the pixels in the N frames of the first image are all collected by the same sensor, the pixels in each first image The number is the same and both include M pixels.
  • Step 104 Divide the first target image into P first pixel groups, where the first target image is any image in N frames of first images, and P is a positive integer;
  • the first target image is an image used for image fusion processing among the N frames of first images.
  • the first target image can select any image among the N frames of first images.
  • the first target image is used as The initial image is fused with other images.
  • All pixels of the first image in each frame are divided into P first pixel groups.
  • the number of pixels in each first pixel group needs to be smaller than the number of pixels in the first target image, and the first pixel group includes at least one pixel.
  • the number of pixels in each of the P first pixel groups may be the same or different.
  • the pixel arrangement forms in the plurality of first pixel groups may be the same or different.
  • the arrangement form of the first pixel group may be 2 ⁇ 6, 3 ⁇ 4, or 1 ⁇ 12.
  • Step 106 Obtain the optical parameters of the target pixel group among the P first pixel groups, and the target pixel group is any pixel group among the P first pixel groups;
  • the target pixel group is any pixel group among the P first pixel groups.
  • each pixel group among the P first pixel groups can be used as the target pixel group.
  • Some pixel groups among the P first pixel groups may be used as target pixel groups.
  • Step 108 Determine at least one second target image among the N frames of first images based on the optical parameters of the target pixel group.
  • the second target image includes a second pixel group that matches the optical parameters of the target pixel group.
  • the target image is the image in the first image of N frames, and the target pixel group includes Q pixels, Q ⁇ M;
  • the second target image is filtered from the N frames of the first image according to the optical parameters of the target pixel group. It should be noted that the second target image and the first target image are different images, and the number of the second target image is at most N-1 frames, that is, the second target image can be N frames of the first image except the first target image. All images except .
  • the second group of pixels in the second target image matches optical parameters of the target group of pixels.
  • the parameter difference between the optical parameters of the second pixel group and the optical parameters of the target pixel group is less than the preset difference, it is determined that the optical parameters of the second pixel group match the target pixel group.
  • the position of the second pixel group in the second target image corresponds to the position of the target pixel group in the first target image.
  • the pixel matrices corresponding to the first target image and the second target image are the same, and the position of the target pixel group in the pixel matrix is the same as the position of the first pixel group in the pixel matrix.
  • Step 110 Fusion processing is performed on the target pixel group and the second pixel group.
  • the position of the target pixel group in the first target image corresponds to the position of the second pixel group in the second target image.
  • the electronic device collects multiple frames of first images, divides the first target image in the multiple frames of first images into P first pixel groups, and searches for multiple first pixel groups based on the target pixel groups in the P first pixel groups. Frame the second target image within the first image. The target pixel group is fused according to the second pixel group in the corresponding second target image. After all target pixel groups in the P first pixel groups are fused, a fused image is obtained. The image obtained through the fusion of the above process can avoid the problem of motion blur caused by the movement of the subject during the shooting process.
  • the process of searching for the second target image in the multi-frame first image based on the target pixel group it is necessary to first determine the third pixel in the multi-frame first image except the first target image based on the target pixel group.
  • Group. Obtain the optical parameters of the target pixel group and the optical parameters of the plurality of third pixel groups, and determine the image corresponding to the second pixel group of the plurality of third pixel groups that matches the optical parameters of the target pixel group as the second target image. .
  • determining whether the optical parameters of the third pixel group match the optical parameters of the target pixel group includes: calculating the difference between the optical parameters of the third pixel group and the target pixel group, and calculating the difference between the optical parameters that are smaller than the preset difference.
  • the three-pixel group is determined as the second pixel group that matches the target pixel group.
  • Optical parameters include any of the following: luminous flux value, number of photoelectrons.
  • the optical parameter only includes one of the luminous flux value or the number of photoelectrons.
  • the third pixel group is determined to be the second pixel group matching the target pixel group.
  • the optical parameters include luminous flux values and photoelectron numbers.
  • the third pixel group is determined to be the second pixel group matching the target pixel group. It can also be detected that the difference between the luminous flux values of the third pixel group and the target pixel group is less than the preset difference, or the difference between the photoelectron numbers of the third pixel group and the target pixel group is less than the preset difference. If there is a difference, the third pixel group is determined to be the second pixel group that matches the target pixel group.
  • the luminous flux value can be obtained through calculation.
  • the number of photoelectrons is the number of pixels in the lit state in the pixel group, which can be collected and counted by the sensor.
  • Figure 2 shows the change curve of the luminous flux value provided by the embodiment of the present application.
  • the electronic device collected 1000 frames of the third image, and the luminous flux value of the target pixel group had two obvious changes in the 1000 frames of the third image.
  • the change amount of the first change is 0.6
  • the change amount of the second change is 1.
  • the time corresponding to the second change is determined as the sudden change time of the luminous flux value, that is, the first time.
  • the electronic device when the electronic device captures a subject in motion, multiple frames including the first image of the subject are collected, and the first target image in the N frames of first images is divided into a plurality of first pixels. group, and obtain a target pixel group in a plurality of first pixel groups.
  • a second pixel group in the second target image that can be fused with the target pixel group can be found. Since the The second pixel group is a pixel group found based on the optical parameters of the target pixel group, so it can be ensured that the optical parameters between the second pixel group for fusion and the target pixel group match.
  • the pixel group is used as the unit of image fusion, so that each target pixel group is fused with the matching second pixel group, which can avoid the existence of pixels in the fused image due to mismatch between some pixels and the optical parameters.
  • the blur caused by other pixel fusion improves the clarity of the final composite image.
  • the pixel group is used as the unit of image fusion, and only the optical parameters of the entire pixel group are calculated, without the need to fuse each pixel in the pixel group separately. Since the correlation between pixels in the target pixel group is strong, using the pixel group as the unit of image fusion can reduce the calculation amount of electronic equipment while ensuring the accuracy of image fusion processing. This method ensures the clarity of the fused image while also reducing the amount of data processing required for image fusion.
  • obtaining the optical parameters of the target pixel group in the P first pixel groups includes: determining X target pixels in the target pixel group, X is a positive integer, X ⁇ Q; The optical parameters of the pixel determine the optical parameters of the target pixel group.
  • the X target pixels are part of the pixels in the target pixel group.
  • the value range of the number of target pixels is greater than 1 and less than or equal to Q.
  • the selection rules for the X target pixels can be set in advance before the electronic device leaves the factory.
  • the optical parameters of the target pixel are directly used as the optical parameters of the target pixel group.
  • the number of target pixels is 1 and the light flux value of the target pixel is 1.2
  • the light flux value of the target pixel group where the target pixel is located is determined to be 1.2.
  • the optical parameters of the multiple target pixels are calculated to determine the optical parameters of the target pixel group where the multiple target pixels are located. For example, when the number of target pixels is 2, the light flux value of one target pixel is 0.4, and the light flux value of the other target pixel is 0.6, the target is determined by calculating the average of the light flux values of the two target pixels.
  • the luminous flux value of the pixel group is 0.5. You may also choose to perform other weighted calculation methods on the optical parameters of multiple target pixels to determine the optical parameters of the target pixel group.
  • the optical parameter is the number of photoelectrons
  • Figure 3 shows one of the schematic diagrams of the pixel arrangement of the target pixel group provided by the embodiment of the present application.
  • the target pixel group 300 is a 2 ⁇ 2 pixel group. Select the upper left corner of the 2 ⁇ 2 pixel group. If a single target pixel 302 is used as the basis for calculating the light flux value of the target pixel group 300, there is no need to calculate the light flux values of other pixels, thereby reducing the calculation amount by three-quarters.
  • Figure 4 shows the second schematic diagram of the pixel arrangement of the target pixel group provided by the embodiment of the present application.
  • the target pixel group 400 is a 2 ⁇ 2 pixel group. Select the diagonal line in the 2 ⁇ 2 pixel group.
  • the two target pixels 402 on are used as the basis for calculating the luminous flux value of the target pixel group 400.
  • the average value of the light flux values of the two target pixels 402 is calculated, and the average value is used as the light flux value of the target pixel group 400, thereby reducing the amount of calculation.
  • Figure 5 shows the third schematic diagram of the pixel arrangement of the target pixel group provided by the embodiment of the present application.
  • the target pixel group 500 is a 2 ⁇ 2 pixel group, and the first row in the 2 ⁇ 2 pixel group is selected.
  • the two target pixels 502 in are used as the basis for calculating the luminous flux value of the target pixel group 500 .
  • the average value of the light flux values of the two target pixels 502 is calculated, and the average value is used as the light flux value of the target pixel group 500, thereby reducing the amount of calculation.
  • the optical parameters of the corresponding target pixel group are determined based on the target pixels, thereby achieving the goal of eliminating the need for Calculating the optical parameters of all pixels in the target pixel group reduces the amount of calculation required to determine the optical parameters corresponding to the target pixel group.
  • determining the X target pixels in the target pixel group includes: determining the X target pixels in the target pixel group according to the image content corresponding to the target pixel group in the first target image.
  • the target in the process of selecting X target pixels in the first pixel group, the number of target pixels in the first pixel group, the target Select the location of the pixel.
  • the image content corresponding to the first pixel group is relatively rich, in order to ensure the accuracy of determining the optical parameters in the first pixel group, a larger number of target pixels will be selected, and the image content in the first pixel group will be selected.
  • the target pixel at the corresponding position in .
  • the electronic device determines the image content corresponding to the target pixel group through an image recognition algorithm, and selects different target pixels for the target pixel group based on different image contents.
  • the image content corresponding to the target pixel group is obtained, and the number of target pixels in the target pixel group is determined according to the content of the image content corresponding to the target pixel group.
  • the image content corresponding to the target pixel group is the target image feature in the image area of the target pixel group in the first target image.
  • the target image feature in the image area can be determined.
  • the content of the image content is the proportion of the identified target image features in the image area. For example, the image area has a total of N pixels, and the identified target image features in the image area total n pixels, then the image content is is n/N.
  • the content of the image content corresponding to the target pixel group is large, a larger number of target pixels are selected from the target pixel group.
  • the content of the image content corresponding to the target pixel group is small, a larger number of target pixels are selected. , a smaller target number will be selected from the target pixels.
  • the image content corresponding to the target pixel group is obtained, and the target pixel in the target pixel group is selected according to the position information of the image content corresponding to the target pixel group.
  • the position information of the image content is the position of the identified target image feature in the image area.
  • the image area is an M ⁇ N pixel matrix
  • the position of the target image feature is an m ⁇ n pixel matrix
  • the electronic device adaptively selects the target pixel in the first pixel group according to the image content, thereby reducing the calculation amount of determining the optical parameters and improving the determined optical parameters of the first pixel group. accuracy.
  • dividing the first target image into P first pixel groups includes: obtaining a first resolution of the first target image; and determining, according to the first resolution, the number of pixels in each first pixel group. the preset number of pixels; divide the first target image into P first pixel groups according to the preset number of pixels.
  • the first target image before dividing the first target image into P first pixel groups, it is necessary to determine the first resolution of the first target image, determine the preset number of pixels in the first pixel group according to the first resolution, and The first target image is divided into P first pixel groups according to a preset number of pixels, and the number of pixels in the first pixel groups obtained by dividing in the above manner is equal.
  • the electronic device can automatically determine the number of pixels in the first pixel group according to the resolution of the first target image, and divide the first target image according to the number of pixels in the first pixel group without manual operation by the user.
  • the division of the first target image can be completed, and the number of pixels in each first pixel group obtained by division is equal.
  • the calculation amount required by the electronic device is further reduced, and the process of the electronic device performing fusion processing on the first target image is simplified.
  • the preset number of pixels in each first pixel group is determined according to the first resolution.
  • the amount includes: when the first resolution is greater than the preset resolution, determining the preset number of pixels to be the first value; when the first resolution is less than or equal to the preset resolution, determining the preset number of pixels to be the first value. Two values; where the first value is greater than the second value.
  • the number of pixels in the first pixel group when the resolution of the first target image is higher, the number of pixels in the first pixel group is set higher.
  • the resolution of the first target image is lower, the number of pixels in the first pixel group is set higher.
  • the number of pixels in the first pixel group is set lower.
  • Figure 6 shows one of the schematic diagrams of the first pixel group in the first target image provided by the embodiment of the present application. As shown in Figure 6, when the resolution of the first target image 600 is relatively high, you can choose to The default number of pixels in the first pixel group 602 in a target image 600 is set to 9, and the arrangement is 3 ⁇ 3.
  • the electronic device can select a different preset number of pixels for the first pixel group based on the comparison result between the preset resolution and the first resolution of the first target image, ensuring that the first resolution is higher.
  • the number of pixels in the first pixel group can be larger.
  • the first resolution is lower, the number of pixels in the first pixel group can be smaller. This enables the electronic device to automatically set the first pixel group. the number of pixels, and divide the first target image according to the set number of pixels.
  • dividing the first target image into P first pixel groups includes: identifying the image content of the first target image; dividing the first target image into P first pixel groups according to the image content ; Among them, the P first pixel groups include pixel groups with different numbers of pixels.
  • the electronic device in the process of dividing the first target image into the first pixel group, can adaptively divide the first target image according to the recognized image content.
  • the electronic device determines the image content in the first target image through image recognition, and divides the first target image according to the recognized image content, so that the first target image is The number of the first pixel group in the area with more image content is smaller, and the number of the first pixel group in the area with less image content in the first target image is larger.
  • the image content is the target image feature in the first target image, and by performing image recognition on the first target image, the target image feature in the image area can be determined.
  • the area with more image content is the area where the target image feature is located in the first target image.
  • the area with more image content can be used as the main body area in the first target image.
  • the area in the first target image is outside the area where the target image feature is located.
  • the area of is an area with less image content, and the area with less image content can be used as the background area in the first target image.
  • Figure 7 shows the second schematic diagram of the first pixel group in the first target image provided by the embodiment of the present application. As shown in Figure 7, the first area 702 of the first target image 700 is the background of the first target image 700.
  • the electronic device sets the first pixel group 708 located in the first area 702 as a 5 ⁇ 5 pixel group, and sets the first pixel group 708 located in the second area 704 as a 2 ⁇ 2 pixel group.
  • the electronic device can identify the main body area with more image content in the first target image and the background area with less image content through image recognition, and set the first pixel group in the main body area with relatively small content.
  • a small number of pixels ensures that the first pixel group located in the subject area will not lose image content after fusion, and a larger number of pixels is set for the first pixel group in the background area to further reduce the calculation amount of the electronic device.
  • the optical parameters include any of the following: luminous flux value, number of photoelectrons.
  • the optical parameters can be selected from the luminous flux value and the number of photoelectrons.
  • the moment of the sudden change is regarded as the first moment when the optical parameters change.
  • the number of photoelectrons is the number of pixels in the lit state in the first pixel group.
  • the number of photoelectrons can be directly collected by the sensor, and the luminous flux value can be obtained by calculation.
  • N pf is the number of the first image
  • T pf is the acquisition time of a single exposure
  • ti is the moment when the pixel receives photons
  • q is the photon detection efficiency of the sensor.
  • the optical parameters are set to either the luminous flux value or the number of photoelectrons, which ensures the accuracy of the first moment judgment of optical parameter mutation and simplifies the steps of obtaining the optical parameters.
  • optical parameters are not limited to the above-mentioned luminous flux value and the number of photoelectrons, and can also be other optical parameters, which are not specifically limited here.
  • determining at least one frame of the second target image among the N frames of first images according to the optical parameters of the target pixel group includes: acquiring the third pixel in the third target image adjacent to the acquisition time The optical parameter change amount of the group, the third target image is the other images in the N frames of the first image except the first target image, the position of the third pixel group in the third target image is the same as the position of the first pixel group in the first target image corresponding to the position in; determine the acquisition time when the change amount of the optical parameter is greater than the preset change amount as the target time; determine at least one frame of the second target image in the N frames of the first image according to the target time, and the second target image of the second target image.
  • the acquisition time is between the acquisition time of the first target image and the target time.
  • the acquisition time of each frame of the first image is recorded. All images in the N frames of first images except the first target image are used as third target images.
  • the third target images are sorted according to the acquisition time, and the third pixel group in the third target image in each frame is determined according to the position of the target pixel group in the first target image. Difference calculation is performed based on the optical parameters of the third pixel group in each adjacent two third target images to obtain the change amount of the optical parameter corresponding to the acquisition time. If it is determined that the change amount of the optical parameter is greater than the preset change amount, the change amount of the optical parameter is used as the target time.
  • the target moment is the moment when the optical parameters of the third pixel group suddenly change during the process of collecting the first image of multiple frames.
  • the acquisition time of the first target image is before the target time
  • the acquisition time will be at the acquisition time of the first target image.
  • the third target image after the time and before the target time is determined as the second target image.
  • the first image with the earliest acquisition time can be used as the first target image, and the first images collected subsequently can be used as the third target image. Therefore, in the process of collecting N frames of the first image, the target time can be determined, that is, every time a frame of the third target image is collected, the third pixel group in it is compared with the third pixel group in the third target image at the previous collection time.
  • the three-pixel group calculates the change amount of the optical parameters and compares it with the preset change amount, so that the target moment can be determined during the shooting process, and the second target image is determined based on the target moment, further improving the ability to determine the target.
  • the efficiency of the pixel group fusion of the second pixel group thereby improves the overall efficiency of image fusion.
  • the third target image whose collection time is after the target image and before the collection time of the first target image is determined as the second target image.
  • the target time is the time when the optical parameters of the third pixel group suddenly change during the acquisition of N frames of the first image.
  • the acquisition time of the first target image is before the target time, in order to ensure that the target pixel group in the first target image can be image fused with the second pixel group that matches the optical parameters, the image before the optical parameters change is determined as Second target image.
  • the acquisition time of the first target image is after the target time, in order to ensure that the target pixel group in the first target image can be image fused with the second pixel group that matches the optical parameters, the image after the optical parameter changes is determined as Second target image.
  • the difference in optical parameters of the adjacent third target pixel group at the acquisition time is calculated, and the change amount of the optical parameter corresponding to the acquisition time can be determined.
  • the optical parameter change amount of the third pixel group can be used to obtain the optical parameter change amount corresponding to each collection time.
  • the change amount of the optical parameter exceeds the preset change amount, it is determined that a sudden change in the optical change amount occurs at the acquisition time, and the third target image collected between the target time and the acquisition time of the first target image is The third pixel group all matches the target pixel group, so all the first images between the target time and the collection time of the first target image are used as the second target image, ensuring that according to the second pixel group in the second target image In the image that is fused with the target pixel group, the image area of the target pixel group will not be blurred.
  • the method includes: generating a fourth target image based on a plurality of third pixel groups, where the third pixel group is the target pixel group and the third pixel group.
  • the number of the third pixel group is the same as the number of the first pixel group.
  • each first pixel group is determined as a target pixel group, and then a second target image corresponding to each target pixel group is obtained.
  • the corresponding target pixel group is fused with the corresponding second pixel group in the second target image to obtain a third pixel group.
  • the electronic device uses the pixel group as the unit of fusion processing to ensure that each part of the first target image is fused in a targeted manner and avoids the existence of pixels in the fourth target image obtained after the fusion process. Partially unclear areas, and there is no need to process each pixel individually, which reduces the calculation amount of electronic equipment and improves the efficiency of drawing.
  • the execution subject may be an image fusion device.
  • the image fusion device performing the image fusion method is taken as an example to illustrate the image fusion device provided by the embodiment of the present application.
  • an image fusion device is provided.
  • Figure 8 shows a schematic block diagram of the image fusion device 800 provided by the embodiment of the present application. As shown in Figure 8, the image fusion device 800 includes:
  • the collection module 802 is used to collect N frames of first images.
  • Each frame of the first image includes M pixels, and N and M are both positive integers;
  • the grouping module 804 is used to divide the first target image into P first pixel groups, where the first target image is any image in the N frames of first images, and P is a positive integer;
  • the acquisition module 806 is used to acquire the optical parameters of the target pixel group in the P first pixel groups, and the target pixel group is any pixel group in the P first pixel groups;
  • Determining module 808, configured to determine at least one frame of the second target image among the N frames of first images according to the optical parameters of the target pixel group, and the second target image includes a second pixel group that matches the optical parameters of the target pixel group.
  • the second target image is an image in the N-frame first image, and the target pixel group includes Q pixels;
  • the fusion module 810 is configured to perform fusion processing on the target pixel group and the second pixel group.
  • the position of the target pixel group in the first target image corresponds to the position of the second pixel group in the second target image.
  • the electronic device when the electronic device captures a subject in motion, multiple frames including the first image of the subject are collected, and the first target image in the N frames of first images is divided into a plurality of first pixels. group, and obtain a target pixel group in a plurality of first pixel groups.
  • a second pixel group in the second target image that can be fused with the target pixel group can be found. Since the The second pixel group is a pixel group found based on the optical parameters of the target pixel group, so it can be ensured that the optical parameters between the second pixel group for fusion and the target pixel group match.
  • the pixel group is used as the unit of image fusion, so that each target pixel group is fused with the matching second pixel group, which can avoid the existence of pixels in the fused image due to mismatch between some pixels and the optical parameters.
  • the blur caused by other pixel fusion improves the clarity of the final composite image.
  • the pixel group is used as the unit of image fusion, and only the optical parameters of the entire pixel group are calculated, without the need to fuse each pixel in the pixel group separately. Since the correlation between pixels in the target pixel group is strong, using the pixel group as the unit of image fusion can reduce the calculation amount of electronic equipment while ensuring the accuracy of image fusion processing. This method ensures the clarity of the fused image while also reducing the amount of data processing required for image fusion.
  • the determination module 808 is also used to determine X target pixels in the target pixel group, where X is a positive integer and X ⁇ Q;
  • the determination module 808 is also used to determine the optical parameters of the X target pixels and determine the optical parameters of the target pixel group.
  • the optical parameters of the corresponding target pixel group are determined according to the target pixels, thereby achieving There is no need to calculate the optical parameters of all pixels in the target pixel group, which reduces the amount of calculation required to determine the optical parameters corresponding to the target pixel group.
  • the determination module 808 is also used to determine X target pixels in the target pixel group according to the image content corresponding to the target pixel group in the first target image.
  • the electronic device adaptively selects the target pixel in the first pixel group according to the image content, thereby reducing the calculation amount of determining the optical parameters and improving the determined optical parameters of the first pixel group. accuracy.
  • the acquisition module 806 is also used to acquire the first resolution of the first target image
  • the determination module 808 is also used to determine the preset number of pixels in each first pixel group according to the first resolution
  • the grouping module 804 is also used to divide the first target image into P first pixel groups according to the preset number of pixels.
  • the electronic device can automatically determine the number of pixels in the first pixel group according to the resolution of the first target image, and divide the first target image according to the number of pixels in the first pixel group without manual operation by the user.
  • the division of the first target image can be completed, and the number of pixels in each first pixel group obtained by division is equal.
  • the calculation amount required by the electronic device is further reduced, and the process of the electronic device performing fusion processing on the first target image is simplified.
  • the determination module 808 is also used to determine the preset number of pixels to be a first value when the first resolution is greater than the preset resolution;
  • the determination module 808 is also configured to determine the preset number of pixels to be a second value when the first resolution is less than or equal to the preset resolution;
  • the first numerical value is greater than the second numerical value.
  • the electronic device can select a different preset number of pixels for the first pixel group based on the comparison result between the preset resolution and the first resolution of the first target image, ensuring that the first resolution is higher.
  • the number of pixels in the first pixel group can be larger.
  • the first resolution is lower, the number of pixels in the first pixel group can be smaller. This enables the electronic device to automatically set the first pixel group. the number of pixels, and divide the first target image according to the set number of pixels.
  • the image fusion device 800 further includes:
  • a recognition module used to recognize the image content of the first target image
  • the grouping module 804 is also used to divide the first target image into P first pixel groups according to the image content;
  • the P first pixel groups include pixel groups with different numbers of pixels.
  • the electronic device can identify the main body area with more image content in the first target image and the background area with less image content through image recognition, and set the first pixel group in the main body area with relatively small content.
  • a small number of pixels ensures that the first pixel group located in the subject area will not lose image content after fusion, and a larger number of pixels is set for the first pixel group in the background area to further reduce the calculation amount of the electronic device.
  • the optical parameters include any of the following: luminous flux value, number of photoelectrons.
  • the optical parameters are set to either the luminous flux value or the number of photoelectrons, which ensures the accuracy of the first moment judgment of optical parameter mutation and simplifies the steps of obtaining the optical parameters.
  • the acquisition module 806 is used to acquire the optical parameter change amount of the third pixel group in the third target image adjacent to the acquisition time.
  • the third target image is the Nth frame of the first image except the In other images other than a target image, the position of the third pixel group in the third target image corresponds to the position of the first pixel group in the first target image;
  • the determination module 808 is used to set the optical parameter change amount to be greater than the preset
  • the collection time of the change amount is determined as the target time; the determination module 808 is used to determine at least one frame of the second target image among the N frames of the first image according to the target time, and the collection time of the second target image is at the time of the first target image. between the acquisition time and the target time.
  • the difference in optical parameters of the adjacent third target pixel group at the acquisition time is calculated, and the change amount of the optical parameter corresponding to the acquisition time can be determined.
  • the optical parameter change amount of the third pixel group can be used to obtain the optical parameter change amount corresponding to each collection time.
  • the change amount of the optical parameter exceeds the preset change amount, it is determined that a sudden change in the optical change amount occurs at the acquisition time, and the third target image collected between the target time and the acquisition time of the first target image is The third pixel group all matches the target pixel group, so all the first images between the target time and the collection time of the first target image are used as the second target image, ensuring that according to the second pixel group in the second target image In the image that is fused with the target pixel group, the image area of the target pixel group will not be blurred.
  • the image fusion device 800 further includes:
  • a generation module configured to generate a fourth target image based on a plurality of third pixel groups.
  • the third pixel group is a pixel group obtained by merging the target pixel group and the second pixel group.
  • the number of the third pixel group is equal to the number of the first pixel group. same.
  • the electronic device uses the pixel group as the unit of fusion processing to ensure that each part of the first target image is fused in a targeted manner and avoids the existence of pixels in the fourth target image obtained after the fusion process. Partially unclear areas, and there is no need to process each pixel individually, which reduces the calculation amount of electronic equipment and improves the efficiency of drawing.
  • the image fusion device in the embodiment of the present application may be an electronic device or a component in the electronic device, such as an integrated circuit or chip.
  • the electronic device may be a terminal or other devices other than the terminal.
  • the electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or augmented reality (AR)/virtual reality (VR).
  • MID mobile Internet device
  • AR augmented reality
  • VR virtual reality
  • the image fusion device in the embodiment of the present application may be a device with an operating system.
  • the operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
  • the image fusion device provided by the embodiments of the present application can implement various processes implemented by the above method embodiments. To avoid duplication, they will not be described again here.
  • the embodiment of the present application also provides an electronic device, which includes the image fusion device as in any of the above embodiments, and thus has all the beneficial effects of the image fusion device in any embodiment, which will not be discussed here. Too much elaboration.
  • the embodiment of the present application also provides an electronic device.
  • Figure 9 shows a structural block diagram of the electronic device according to the embodiment of the present application.
  • the electronic device 900 includes a processor 902, a memory 904, and a storage device 900.
  • a program or instruction on the memory 904 that can be run on the processor 902.
  • the program or instruction When the program or instruction is executed by the processor 902, it implements each process of the above image fusion method embodiment and can achieve the same technical effect. To avoid duplication, I won’t go into details here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 10 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 1000 includes but is not limited to: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, processor 1010 and other components. .
  • the electronic device 1000 may also include a power supply (such as a battery) that supplies power to various components.
  • the power supply may be logically connected to the processor 1010 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions.
  • the structure of the electronic device shown in Figure 10 does not constitute a limitation of the electronic device.
  • the electronic device may include more or less components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
  • the processor 1010 is used to collect N frames of first images, each frame of the first image includes M pixels, and N and M are both positive integers;
  • the processor 1010 is configured to divide the first target image into P first pixel groups, where the first target image is any image in the N frames of first images, and P is a positive integer;
  • Processor 1010 configured to obtain optical parameters of a target pixel group in the P first pixel groups, where the target pixel group is any pixel group in the P first pixel groups;
  • Processor 1010 configured to determine at least one frame of the second target image among the N frames of first images according to the optical parameters of the target pixel group, and the second target image includes a second pixel group that matches the optical parameters of the target pixel group.
  • the second target image is an image in the N-frame first image, and the target pixel group includes Q pixels;
  • the processor 1010 is configured to perform fusion processing on a target pixel group and a second pixel group, where the position of the target pixel group in the first target image corresponds to the position of the second pixel group in the second target image.
  • the electronic device when the electronic device captures a subject in motion, multiple frames including the first image of the subject are collected, and the first target image in the N frames of first images is divided into a plurality of first pixels. group, and obtain a target pixel group in a plurality of first pixel groups.
  • the target pixel group is the second pixel group in the second target image for fusion processing. Since the second pixel group is a pixel group found according to the optical parameters of the target pixel group, it can ensure that the second pixel group and the target pixel group are fused.
  • Optical parameters are matched between pixel groups.
  • the pixel group is used as the unit of image fusion, so that each target pixel group is fused with the matching second pixel group, which can avoid the existence of pixels in the fused image due to mismatch between some pixels and the optical parameters.
  • the blur problem caused by other pixel fusion reduces the motion blur in the image and improves the image clarity of shooting moving objects.
  • the pixel group is used as the unit of image fusion, and only the optical parameters of the entire pixel group are calculated, without the need to fuse each pixel in the pixel group separately. Since the correlation between pixels in the target pixel group is strong, using the pixel group as the unit of image fusion can reduce the calculation amount of electronic equipment while ensuring the accuracy of image fusion processing. This method ensures the clarity of the fused image while also reducing the amount of data processing required for image fusion.
  • the processor 1010 is used to determine X target pixels in the target pixel group, X is a positive integer, and X ⁇ Q;
  • the processor 1010 is used to determine the optical parameters of the target pixel group for the optical parameters of the X target pixels.
  • the optical parameters of the corresponding target pixel group are determined based on the target pixels, thereby achieving the goal of eliminating the need for Calculating the optical parameters of all pixels in the target pixel group reduces the amount of calculation required to determine the optical parameters corresponding to the target pixel group.
  • the processor 1010 is configured to determine X target pixels in the target pixel group according to the image content corresponding to the target pixel group in the first target image.
  • the electronic device adaptively selects the target pixel in the first pixel group according to the image content, thereby reducing the calculation amount of determining the optical parameters and improving the determined optical parameters of the first pixel group. accuracy.
  • processor 1010 is used to obtain the first resolution of the first target image
  • Processor 1010 configured to determine the preset number of pixels in each first pixel group according to the first resolution
  • the processor 1010 is configured to divide the first target image into P first pixel groups according to a preset number of pixels.
  • the electronic device can automatically determine the number of pixels in the first pixel group according to the resolution of the first target image, and divide the first target image according to the number of pixels in the first pixel group without manual operation by the user.
  • the division of the first target image can be completed, and the number of pixels in each first pixel group obtained by division is equal.
  • the calculation amount required by the electronic device is further reduced, and the process of the electronic device performing fusion processing on the first target image is simplified.
  • the processor 1010 is configured to determine the preset number of pixels to be the first value when the first resolution is greater than the preset resolution
  • Processor 1010 configured to determine the preset number of pixels when the first resolution is less than or equal to the preset resolution is the second value
  • the first numerical value is greater than the second numerical value.
  • the electronic device can select a different preset number of pixels for the first pixel group based on the comparison result between the preset resolution and the first resolution of the first target image, ensuring that the first resolution is higher.
  • the number of pixels in the first pixel group can be larger.
  • the first resolution is lower, the number of pixels in the first pixel group can be smaller. This enables the electronic device to automatically set the first pixel group. the number of pixels, and divide the first target image according to the set number of pixels.
  • processor 1010 is configured to identify the image content of the first target image
  • the processor 1010 is configured to divide the first target image into P first pixel groups according to the image content
  • the P first pixel groups include pixel groups with different numbers of pixels.
  • the electronic device can identify the main body area with more image content in the first target image and the background area with less image content through image recognition, and set the first pixel group in the main body area with relatively small content.
  • a small number of pixels ensures that the first pixel group located in the subject area will not lose image content after fusion, and a larger number of pixels is set for the first pixel group in the background area to further reduce the calculation amount of the electronic device.
  • optical parameters include any of the following: luminous flux value, number of photoelectrons.
  • the optical parameters are set to either the luminous flux value or the number of photoelectrons, which ensures the accuracy of the first moment judgment of optical parameter mutation and simplifies the steps of obtaining the optical parameters.
  • the processor 1010 is used to obtain the optical parameter change amount of the third pixel group in the third target image adjacent to the acquisition time.
  • the third target image is other than the first target image in the N frames of the first image. Image, the position of the third pixel group in the third target image corresponds to the position of the first pixel group in the first target image;
  • the processor 1010 is configured to determine the acquisition time when the optical parameter change amount is greater than the preset change amount as the target time;
  • the processor 1010 is configured to determine at least one frame of the second target image among the N frames of first images according to the target time, and the collection time of the second target image is between the collection time of the first target image and the target time.
  • the difference in optical parameters of the adjacent third target pixel group at the acquisition time is calculated, and the change amount of the optical parameter corresponding to the acquisition time can be determined.
  • the optical parameter change amount of the third pixel group can be used to obtain the optical parameter change amount corresponding to each collection time.
  • the change amount of the optical parameter exceeds the preset change amount, it is determined that a sudden change in the optical change amount occurs at the acquisition time, and the third target image collected between the target time and the acquisition time of the first target image is The third pixel group all matches the target pixel group, so all the first images between the target time and the collection time of the first target image are used as the second target image, ensuring that according to the second pixel group in the second target image In the image that is fused with the target pixel group, the image area of the target pixel group will not be blurred.
  • the processor 1010 is configured to generate a fourth target image according to a plurality of third pixel groups.
  • the third pixel group is a pixel group obtained by merging the target pixel group and the second pixel group.
  • the number of the third pixel group is the same as that of the first pixel group.
  • the number of pixel groups is the same.
  • the electronic device can ensure that the first Each part of the target image is subjected to targeted fusion processing to avoid partially unclear areas in the fourth target image obtained after the fusion processing, and there is no need to process each pixel individually, which reduces the calculation amount of electronic equipment. Improved drawing efficiency.
  • the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042.
  • the graphics processor 10041 is responsible for the image capture device (GPU) in the video capture mode or the image capture mode. Process the image data of still pictures or videos obtained by cameras (such as cameras).
  • the display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072 .
  • Touch panel 10071 also known as touch screen.
  • the touch panel 10071 may include two parts: a touch detection device and a touch controller.
  • Other input devices 10072 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
  • Memory 1009 may be used to store software programs as well as various data.
  • the memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc.
  • memory 1009 may include volatile memory or nonvolatile memory, or memory 1009 may include both volatile and nonvolatile memory.
  • non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory.
  • Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM).
  • RAM Random Access Memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • synchronous dynamic random access memory Synchronous DRAM, SDRAM
  • Double data rate synchronous dynamic random access memory Double Data Rate SDRAM, DDRSDRAM
  • enhanced SDRAM synchronous dynamic random access memory
  • Synch link DRAM synchronous link dynamic random access memory
  • SLDRAM direct memory bus random access memory
  • Direct Rambus RAM Direct Rambus RAM
  • the processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 1010.
  • Embodiments of the present application also provide a readable storage medium.
  • Programs or instructions are stored on the readable storage medium.
  • the program or instructions are executed by a processor, each process of the above method embodiments is implemented and the same technical effect can be achieved. To avoid repetition, they will not be repeated here.
  • Readable storage media includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks or optical disks.
  • the embodiment of the present application further provides a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface and the processor Coupling, the processor is used to run programs or instructions to implement each process of the above image fusion method embodiment, and can achieve the same technical effect. To avoid duplication, it will not be described again here.
  • chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
  • Embodiments of the present application provide a computer program product.
  • the program product is stored in a storage medium.
  • the program product is executed by at least one processor to implement each process of the above image fusion method embodiment, and can achieve the same technical effect. , to avoid repetition, will not be repeated here.
  • modules, units, and subunits can be implemented in one or more Application Specific Integrated Circuits (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSP Device, DSPD) ), programmable logic device (Programmable Logic Device, PLD), field-programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, used to execute the disclosure other electronic units or combinations thereof with the above functions.
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processor
  • DSP Device Digital Signal Processing Device
  • DSPD Digital Signal Processing Device
  • PLD programmable logic device
  • FPGA field-programmable gate array
  • controller microcontroller, microprocessor
  • the technology described in the embodiments of the present disclosure can be implemented through modules (such as procedures, functions, etc.) that perform the functions described in the embodiments of the present disclosure.
  • Software code may be stored in memory and executed by a processor.
  • the memory can be implemented in the processor or external to the processor.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or may be integrated into another system, or some features may be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in various embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the computer software product is stored in a storage medium (such as ROM/RAM, disk , CD), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present application.
  • a storage medium such as ROM/RAM, disk , CD

Abstract

The present application relates to the technical field of photography, and discloses an image fusion method and apparatus, an electronic device, and a storage medium. The image fusion method comprises: collecting N frames of first images, wherein each frame of first image comprises M pixels, and N and M are both positive integers; dividing a first target image into P first pixel groups, wherein the first target image is any image in the N frames of first images, and P is a positive integer; obtaining optical parameters of a target pixel group in the P first pixel groups; determining at least one frame of second target image in the N frames of first images according to the optical parameters of the target pixel group, wherein the second target image comprises a second pixel group of which optical parameters match the optical parameters of the target pixel group, the second target image is an image in the N frames of first images, the target pixel group comprises Q pixels, and Q is less than M; and fusing the target pixel group with the second pixel group.

Description

图像融合方法、装置、电子设备和存储介质Image fusion method, device, electronic device and storage medium
相关申请的交叉引用Cross-references to related applications
本申请要求在2022年09月06日提交中国专利局、申请号为202211084167.1、名称为“图像融合方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on September 6, 2022, with application number 202211084167.1 and titled "Image fusion method, device, electronic device and storage medium", the entire content of which is incorporated by reference. in this application.
技术领域Technical field
本申请属于拍摄技术领域,具体涉及一种图像融合方法、装置、电子设备和存储介质。This application belongs to the field of photography technology, and specifically relates to an image fusion method, device, electronic equipment and storage medium.
背景技术Background technique
在相关技术中,拍摄照片的亮度与传感器进光量正相关,在光照复杂的环境下拍照,由于曝光时间过长会造成明亮区域过曝,曝光时间过短会导致暗光区域欠曝,导致一次性曝光成像的方式拍摄得到的图像通常难以保证图像质量。In related technologies, the brightness of a photo is positively related to the amount of light entering the sensor. When taking photos in a complex lighting environment, the bright area will be overexposed due to the exposure time being too long, and the exposure time is too short will cause the dark area to be underexposed, resulting in a It is often difficult to ensure image quality in images captured using sexual exposure imaging.
为保证拍摄图像的图像质量,通常通过获取多帧的短曝光图像,并对多帧的短曝光图像中的全部整张图像进行图像融合得到最终合成的图像,导致最终合成的图像中存在运动模糊。In order to ensure the image quality of the captured image, multiple frames of short exposure images are usually obtained and all the entire images in the multiple frames of short exposure images are image fused to obtain the final synthesized image, resulting in motion blur in the final synthesized image. .
发明内容Contents of the invention
本申请实施例的目的是提供一种图像融合方法、装置、电子设备和存储介质,避免融合得到的图像中存在由于部分像素经过与光学参数不匹配的其他像素融合产生的模糊的问题,提高了最终合成的图像的清晰度。The purpose of the embodiments of the present application is to provide an image fusion method, device, electronic device and storage medium to avoid the blurring problem in the fused image caused by the fusion of some pixels with other pixels that do not match the optical parameters, and to improve the The clarity of the final composite image.
第一方面,本申请实施例提供了一种图像融合方法,包括:采集N帧第一图像,每帧第一图像均包括M个像素,N和M均为正整数;将第一目标图像划分为P个第一像素组,第一目标图像为N帧第一图像中的任一图像,P为正整数;获取P个第一像素组中目标像素组的光学参数,目标像素组为P个第一像素组中任一像素组;根据目标像素组的光学参数,确定N帧第一图像中的至少一帧第二目标图像,第二目标图像中包括与目标像素组的光学参数相匹配的第二像素组,第二目标图像为N帧第一图像中的图像,目标像素组包括Q个像素,Q<M;将目标像素组与第二像素组进行融合处理,目标像素组在第一目标图像中的位置与第二像素组在第二目标图像的位置相对应。In the first aspect, embodiments of the present application provide an image fusion method, including: collecting N frames of first images, each frame of the first image including M pixels, N and M are both positive integers; dividing the first target image into is P first pixel groups, the first target image is any image in the N frames of first images, and P is a positive integer; obtain the optical parameters of the target pixel group in the P first pixel groups, and the target pixel group is P Any pixel group in the first pixel group; according to the optical parameters of the target pixel group, determine at least one frame of the second target image among the N frames of the first image, and the second target image includes the optical parameters that match the target pixel group. The second pixel group, the second target image is an image in the first image of N frames, the target pixel group includes Q pixels, Q<M; the target pixel group and the second pixel group are fused, and the target pixel group is in the first The position in the target image corresponds to the position of the second group of pixels in the second target image.
第二方面,本申请实施例提供了一种图像融合装置,包括:采集模块,用于采集N帧第一图像,每帧第一图像均包括M个像素,N和M均为正整数;分组模块,用于将第一目标图像划分为P个第一像素组,第一目标图像为N帧第一图像中的任一图像,P为正整数;获取模块,用于获取P个第一像素组中目标像素组的光学参数,目标像素组为 P个第一像素组中任一像素组;确定模块,用于根据目标像素组的光学参数,确定N帧第一图像中的至少一帧第二目标图像,第二目标图像中包括与目标像素组的光学参数相匹配的第二像素组,第二目标图像为N帧第一图像中的图像,目标像素组包括Q个像素;融合模块,用于将目标像素组与第二像素组进行融合处理,目标像素组在第一目标图像中的位置与第二像素组在第二目标图像的位置相对应。In the second aspect, embodiments of the present application provide an image fusion device, including: a collection module, used to collect N frames of first images, each frame of the first image includes M pixels, N and M are both positive integers; grouping Module, used to divide the first target image into P first pixel groups, the first target image is any image in N frames of first images, P is a positive integer; acquisition module, used to obtain P first pixels Optical parameters of the target pixel group in the group, the target pixel group is Any pixel group among the P first pixel groups; a determination module, configured to determine at least one second target image among the N frames of first images according to the optical parameters of the target pixel group, and the second target image includes the same target pixels. The second pixel group whose optical parameters match the second group, the second target image is the image in the N-frame first image, and the target pixel group includes Q pixels; the fusion module is used to fuse the target pixel group with the second pixel group. Processing, the position of the target pixel group in the first target image corresponds to the position of the second pixel group in the second target image.
第三方面,本申请实施例提供了一种电子设备,包括处理器和存储器,存储器存储可在处理器上运行的程序或指令,程序或指令被处理器执行时实现如第一方面的方法的步骤。In a third aspect, embodiments of the present application provide an electronic device, including a processor and a memory. The memory stores programs or instructions that can be run on the processor. When the program or instructions are executed by the processor, the method of the first aspect is implemented. step.
第四方面,本申请实施例提供了一种可读存储介质,该可读存储介质上存储程序或指令,该程序或指令被处理器执行时实现如第一方面的方法的步骤。In a fourth aspect, embodiments of the present application provide a readable storage medium that stores a program or instructions, and when the program or instructions are executed by a processor, the steps of the method in the first aspect are implemented.
第五方面,本申请实施例提供了一种芯片,该芯片包括处理器和通信接口,该通信接口和该处理器耦合,该处理器用于运行程序或指令,实现如第一方面的方法的步骤。In a fifth aspect, embodiments of the present application provide a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the steps of the method in the first aspect. .
第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面的方法。In a sixth aspect, embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method of the first aspect.
本申请实施例中,在电子设备拍摄处于运动状态下的拍摄对象时,采集多帧包括该拍摄对象的第一图像,将N帧第一图像中的第一目标图像划分为多个第一像素组,并获取多个第一像素组中的目标像素组,通过该目标像素组的光学参数,能够查找到能够与目标像素组进行融合处理的第二目标图像中的第二像素组,由于该第二像素组是根据目标像素组的光学参数查找到的像素组,故能够保证进行融合的第二像素组和目标像素组之间的光学参数相匹配。在对每个目标像素组与相应的第二像素融合之后进行拼接,能够得到消除运动模糊的图像。本申请实施例中将像素组作为图像融合的单位,使每个目标像素组均与相匹配的第二像素组进行融合,能够避免融合得到的图像中存在由于部分像素经过与光学参数不匹配的其他像素融合产生的模糊的问题,提高了最终合成的图像的清晰度。In the embodiment of the present application, when the electronic device captures a subject in motion, multiple frames including the first image of the subject are collected, and the first target image in the N frames of first images is divided into a plurality of first pixels. group, and obtain a target pixel group in a plurality of first pixel groups. Through the optical parameters of the target pixel group, a second pixel group in the second target image that can be fused with the target pixel group can be found. Since the The second pixel group is a pixel group found based on the optical parameters of the target pixel group, so it can be ensured that the optical parameters between the second pixel group for fusion and the target pixel group match. After fusing each target pixel group with the corresponding second pixel and then splicing it, an image with motion blur eliminated can be obtained. In the embodiment of the present application, the pixel group is used as the unit of image fusion, so that each target pixel group is fused with the matching second pixel group, which can avoid the existence of pixels in the fused image due to mismatch between some pixels and the optical parameters. The blur caused by other pixel fusion improves the clarity of the final composite image.
本申请实施例将像素组作为图像融合的单位,仅计算像素组整体的光学参数即可,无需将像素组中每个像素单独进行融合。由于目标像素组中的像素的关联性较强,故以像素组作为图像融合的单位,能够在降低电子设备计算量的同时,保证图像融合处理的精度。实现了在保证融合后的图像的清晰度的同时,还降低了图像融合所需的数据处理量。In the embodiment of the present application, the pixel group is used as the unit of image fusion, and only the optical parameters of the entire pixel group are calculated, without the need to fuse each pixel in the pixel group separately. Since the correlation between pixels in the target pixel group is strong, using the pixel group as the unit of image fusion can reduce the calculation amount of electronic equipment while ensuring the accuracy of image fusion processing. This method ensures the clarity of the fused image while also reducing the amount of data processing required for image fusion.
附图说明Description of the drawings
图1示出了本申请实施例提供的图像融合方法的流程示意图;Figure 1 shows a schematic flow chart of the image fusion method provided by the embodiment of the present application;
图2示出了本申请实施例提供的光通量值变化曲线;Figure 2 shows the luminous flux value change curve provided by the embodiment of the present application;
图3示出了本申请实施例提供的目标像素组的像素排列示意图之一;Figure 3 shows one of the schematic diagrams of the pixel arrangement of the target pixel group provided by the embodiment of the present application;
图4示出了本申请实施例提供的目标像素组的像素排列示意图之二; Figure 4 shows the second schematic diagram of the pixel arrangement of the target pixel group provided by the embodiment of the present application;
图5示出了本申请实施例提供的目标像素组的像素排列示意图之三;Figure 5 shows the third schematic diagram of the pixel arrangement of the target pixel group provided by the embodiment of the present application;
图6示出了本申请实施例提供的第一目标图像中第一像素组的示意图之一;Figure 6 shows one of the schematic diagrams of the first pixel group in the first target image provided by the embodiment of the present application;
图7示出了本申请实施例提供的第一目标图像中第一像素组的示意图之二;Figure 7 shows the second schematic diagram of the first pixel group in the first target image provided by the embodiment of the present application;
图8示出了本申请实施例提供的图像融合装置的示意框图;Figure 8 shows a schematic block diagram of an image fusion device provided by an embodiment of the present application;
图9示出了根据本申请实施例的电子设备的结构框图;Figure 9 shows a structural block diagram of an electronic device according to an embodiment of the present application;
图10为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 10 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
具体实施例Specific embodiments
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art fall within the scope of protection of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first," "second," etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the related objects are in an "or" relationship.
下面结合附图1至图10,通过具体的实施例及其应用场景对本申请实施例提供的图像融合方法、图像融合装置、电子设备和存储介质进行详细地说明。The image fusion method, image fusion device, electronic device and storage medium provided by the embodiments of the present application will be described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings 1 to 10 .
在本申请的一些实施例中提供了一种图像融合方法。图1示出了本申请实施例提供的图像融合方法的流程示意图。如图1所示,图像融合方法包括:In some embodiments of the present application, an image fusion method is provided. Figure 1 shows a schematic flowchart of an image fusion method provided by an embodiment of the present application. As shown in Figure 1, image fusion methods include:
步骤102,采集N帧第一图像,每帧第一图像均包括M个像素,N和M均为正整数;Step 102, collect N frames of first images, each frame of the first image includes M pixels, and N and M are both positive integers;
在电子设备以预设帧率进行多段曝光拍摄的过程中,电子设备能够采集N帧第一图像,由于N帧第一图像中像素均通过相同传感器采集得到,故每个第一图像中的像素数量相同,且均包括M个像素。In the process of the electronic device performing multi-segment exposure shooting at a preset frame rate, the electronic device can collect N frames of the first image. Since the pixels in the N frames of the first image are all collected by the same sensor, the pixels in each first image The number is the same and both include M pixels.
步骤104,将第一目标图像划分为P个第一像素组,第一目标图像为N帧第一图像中的任一图像,P为正整数;Step 104: Divide the first target image into P first pixel groups, where the first target image is any image in N frames of first images, and P is a positive integer;
第一目标图像为N帧第一图像中用于对图像进行融合处理的图像,第一目标图像可以选择N帧第一图像中的任一图像,在后续处理过程中,该第一目标图像作为初始图像与其他图像进行融合处理。The first target image is an image used for image fusion processing among the N frames of first images. The first target image can select any image among the N frames of first images. In the subsequent processing process, the first target image is used as The initial image is fused with other images.
将每帧第一图像的全部像素划分为P个第一像素组。每个第一像素组的像素数量需要小于第一目标图像中的像素数量,且第一像素组中包括至少一个像素。All pixels of the first image in each frame are divided into P first pixel groups. The number of pixels in each first pixel group needs to be smaller than the number of pixels in the first target image, and the first pixel group includes at least one pixel.
需要说明的是,P个第一像素组中的每个第一像素组的像素数量可以相同,也可以不同。并且多个第一像素组中的像素排列形式可以相同,也可以不同。 It should be noted that the number of pixels in each of the P first pixel groups may be the same or different. And the pixel arrangement forms in the plurality of first pixel groups may be the same or different.
示例性地,在确定每个第一像素组中的像素的数量为12个,则第一像素组的排列形式可以为2×6、3×4、1×12。For example, when it is determined that the number of pixels in each first pixel group is 12, the arrangement form of the first pixel group may be 2×6, 3×4, or 1×12.
步骤106,获取P个第一像素组中目标像素组的光学参数,目标像素组为P个第一像素组中任一像素组;Step 106: Obtain the optical parameters of the target pixel group among the P first pixel groups, and the target pixel group is any pixel group among the P first pixel groups;
目标像素组为P个第一像素组中的任意一个像素组,在对第一目标图像进行融合的过程中,可以将P个第一像素组中的每一个像素组均作为目标像素组,还可以将P个第一像素组中的部分像素组作为目标像素组。The target pixel group is any pixel group among the P first pixel groups. In the process of fusing the first target image, each pixel group among the P first pixel groups can be used as the target pixel group. Some pixel groups among the P first pixel groups may be used as target pixel groups.
步骤108,根据目标像素组的光学参数,确定N帧第一图像中的至少一帧第二目标图像,第二目标图像中包括与目标像素组的光学参数相匹配的第二像素组,第二目标图像为N帧第一图像中的图像,目标像素组包括Q个像素,Q<M;Step 108: Determine at least one second target image among the N frames of first images based on the optical parameters of the target pixel group. The second target image includes a second pixel group that matches the optical parameters of the target pixel group. The target image is the image in the first image of N frames, and the target pixel group includes Q pixels, Q<M;
第二目标图像是根据目标像素组的光学参数从N帧第一图像中筛选得到的。需要说明的是,第二目标图像与第一目标图像为不同的图像,第二目标图像的数量为至多N-1帧,即第二目标图像可以为N帧第一图像中除第一目标图像之外的全部图像。The second target image is filtered from the N frames of the first image according to the optical parameters of the target pixel group. It should be noted that the second target image and the first target image are different images, and the number of the second target image is at most N-1 frames, that is, the second target image can be N frames of the first image except the first target image. All images except .
第二目标图像中的第二像素组与目标像素组的光学参数相匹配。在第二像素组的光学参数与目标像素组的光学参数的参数差值小于预设差值的情况下,确定第二像素组与目标像素组的光学参数相匹配。The second group of pixels in the second target image matches optical parameters of the target group of pixels. When the parameter difference between the optical parameters of the second pixel group and the optical parameters of the target pixel group is less than the preset difference, it is determined that the optical parameters of the second pixel group match the target pixel group.
第二像素组在第二目标图像的位置与目标像素组在第一目标图像的位置相对应。第一目标图像和第二目标图像对应的像素矩阵相同,目标像素组在像素矩阵中位置与第一像素组在像素矩阵中的位置相同。The position of the second pixel group in the second target image corresponds to the position of the target pixel group in the first target image. The pixel matrices corresponding to the first target image and the second target image are the same, and the position of the target pixel group in the pixel matrix is the same as the position of the first pixel group in the pixel matrix.
步骤110,将目标像素组与第二像素组进行融合处理,目标像素组在第一目标图像中的位置与第二像素组在第二目标图像的位置相对应。Step 110: Fusion processing is performed on the target pixel group and the second pixel group. The position of the target pixel group in the first target image corresponds to the position of the second pixel group in the second target image.
本申请实施例中,电子设备采集多帧第一图像,将多帧第一图像中的第一目标图像划分为P个第一像素组,根据P个第一像素组中的目标像素组查找多帧第一图像中的第二目标图像。根据相对应的第二目标图像中的第二像素组对该目标像素组进行融合。在P个第一像素组中的全部目标像素组均进行融合后,得到融合后的图像。经过上述过程融合得到的图像能够避免拍摄过程中拍摄对象运动导致的运动模糊的问题。In the embodiment of the present application, the electronic device collects multiple frames of first images, divides the first target image in the multiple frames of first images into P first pixel groups, and searches for multiple first pixel groups based on the target pixel groups in the P first pixel groups. Frame the second target image within the first image. The target pixel group is fused according to the second pixel group in the corresponding second target image. After all target pixel groups in the P first pixel groups are fused, a fused image is obtained. The image obtained through the fusion of the above process can avoid the problem of motion blur caused by the movement of the subject during the shooting process.
具体来说,根据目标像素组查找多帧第一图像中的第二目标图像的过程中,需要先根据目标像素组确定多帧第一图像中除第一目标图像外其他图像中的第三像素组。获取目标像素组的光学参数和多个第三像素组的光学参数,将多个第三像素组中与目标像素组的光学参数相匹配的第二像素组所对应的图像确定为第二目标图像。Specifically, in the process of searching for the second target image in the multi-frame first image based on the target pixel group, it is necessary to first determine the third pixel in the multi-frame first image except the first target image based on the target pixel group. Group. Obtain the optical parameters of the target pixel group and the optical parameters of the plurality of third pixel groups, and determine the image corresponding to the second pixel group of the plurality of third pixel groups that matches the optical parameters of the target pixel group as the second target image. .
示例性地,在判断第三像素组的光学参数是否与目标像素组的光学参数相匹配包括:计算第三像素组与目标像素组的光学参数的差值,将差值小于预设差值的三像素组确定为与目标像素组相匹配的第二像素组。For example, determining whether the optical parameters of the third pixel group match the optical parameters of the target pixel group includes: calculating the difference between the optical parameters of the third pixel group and the target pixel group, and calculating the difference between the optical parameters that are smaller than the preset difference. The three-pixel group is determined as the second pixel group that matches the target pixel group.
光学参数包括以下任一项:光通量值、光电子数量。Optical parameters include any of the following: luminous flux value, number of photoelectrons.
在一些可能的实施方式中,光学参数仅包括光通量值或光电子数中的一个。在检测 到第三像素组与目标像素组的光通量值之间的差值小于预设差值的情况下,或第三像素组与目标像素组的光电子数之间的差值小于预设差值的情况下,确定该第三像素组为与目标像素组相匹配的第二像素组。In some possible implementations, the optical parameter only includes one of the luminous flux value or the number of photoelectrons. In detection When the difference between the luminous flux values of the third pixel group and the target pixel group is less than the preset difference, or when the difference between the photoelectron numbers of the third pixel group and the target pixel group is less than the preset difference Next, the third pixel group is determined to be the second pixel group matching the target pixel group.
在一些可能的实施方式中,光学参数包括光通量值和光电子数。在检测到第三像素组与目标像素组的光通量值之间的差值小于预设差值的情况下,以及第三像素组与目标像素组的光电子数之间的差值小于预设差值的情况下,确定该第三像素组为与目标像素组相匹配的第二像素组。还可以在检测到第三像素组与目标像素组的光通量值之间的差值小于预设差值的情况下,或第三像素组与目标像素组的光电子数之间的差值小于预设差值的情况下,确定该第三像素组为与目标像素组相匹配的第二像素组。In some possible implementations, the optical parameters include luminous flux values and photoelectron numbers. When it is detected that the difference between the luminous flux values of the third pixel group and the target pixel group is less than the preset difference, and the difference between the photoelectron numbers of the third pixel group and the target pixel group is less than the preset difference In the case of , the third pixel group is determined to be the second pixel group matching the target pixel group. It can also be detected that the difference between the luminous flux values of the third pixel group and the target pixel group is less than the preset difference, or the difference between the photoelectron numbers of the third pixel group and the target pixel group is less than the preset difference. If there is a difference, the third pixel group is determined to be the second pixel group that matches the target pixel group.
需要说明的是,光通量值能够通过计算的方式得到。光电子数量为像素组中处于点亮状态下的像素数量,能够通过传感器进行采集统计。It should be noted that the luminous flux value can be obtained through calculation. The number of photoelectrons is the number of pixels in the lit state in the pixel group, which can be collected and counted by the sensor.
图2示出了本申请实施例提供的光通量值变化曲线,如图2所示,电子设备采集到1000帧第三图像,目标像素组的光通量值在1000帧第三图像中存在两次明显变化,其中,第一次变化的变化量为0.6,第二次变化的变化量为1。在预设变化量为0.8的情况下,则将第二次变化对应的时刻,确定为光通量值突变时刻,即第一时刻。Figure 2 shows the change curve of the luminous flux value provided by the embodiment of the present application. As shown in Figure 2, the electronic device collected 1000 frames of the third image, and the luminous flux value of the target pixel group had two obvious changes in the 1000 frames of the third image. , where the change amount of the first change is 0.6, and the change amount of the second change is 1. In the case where the preset change amount is 0.8, the time corresponding to the second change is determined as the sudden change time of the luminous flux value, that is, the first time.
本申请实施例中,在电子设备拍摄处于运动状态下的拍摄对象时,采集多帧包括该拍摄对象的第一图像,将N帧第一图像中的第一目标图像划分为多个第一像素组,并获取多个第一像素组中的目标像素组,通过该目标像素组的光学参数,能够查找到能够与目标像素组进行融合处理的第二目标图像中的第二像素组,由于该第二像素组是根据目标像素组的光学参数查找到的像素组,故能够保证进行融合的第二像素组和目标像素组之间的光学参数相匹配。在对每个目标像素组与相应的第二像素融合之后进行拼接,能够得到消除运动模糊的图像。本申请实施例中将像素组作为图像融合的单位,使每个目标像素组均与相匹配的第二像素组进行融合,能够避免融合得到的图像中存在由于部分像素经过与光学参数不匹配的其他像素融合产生的模糊的问题,提高了最终合成的图像的清晰度。In the embodiment of the present application, when the electronic device captures a subject in motion, multiple frames including the first image of the subject are collected, and the first target image in the N frames of first images is divided into a plurality of first pixels. group, and obtain a target pixel group in a plurality of first pixel groups. Through the optical parameters of the target pixel group, a second pixel group in the second target image that can be fused with the target pixel group can be found. Since the The second pixel group is a pixel group found based on the optical parameters of the target pixel group, so it can be ensured that the optical parameters between the second pixel group for fusion and the target pixel group match. After fusing each target pixel group with the corresponding second pixel and then splicing it, an image with motion blur eliminated can be obtained. In the embodiment of the present application, the pixel group is used as the unit of image fusion, so that each target pixel group is fused with the matching second pixel group, which can avoid the existence of pixels in the fused image due to mismatch between some pixels and the optical parameters. The blur caused by other pixel fusion improves the clarity of the final composite image.
本申请实施例将像素组作为图像融合的单位,仅计算像素组整体的光学参数即可,无需将像素组中每个像素单独进行融合。由于目标像素组中的像素的关联性较强,故以像素组作为图像融合的单位,能够在降低电子设备计算量的同时,保证图像融合处理的精度。实现了在保证融合后的图像的清晰度的同时,还降低了图像融合所需的数据处理量。In the embodiment of the present application, the pixel group is used as the unit of image fusion, and only the optical parameters of the entire pixel group are calculated, without the need to fuse each pixel in the pixel group separately. Since the correlation between pixels in the target pixel group is strong, using the pixel group as the unit of image fusion can reduce the calculation amount of electronic equipment while ensuring the accuracy of image fusion processing. This method ensures the clarity of the fused image while also reducing the amount of data processing required for image fusion.
在本申请的一些实施例中,获取P个第一像素组中目标像素组的光学参数,包括:确定目标像素组中的X个目标像素,X为正整数,X≤Q;根据X个目标像素的光学参数,确定目标像素组的光学参数。In some embodiments of the present application, obtaining the optical parameters of the target pixel group in the P first pixel groups includes: determining X target pixels in the target pixel group, X is a positive integer, X≤Q; The optical parameters of the pixel determine the optical parameters of the target pixel group.
本申请实施例中,X个目标像素为目标像素组中的部分像素。目标像素的数量的取值范围为大于1,小于等于Q。在确定X个目标像素之后,根据X个目标像素对应的光 学参数,确定目标像素组的光学参数。In the embodiment of the present application, the X target pixels are part of the pixels in the target pixel group. The value range of the number of target pixels is greater than 1 and less than or equal to Q. After determining the X target pixels, according to the light corresponding to the X target pixels optical parameters to determine the optical parameters of the target pixel group.
需要说明的是,X个目标像素的选取规则可在电子设备出厂前进行提前设置。It should be noted that the selection rules for the X target pixels can be set in advance before the electronic device leaves the factory.
在目标像素的数量为1的情况下,则直接将该目标像素的光学参数作为目标像素组的光学参数。示例性地,在目标像素的数量为1,且该目标像素的光通量值为1.2则确定该目标像素所在的目标像素组的光通量值1.2。When the number of target pixels is 1, the optical parameters of the target pixel are directly used as the optical parameters of the target pixel group. For example, when the number of target pixels is 1 and the light flux value of the target pixel is 1.2, the light flux value of the target pixel group where the target pixel is located is determined to be 1.2.
在目标像素的数量为多个的情况下,则对多个目标像素的光学参数进行计算,以确定多个目标像素所处目标像素组的光学参数。示例性地,在目标像素的数量为2个,其中一个目标像素的光通量值为0.4,另一个目标像素的光通量值为0.6,通过计算两个目标像素的光通量值的平均值,以确定该目标像素组的光通量值为0.5。还可以选为对多个目标像素的光学参数进行其他加权计算方法,以确定该目标像素组的光学参数。When there are multiple target pixels, the optical parameters of the multiple target pixels are calculated to determine the optical parameters of the target pixel group where the multiple target pixels are located. For example, when the number of target pixels is 2, the light flux value of one target pixel is 0.4, and the light flux value of the other target pixel is 0.6, the target is determined by calculating the average of the light flux values of the two target pixels. The luminous flux value of the pixel group is 0.5. You may also choose to perform other weighted calculation methods on the optical parameters of multiple target pixels to determine the optical parameters of the target pixel group.
需要说明的是,在光学参数为光电子数的情况下,则统计目标像素组中目标像素的点亮数目。It should be noted that, in the case where the optical parameter is the number of photoelectrons, the number of illuminated target pixels in the target pixel group is counted.
图3示出了本申请实施例提供的目标像素组的像素排列示意图之一,如图3所示,目标像素组300为2×2的像素组,选择2×2的像素组中左上角的单个目标像素302作为该目标像素组300的光通量值计算依据,则无需计算其他像素的光通量值,从而减少了四分之三的计算量。Figure 3 shows one of the schematic diagrams of the pixel arrangement of the target pixel group provided by the embodiment of the present application. As shown in Figure 3, the target pixel group 300 is a 2×2 pixel group. Select the upper left corner of the 2×2 pixel group. If a single target pixel 302 is used as the basis for calculating the light flux value of the target pixel group 300, there is no need to calculate the light flux values of other pixels, thereby reducing the calculation amount by three-quarters.
图4示出了本申请实施例提供的目标像素组的像素排列示意图之二,如图4所示,目标像素组400为2×2的像素组,选择2×2的像素组中对角线上的两个目标像素402作为该目标像素组400的光通量值计算依据。对上述两个目标像素402的光通量值计算平均值,并将该平均值作为该目标像素组400的光通量值,从而降低了计算量。Figure 4 shows the second schematic diagram of the pixel arrangement of the target pixel group provided by the embodiment of the present application. As shown in Figure 4, the target pixel group 400 is a 2×2 pixel group. Select the diagonal line in the 2×2 pixel group. The two target pixels 402 on are used as the basis for calculating the luminous flux value of the target pixel group 400. The average value of the light flux values of the two target pixels 402 is calculated, and the average value is used as the light flux value of the target pixel group 400, thereby reducing the amount of calculation.
图5示出了本申请实施例提供的目标像素组的像素排列示意图之三,如图5所示,目标像素组500为2×2的像素组,选择2×2的像素组中第一行中的两个目标像素502作为该目标像素组500的光通量值计算依据。对上述两个目标像素502的光通量值计算平均值,并将该平均值作为该目标像素组500的光通量值,从而降低了计算量。Figure 5 shows the third schematic diagram of the pixel arrangement of the target pixel group provided by the embodiment of the present application. As shown in Figure 5, the target pixel group 500 is a 2×2 pixel group, and the first row in the 2×2 pixel group is selected. The two target pixels 502 in are used as the basis for calculating the luminous flux value of the target pixel group 500 . The average value of the light flux values of the two target pixels 502 is calculated, and the average value is used as the light flux value of the target pixel group 500, thereby reducing the amount of calculation.
本申请实施例中,在将第一图像划分为多个目标像素组之后,通过将目标像素组中的部分像素作为目标像素,并根据目标像素确定相应的目标像素组的光学参数,实现了无需计算目标像素组中全部像素的光学参数,减少了确定目标像素组对应的光学参数的计算量。In the embodiment of the present application, after the first image is divided into multiple target pixel groups, some pixels in the target pixel group are used as target pixels, and the optical parameters of the corresponding target pixel group are determined based on the target pixels, thereby achieving the goal of eliminating the need for Calculating the optical parameters of all pixels in the target pixel group reduces the amount of calculation required to determine the optical parameters corresponding to the target pixel group.
在本申请的一些实施例中,确定目标像素组中的X个目标像素,包括:根据目标像素组在第一目标图像中对应的图像内容,确定目标像素组中的X个目标像素。In some embodiments of the present application, determining the X target pixels in the target pixel group includes: determining the X target pixels in the target pixel group according to the image content corresponding to the target pixel group in the first target image.
本申请实施例中,在选择第一像素组中的X个目标像素的过程中,可以根据第一像素组所包含的像素对应的图像内容,对该第一像素组中目标像素的数量、目标像素所处的位置进行选择。在第一像素组所对应的图像内容较为丰富的情况下,为保证确定第一像素组中的光学参数的准确性,则将选择数量较多的目标像素,并且选择图像内容在第一像素组中对应位置的目标像素。 In the embodiment of the present application, in the process of selecting X target pixels in the first pixel group, the number of target pixels in the first pixel group, the target Select the location of the pixel. When the image content corresponding to the first pixel group is relatively rich, in order to ensure the accuracy of determining the optical parameters in the first pixel group, a larger number of target pixels will be selected, and the image content in the first pixel group will be selected. The target pixel at the corresponding position in .
具体来说,电子设备在对第一像素组划分完毕后,电子设备通过图像识别算法,确定目标像素组所对应的图像内容,并基于不同的图像内容,对目标像素组选择不同的目标像素。Specifically, after the electronic device completes dividing the first pixel group, the electronic device determines the image content corresponding to the target pixel group through an image recognition algorithm, and selects different target pixels for the target pixel group based on different image contents.
示例性地,获取目标像素组对应的图像内容,根据目标像素组对应的图像内容的内容量确定目标像素组中的目标像素的数量。For example, the image content corresponding to the target pixel group is obtained, and the number of target pixels in the target pixel group is determined according to the content of the image content corresponding to the target pixel group.
其中,目标像素组对应的图像内容为目标像素组在第一目标图像中的图像区域中目标图像特征,通过对上述图像区域进行图像识别,能够确定该图像区域内的目标图像特征。图像内容的内容量为识别到的目标图像特征在图像区域中的占比,示例性地,图像区域共计N个像素,在图像区域中识别到的目标图像特征共计n个像素,则图像内容量为n/N。The image content corresponding to the target pixel group is the target image feature in the image area of the target pixel group in the first target image. By performing image recognition on the above image area, the target image feature in the image area can be determined. The content of the image content is the proportion of the identified target image features in the image area. For example, the image area has a total of N pixels, and the identified target image features in the image area total n pixels, then the image content is is n/N.
具体来说,在目标像素组对应的图像内容的内容量较大的情况下,则将目标像素组中选取数量较多的目标像素,在目标像素组对应的图像内容的内容量较小的情况下,则将目标像素中选取数量较少的目标数量。Specifically, when the content of the image content corresponding to the target pixel group is large, a larger number of target pixels are selected from the target pixel group. When the content of the image content corresponding to the target pixel group is small, a larger number of target pixels are selected. , a smaller target number will be selected from the target pixels.
示例性地,获取目标像素组对应的图像内容,根据目标像素组对应的图像内容的位置信息,选取目标像素组中的目标像素。For example, the image content corresponding to the target pixel group is obtained, and the target pixel in the target pixel group is selected according to the position information of the image content corresponding to the target pixel group.
其中,图像内容的位置信息为识别到的目标图像特征在图像区域中位置,示例性地,图像区域为M×N的像素矩阵,目标图像特征所处的位置为m×n的像素矩阵,则将m×n的像素矩阵中的像素作为目标像素。Among them, the position information of the image content is the position of the identified target image feature in the image area. For example, the image area is an M×N pixel matrix, and the position of the target image feature is an m×n pixel matrix, then Use the pixels in the m×n pixel matrix as target pixels.
本申请实施例中,通过电子设备根据图像内容自适应选择第一像素组中的目标像素,实现了在降低确定光学参数的计算量的同时,提高了确定得到的该第一像素组的光学参数的准确性。In the embodiment of the present application, the electronic device adaptively selects the target pixel in the first pixel group according to the image content, thereby reducing the calculation amount of determining the optical parameters and improving the determined optical parameters of the first pixel group. accuracy.
在本申请的一些实施例中,将第一目标图像划分为P个第一像素组,包括:获取第一目标图像的第一分辨率;根据第一分辨率,确定每个第一像素组中的预设像素数量;按照预设像素数量,将第一目标图像划分为P个第一像素组。In some embodiments of the present application, dividing the first target image into P first pixel groups includes: obtaining a first resolution of the first target image; and determining, according to the first resolution, the number of pixels in each first pixel group. the preset number of pixels; divide the first target image into P first pixel groups according to the preset number of pixels.
本申请实施例中在将第一目标图像划分为P个第一像素组之前,需要确定第一目标图像的第一分辨率,根据第一分辨率确定第一像素组的预设像素数量,并按照预设像素数量将第一目标图像划分为P个第一像素组,通过上述方式划分得到的第一像素组中的像素数量相等。In the embodiment of the present application, before dividing the first target image into P first pixel groups, it is necessary to determine the first resolution of the first target image, determine the preset number of pixels in the first pixel group according to the first resolution, and The first target image is divided into P first pixel groups according to a preset number of pixels, and the number of pixels in the first pixel groups obtained by dividing in the above manner is equal.
本申请实施例中,电子设备能够根据第一目标图像的分辨率自动确定第一像素组中的像素数量,并根据第一像素组中的像素数量对第一目标图像进行划分,无需用户手动操作即可完成对第一目标图像的划分,并且划分得到的每个第一像素组中的像素数量相等,在划分第一目标图像的过程中,无需对第一目标图像进行图像识别和特征提取,进一步降低了电子设备所需的计算量,简化了电子设备对第一目标图像进行融合处理的过程。In the embodiment of the present application, the electronic device can automatically determine the number of pixels in the first pixel group according to the resolution of the first target image, and divide the first target image according to the number of pixels in the first pixel group without manual operation by the user. The division of the first target image can be completed, and the number of pixels in each first pixel group obtained by division is equal. In the process of dividing the first target image, there is no need to perform image recognition and feature extraction on the first target image. The calculation amount required by the electronic device is further reduced, and the process of the electronic device performing fusion processing on the first target image is simplified.
在本申请的一些实施例中,根据第一分辨率,确定每个第一像素组中的预设像素数 量,包括:在第一分辨率大于预设分辨率的情况下,确定预设像素数量为第一数值;在第一分辨率小于等于预设分辨率的情况下,确定预设像素数量为第二数值;其中,第一数值大于第二数值。In some embodiments of the present application, the preset number of pixels in each first pixel group is determined according to the first resolution. The amount includes: when the first resolution is greater than the preset resolution, determining the preset number of pixels to be the first value; when the first resolution is less than or equal to the preset resolution, determining the preset number of pixels to be the first value. Two values; where the first value is greater than the second value.
本申请实施例中,在第一目标图像的分辨率较高的情况下,则将第一像素组中的像素数量设置较高,在第一目标图像的分辨率较低的情况下,则将第一像素组中的像素数量设置较低。In the embodiment of the present application, when the resolution of the first target image is higher, the number of pixels in the first pixel group is set higher. When the resolution of the first target image is lower, the number of pixels in the first pixel group is set higher. The number of pixels in the first pixel group is set lower.
第一目标图像的分辨率越大,第一目标图像中相邻的像素之间的关联性越大,则将第一像素组中的像素数量设置较多,能够保证在不影响确定第一像素组的光学参数的准确性的同时,降低电子设备的计算量。第一目标图像的分辨率越低,第一目标图像中相邻的像素之间的关联性越小,为保证第一像素组的光学参数的准确性,则将第一像素组中的像素数量设置较少。The greater the resolution of the first target image and the greater the correlation between adjacent pixels in the first target image, then setting a larger number of pixels in the first pixel group can ensure that the determination of the first pixel is not affected. While improving the accuracy of the set of optical parameters, it also reduces the calculation amount of electronic equipment. The lower the resolution of the first target image, the smaller the correlation between adjacent pixels in the first target image. In order to ensure the accuracy of the optical parameters of the first pixel group, the number of pixels in the first pixel group is Fewer settings.
图6示出了本申请实施例提供的第一目标图像中第一像素组的示意图之一,如图6所示,在第一目标图像600的分辨率较高的情况下,可选择将第一目标图像600中的第一像素组602的预设像素数量设置为9个,排列方式为3×3。Figure 6 shows one of the schematic diagrams of the first pixel group in the first target image provided by the embodiment of the present application. As shown in Figure 6, when the resolution of the first target image 600 is relatively high, you can choose to The default number of pixels in the first pixel group 602 in a target image 600 is set to 9, and the arrangement is 3×3.
本申请实施例中,电子设备能够根据预设分辨率与第一目标图像的第一分辨率的比较结果,对第一像素组选择不同的预设像素数量,保证了第一分辨率较高的情况下,能够使第一像素组中的像素数量较多,第一分辨率较低的情况下,能够使第一像素组中的像素数量较少,实现了电子设备能够自动设置第一像素组的像素数量,并根据设置的像素数量对第一目标图像进行划分。In the embodiment of the present application, the electronic device can select a different preset number of pixels for the first pixel group based on the comparison result between the preset resolution and the first resolution of the first target image, ensuring that the first resolution is higher. In this case, the number of pixels in the first pixel group can be larger. When the first resolution is lower, the number of pixels in the first pixel group can be smaller. This enables the electronic device to automatically set the first pixel group. the number of pixels, and divide the first target image according to the set number of pixels.
在本申请的一些实施例中,将第一目标图像划分为P个第一像素组,包括:识别第一目标图像的图像内容;根据图像内容,第一目标图像划分为P个第一像素组;其中,P个第一像素组中包括像素数量不同的像素组。In some embodiments of the present application, dividing the first target image into P first pixel groups includes: identifying the image content of the first target image; dividing the first target image into P first pixel groups according to the image content ; Among them, the P first pixel groups include pixel groups with different numbers of pixels.
本申请实施例中,电子设备在对第一目标图像划分第一像素组的过程中,能够根据识别到的图像内容,自适应对第一目标图像进行划分。In the embodiment of the present application, in the process of dividing the first target image into the first pixel group, the electronic device can adaptively divide the first target image according to the recognized image content.
具体来说,在采集得到第一目标图像之后,电子设备通过图像识别的方式确定第一目标图像中的图像内容,根据识别得到的图像内容对第一目标图像进行划分,使第一目标图像中图像内容较多的区域的第一像素组的数量较少,第一目标图像中图像内容较少的区域的第一像素组的数量较多。Specifically, after acquiring the first target image, the electronic device determines the image content in the first target image through image recognition, and divides the first target image according to the recognized image content, so that the first target image is The number of the first pixel group in the area with more image content is smaller, and the number of the first pixel group in the area with less image content in the first target image is larger.
需要说明的是,图像内容为第一目标图像中的目标图像特征,通过对第一目标图像进行图像识别,能够确定该图像区域内的目标图像特征。图像内容较多的区域为目标图像特征在第一目标图像中所处的区域,图像内容较多的区域可以作为第一目标图像中的主体区域,第一目标图像中目标图像特征所处区域以外的区域为图像内容较少的区域,图像内容较少的区域可以作为第一目标图像中的背景区域。图7示出了本申请实施例提供的第一目标图像中第一像素组的示意图之二,如图7所示,在第一目标图像700的第一区域702为第一目标图像700的背景区域,第一目标图像700的第二区域704中显示 有拍摄对象706。电子设备将位于第一区域702的第一像素组708设置为5×5的像素组,并将位于第二区域704的第一像素组708设置为2×2的像素组。It should be noted that the image content is the target image feature in the first target image, and by performing image recognition on the first target image, the target image feature in the image area can be determined. The area with more image content is the area where the target image feature is located in the first target image. The area with more image content can be used as the main body area in the first target image. The area in the first target image is outside the area where the target image feature is located. The area of is an area with less image content, and the area with less image content can be used as the background area in the first target image. Figure 7 shows the second schematic diagram of the first pixel group in the first target image provided by the embodiment of the present application. As shown in Figure 7, the first area 702 of the first target image 700 is the background of the first target image 700. area, displayed in the second area 704 of the first target image 700 There are subjects 706. The electronic device sets the first pixel group 708 located in the first area 702 as a 5×5 pixel group, and sets the first pixel group 708 located in the second area 704 as a 2×2 pixel group.
本申请实施例中,电子设备能够通过图像识别的方式识别到第一目标图像中的图像内容较多的主体区域,以及图像内容较少的背景区域,对主体区域中的第一像素组设置较少的像素数量,从而保证位于拍摄主体区域的第一像素组融合后不会丢失图像内容,对背景区域的第一像素组设置较多的像素数量,进一步减少电子设备的计算量。In the embodiment of the present application, the electronic device can identify the main body area with more image content in the first target image and the background area with less image content through image recognition, and set the first pixel group in the main body area with relatively small content. A small number of pixels ensures that the first pixel group located in the subject area will not lose image content after fusion, and a larger number of pixels is set for the first pixel group in the background area to further reduce the calculation amount of the electronic device.
在本申请的一些实施例中,光学参数包括以下任一项:光通量值、光电子数量。In some embodiments of the present application, the optical parameters include any of the following: luminous flux value, number of photoelectrons.
本申请实施例中,光学参数可选为光通量值和光电子数量。在检测到光通量值发生突变,或光电子数量发生突变的情况下,将突变的时刻作为光学参数变化的第一时刻。In the embodiment of this application, the optical parameters can be selected from the luminous flux value and the number of photoelectrons. When a sudden change in the luminous flux value or a sudden change in the number of photoelectrons is detected, the moment of the sudden change is regarded as the first moment when the optical parameters change.
光电子数量为第一像素组中处于点亮状态的像素的数量,光电子数量能够通过传感器直接进行采集,光通量值能够通过计算得到。The number of photoelectrons is the number of pixels in the lit state in the first pixel group. The number of photoelectrons can be directly collected by the sensor, and the luminous flux value can be obtained by calculation.
光通量值的计算方式如公式(1)所示:
The calculation method of luminous flux value is as shown in formula (1):
其中,为光通量值,Npf为第一图像的数量,Tpf为单次曝光的采集时间,ti为像素接收到光子的时刻,q是传感器的光子探测效率。in, is the luminous flux value, N pf is the number of the first image, T pf is the acquisition time of a single exposure, ti is the moment when the pixel receives photons, and q is the photon detection efficiency of the sensor.
本申请实施例中,将光学参数设置为光通量值和光电子数中的任一项,保证了对光学参数突变的第一时刻判断的准确性,还简化了获取光学参数的步骤。In the embodiments of the present application, the optical parameters are set to either the luminous flux value or the number of photoelectrons, which ensures the accuracy of the first moment judgment of optical parameter mutation and simplifies the steps of obtaining the optical parameters.
需要说明的是,光学参数不限于上述光通量值和光电子数量,还可以为其他光学参数,在此不做具体限定。It should be noted that the optical parameters are not limited to the above-mentioned luminous flux value and the number of photoelectrons, and can also be other optical parameters, which are not specifically limited here.
在本申请的一些实施例中,根据目标像素组的光学参数,确定N帧第一图像中的至少一帧第二目标图像,包括:获取采集时刻相邻的第三目标图像中的第三像素组的光学参数变化量,第三目标图像为N帧第一图像中除第一目标图像外的其他图像,第三像素组在第三目标图像中的位置与第一像素组在第一目标图像中的位置相对应;将光学参数变化量大于预设变化量的采集时刻,确定为目标时刻;根据目标时刻,确定N帧第一图像中的至少一帧第二目标图像,第二目标图像的采集时刻在第一目标图像的采集时刻与目标时刻之间。In some embodiments of the present application, determining at least one frame of the second target image among the N frames of first images according to the optical parameters of the target pixel group includes: acquiring the third pixel in the third target image adjacent to the acquisition time The optical parameter change amount of the group, the third target image is the other images in the N frames of the first image except the first target image, the position of the third pixel group in the third target image is the same as the position of the first pixel group in the first target image corresponding to the position in; determine the acquisition time when the change amount of the optical parameter is greater than the preset change amount as the target time; determine at least one frame of the second target image in the N frames of the first image according to the target time, and the second target image of the second target image. The acquisition time is between the acquisition time of the first target image and the target time.
本申请实施例中,在拍摄得到N帧第一图像之后,记录每帧第一图像的采集时刻。将N帧第一图像中除第一目标图像之外的图像均作为第三目标图像。按照采集时刻对第三目标图像进行排序,并根据第一目标图像中的目标像素组的位置,每帧第三目标图像中的第三像素组。根据每相邻的两个第三目标图像中的第三像素组的光学参数进行差值计算,以得到与该采集时刻相对应的光学参数变化量。在确定该光学参数变化量大于预设变化量的情况下,将该光学参数变化量作为目标时刻。该目标时刻为采集多帧第一图像过程中,第三像素组的光学参数突变时刻。In the embodiment of the present application, after N frames of first images are captured, the acquisition time of each frame of the first image is recorded. All images in the N frames of first images except the first target image are used as third target images. The third target images are sorted according to the acquisition time, and the third pixel group in the third target image in each frame is determined according to the position of the target pixel group in the first target image. Difference calculation is performed based on the optical parameters of the third pixel group in each adjacent two third target images to obtain the change amount of the optical parameter corresponding to the acquisition time. If it is determined that the change amount of the optical parameter is greater than the preset change amount, the change amount of the optical parameter is used as the target time. The target moment is the moment when the optical parameters of the third pixel group suddenly change during the process of collecting the first image of multiple frames.
在第一目标图像的采集时刻在目标时刻之前,则将采集时刻在第一目标图像的采集 时刻之后,以及目标时刻之前的第三目标图像确定为第二目标图像。When the acquisition time of the first target image is before the target time, the acquisition time will be at the acquisition time of the first target image. The third target image after the time and before the target time is determined as the second target image.
示例性地,在采集N帧第一图像的过程中,可以将采集时刻最早的第一图像作为第一目标图像,后续采集到的第一图像均作为第三目标图像。故在采集N帧第一图像的过程中,能够对目标时刻进行确定,即每采集一帧第三目标图像,均将其中的第三像素组与前一采集时刻的第三目标图像中的第三像素组进行光学参数变化量的计算,以及与预设变化量的比较,从而实现了在拍摄过程中就能够确定目标时刻,并基于目标时刻确定第二目标图像,进一步提高了确定能够与目标像素组融合的第二像素组的效率,从而提高了图像融合的整体效率。For example, in the process of collecting N frames of first images, the first image with the earliest acquisition time can be used as the first target image, and the first images collected subsequently can be used as the third target image. Therefore, in the process of collecting N frames of the first image, the target time can be determined, that is, every time a frame of the third target image is collected, the third pixel group in it is compared with the third pixel group in the third target image at the previous collection time. The three-pixel group calculates the change amount of the optical parameters and compares it with the preset change amount, so that the target moment can be determined during the shooting process, and the second target image is determined based on the target moment, further improving the ability to determine the target. The efficiency of the pixel group fusion of the second pixel group thereby improves the overall efficiency of image fusion.
在第一目标图像的采集时刻在目标时刻之后,则将采集时刻在目标图像之后,以及第一目标图像的采集时刻之前的第三目标图像确定为第二目标图像。If the collection time of the first target image is after the target time, then the third target image whose collection time is after the target image and before the collection time of the first target image is determined as the second target image.
需要说明的是,目标时刻为采集N帧第一图像过程中,第三像素组的光学参数发生突变的时刻。在第一目标图像的采集时刻在目标时刻之前,为了保证第一目标图像中的目标像素组能够与光学参数相匹配的第二像素组进行图像融合,则将光学参数发生突变之前的图像确定为第二目标图像。在第一目标图像的采集时刻在目标时刻之后,为了保证第一目标图像中的目标像素组能够与光学参数相匹配的第二像素组进行图像融合,则将光学参数发生突变之后的图像确定为第二目标图像。It should be noted that the target time is the time when the optical parameters of the third pixel group suddenly change during the acquisition of N frames of the first image. When the acquisition time of the first target image is before the target time, in order to ensure that the target pixel group in the first target image can be image fused with the second pixel group that matches the optical parameters, the image before the optical parameters change is determined as Second target image. When the acquisition time of the first target image is after the target time, in order to ensure that the target pixel group in the first target image can be image fused with the second pixel group that matches the optical parameters, the image after the optical parameter changes is determined as Second target image.
本申请实施例中,计算采集时刻相邻的第三目标像素组的光学参数的差值,能够确定该采集时刻对应的光学参数变化量,通过获取每相邻的两个第三目标图像中的第三像素组的光学参数变化量,能够得到每个采集时刻对应的光学参数变化量。在光学参数变化量超过预设变化量的情况下,则确定该采集时刻发生了光学变化量的突变,该目标时刻与第一目标图像的采集时刻之间所采集到的第三目标图像中的第三像素组均与目标像素组匹配,故将该目标时刻与第一目标图像的采集时刻之间的全部第一图像作为第二目标图像,保证了根据第二目标图像中的第二像素组与目标像素组进行融合后的图像中该目标像素组的图像区域不会出现模糊的问题。In the embodiment of the present application, the difference in optical parameters of the adjacent third target pixel group at the acquisition time is calculated, and the change amount of the optical parameter corresponding to the acquisition time can be determined. The optical parameter change amount of the third pixel group can be used to obtain the optical parameter change amount corresponding to each collection time. When the change amount of the optical parameter exceeds the preset change amount, it is determined that a sudden change in the optical change amount occurs at the acquisition time, and the third target image collected between the target time and the acquisition time of the first target image is The third pixel group all matches the target pixel group, so all the first images between the target time and the collection time of the first target image are used as the second target image, ensuring that according to the second pixel group in the second target image In the image that is fused with the target pixel group, the image area of the target pixel group will not be blurred.
在本申请的一些实施例中,将目标像素组与所述第二像素组进行融合处理之后,包括:根据多个第三像素组生成第四目标图像,第三像素组为目标像素组与第二像素组融合得到的像素组,第三像素组的数量与第一像素组的数量相同。本申请实施例中,将每个第一像素组均确定为目标像素组,则获取每个目标像素组对应的第二目标图像。将相对应的目标像素组与第二目标图像中相应的第二像素组进行融合,得到第三像素组。重复对每个目标像素组执行融合步骤,得到多个第三像素组,通过将多个第三像素组按照相应的第一像素组在第一目标图像中的位置进行拼接,生成第四目标图像。In some embodiments of the present application, after fusing the target pixel group and the second pixel group, the method includes: generating a fourth target image based on a plurality of third pixel groups, where the third pixel group is the target pixel group and the third pixel group. In the pixel group obtained by merging two pixel groups, the number of the third pixel group is the same as the number of the first pixel group. In the embodiment of the present application, each first pixel group is determined as a target pixel group, and then a second target image corresponding to each target pixel group is obtained. The corresponding target pixel group is fused with the corresponding second pixel group in the second target image to obtain a third pixel group. Repeat the fusion step for each target pixel group to obtain multiple third pixel groups, and generate a fourth target image by splicing the multiple third pixel groups according to the position of the corresponding first pixel group in the first target image. .
本申请实施例中,电子设备通过将像素组作为融合处理的单位,能够保证了对第一目标图像中每个部分均进行针对性的融合处理,避免融合处理后得到的第四目标图像中存在部分不清晰的区域,并且无需对每个像素进行单独处理,减少了电子设备的计算量,提高了出图效率。 In the embodiment of the present application, the electronic device uses the pixel group as the unit of fusion processing to ensure that each part of the first target image is fused in a targeted manner and avoids the existence of pixels in the fourth target image obtained after the fusion process. Partially unclear areas, and there is no need to process each pixel individually, which reduces the calculation amount of electronic equipment and improves the efficiency of drawing.
本申请实施例提供的图像融合方法,执行主体可以为图像融合装置。本申请实施例中以图像融合装置执行图像融合方法为例,说明本申请实施例提供的图像融合装置。For the image fusion method provided by the embodiments of the present application, the execution subject may be an image fusion device. In the embodiment of the present application, the image fusion device performing the image fusion method is taken as an example to illustrate the image fusion device provided by the embodiment of the present application.
在本申请的一些实施例中,提供了一种图像融合装置。图8示出了本申请实施例提供的图像融合装置800的示意框图,如图8所示,图像融合装置800包括:In some embodiments of the present application, an image fusion device is provided. Figure 8 shows a schematic block diagram of the image fusion device 800 provided by the embodiment of the present application. As shown in Figure 8, the image fusion device 800 includes:
采集模块802,用于采集N帧第一图像,每帧第一图像均包括M个像素,N和M均为正整数;The collection module 802 is used to collect N frames of first images. Each frame of the first image includes M pixels, and N and M are both positive integers;
分组模块804,用于将第一目标图像划分为P个第一像素组,第一目标图像为N帧第一图像中的任一图像,P为正整数;The grouping module 804 is used to divide the first target image into P first pixel groups, where the first target image is any image in the N frames of first images, and P is a positive integer;
获取模块806,用于获取P个第一像素组中目标像素组的光学参数,目标像素组为P个第一像素组中任一像素组;The acquisition module 806 is used to acquire the optical parameters of the target pixel group in the P first pixel groups, and the target pixel group is any pixel group in the P first pixel groups;
确定模块808,用于根据目标像素组的光学参数,确定N帧第一图像中的至少一帧第二目标图像,第二目标图像中包括与目标像素组的光学参数相匹配的第二像素组,第二目标图像为N帧第一图像中的图像,目标像素组包括Q个像素;Determining module 808, configured to determine at least one frame of the second target image among the N frames of first images according to the optical parameters of the target pixel group, and the second target image includes a second pixel group that matches the optical parameters of the target pixel group. , the second target image is an image in the N-frame first image, and the target pixel group includes Q pixels;
融合模块810,用于将目标像素组与第二像素组进行融合处理,目标像素组在第一目标图像中的位置与第二像素组在第二目标图像的位置相对应。The fusion module 810 is configured to perform fusion processing on the target pixel group and the second pixel group. The position of the target pixel group in the first target image corresponds to the position of the second pixel group in the second target image.
本申请实施例中,在电子设备拍摄处于运动状态下的拍摄对象时,采集多帧包括该拍摄对象的第一图像,将N帧第一图像中的第一目标图像划分为多个第一像素组,并获取多个第一像素组中的目标像素组,通过该目标像素组的光学参数,能够查找到能够与目标像素组进行融合处理的第二目标图像中的第二像素组,由于该第二像素组是根据目标像素组的光学参数查找到的像素组,故能够保证进行融合的第二像素组和目标像素组之间的光学参数相匹配。在对每个目标像素组与相应的第二像素融合之后进行拼接,能够得到消除运动模糊的图像。本申请实施例中将像素组作为图像融合的单位,使每个目标像素组均与相匹配的第二像素组进行融合,能够避免融合得到的图像中存在由于部分像素经过与光学参数不匹配的其他像素融合产生的模糊的问题,提高了最终合成的图像的清晰度。In the embodiment of the present application, when the electronic device captures a subject in motion, multiple frames including the first image of the subject are collected, and the first target image in the N frames of first images is divided into a plurality of first pixels. group, and obtain a target pixel group in a plurality of first pixel groups. Through the optical parameters of the target pixel group, a second pixel group in the second target image that can be fused with the target pixel group can be found. Since the The second pixel group is a pixel group found based on the optical parameters of the target pixel group, so it can be ensured that the optical parameters between the second pixel group for fusion and the target pixel group match. After fusing each target pixel group with the corresponding second pixel and then splicing it, an image with motion blur eliminated can be obtained. In the embodiment of the present application, the pixel group is used as the unit of image fusion, so that each target pixel group is fused with the matching second pixel group, which can avoid the existence of pixels in the fused image due to mismatch between some pixels and the optical parameters. The blur caused by other pixel fusion improves the clarity of the final composite image.
本申请实施例将像素组作为图像融合的单位,仅计算像素组整体的光学参数即可,无需将像素组中每个像素单独进行融合。由于目标像素组中的像素的关联性较强,故以像素组作为图像融合的单位,能够在降低电子设备计算量的同时,保证图像融合处理的精度。实现了在保证融合后的图像的清晰度的同时,还降低了图像融合所需的数据处理量。In the embodiment of the present application, the pixel group is used as the unit of image fusion, and only the optical parameters of the entire pixel group are calculated, without the need to fuse each pixel in the pixel group separately. Since the correlation between pixels in the target pixel group is strong, using the pixel group as the unit of image fusion can reduce the calculation amount of electronic equipment while ensuring the accuracy of image fusion processing. This method ensures the clarity of the fused image while also reducing the amount of data processing required for image fusion.
在本申请的一些实施例中,确定模块808,还用于确定目标像素组中的X个目标像素,X为正整数,X≤Q;In some embodiments of the present application, the determination module 808 is also used to determine X target pixels in the target pixel group, where X is a positive integer and X≤Q;
确定模块808,还用于X个目标像素的光学参数,确定目标像素组的光学参数。The determination module 808 is also used to determine the optical parameters of the X target pixels and determine the optical parameters of the target pixel group.
本申请实施例中,在将第一图像划分为多个目标像素组之后,通过将目标像素组中的部分像素作为目标像素,并根据目标像素确定相应的目标像素组的光学参数,实现了 无需计算目标像素组中全部像素的光学参数,减少了确定目标像素组对应的光学参数的计算量。In the embodiment of the present application, after dividing the first image into multiple target pixel groups, some pixels in the target pixel group are used as target pixels, and the optical parameters of the corresponding target pixel group are determined according to the target pixels, thereby achieving There is no need to calculate the optical parameters of all pixels in the target pixel group, which reduces the amount of calculation required to determine the optical parameters corresponding to the target pixel group.
在本申请的一些实施例中,确定模块808,还用于根据目标像素组在第一目标图像中对应的图像内容,确定目标像素组中的X个目标像素。In some embodiments of the present application, the determination module 808 is also used to determine X target pixels in the target pixel group according to the image content corresponding to the target pixel group in the first target image.
本申请实施例中,通过电子设备根据图像内容自适应选择第一像素组中的目标像素,实现了在降低确定光学参数的计算量的同时,提高了确定得到的该第一像素组的光学参数的准确性。In the embodiment of the present application, the electronic device adaptively selects the target pixel in the first pixel group according to the image content, thereby reducing the calculation amount of determining the optical parameters and improving the determined optical parameters of the first pixel group. accuracy.
在本申请的一些实施例中,获取模块806,还用于获取第一目标图像的第一分辨率;In some embodiments of the present application, the acquisition module 806 is also used to acquire the first resolution of the first target image;
确定模块808,还用于根据第一分辨率,确定每个第一像素组中的预设像素数量;The determination module 808 is also used to determine the preset number of pixels in each first pixel group according to the first resolution;
分组模块804,还用于按照预设像素数量,将第一目标图像划分为P个第一像素组。The grouping module 804 is also used to divide the first target image into P first pixel groups according to the preset number of pixels.
本申请实施例中,电子设备能够根据第一目标图像的分辨率自动确定第一像素组中的像素数量,并根据第一像素组中的像素数量对第一目标图像进行划分,无需用户手动操作即可完成对第一目标图像的划分,并且划分得到的每个第一像素组中的像素数量相等,在划分第一目标图像的过程中,无需对第一目标图像进行图像识别和特征提取,进一步降低了电子设备所需的计算量,简化了电子设备对第一目标图像进行融合处理的过程。In the embodiment of the present application, the electronic device can automatically determine the number of pixels in the first pixel group according to the resolution of the first target image, and divide the first target image according to the number of pixels in the first pixel group without manual operation by the user. The division of the first target image can be completed, and the number of pixels in each first pixel group obtained by division is equal. In the process of dividing the first target image, there is no need to perform image recognition and feature extraction on the first target image. The calculation amount required by the electronic device is further reduced, and the process of the electronic device performing fusion processing on the first target image is simplified.
在本申请的一些实施例中,确定模块808,还用于在第一分辨率大于预设分辨率的情况下,确定预设像素数量为第一数值;In some embodiments of the present application, the determination module 808 is also used to determine the preset number of pixels to be a first value when the first resolution is greater than the preset resolution;
确定模块808,还用于在第一分辨率小于等于预设分辨率的情况下,确定预设像素数量为第二数值;The determination module 808 is also configured to determine the preset number of pixels to be a second value when the first resolution is less than or equal to the preset resolution;
其中,第一数值大于第二数值。Wherein, the first numerical value is greater than the second numerical value.
本申请实施例中,电子设备能够根据预设分辨率与第一目标图像的第一分辨率的比较结果,对第一像素组选择不同的预设像素数量,保证了第一分辨率较高的情况下,能够使第一像素组中的像素数量较多,第一分辨率较低的情况下,能够使第一像素组中的像素数量较少,实现了电子设备能够自动设置第一像素组的像素数量,并根据设置的像素数量对第一目标图像进行划分。In the embodiment of the present application, the electronic device can select a different preset number of pixels for the first pixel group based on the comparison result between the preset resolution and the first resolution of the first target image, ensuring that the first resolution is higher. In this case, the number of pixels in the first pixel group can be larger. When the first resolution is lower, the number of pixels in the first pixel group can be smaller. This enables the electronic device to automatically set the first pixel group. the number of pixels, and divide the first target image according to the set number of pixels.
在本申请的一些实施例中,图像融合装置800,还包括:In some embodiments of the present application, the image fusion device 800 further includes:
识别模块,用于识别第一目标图像的图像内容;a recognition module, used to recognize the image content of the first target image;
分组模块804,还用于根据图像内容,将第一目标图像划分为P个第一像素组;The grouping module 804 is also used to divide the first target image into P first pixel groups according to the image content;
其中,P个第一像素组中包括像素数量不同的像素组。The P first pixel groups include pixel groups with different numbers of pixels.
本申请实施例中,电子设备能够通过图像识别的方式识别到第一目标图像中的图像内容较多的主体区域,以及图像内容较少的背景区域,对主体区域中的第一像素组设置较少的像素数量,从而保证位于拍摄主体区域的第一像素组融合后不会丢失图像内容,对背景区域的第一像素组设置较多的像素数量,进一步减少电子设备的计算量。In the embodiment of the present application, the electronic device can identify the main body area with more image content in the first target image and the background area with less image content through image recognition, and set the first pixel group in the main body area with relatively small content. A small number of pixels ensures that the first pixel group located in the subject area will not lose image content after fusion, and a larger number of pixels is set for the first pixel group in the background area to further reduce the calculation amount of the electronic device.
在本申请的一些实施例中,光学参数包括以下任一项:光通量值、光电子数量。 In some embodiments of the present application, the optical parameters include any of the following: luminous flux value, number of photoelectrons.
本申请实施例中,将光学参数设置为光通量值和光电子数中的任一项,保证了对光学参数突变的第一时刻判断的准确性,还简化了获取光学参数的步骤。In the embodiments of the present application, the optical parameters are set to either the luminous flux value or the number of photoelectrons, which ensures the accuracy of the first moment judgment of optical parameter mutation and simplifies the steps of obtaining the optical parameters.
在本申请的一些实施例中,获取模块806,用于获取采集时刻相邻的第三目标图像中的第三像素组的光学参数变化量,第三目标图像为N帧第一图像中除第一目标图像外的其他图像,第三像素组在第三目标图像中的位置与第一像素组在第一目标图像中的位置相对应;确定模块808,用于将光学参数变化量大于预设变化量的采集时刻,确定为目标时刻;确定模块808,用于根据目标时刻,确定N帧第一图像中的至少一帧第二目标图像,第二目标图像的采集时刻在第一目标图像的采集时刻与目标时刻之间。In some embodiments of the present application, the acquisition module 806 is used to acquire the optical parameter change amount of the third pixel group in the third target image adjacent to the acquisition time. The third target image is the Nth frame of the first image except the In other images other than a target image, the position of the third pixel group in the third target image corresponds to the position of the first pixel group in the first target image; the determination module 808 is used to set the optical parameter change amount to be greater than the preset The collection time of the change amount is determined as the target time; the determination module 808 is used to determine at least one frame of the second target image among the N frames of the first image according to the target time, and the collection time of the second target image is at the time of the first target image. between the acquisition time and the target time.
本申请实施例中,计算采集时刻相邻的第三目标像素组的光学参数的差值,能够确定该采集时刻对应的光学参数变化量,通过获取每相邻的两个第三目标图像中的第三像素组的光学参数变化量,能够得到每个采集时刻对应的光学参数变化量。在光学参数变化量超过预设变化量的情况下,则确定该采集时刻发生了光学变化量的突变,该目标时刻与第一目标图像的采集时刻之间所采集到的第三目标图像中的第三像素组均与目标像素组匹配,故将该目标时刻与第一目标图像的采集时刻之间的全部第一图像作为第二目标图像,保证了根据第二目标图像中的第二像素组与目标像素组进行融合后的图像中该目标像素组的图像区域不会出现模糊的问题。In the embodiment of the present application, the difference in optical parameters of the adjacent third target pixel group at the acquisition time is calculated, and the change amount of the optical parameter corresponding to the acquisition time can be determined. The optical parameter change amount of the third pixel group can be used to obtain the optical parameter change amount corresponding to each collection time. When the change amount of the optical parameter exceeds the preset change amount, it is determined that a sudden change in the optical change amount occurs at the acquisition time, and the third target image collected between the target time and the acquisition time of the first target image is The third pixel group all matches the target pixel group, so all the first images between the target time and the collection time of the first target image are used as the second target image, ensuring that according to the second pixel group in the second target image In the image that is fused with the target pixel group, the image area of the target pixel group will not be blurred.
在本申请的一些实施例中,图像融合装置800,还包括:In some embodiments of the present application, the image fusion device 800 further includes:
生成模块,用于根据多个第三像素组生成第四目标图像,第三像素组为目标像素组与第二像素组融合得到的像素组,第三像素组的数量与第一像素组的数量相同。A generation module configured to generate a fourth target image based on a plurality of third pixel groups. The third pixel group is a pixel group obtained by merging the target pixel group and the second pixel group. The number of the third pixel group is equal to the number of the first pixel group. same.
本申请实施例中,电子设备通过将像素组作为融合处理的单位,能够保证了对第一目标图像中每个部分均进行针对性的融合处理,避免融合处理后得到的第四目标图像中存在部分不清晰的区域,并且无需对每个像素进行单独处理,减少了电子设备的计算量,提高了出图效率。In the embodiment of the present application, the electronic device uses the pixel group as the unit of fusion processing to ensure that each part of the first target image is fused in a targeted manner and avoids the existence of pixels in the fourth target image obtained after the fusion process. Partially unclear areas, and there is no need to process each pixel individually, which reduces the calculation amount of electronic equipment and improves the efficiency of drawing.
本申请实施例中的图像融合装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性地,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The image fusion device in the embodiment of the present application may be an electronic device or a component in the electronic device, such as an integrated circuit or chip. The electronic device may be a terminal or other devices other than the terminal. Illustratively, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or augmented reality (AR)/virtual reality (VR). ) equipment, robots, wearable devices, ultra-mobile personal computers (UMPC), netbooks or personal digital assistants (personal digital assistants, PDA), etc., and can also be servers, network attached storage (Network Attached Storage), NAS), personal computer (PC), television (TV), teller machine or self-service machine, etc., the embodiments of this application are not specifically limited.
本申请实施例中的图像融合装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。 The image fusion device in the embodiment of the present application may be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
本申请实施例提供的图像融合装置能够实现上述方法实施例实现的各个过程,为避免重复,这里不再赘述。The image fusion device provided by the embodiments of the present application can implement various processes implemented by the above method embodiments. To avoid duplication, they will not be described again here.
可选地,本申请实施例还提供了一种电子设备,其中包括如上述任一实施例中的图像融合装置,因而具有任一实施例中的图像融合装置的全部有益效果,在此不再做过多赘述。Optionally, the embodiment of the present application also provides an electronic device, which includes the image fusion device as in any of the above embodiments, and thus has all the beneficial effects of the image fusion device in any embodiment, which will not be discussed here. Too much elaboration.
可选地,本申请实施例还提供一种电子设备,图9示出了根据本申请实施例的电子设备的结构框图,如图9所示,电子设备900包括处理器902,存储器904,存储在存储器904上并可在处理器902上运行的程序或指令,该程序或指令被处理器902执行时实现上述图像融合方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, the embodiment of the present application also provides an electronic device. Figure 9 shows a structural block diagram of the electronic device according to the embodiment of the present application. As shown in Figure 9, the electronic device 900 includes a processor 902, a memory 904, and a storage device 900. A program or instruction on the memory 904 that can be run on the processor 902. When the program or instruction is executed by the processor 902, it implements each process of the above image fusion method embodiment and can achieve the same technical effect. To avoid duplication, I won’t go into details here.
需要说明的是,本申请实施例中的电子设备包括上述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
图10为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 10 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
该电子设备1000包括但不限于:射频单元1001、网络模块1002、音频输出单元1003、输入单元1004、传感器1005、显示单元1006、用户输入单元1007、接口单元1008、存储器1009以及处理器1010等部件。The electronic device 1000 includes but is not limited to: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, processor 1010 and other components. .
本领域技术人员可以理解,电子设备1000还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1010逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图10中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 1000 may also include a power supply (such as a battery) that supplies power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions. The structure of the electronic device shown in Figure 10 does not constitute a limitation of the electronic device. The electronic device may include more or less components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
其中,处理器1010,用于采集N帧第一图像,每帧第一图像均包括M个像素,N和M均为正整数;Among them, the processor 1010 is used to collect N frames of first images, each frame of the first image includes M pixels, and N and M are both positive integers;
处理器1010,用于将第一目标图像划分为P个第一像素组,第一目标图像为N帧第一图像中的任一图像,P为正整数;The processor 1010 is configured to divide the first target image into P first pixel groups, where the first target image is any image in the N frames of first images, and P is a positive integer;
处理器1010,用于获取P个第一像素组中目标像素组的光学参数,目标像素组为P个第一像素组中任一像素组;Processor 1010, configured to obtain optical parameters of a target pixel group in the P first pixel groups, where the target pixel group is any pixel group in the P first pixel groups;
处理器1010,用于根据目标像素组的光学参数,确定N帧第一图像中的至少一帧第二目标图像,第二目标图像中包括与目标像素组的光学参数相匹配的第二像素组,第二目标图像为N帧第一图像中的图像,目标像素组包括Q个像素;Processor 1010, configured to determine at least one frame of the second target image among the N frames of first images according to the optical parameters of the target pixel group, and the second target image includes a second pixel group that matches the optical parameters of the target pixel group. , the second target image is an image in the N-frame first image, and the target pixel group includes Q pixels;
处理器1010,用于将目标像素组与第二像素组进行融合处理,目标像素组在第一目标图像中的位置与第二像素组在第二目标图像的位置相对应。The processor 1010 is configured to perform fusion processing on a target pixel group and a second pixel group, where the position of the target pixel group in the first target image corresponds to the position of the second pixel group in the second target image.
本申请实施例中,在电子设备拍摄处于运动状态下的拍摄对象时,采集多帧包括该拍摄对象的第一图像,将N帧第一图像中的第一目标图像划分为多个第一像素组,并获取多个第一像素组中的目标像素组,通过该目标像素组的光学参数,能够查找到能够与 目标像素组进行融合处理的第二目标图像中的第二像素组,由于该第二像素组是根据目标像素组的光学参数查找到的像素组,故能够保证进行融合的第二像素组和目标像素组之间的光学参数相匹配。在对每个目标像素组与相应的第二像素融合之后进行拼接,能够得到消除运动模糊的图像。本申请实施例中将像素组作为图像融合的单位,使每个目标像素组均与相匹配的第二像素组进行融合,能够避免融合得到的图像中存在由于部分像素经过与光学参数不匹配的其他像素融合产生的模糊的问题,减少了图像中的运动模糊,提高了拍摄运动对象的图像清晰度。In the embodiment of the present application, when the electronic device captures a subject in motion, multiple frames including the first image of the subject are collected, and the first target image in the N frames of first images is divided into a plurality of first pixels. group, and obtain a target pixel group in a plurality of first pixel groups. Through the optical parameters of the target pixel group, it is possible to find the The target pixel group is the second pixel group in the second target image for fusion processing. Since the second pixel group is a pixel group found according to the optical parameters of the target pixel group, it can ensure that the second pixel group and the target pixel group are fused. Optical parameters are matched between pixel groups. After fusing each target pixel group with the corresponding second pixel and then splicing it, an image with motion blur eliminated can be obtained. In the embodiment of the present application, the pixel group is used as the unit of image fusion, so that each target pixel group is fused with the matching second pixel group, which can avoid the existence of pixels in the fused image due to mismatch between some pixels and the optical parameters. The blur problem caused by other pixel fusion reduces the motion blur in the image and improves the image clarity of shooting moving objects.
本申请实施例将像素组作为图像融合的单位,仅计算像素组整体的光学参数即可,无需将像素组中每个像素单独进行融合。由于目标像素组中的像素的关联性较强,故以像素组作为图像融合的单位,能够在降低电子设备计算量的同时,保证图像融合处理的精度。实现了在保证融合后的图像的清晰度的同时,还降低了图像融合所需的数据处理量。In the embodiment of the present application, the pixel group is used as the unit of image fusion, and only the optical parameters of the entire pixel group are calculated, without the need to fuse each pixel in the pixel group separately. Since the correlation between pixels in the target pixel group is strong, using the pixel group as the unit of image fusion can reduce the calculation amount of electronic equipment while ensuring the accuracy of image fusion processing. This method ensures the clarity of the fused image while also reducing the amount of data processing required for image fusion.
进一步地,处理器1010,用于确定目标像素组中的X个目标像素,X为正整数,X≤Q;Further, the processor 1010 is used to determine X target pixels in the target pixel group, X is a positive integer, and X≤Q;
处理器1010,用于X个目标像素的光学参数,确定目标像素组的光学参数。The processor 1010 is used to determine the optical parameters of the target pixel group for the optical parameters of the X target pixels.
本申请实施例中,在将第一图像划分为多个目标像素组之后,通过将目标像素组中的部分像素作为目标像素,并根据目标像素确定相应的目标像素组的光学参数,实现了无需计算目标像素组中全部像素的光学参数,减少了确定目标像素组对应的光学参数的计算量。In the embodiment of the present application, after the first image is divided into multiple target pixel groups, some pixels in the target pixel group are used as target pixels, and the optical parameters of the corresponding target pixel group are determined based on the target pixels, thereby achieving the goal of eliminating the need for Calculating the optical parameters of all pixels in the target pixel group reduces the amount of calculation required to determine the optical parameters corresponding to the target pixel group.
进一步地,处理器1010,用于根据目标像素组在第一目标图像中对应的图像内容,确定目标像素组中的X个目标像素。Further, the processor 1010 is configured to determine X target pixels in the target pixel group according to the image content corresponding to the target pixel group in the first target image.
本申请实施例中,通过电子设备根据图像内容自适应选择第一像素组中的目标像素,实现了在降低确定光学参数的计算量的同时,提高了确定得到的该第一像素组的光学参数的准确性。In the embodiment of the present application, the electronic device adaptively selects the target pixel in the first pixel group according to the image content, thereby reducing the calculation amount of determining the optical parameters and improving the determined optical parameters of the first pixel group. accuracy.
进一步地,处理器1010,用于获取第一目标图像的第一分辨率;Further, the processor 1010 is used to obtain the first resolution of the first target image;
处理器1010,用于根据第一分辨率,确定每个第一像素组中的预设像素数量;Processor 1010, configured to determine the preset number of pixels in each first pixel group according to the first resolution;
处理器1010,用于按照预设像素数量,将第一目标图像划分为P个第一像素组。The processor 1010 is configured to divide the first target image into P first pixel groups according to a preset number of pixels.
本申请实施例中,电子设备能够根据第一目标图像的分辨率自动确定第一像素组中的像素数量,并根据第一像素组中的像素数量对第一目标图像进行划分,无需用户手动操作即可完成对第一目标图像的划分,并且划分得到的每个第一像素组中的像素数量相等,在划分第一目标图像的过程中,无需对第一目标图像进行图像识别和特征提取,进一步降低了电子设备所需的计算量,简化了电子设备对第一目标图像进行融合处理的过程。In the embodiment of the present application, the electronic device can automatically determine the number of pixels in the first pixel group according to the resolution of the first target image, and divide the first target image according to the number of pixels in the first pixel group without manual operation by the user. The division of the first target image can be completed, and the number of pixels in each first pixel group obtained by division is equal. In the process of dividing the first target image, there is no need to perform image recognition and feature extraction on the first target image. The calculation amount required by the electronic device is further reduced, and the process of the electronic device performing fusion processing on the first target image is simplified.
进一步地,处理器1010,用于在第一分辨率大于预设分辨率的情况下,确定预设像素数量为第一数值;Further, the processor 1010 is configured to determine the preset number of pixels to be the first value when the first resolution is greater than the preset resolution;
处理器1010,用于在第一分辨率小于等于预设分辨率的情况下,确定预设像素数量 为第二数值;Processor 1010, configured to determine the preset number of pixels when the first resolution is less than or equal to the preset resolution is the second value;
其中,第一数值大于第二数值。Wherein, the first numerical value is greater than the second numerical value.
本申请实施例中,电子设备能够根据预设分辨率与第一目标图像的第一分辨率的比较结果,对第一像素组选择不同的预设像素数量,保证了第一分辨率较高的情况下,能够使第一像素组中的像素数量较多,第一分辨率较低的情况下,能够使第一像素组中的像素数量较少,实现了电子设备能够自动设置第一像素组的像素数量,并根据设置的像素数量对第一目标图像进行划分。In the embodiment of the present application, the electronic device can select a different preset number of pixels for the first pixel group based on the comparison result between the preset resolution and the first resolution of the first target image, ensuring that the first resolution is higher. In this case, the number of pixels in the first pixel group can be larger. When the first resolution is lower, the number of pixels in the first pixel group can be smaller. This enables the electronic device to automatically set the first pixel group. the number of pixels, and divide the first target image according to the set number of pixels.
进一步地,处理器1010,用于识别第一目标图像的图像内容;Further, the processor 1010 is configured to identify the image content of the first target image;
处理器1010,用于根据图像内容,将第一目标图像划分为P个第一像素组;The processor 1010 is configured to divide the first target image into P first pixel groups according to the image content;
其中,P个第一像素组中包括像素数量不同的像素组。The P first pixel groups include pixel groups with different numbers of pixels.
本申请实施例中,电子设备能够通过图像识别的方式识别到第一目标图像中的图像内容较多的主体区域,以及图像内容较少的背景区域,对主体区域中的第一像素组设置较少的像素数量,从而保证位于拍摄主体区域的第一像素组融合后不会丢失图像内容,对背景区域的第一像素组设置较多的像素数量,进一步减少电子设备的计算量。In the embodiment of the present application, the electronic device can identify the main body area with more image content in the first target image and the background area with less image content through image recognition, and set the first pixel group in the main body area with relatively small content. A small number of pixels ensures that the first pixel group located in the subject area will not lose image content after fusion, and a larger number of pixels is set for the first pixel group in the background area to further reduce the calculation amount of the electronic device.
进一步地,光学参数包括以下任一项:光通量值、光电子数量。Further, the optical parameters include any of the following: luminous flux value, number of photoelectrons.
本申请实施例中,将光学参数设置为光通量值和光电子数中的任一项,保证了对光学参数突变的第一时刻判断的准确性,还简化了获取光学参数的步骤。In the embodiments of the present application, the optical parameters are set to either the luminous flux value or the number of photoelectrons, which ensures the accuracy of the first moment judgment of optical parameter mutation and simplifies the steps of obtaining the optical parameters.
进一步地,处理器1010,用于获取采集时刻相邻的第三目标图像中的第三像素组的光学参数变化量,第三目标图像为N帧第一图像中除第一目标图像外的其他图像,第三像素组在第三目标图像中的位置与第一像素组在第一目标图像中的位置相对应;Further, the processor 1010 is used to obtain the optical parameter change amount of the third pixel group in the third target image adjacent to the acquisition time. The third target image is other than the first target image in the N frames of the first image. Image, the position of the third pixel group in the third target image corresponds to the position of the first pixel group in the first target image;
处理器1010,用于将光学参数变化量大于预设变化量的采集时刻,确定为目标时刻;The processor 1010 is configured to determine the acquisition time when the optical parameter change amount is greater than the preset change amount as the target time;
处理器1010,用于根据目标时刻,确定N帧第一图像中的至少一帧第二目标图像,第二目标图像的采集时刻在第一目标图像的采集时刻与目标时刻之间。The processor 1010 is configured to determine at least one frame of the second target image among the N frames of first images according to the target time, and the collection time of the second target image is between the collection time of the first target image and the target time.
本申请实施例中,计算采集时刻相邻的第三目标像素组的光学参数的差值,能够确定该采集时刻对应的光学参数变化量,通过获取每相邻的两个第三目标图像中的第三像素组的光学参数变化量,能够得到每个采集时刻对应的光学参数变化量。在光学参数变化量超过预设变化量的情况下,则确定该采集时刻发生了光学变化量的突变,该目标时刻与第一目标图像的采集时刻之间所采集到的第三目标图像中的第三像素组均与目标像素组匹配,故将该目标时刻与第一目标图像的采集时刻之间的全部第一图像作为第二目标图像,保证了根据第二目标图像中的第二像素组与目标像素组进行融合后的图像中该目标像素组的图像区域不会出现模糊的问题。In the embodiment of the present application, the difference in optical parameters of the adjacent third target pixel group at the acquisition time is calculated, and the change amount of the optical parameter corresponding to the acquisition time can be determined. The optical parameter change amount of the third pixel group can be used to obtain the optical parameter change amount corresponding to each collection time. When the change amount of the optical parameter exceeds the preset change amount, it is determined that a sudden change in the optical change amount occurs at the acquisition time, and the third target image collected between the target time and the acquisition time of the first target image is The third pixel group all matches the target pixel group, so all the first images between the target time and the collection time of the first target image are used as the second target image, ensuring that according to the second pixel group in the second target image In the image that is fused with the target pixel group, the image area of the target pixel group will not be blurred.
进一步地,处理器1010,用于根据多个第三像素组生成第四目标图像,第三像素组为目标像素组与第二像素组融合得到的像素组,第三像素组的数量与第一像素组的数量相同。Further, the processor 1010 is configured to generate a fourth target image according to a plurality of third pixel groups. The third pixel group is a pixel group obtained by merging the target pixel group and the second pixel group. The number of the third pixel group is the same as that of the first pixel group. The number of pixel groups is the same.
本申请实施例中,电子设备通过将像素组作为融合处理的单位,能够保证了对第一 目标图像中每个部分均进行针对性的融合处理,避免融合处理后得到的第四目标图像中存在部分不清晰的区域,并且无需对每个像素进行单独处理,减少了电子设备的计算量,提高了出图效率。In the embodiment of the present application, the electronic device can ensure that the first Each part of the target image is subjected to targeted fusion processing to avoid partially unclear areas in the fourth target image obtained after the fusion processing, and there is no need to process each pixel individually, which reduces the calculation amount of electronic equipment. Improved drawing efficiency.
应理解的是,本申请实施例中,输入单元1004可以包括图形处理器(Graphics Processing Unit,GPU)10041和麦克风10042,图形处理器10041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1006可包括显示面板10061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板10061。用户输入单元1007包括触控面板10071以及其他输入设备10072中的至少一种。触控面板10071,也称为触摸屏。触控面板10071可包括触摸检测装置和触摸控制器两个部分。其他输入设备10072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042. The graphics processor 10041 is responsible for the image capture device (GPU) in the video capture mode or the image capture mode. Process the image data of still pictures or videos obtained by cameras (such as cameras). The display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072 . Touch panel 10071, also known as touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
存储器1009可用于存储软件程序以及各种数据。存储器1009可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器1009可以包括易失性存储器或非易失性存储器,或者,存储器1009可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器1009包括但不限于这些和任意其它适合类型的存储器。Memory 1009 may be used to store software programs as well as various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc. Additionally, memory 1009 may include volatile memory or nonvolatile memory, or memory 1009 may include both volatile and nonvolatile memory. Among them, non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 1009 in the embodiment of the present application includes, but is not limited to, these and any other suitable types of memory.
处理器1010可包括一个或多个处理单元;可选地,处理器1010集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器1010中。The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 1010.
本申请实施例还提供一种可读存储介质,可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application also provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the program or instructions are executed by a processor, each process of the above method embodiments is implemented and the same technical effect can be achieved. To avoid repetition, they will not be repeated here.
其中,处理器为上述实施例中的电子设备中的处理器。可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device in the above embodiment. Readable storage media includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks or optical disks.
本申请实施例另提供了一种芯片,芯片包括处理器和通信接口,通信接口和处理器 耦合,处理器用于运行程序或指令,实现上述图像融合方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application further provides a chip. The chip includes a processor and a communication interface. The communication interface and the processor Coupling, the processor is used to run programs or instructions to implement each process of the above image fusion method embodiment, and can achieve the same technical effect. To avoid duplication, it will not be described again here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述图像融合方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application provide a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to implement each process of the above image fusion method embodiment, and can achieve the same technical effect. , to avoid repetition, will not be repeated here.
可以理解的是,本公开实施例描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,模块、单元、子单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本公开所述功能的其它电子单元或其组合中。It can be understood that the embodiments described in the embodiments of the present disclosure can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, modules, units, and subunits can be implemented in one or more Application Specific Integrated Circuits (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSP Device, DSPD) ), programmable logic device (Programmable Logic Device, PLD), field-programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, used to execute the disclosure other electronic units or combinations thereof with the above functions.
对于软件实现,可通过执行本公开实施例所述功能的模块(例如过程、函数等)来实现本公开实施例所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。For software implementation, the technology described in the embodiments of the present disclosure can be implemented through modules (such as procedures, functions, etc.) that perform the functions described in the embodiments of the present disclosure. Software code may be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽咯,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be integrated into another system, or some features may be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in various embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能, 还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the terms "comprising", "comprises" or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device that includes a series of elements not only includes those elements, It also includes other elements not expressly listed or inherent in the process, method, article or apparatus. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or apparatus that includes that element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed. It may also include performing functions in a substantially concurrent manner or in the reverse order, depending upon the functionality involved. For example, the described methods may be performed in an order different from that described, and various elements may be added, omitted, or combined. kind of steps. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件来实现。而各实施例示例的方法及单元的这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开的范围。很多情况下上述实施例方法可借助软件加必需的通用硬件平台的方式来实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware. Whether these functions of the methods and units illustrated in each embodiment are executed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered to be beyond the scope of this disclosure. In many cases, the above embodiment method can be implemented by means of software plus the necessary general hardware platform, which is a better implementation method. Based on this understanding, the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk , CD), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。 The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.

Claims (15)

  1. 一种图像融合方法,包括:An image fusion method including:
    采集N帧第一图像,每帧所述第一图像均包括M个像素,N和M均为正整数;Collect N frames of first images, each frame of the first image includes M pixels, and N and M are both positive integers;
    将第一目标图像划分为P个第一像素组,所述第一目标图像为所述N帧第一图像中的任一图像,P为正整数;Divide the first target image into P first pixel groups, the first target image is any image in the N frames of first images, and P is a positive integer;
    获取所述P个第一像素组中目标像素组的光学参数,所述目标像素组为所述P个第一像素组中任一像素组;Obtaining optical parameters of a target pixel group in the P first pixel groups, where the target pixel group is any pixel group in the P first pixel groups;
    根据所述目标像素组的光学参数,确定所述N帧第一图像中的至少一帧第二目标图像,所述第二目标图像中包括与所述目标像素组的光学参数相匹配的第二像素组,所述第二目标图像为所述N帧第一图像中的图像,所述目标像素组包括Q个像素,Q<M;According to the optical parameters of the target pixel group, at least one frame of the second target image among the N frames of first images is determined, and the second target image includes a second frame that matches the optical parameters of the target pixel group. A pixel group, the second target image is an image in the N frames of the first image, the target pixel group includes Q pixels, Q<M;
    将所述目标像素组与所述第二像素组进行融合处理,所述目标像素组在所述第一目标图像中的位置与所述第二像素组在所述第二目标图像的位置相对应。Fusion processing is performed on the target pixel group and the second pixel group, and the position of the target pixel group in the first target image corresponds to the position of the second pixel group in the second target image. .
  2. 根据权利要求1所述的图像融合方法,其中,所述获取所述P个第一像素组中目标像素组的光学参数,包括:The image fusion method according to claim 1, wherein said obtaining the optical parameters of the target pixel group in the P first pixel groups includes:
    确定所述目标像素组中的X个目标像素,X为正整数,X≤Q;Determine X target pixels in the target pixel group, X is a positive integer, and X≤Q;
    根据所述X个目标像素的光学参数,确定所述目标像素组的光学参数。According to the optical parameters of the X target pixels, the optical parameters of the target pixel group are determined.
  3. 根据权利要求2所述的图像融合方法,其中,所述确定所述目标像素组中的X个目标像素,包括:The image fusion method according to claim 2, wherein determining the X target pixels in the target pixel group includes:
    根据所述目标像素组在所述第一目标图像中对应的图像内容,确定所述目标像素组中的所述X个目标像素。The X target pixels in the target pixel group are determined according to the image content corresponding to the target pixel group in the first target image.
  4. 根据权利要求1至3中任一项所述的图像融合方法,其中,所述将第一目标图像划分为P个第一像素组,包括:The image fusion method according to any one of claims 1 to 3, wherein dividing the first target image into P first pixel groups includes:
    识别所述第一目标图像的图像内容;Identify the image content of the first target image;
    根据所述图像内容,将所述第一目标图像划分为P个第一像素组;According to the image content, the first target image is divided into P first pixel groups;
    其中,所述P个第一像素组中包括像素数量不同的像素组。Wherein, the P first pixel groups include pixel groups with different numbers of pixels.
  5. 根据权利要求1至3中任一项所述的图像融合方法,其中,所述根据所述目标像素组的光学参数,确定所述N帧第一图像中的至少一帧第二目标图像,包括:The image fusion method according to any one of claims 1 to 3, wherein determining at least one frame of the second target image among the N frames of first images according to the optical parameters of the target pixel group includes: :
    获取采集时刻相邻的第三目标图像中的第三像素组的光学参数变化量,所述第三目标图像为所述N帧第一图像中除所述第一目标图像外的其他图像,所述第三像素组在所述第三目标图像中的位置与所述第一像素组在所述第一目标图像中的位置相对应;Obtain the optical parameter change amount of the third pixel group in the third target image adjacent to the acquisition time, and the third target image is other images in the N frames of first images except the first target image, so The position of the third pixel group in the third target image corresponds to the position of the first pixel group in the first target image;
    将所述光学参数变化量大于预设变化量的所述采集时刻,确定为目标时刻;Determine the acquisition time when the change amount of the optical parameter is greater than the preset change amount as the target time;
    根据所述目标时刻,确定所述N帧第一图像中的至少一帧所述第二目标图像,所述第二目标图像的采集时刻在所述第一目标图像的采集时刻与所述目标时刻之间。According to the target time, at least one frame of the second target image among the N frames of first images is determined, and the collection time of the second target image is between the collection time of the first target image and the target time. between.
  6. 一种图像融合装置,包括: An image fusion device including:
    采集模块,用于采集N帧第一图像,每帧所述第一图像均包括M个像素,N和M均为正整数;An acquisition module, used to acquire N frames of first images. Each frame of the first image includes M pixels, and N and M are both positive integers;
    分组模块,用于将第一目标图像划分为P个第一像素组,所述第一目标图像为所述N帧第一图像中的任一图像,P为正整数;A grouping module configured to divide the first target image into P first pixel groups, where the first target image is any image in the N frames of first images, and P is a positive integer;
    获取模块,用于获取所述P个第一像素组中目标像素组的光学参数,所述目标像素组为所述P个第一像素组中任一像素组;An acquisition module, configured to acquire optical parameters of a target pixel group in the P first pixel groups, where the target pixel group is any pixel group in the P first pixel groups;
    确定模块,用于根据所述目标像素组的光学参数,确定所述N帧第一图像中的至少一帧第二目标图像,所述第二目标图像中包括与所述目标像素组的光学参数相匹配的第二像素组,所述第二目标图像为所述N帧第一图像中的图像,所述目标像素组包括Q个像素;Determining module, configured to determine at least one frame of the second target image among the N frames of first images according to the optical parameters of the target pixel group, the second target image includes optical parameters related to the target pixel group A matching second pixel group, the second target image is an image in the N frames of the first image, and the target pixel group includes Q pixels;
    融合模块,用于将所述目标像素组与所述第二像素组进行融合处理,所述目标像素组在所述第一目标图像中的位置与所述第二像素组在所述第二目标图像的位置相对应。a fusion module, configured to perform fusion processing on the target pixel group and the second pixel group; the position of the target pixel group in the first target image and the position of the second pixel group in the second target corresponding to the position of the image.
  7. 根据权利要求6所述的图像融合装置,其中,The image fusion device according to claim 6, wherein,
    所述确定模块,还用于确定目标像素组中的X个目标像素,X为正整数,X≤Q;The determination module is also used to determine X target pixels in the target pixel group, X is a positive integer, and X≤Q;
    所述确定模块,还用于根据所述X个目标像素的光学参数,确定所述目标像素组的光学参数。The determination module is also configured to determine the optical parameters of the target pixel group according to the optical parameters of the X target pixels.
  8. 根据权利要求7所述的图像融合装置,其中,The image fusion device according to claim 7, wherein,
    所述确定模块,还用于根据所述目标像素组在所述第一目标图像中对应的图像内容,确定所述目标像素组中的所述X个目标像素。The determination module is further configured to determine the X target pixels in the target pixel group according to the image content corresponding to the target pixel group in the first target image.
  9. 根据权利要求6至8中任一项所述的图像融合装置,其中,还包括:The image fusion device according to any one of claims 6 to 8, further comprising:
    识别模块,用于识别所述第一目标图像的图像内容;An identification module, used to identify the image content of the first target image;
    所述分组模块,还用于根据所述图像内容,将所述第一目标图像划分为P个第一像素组;The grouping module is also configured to divide the first target image into P first pixel groups according to the image content;
    其中,所述P个第一像素组中包括像素数量不同的像素组。Wherein, the P first pixel groups include pixel groups with different numbers of pixels.
  10. 根据权利要求6至8中任一项所述的图像融合装置,其中,The image fusion device according to any one of claims 6 to 8, wherein,
    所述获取模块,还用于获取采集时刻相邻的第三目标图像中的第三像素组的光学参数变化量,所述第三目标图像为所述N帧第一图像中除所述第一目标图像外的其他图像,所述第三像素组在所述第三目标图像中的位置与所述第一像素组在所述第一目标图像中的位置相对应;The acquisition module is also used to acquire the optical parameter change amount of the third pixel group in the third target image adjacent to the acquisition time. The third target image is the first image in the N frames except the first In other images other than the target image, the position of the third pixel group in the third target image corresponds to the position of the first pixel group in the first target image;
    所述确定模块,还用于将所述光学参数变化量大于预设变化量的所述采集时刻,确定为目标时刻;The determination module is also configured to determine the acquisition time when the change amount of the optical parameter is greater than the preset change amount as the target time;
    所述确定模块,用于根据所述目标时刻,确定所述N帧第一图像中的至少一帧所述第二目标图像,所述第二目标图像的采集时刻在所述第一目标图像的采集时刻与所述目标时刻之间。The determination module is configured to determine the second target image in at least one frame of the N frames of first images according to the target time, and the collection time of the second target image is at the time of the first target image. between the collection time and the target time.
  11. 一种电子设备,包括: An electronic device including:
    处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至5中任一项所述的图像融合方法的步骤。A processor and a memory, the memory stores a program or instructions executable on the processor, and when executed by the processor, the image fusion of any one of claims 1 to 5 is achieved. Method steps.
  12. 一种可读存储介质,其上存储有程序或指令,所述程序或指令被处理器执行时实现如权利要求1至5中任一项所述的图像融合方法的步骤。A readable storage medium on which a program or instructions are stored. When the program or instructions are executed by a processor, the steps of the image fusion method according to any one of claims 1 to 5 are implemented.
  13. 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1至5中任一项所述的图像融合方法的步骤。A chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the image as described in any one of claims 1 to 5 The steps of the fusion method.
  14. 一种计算机程序产品,其中,所述计算机程序产品被至少一个处理器执行以实现如权利要求1至5中任一项所述的图像融合方法的步骤。A computer program product, wherein the computer program product is executed by at least one processor to implement the steps of the image fusion method according to any one of claims 1 to 5.
  15. 一种电子设备,所述电子设备用于执行如权利要求1至5中任一项所述的图像融合方法的步骤。 An electronic device, the electronic device is used to perform the steps of the image fusion method according to any one of claims 1 to 5.
PCT/CN2023/117064 2022-09-06 2023-09-05 Image fusion method and apparatus, electronic device, and storage medium WO2024051697A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211084167.1 2022-09-06
CN202211084167.1A CN115439386A (en) 2022-09-06 2022-09-06 Image fusion method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2024051697A1 true WO2024051697A1 (en) 2024-03-14

Family

ID=84247466

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/117064 WO2024051697A1 (en) 2022-09-06 2023-09-05 Image fusion method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN115439386A (en)
WO (1) WO2024051697A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115439386A (en) * 2022-09-06 2022-12-06 维沃移动通信有限公司 Image fusion method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170337667A1 (en) * 2016-05-18 2017-11-23 Thomson Licensing Method and device for obtaining a hdr image by graph signal processing
CN110189285A (en) * 2019-05-28 2019-08-30 北京迈格威科技有限公司 A kind of frames fusion method and device
CN111770243A (en) * 2020-08-04 2020-10-13 深圳市精锋医疗科技有限公司 Image processing method, device and storage medium for endoscope
CN114119423A (en) * 2021-12-08 2022-03-01 上海肇观电子科技有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114511487A (en) * 2022-02-16 2022-05-17 展讯通信(上海)有限公司 Image fusion method and device, computer readable storage medium and terminal
CN115439386A (en) * 2022-09-06 2022-12-06 维沃移动通信有限公司 Image fusion method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170337667A1 (en) * 2016-05-18 2017-11-23 Thomson Licensing Method and device for obtaining a hdr image by graph signal processing
CN110189285A (en) * 2019-05-28 2019-08-30 北京迈格威科技有限公司 A kind of frames fusion method and device
CN111770243A (en) * 2020-08-04 2020-10-13 深圳市精锋医疗科技有限公司 Image processing method, device and storage medium for endoscope
CN114119423A (en) * 2021-12-08 2022-03-01 上海肇观电子科技有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114511487A (en) * 2022-02-16 2022-05-17 展讯通信(上海)有限公司 Image fusion method and device, computer readable storage medium and terminal
CN115439386A (en) * 2022-09-06 2022-12-06 维沃移动通信有限公司 Image fusion method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115439386A (en) 2022-12-06

Similar Documents

Publication Publication Date Title
US11563897B2 (en) Image processing method and apparatus which determines an image processing mode based on status information of the terminal device and photographing scene information
CN110505411B (en) Image shooting method and device, storage medium and electronic equipment
CN107172345B (en) Image processing method and terminal
US9407831B2 (en) Intelligent auto-exposure bracketing
CN109671106B (en) Image processing method, device and equipment
CN107592453B (en) A kind of image pickup method and mobile terminal
CN111028189A (en) Image processing method, image processing device, storage medium and electronic equipment
US7450756B2 (en) Method and apparatus for incorporating iris color in red-eye correction
CN107172296A (en) A kind of image capturing method and mobile terminal
WO2015081556A1 (en) Photographing method for dual-camera device and dual-camera device
WO2022166944A1 (en) Photographing method and apparatus, electronic device, and medium
CN101998048A (en) Digital image signal processing method, medium for recording the method, digital image signal pocessing apparatus
WO2024051697A1 (en) Image fusion method and apparatus, electronic device, and storage medium
TW201902204A (en) Power reduction in a multi-sensor camera device by on-demand sensors activation
CN110198418A (en) Image processing method, device, storage medium and electronic equipment
CN112668636A (en) Camera shielding detection method and system, electronic equipment and storage medium
CN112422798A (en) Photographing method and device, electronic equipment and storage medium
CN110717871A (en) Image processing method, image processing device, storage medium and electronic equipment
CN110929615B (en) Image processing method, image processing apparatus, storage medium, and terminal device
US10769416B2 (en) Image processing method, electronic device and storage medium
CN103139521B (en) Image acquisition and choosing method and image collecting device
CN108259767B (en) Image processing method, image processing device, storage medium and electronic equipment
CN107180417B (en) Photo processing method and device, computer readable storage medium and electronic equipment
CN111885371A (en) Image occlusion detection method and device, electronic equipment and computer readable medium
CN108495038B (en) Image processing method, image processing device, storage medium and electronic equipment