WO2023245383A1 - Method for aligning multiple image frames, apparatus for aligning multiple image frames, and storage medium - Google Patents

Method for aligning multiple image frames, apparatus for aligning multiple image frames, and storage medium Download PDF

Info

Publication number
WO2023245383A1
WO2023245383A1 PCT/CN2022/099957 CN2022099957W WO2023245383A1 WO 2023245383 A1 WO2023245383 A1 WO 2023245383A1 CN 2022099957 W CN2022099957 W CN 2022099957W WO 2023245383 A1 WO2023245383 A1 WO 2023245383A1
Authority
WO
WIPO (PCT)
Prior art keywords
amplitude
frame
reference frame
frequency domain
domain signal
Prior art date
Application number
PCT/CN2022/099957
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 北京小米移动软件有限公司
Priority to CN202280004289.7A priority Critical patent/CN117616455A/en
Priority to PCT/CN2022/099957 priority patent/WO2023245383A1/en
Publication of WO2023245383A1 publication Critical patent/WO2023245383A1/en

Links

Images

Definitions

  • the present disclosure relates to the field of image processing technology, and in particular to a multi-frame image alignment method, a multi-frame image alignment device and a storage medium.
  • a method based on feature point alignment is used to perform feature detection, feature matching, and image transformation on multi-frame images.
  • the computational complexity is high, and the processed image is greatly affected by the noise and brightness of the original image, resulting in Poor user experience.
  • the present disclosure provides a multi-frame image alignment method, a multi-frame image alignment device and a storage medium for quickly aligning multi-frame images.
  • a multi-frame image alignment method applied to a terminal, including: obtaining a reference frame and a supporting frame of a multi-frame image; performing fast Fourier transform on the reference frame to obtain the The frequency domain signal of the reference frame is performed, and the fast Fourier transform is performed on the support frame to obtain the frequency domain signal of the support frame; based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame, Align the support frame and the reference frame to obtain a multi-frame aligned image.
  • aligning the support frame and the reference frame based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame includes: based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame to determine a first amplitude and a second amplitude, where the first amplitude is the amplitude corresponding to the frequency domain signal of the reference frame, and the second amplitude is the Amplitude corresponding to the frequency domain signal of the support frame; based on the first amplitude and the second amplitude, determine an alignment parameter between the reference frame and the support frame, the alignment parameter including at least one of the following Types: offset, rotation and scaling; align the support frame and the reference frame based on the alignment parameter.
  • a multi-frame image alignment device which is applied to a terminal and includes: an acquisition unit for acquiring a reference frame and a supporting frame of a multi-frame image; a processing unit for aligning the reference frame The frame is subjected to fast Fourier transform to obtain the frequency domain signal of the reference frame, and the support frame is subjected to fast Fourier transform to obtain the frequency domain signal of the support frame; and based on the frequency domain signal of the reference frame signal and the frequency domain signal of the support frame, and align the support frame and the reference frame to obtain a multi-frame aligned image.
  • the processing unit aligns the supporting frame and the reference frame based on the frequency domain signal of the reference frame and the frequency domain signal of the supporting frame in the following manner: based on the frequency domain signal of the reference frame
  • the frequency domain signal and the frequency domain signal of the support frame determine a first amplitude and a second amplitude.
  • the first amplitude is the amplitude corresponding to the frequency domain signal of the reference frame.
  • the second amplitude is the amplitude corresponding to the frequency domain signal of the support frame; based on the first amplitude and the second amplitude, determine the alignment parameters between the reference frame and the support frame, the alignment parameters include At least one of the following: an offset, a rotation, and a scaling; aligning the support frame and the reference frame based on the alignment parameter.
  • the alignment parameter includes an offset
  • the processing unit determines the distance between the reference frame and the support frame based on the first amplitude and the second amplitude in the following manner: Alignment parameter: based on the first amplitude and the second amplitude, determine the correlation between the frequency domain signal of the reference frame and the frequency domain signal of the support frame; based on the maximum value of the correlation, An offset between the reference frame and the supporting frame is determined.
  • the alignment parameter includes a rotation amount and/or a scaling amount
  • the processing unit determines the reference frame and the reference frame based on the first amplitude value and the second amplitude value in the following manner: Support alignment parameters between frames: convert the first amplitude and the second amplitude to polar coordinates respectively to obtain the first polar coordinate amplitude and the second polar coordinate amplitude; based on the first polar coordinate The amplitude and the second polar coordinate amplitude determine the amount of rotation and/or scaling between the reference frame and the reference frame.
  • the processing unit determines the alignment parameter between the reference frame and the support frame based on the first amplitude and the second amplitude in the following manner: determining the first amplitude and the cross power spectrum of the second amplitude; perform an inverse fast Fourier transform on the cross power spectrum to obtain a peak value, and determine the alignment parameter between the reference frame and the support frame based on the peak value .
  • the processing unit performs fast Fourier transform on the reference frame in the following manner to obtain the frequency domain signal of the reference frame, and performs fast Fourier transform on the support frame to obtain The frequency domain signal of the support frame: perform Y channel downsampling on the reference frame and then perform fast Fourier transform to obtain the frequency domain signal of the reference frame, and perform Y channel downsampling on the support frame. Fast Fourier transform is performed to obtain the frequency domain signal of the support frame.
  • the technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: perform fast Fourier transform on the reference frame and the support frame to obtain frequency domain signals of the reference frame and the support frame, based on the frequency domain signals of the reference frame and the support frame, Align reference and supporting frames.
  • perform fast Fourier transform on the reference frame and the support frame to obtain frequency domain signals of the reference frame and the support frame, based on the frequency domain signals of the reference frame and the support frame
  • Align reference and supporting frames By converting the reference frame and supporting frame from the spatial domain to the frequency domain, the computational complexity is reduced and the alignment speed can be accelerated.
  • Figure 1 is a flow chart of a multi-frame image alignment method according to an exemplary embodiment.
  • Figure 2 is a flowchart of a multi-frame image alignment method according to an exemplary embodiment.
  • Figure 3 is a flowchart of a multi-frame image alignment method according to an exemplary embodiment.
  • the multi-frame super-resolution algorithm means that when taking pictures, multiple frames of low-quality images are collected quickly and continuously, and after the fusion processing of the super-resolution algorithm, a high-quality image is obtained. Due to the jitter of the handheld terminal, the multiple frames of images collected continuously are not aligned.
  • alignment algorithms can be divided into two major categories. One is a method based on feature point alignment, which performs feature detection, feature matching, and image transformation on multi-frame images. The second category is an alignment method based on block matching. A typical example is HDR+ proposed by Google.
  • the present disclosure provides a multi-frame image alignment method, which is applied to a terminal.
  • the multi-frame image alignment method includes: obtaining a reference frame and a supporting frame from the multi-frame images collected by the terminal; performing fast Fourier transform on the reference frame. , transform the reference frame from the spatial domain to the frequency domain to obtain the frequency domain signal of the reference frame, and perform fast Fourier transform on the supporting frame to transform the supporting frame from the spatial domain to the frequency domain to obtain the frequency domain signal of the supporting frame;
  • the frequency domain signal of the frame and the frequency domain signal of the supporting frame are calculated for correlation, and the alignment parameters of the supporting frame and the reference frame are determined to realize the alignment of multi-frame images.
  • a multi-frame image is divided into several image blocks of the same size and partially overlapping edges, the clearest frame in each group of image blocks is selected as the reference frame, and the remaining frames are support frames.
  • step S12 fast Fourier transform is performed on the reference frame to obtain the frequency domain signal of the reference frame, and fast Fourier transform is performed on the support frame to obtain the frequency domain signal of the support frame.
  • Fast Fourier transform can convert reference frames and support frames from the spatial domain to the frequency domain. Aligning frequency domain images can speed up the calculation of alignment, avoid multiple traversals of pixels in the image, and reduce computational complexity.
  • Figure 2 is a flow chart of a multi-frame image alignment method according to an exemplary embodiment. As shown in Figure 2, the multi-frame image alignment method is used in a terminal. The embodiment of the present disclosure applies the multi-frame image alignment method The type of terminal is not limited. Based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame, the method of aligning the support frame and the reference frame includes the following steps.
  • fast Fourier transform is used to convert the reference frame and the support frame from the spatial domain to the frequency domain to obtain the spectrogram of the reference frame and the support frame.
  • the spectrogram describes the relationship between the frequency and amplitude of the signal. It can also be It is understood as a frequency distribution curve.
  • the independent variable of the frequency distribution curve is frequency, that is, the horizontal axis is frequency, and the vertical axis is the amplitude of the frequency signal.
  • the independent variable of the frequency distribution curve is frequency, that is, the horizontal axis is frequency
  • the vertical axis is the amplitude of the frequency signal.
  • step S22 based on the first amplitude value and the second amplitude value, an alignment parameter between the reference frame and the support frame is determined, where the alignment parameter includes at least one of an offset amount, a rotation amount, and a scaling amount.
  • the multiple frames of images continuously collected by the terminal are not aligned.
  • the reference frame and the supporting frame will have at least one alignment parameter including positional offset, angle rotation, and image size scaling. Based on the first amplitude and the second amplitude, the alignment parameters of the reference frame and the support frame are calculated to achieve multi-frame image alignment.
  • step S23 the support frame and the reference frame are aligned based on the alignment parameters.
  • the support frame and the reference frame are aligned.
  • the alignment operation of the reference frame and the support frame is performed according to the correlation law.
  • the correlation reaches the maximum.
  • the cross-correlated Fourier transform of the two images can be obtained, that is, the correlation between the reference frame and the support frame is calculated. Based on the correlation The maximum value determines the offset.
  • the reference frame is f(x,y) and the supporting frame is g(x,y).
  • Perform fast Fourier transform on the reference frame to obtain the frequency domain signal of the reference frame and obtain the first amplitude F(u,v).
  • Perform fast Fourier transform on the support frame to obtain the frequency domain signal of the support frame, and obtain the second amplitude G(u,v).
  • F(CC) F * (u,v)G(u,v)
  • F * (u, v) represents the complex conjugate of F (u, v)
  • F (CC) represents the Fourier transform of the cross-correlation between the reference frame and the support frame.
  • the process of multi-frame image alignment can be expressed as the process of calculating the correlation between two images. When the matching degree between the two images is the highest, the correlation reaches the maximum. Therefore, according to the maximum value of F(CC), the displacements ⁇ x and ⁇ y of the reference frame and the support frame in the x and y directions are determined, and the offset is obtained.
  • the mutual correlation between f(x,y) and g(x,y) is defined as follows:
  • CC(u,v) represents the cross-correlation between the reference frame and the support frame. Calculating the value of CC(u,v) at (u,v) requires traversing all (x,y), and calculating CC(u,v ) all values require traversing all (x, y) multiple times, and the computational complexity is very high. Therefore, fast Fourier transform is performed on the reference frame to obtain the frequency domain signal of the reference frame, and fast Fourier transform is performed on the support frame to obtain the frequency domain signal of the support frame.
  • the reference frame and supporting frame can be converted from the spatial domain to the frequency domain. Alignment in the frequency domain can reduce the complexity of calculating correlation, speed up the alignment, and improve the image alignment effect.
  • the reference frame f(x,y) and the supporting frame g(x,y) are not aligned, There are displacements ⁇ x and ⁇ y in the x and y directions, as well as a rotation amount ⁇ 0 and a scaling amount s, then the relationship between the reference frame f (x, y) and the support frame g (x, y) is
  • g(x,y) f(s(xcos ⁇ 0 +ysin ⁇ 0 )- ⁇ x,s(-xsin ⁇ 0 +ycos ⁇ 0 )- ⁇ y)
  • M G (u,v) s 2 M F (s -1 (ucos ⁇ 0 +vsin ⁇ 0 ),s -1 (-usin ⁇ 0 +vcos ⁇ 0 ))
  • M GLP ( ⁇ , ⁇ ) s 2 M FLP ( ⁇ -logs, ⁇ - ⁇ 0 ), where logs is the difference in radians between the amplitudes of the reference frame and the support frame in polar coordinates, and ⁇ 0 is the difference in angle.
  • M FLP ( ⁇ , ⁇ ) is the amplitude of the reference frame in polar coordinates, which is later called the first polar coordinate amplitude.
  • M GLP ( ⁇ , ⁇ ) is the amplitude of the support frame in polar coordinates, which is later called is the second polar coordinate amplitude.
  • M FLP * ( ⁇ , ⁇ ) represents the complex conjugate of M FLP ( ⁇ , ⁇ )
  • M (CC) represents the Fourier transform of the cross-correlation between the reference frame and the support frame in polar coordinates.
  • the process of multi-frame image alignment can be expressed as the process of calculating the correlation between two images. When the matching degree between the two images is the highest, the correlation reaches the maximum. Therefore, in the embodiment of the present disclosure, the arc of the polar coordinate corresponding to the maximum value of M(CC) is used as the scaling amount between the reference frame and the support frame.
  • the angle of the polar coordinate corresponding to the maximum value of M(CC) is used as the rotation amount between the reference frame and the support frame.
  • the alignment of the reference frame and the support frame can be achieved through the calculated scaling amount and rotation amount.
  • the offset of the support frame relative to the reference frame can be calculated, but also the rotation amount and/or scaling amount of the support frame relative to the reference frame can be calculated, so as to further improve the alignment accuracy and obtain better Align effects and improve user experience.
  • FIG. 3 is a flowchart of yet another multi-frame image alignment method according to an exemplary embodiment.
  • the multi-frame image alignment method is used in a terminal.
  • the embodiments of the present disclosure describe the multi-frame image alignment method.
  • the type of terminal used is not limited.
  • the multi-frame image alignment method includes step S31, step S32 and step S33. Among them, the execution steps of step S31 and step S21 in FIG. 2 are similar, and will not be described again in this disclosure.
  • step S32 the cross power spectrum of the first amplitude and the second amplitude is determined.
  • the present disclosure when calculating the correlation between the reference frame and the supporting frame, no normalization operation is performed on the brightness of the image pixels. If the exposure time or ISO of the two images is different, resulting in a difference in the brightness of the images, then it is impossible to find a position where the two images can be aligned. Therefore, the present disclosure introduces a normalization factor to obtain the cross power spectrum of the frequency domain signal of the reference frame and the frequency domain signal of the support frame, thereby reducing the impact of image brightness on alignment accuracy.
  • step S33 the peak value is obtained after performing inverse fast Fourier transform on the cross power spectrum, and the alignment parameter between the reference frame and the support frame is determined based on the peak value.
  • the alignment parameter determined based on the peak value in the embodiment of the present disclosure may include at least one of a translation amount, a rotation amount, and a scaling amount.
  • the following is an exemplary explanation of the process of performing inverse fast Fourier transform based on the cross power spectrum to obtain the peak value, and determining the alignment parameters based on the peak value.
  • the peak value is obtained by inversely transforming the cross power spectrum through the following formula:
  • M GLP ( ⁇ , ⁇ ) s 2 M FLP ( ⁇ -logs, ⁇ - ⁇ 0 ),
  • log s is the difference in radians between the amplitudes of the reference frame and the support frame in polar coordinates
  • ⁇ 0 is the difference in angle
  • the multi-frame image alignment device provided by the embodiment of the present disclosure includes hardware structures and/or software modules corresponding to each function.
  • the embodiments of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or by computer software driving the hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to go beyond the scope of the technical solutions of the embodiments of the present disclosure.
  • the processing unit 102 determines the alignment parameter between the reference frame and the supporting frame based on the first amplitude and the second amplitude in the following manner: determining the intersection of the first amplitude and the second amplitude. Power spectrum; perform inverse fast Fourier transform on the cross power spectrum to obtain the peak value, and determine the alignment parameters between the reference frame and the support frame based on the peak value.
  • the processing unit 102 performs fast Fourier transform on the reference frame in the following manner to obtain the frequency domain signal of the reference frame, and performs fast Fourier transform on the support frame to obtain the frequency domain signal of the support frame:
  • the reference frame is subjected to Y channel downsampling and then fast Fourier transform is performed to obtain the frequency domain signal of the reference frame.
  • the support frame is Y channel downsampled and then fast Fourier transformed is performed to obtain the frequency domain signal of the support frame.
  • Processing component 202 generally controls the overall operations of device 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 202 may include one or more processors 220 to execute instructions to complete all or part of the steps of the above method.
  • processing component 202 may include one or more modules that facilitate interaction between processing component 202 and other components.
  • processing component 202 may include a multimedia module to facilitate interaction between multimedia component 208 and processing component 202.
  • Memory 204 is configured to store various types of data to support operations at device 200 . Examples of such data include instructions for any application or method operating on device 200, contact data, phonebook data, messages, pictures, videos, etc.
  • Memory 204 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EEPROM erasable programmable read-only memory
  • EPROM Programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory, magnetic or optical disk.
  • Multimedia component 208 includes a screen that provides an output interface between the device 200 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action.
  • multimedia component 208 includes a front-facing camera and/or a rear-facing camera.
  • the front camera and/or the rear camera may receive external multimedia data.
  • Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
  • Audio component 210 is configured to output and/or input audio signals.
  • audio component 210 includes a microphone (MIC) configured to receive external audio signals when device 200 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 204 or sent via communications component 216.
  • audio component 210 also includes a speaker for outputting audio signals.
  • the I/O interface 212 provides an interface between the processing component 202 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
  • Sensor component 214 includes one or more sensors for providing various aspects of status assessment for device 200 .
  • the sensor component 214 can detect the open/closed state of the device 200, the relative positioning of components, such as the display and keypad of the device 200, and the sensor component 214 can also detect a change in position of the device 200 or a component of the device 200. , the presence or absence of user contact with the device 200 , device 200 orientation or acceleration/deceleration and temperature changes of the device 200 .
  • Sensor assembly 214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 214 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 216 is configured to facilitate wired or wireless communication between apparatus 200 and other devices.
  • Device 200 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof.
  • the communication component 216 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communications component 216 also includes a near field communications (NFC) module to facilitate short-range communications.
  • NFC near field communications
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • apparatus 200 may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable Gate array
  • controller microcontroller, microprocessor or other electronic components are implemented for executing the above method.
  • a non-transitory computer-readable storage medium including instructions such as a memory 204 including instructions, which can be executed by the processor 220 of the device 200 to complete the above method is also provided.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
  • “plurality” in this disclosure refers to two or more, and other quantifiers are similar.
  • “And/or” describes the relationship between related objects, indicating that there can be three relationships.
  • a and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone.
  • the character “/” generally indicates that the related objects are in an “or” relationship.
  • the singular forms “a”, “the” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise.
  • first, second, etc. are used to describe various information, but the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other and do not imply a specific order or importance. In fact, expressions such as “first” and “second” can be used interchangeably.
  • first information may also be called second information, and similarly, the second information may also be called first information.

Abstract

The present disclosure relates to a method and apparatus for aligning multiple image frames, and a storage medium. The method for aligning multiple image frames comprises: acquiring reference frames and support frames of multiple image frames; performing fast Fourier transform on the reference frames, so as to obtain frequency-domain signals of the reference frames, and performing fast Fourier transform on the support frames, so as to obtain frequency-domain signals of the support frames; and aligning the support frames and the reference frames on the basis of the frequency-domain signals of the reference frames and the frequency-domain signals of the support frames, so as to obtain multiple aligned image frames. By means of the embodiments of the present disclosure, fast Fourier transform is performed on reference frames and support frames, so as to convert same from a space domain to a frequency domain and align same in the frequency domain, such that pixel points of images can be prevented from being traversed multiple times, thereby reducing the calculation complexity, and accelerating the alignment.

Description

多帧图像对齐方法、多帧图像对齐装置及存储介质Multi-frame image alignment method, multi-frame image alignment device and storage medium 技术领域Technical field
本公开涉及图像处理技术领域,尤其涉及一种多帧图像对齐方法、多帧图像对齐装置及存储介质。The present disclosure relates to the field of image processing technology, and in particular to a multi-frame image alignment method, a multi-frame image alignment device and a storage medium.
背景技术Background technique
随着智能手机的不断升级,手机拍照变成了非常重要的功能。手机拍照操作简单、成像直观、处理方便,因此用户对于手机拍照的表现格外关注。在拍照时,当手抖动或者拍摄的图像为动态时,拍出的照片会存在噪声,导致照片不清晰。智能手机为了从低画质图像恢复出原始高分辨率图像,大多连续采集多帧图像,并且对多帧图像进行对齐处理。With the continuous upgrading of smart phones, taking pictures on mobile phones has become a very important function. Mobile phone photography is simple to operate, intuitive to image, and easy to process, so users pay special attention to the performance of mobile phone photography. When taking pictures, when the hand shakes or the captured image is dynamic, there will be noise in the photos, resulting in unclear photos. In order to restore the original high-resolution image from a low-quality image, smartphones mostly continuously collect multiple frames of images and perform alignment processing on the multiple frames of images.
相关技术中,采用基于特征点对齐的方法,对多帧图像进行特征检测、特征匹配以及图像变换等处理,但是计算复杂度较高,处理后的图像受原图像噪声和亮度影响较大,导致用户体验较差。In related technologies, a method based on feature point alignment is used to perform feature detection, feature matching, and image transformation on multi-frame images. However, the computational complexity is high, and the processed image is greatly affected by the noise and brightness of the original image, resulting in Poor user experience.
发明内容Contents of the invention
为克服相关技术中存在的问题,本公开提供一种多帧图像对齐方法、多帧图像对齐装置以及存储介质,用于快速对齐多帧图像。In order to overcome the problems existing in related technologies, the present disclosure provides a multi-frame image alignment method, a multi-frame image alignment device and a storage medium for quickly aligning multi-frame images.
根据本公开实施例的第一方面,提供一种多帧图像对齐方法,应用于终端,包括:获取多帧图像的参考帧和支持帧;对所述参考帧进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行快速傅里叶变换,得到所述支持帧的频域信号;基于所述参考帧的频域信号和所述支持帧的频域信号,对齐所述支持帧和所述参考帧,得到多帧对齐的图像。According to a first aspect of an embodiment of the present disclosure, a multi-frame image alignment method is provided, applied to a terminal, including: obtaining a reference frame and a supporting frame of a multi-frame image; performing fast Fourier transform on the reference frame to obtain the The frequency domain signal of the reference frame is performed, and the fast Fourier transform is performed on the support frame to obtain the frequency domain signal of the support frame; based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame, Align the support frame and the reference frame to obtain a multi-frame aligned image.
在一种实施方式中,所述基于所述参考帧的频域信号和所述支持帧的频域信号,对齐所述支持帧和所述参考帧,包括:基于所述参考帧的频域信号和所述支持帧的频域信号,确定第一幅值和第二幅值,所述第一幅值为所述参考帧的频域信号对应的幅值,所述第二幅值为所述支持帧的频域信号对应的幅值;基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数,所述对齐参数包括以下至少一种:偏移量、旋转量以及缩放量;基于所述对齐参数,对齐所述支持帧和所述参考帧。In one embodiment, aligning the support frame and the reference frame based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame includes: based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame to determine a first amplitude and a second amplitude, where the first amplitude is the amplitude corresponding to the frequency domain signal of the reference frame, and the second amplitude is the Amplitude corresponding to the frequency domain signal of the support frame; based on the first amplitude and the second amplitude, determine an alignment parameter between the reference frame and the support frame, the alignment parameter including at least one of the following Types: offset, rotation and scaling; align the support frame and the reference frame based on the alignment parameter.
在一种实施方式中,所述对齐参数包括偏移量;所述基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数,包括:基于所述第一幅值和所述第二幅值,确定所述参考帧的频域信号和所述支持帧的频域信号的相关度;基于所述相关度的最大值,确定所述参考帧和所述支持帧之间的偏移量。In one implementation, the alignment parameter includes an offset; and determining the alignment parameter between the reference frame and the support frame based on the first amplitude and the second amplitude includes: : Based on the first amplitude and the second amplitude, determine the correlation between the frequency domain signal of the reference frame and the frequency domain signal of the support frame; based on the maximum value of the correlation, determine the The offset between the reference frame and the supporting frame.
在一种实施方式中,所述对齐参数包括旋转量和/或缩放量;所述基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数,包括:将所述第一幅值和所述第二幅值分别转换到极坐标,得到第一极坐标幅值和第二极坐标幅值;基于所述第一极坐标幅值和所述第二极坐标幅值,确定所述参考帧和所述支持帧之间的旋转量和/或缩放量。In one embodiment, the alignment parameter includes a rotation amount and/or a scaling amount; and based on the first amplitude value and the second amplitude value, the alignment parameter between the reference frame and the support frame is determined. Alignment parameters include: converting the first amplitude and the second amplitude into polar coordinates respectively to obtain a first polar coordinate amplitude and a second polar coordinate amplitude; based on the first polar coordinate amplitude and The second polar coordinate amplitude determines the amount of rotation and/or scaling between the reference frame and the support frame.
在一种实施方式中,基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数,包括:确定所述第一幅值和所述第二幅值的交叉功率谱;对所述交叉功率谱进行快速傅里叶逆变换后得到峰值,基于所述峰值确定所述参考帧和所述支持帧之间的对齐参数。In one implementation, determining an alignment parameter between the reference frame and the support frame based on the first amplitude and the second amplitude includes: determining the first amplitude and the Cross power spectrum of the second amplitude; perform inverse fast Fourier transform on the cross power spectrum to obtain a peak value, and determine alignment parameters between the reference frame and the support frame based on the peak value.
在一种实施方式中,对所述参考帧进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行快速傅里叶变换,得到所述支持帧的频域信号,包括:对所述参考帧进行Y通道下采样后进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行Y通道下采样后进行快速傅里叶变换,得到所述支持帧的频域信号。In one implementation, fast Fourier transform is performed on the reference frame to obtain the frequency domain signal of the reference frame, and fast Fourier transform is performed on the support frame to obtain the frequency domain signal of the support frame. The signal includes: performing Y-channel downsampling on the reference frame and then performing fast Fourier transform to obtain the frequency domain signal of the reference frame, and performing Y-channel downsampling on the support frame and then performing fast Fourier transform. , obtain the frequency domain signal of the support frame.
根据本公开实施例的第二方面,提供一种多帧图像对齐装置,应用于终端,包括:获取单元,用于获取多帧图像的参考帧和支持帧;处理单元,用于对所述参考帧进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行快速傅里叶变换,得到所述支持帧的频域信号;并基于所述参考帧的频域信号和所述支持帧的频域信号,对齐所述支持帧和所述参考帧,得到多帧对齐的图像。According to a second aspect of an embodiment of the present disclosure, a multi-frame image alignment device is provided, which is applied to a terminal and includes: an acquisition unit for acquiring a reference frame and a supporting frame of a multi-frame image; a processing unit for aligning the reference frame The frame is subjected to fast Fourier transform to obtain the frequency domain signal of the reference frame, and the support frame is subjected to fast Fourier transform to obtain the frequency domain signal of the support frame; and based on the frequency domain signal of the reference frame signal and the frequency domain signal of the support frame, and align the support frame and the reference frame to obtain a multi-frame aligned image.
在一种实施方式中,所述处理单元采用如下方式基于所述参考帧的频域信号和所述支持帧的频域信号,对齐所述支持帧和所述参考帧:基于所述参考帧的频域信号和所述支持帧的频域信号,确定第一幅值和第二幅值,所述第一幅值为所述参考帧的频域信号对应的幅值,所述第二幅值为所述支持帧的频域信号对应的幅值;基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数,所述对齐参数包括以下至少一种:偏移量、旋转量以及缩放量;基于所述对齐参数,对齐所述支持帧和所述参考帧。In one implementation, the processing unit aligns the supporting frame and the reference frame based on the frequency domain signal of the reference frame and the frequency domain signal of the supporting frame in the following manner: based on the frequency domain signal of the reference frame The frequency domain signal and the frequency domain signal of the support frame determine a first amplitude and a second amplitude. The first amplitude is the amplitude corresponding to the frequency domain signal of the reference frame. The second amplitude is the amplitude corresponding to the frequency domain signal of the support frame; based on the first amplitude and the second amplitude, determine the alignment parameters between the reference frame and the support frame, the alignment parameters include At least one of the following: an offset, a rotation, and a scaling; aligning the support frame and the reference frame based on the alignment parameter.
在一种实施方式中,所述对齐参数包括偏移量;所述处理单元采用如下方式基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数:基于所述第一幅值和所述第二幅值,确定所述参考帧的频域信号和所述支持帧的频域信号的相关度;基于所述相关度的最大值,确定所述参考帧和所述支持帧之间的偏移量。In one implementation, the alignment parameter includes an offset; the processing unit determines the distance between the reference frame and the support frame based on the first amplitude and the second amplitude in the following manner: Alignment parameter: based on the first amplitude and the second amplitude, determine the correlation between the frequency domain signal of the reference frame and the frequency domain signal of the support frame; based on the maximum value of the correlation, An offset between the reference frame and the supporting frame is determined.
在一种实施方式中,所述对齐参数包括旋转量和/或缩放量;所述处理单元采用如下方式基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数:将所述第一幅值和所述第二幅值分别转换到极坐标,得到第一极坐标幅值和第二极坐标幅 值;基于所述第一极坐标幅值和所述第二极坐标幅值,确定所述参考帧和所述参考帧之间的旋转量和/或缩放量。In one implementation, the alignment parameter includes a rotation amount and/or a scaling amount; the processing unit determines the reference frame and the reference frame based on the first amplitude value and the second amplitude value in the following manner: Support alignment parameters between frames: convert the first amplitude and the second amplitude to polar coordinates respectively to obtain the first polar coordinate amplitude and the second polar coordinate amplitude; based on the first polar coordinate The amplitude and the second polar coordinate amplitude determine the amount of rotation and/or scaling between the reference frame and the reference frame.
在一种实施方式中,所述处理单元采用如下方式基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数:确定所述第一幅值和所述第二幅值的交叉功率谱;对所述交叉功率谱进行快速傅里叶逆变换后得到峰值,基于所述峰值确定所述参考帧和所述支持帧之间的对齐参数。In one implementation, the processing unit determines the alignment parameter between the reference frame and the support frame based on the first amplitude and the second amplitude in the following manner: determining the first amplitude and the cross power spectrum of the second amplitude; perform an inverse fast Fourier transform on the cross power spectrum to obtain a peak value, and determine the alignment parameter between the reference frame and the support frame based on the peak value .
在一种实施方式中,所述处理单元采用如下方式对所述参考帧进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行快速傅里叶变换,得到所述支持帧的频域信号:对所述参考帧进行Y通道下采样后进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行Y通道下采样后进行快速傅里叶变换,得到所述支持帧的频域信号。In one implementation, the processing unit performs fast Fourier transform on the reference frame in the following manner to obtain the frequency domain signal of the reference frame, and performs fast Fourier transform on the support frame to obtain The frequency domain signal of the support frame: perform Y channel downsampling on the reference frame and then perform fast Fourier transform to obtain the frequency domain signal of the reference frame, and perform Y channel downsampling on the support frame. Fast Fourier transform is performed to obtain the frequency domain signal of the support frame.
根据本公开实施例的第三方面,提供一种多帧图像对齐装置,包括:处理器;用于存储处理器可执行指令的存储器;其中,处理器被配置为:执行第一方面任意一种实施方式中所述的多帧图像对齐的方法。According to a third aspect of the embodiment of the present disclosure, a multi-frame image alignment device is provided, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to: execute any one of the first aspects The multi-frame image alignment method described in the embodiment.
根据本公开实施例的第四方面,提供一种非临时性计算机可读存储介质,所述存储介质中存储有指令,当所述存储介质中的指令由终端的处理器执行时,使得终端能够执行第一方面任意一种实施方式中所述的多帧图像对齐的方法。According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, the storage medium stores instructions, and when the instructions in the storage medium are executed by a processor of the terminal, the terminal can Execute the multi-frame image alignment method described in any embodiment of the first aspect.
本公开的实施例提供的技术方案可以包括以下有益效果:对参考帧和支持帧进行快速傅里叶变换,得到参考帧和支持帧的频域信号,基于参考帧和支持帧的频域信号,对齐参考帧和支持帧。通过将参考帧和支持帧从空域转换到频域,降低了计算复杂度,能够加快对齐速度。The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: perform fast Fourier transform on the reference frame and the support frame to obtain frequency domain signals of the reference frame and the support frame, based on the frequency domain signals of the reference frame and the support frame, Align reference and supporting frames. By converting the reference frame and supporting frame from the spatial domain to the frequency domain, the computational complexity is reduced and the alignment speed can be accelerated.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and do not limit the present disclosure.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
图1是根据一示例性实施例示出的一种多帧图像对齐方法的流程图。Figure 1 is a flow chart of a multi-frame image alignment method according to an exemplary embodiment.
图2是根据一示例性实施例示出的一种多帧图像对齐方法的流程图。Figure 2 is a flowchart of a multi-frame image alignment method according to an exemplary embodiment.
图3是根据一示例性实施例示出的一种多帧图像对齐方法的流程图。Figure 3 is a flowchart of a multi-frame image alignment method according to an exemplary embodiment.
图4是根据一示例性实施例示出的一种多帧图像对齐方法的流程图。Figure 4 is a flow chart of a multi-frame image alignment method according to an exemplary embodiment.
图5是根据一示例性实施例示出的一种多帧图像对齐装置的框图。Figure 5 is a block diagram of a multi-frame image alignment device according to an exemplary embodiment.
图6是根据一示例性实施例示出的一种多帧图像对齐装置的框图。FIG. 6 is a block diagram of a multi-frame image alignment device according to an exemplary embodiment.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.
随着智能手机等终端的不断升级,执行的应用功能也要求越来越高。其中,终端的拍照功能也不断在优化。手机拍照操作简单、成像直观、处理方便,因此用户对于手机拍照的表现格外关注。在拍照时,当手抖动或者拍摄的图像为动态时,拍出的照片会存在噪声,导致照片不清晰。在不增加成本的前提下,智能手机为了从低画质图像恢复出原始高分辨率图像,多选择采用超分辨率算法作为高画质图像恢复算法,而多帧超分算法相比单帧超分算法,在恢复效果上有明显优势。多帧超分算法是指,在拍照时,连续快速采集多帧低画质图像,经过超分辨率算法的融合处理,得到一张高画质图像。由于手持终端存在抖动,连续采集得到的多帧图像是没有对齐的。相关技术中,对齐算法可以分为两大类,一类是基于特征点对齐的方法,对多帧图像进行特征检测、特征匹配以及图像变换等处理,第二类是基于块匹配的对齐方法,典型的有Google提出的HDR+。但是基于特征点对齐的方法会导致计算复杂度较高,处理后的图像受原图像噪声和亮度影响较大;基于块匹配的对齐方法,照片在高感下的噪点不均匀,一些色调映射上存在瑕疵,导致用户体验较差。As terminals such as smartphones continue to upgrade, the application functions they perform are becoming more and more demanding. Among them, the camera function of the terminal is also constantly being optimized. Mobile phone photography is simple to operate, intuitive to image, and easy to process, so users pay special attention to the performance of mobile phone photography. When taking pictures, when the hand shakes or the captured image is dynamic, there will be noise in the photos, resulting in unclear photos. In order to restore the original high-resolution image from the low-quality image without increasing the cost, smartphones often choose to use super-resolution algorithm as the high-quality image restoration algorithm, and the multi-frame super-resolution algorithm is compared with the single-frame super-resolution algorithm. The algorithm has obvious advantages in recovery effect. The multi-frame super-resolution algorithm means that when taking pictures, multiple frames of low-quality images are collected quickly and continuously, and after the fusion processing of the super-resolution algorithm, a high-quality image is obtained. Due to the jitter of the handheld terminal, the multiple frames of images collected continuously are not aligned. In related technologies, alignment algorithms can be divided into two major categories. One is a method based on feature point alignment, which performs feature detection, feature matching, and image transformation on multi-frame images. The second category is an alignment method based on block matching. A typical example is HDR+ proposed by Google. However, the method based on feature point alignment will lead to high computational complexity, and the processed image will be greatly affected by the noise and brightness of the original image; the alignment method based on block matching will cause uneven noise in the photo under high sensitivity, and some tone mapping There are flaws that result in a poor user experience.
由此,本公开提供一种多帧图像对齐方法,应用于终端,多帧图像对齐方法包括:从终端采集的多帧图像中,获取参考帧和支持帧;对参考帧进行快速傅里叶变换,将参考帧从空域变换到频域,得到参考帧的频域信号,并对支持帧进行快速傅里叶变换,将支持帧从空域变换到频域,得到支持帧的频域信号;对参考帧的频域信号和支持帧的频域信号进行相关度计算,确定支持帧和参考帧的对齐参数,实现多帧图像的对齐。通过将参考帧和支持帧进行快速傅里叶变换,从空域转换到频域,在频域上进行对齐,降低了计算复杂度,加快对齐速度,提升图像对齐效果。Therefore, the present disclosure provides a multi-frame image alignment method, which is applied to a terminal. The multi-frame image alignment method includes: obtaining a reference frame and a supporting frame from the multi-frame images collected by the terminal; performing fast Fourier transform on the reference frame. , transform the reference frame from the spatial domain to the frequency domain to obtain the frequency domain signal of the reference frame, and perform fast Fourier transform on the supporting frame to transform the supporting frame from the spatial domain to the frequency domain to obtain the frequency domain signal of the supporting frame; The frequency domain signal of the frame and the frequency domain signal of the supporting frame are calculated for correlation, and the alignment parameters of the supporting frame and the reference frame are determined to realize the alignment of multi-frame images. By performing fast Fourier transform on the reference frame and the support frame, converting from the spatial domain to the frequency domain, and performing alignment in the frequency domain, the computational complexity is reduced, the alignment speed is accelerated, and the image alignment effect is improved.
图1是根据一示例性实施例示出的一种多帧图像对齐方法的流程图,如图1所示,多帧图像对齐方法可以用于终端中,本公开实施例对多帧图像对齐方法所应用的终端种类不作限定。例如,终端的示例可以包括:手机、平板电脑、笔记本电脑、可穿戴设备等。多帧图像对齐方法包括以下步骤。Figure 1 is a flow chart of a multi-frame image alignment method according to an exemplary embodiment. As shown in Figure 1, the multi-frame image alignment method can be used in a terminal. The embodiments of the present disclosure describe the multi-frame image alignment method. The type of terminal used is not limited. For example, examples of terminals may include: mobile phones, tablets, laptops, wearable devices, etc. The multi-frame image alignment method includes the following steps.
在步骤S11中,获取多帧图像的参考帧和支持帧。In step S11, the reference frames and supporting frames of the multi-frame image are obtained.
在本公开实施例中,当用户按下拍照按钮时,终端会连续采集多帧图像,由于手持手机存在抖动,连续采集得到的多帧图像是没有对齐的,从多帧图像中选取最清晰的一帧为 参考帧,剩下的帧为支持帧。其中,本公开实施例中参考帧的选取可以采用相关技术中的方式确定。一种实施方式中,例如,可以采用平均梯度值的方法计算每一帧图像的平均梯度,平均梯度值越大,图像越清晰。In the embodiment of the present disclosure, when the user presses the camera button, the terminal will continuously collect multiple frames of images. Due to the jitter of the handheld mobile phone, the continuously collected multiple frames of images are not aligned. The clearest image is selected from the multiple frames of images. One frame is the reference frame and the remaining frames are support frames. The selection of the reference frame in the embodiment of the present disclosure can be determined by methods in related technologies. In one implementation, for example, the average gradient value method can be used to calculate the average gradient of each frame of image. The larger the average gradient value, the clearer the image.
在一示例中,将多帧图像划分割成若干个大小相同、边缘部分重叠的图像块,选取每组图像块中最清晰的一帧为参考帧,剩下的帧为支持帧。In one example, a multi-frame image is divided into several image blocks of the same size and partially overlapping edges, the clearest frame in each group of image blocks is selected as the reference frame, and the remaining frames are support frames.
在步骤S12中,对参考帧进行快速傅里叶变换,得到参考帧的频域信号,并对支持帧进行快速傅里叶变换,得到支持帧的频域信号。In step S12, fast Fourier transform is performed on the reference frame to obtain the frequency domain signal of the reference frame, and fast Fourier transform is performed on the support frame to obtain the frequency domain signal of the support frame.
在本公开实施例中,假设参考帧为f(x,y),支持帧为g(x,y)。对参考帧进行快速傅里叶变换,将参考帧从空域变换到频域,得到参考帧的频域信号F(u,v)。对支持帧进行快速傅里叶变换,将支持帧从空域变换到频域,得到支持帧的频域信号G(u,v)。In the embodiment of the present disclosure, it is assumed that the reference frame is f(x,y) and the support frame is g(x,y). Perform fast Fourier transform on the reference frame to transform the reference frame from the spatial domain to the frequency domain to obtain the frequency domain signal F(u,v) of the reference frame. Perform fast Fourier transform on the support frame to transform the support frame from the spatial domain to the frequency domain to obtain the frequency domain signal G(u,v) of the support frame.
在步骤S13中,基于参考帧的频域信号和支持帧的频域信号,对齐所述支持帧和所述参考帧,得到对齐的多帧图像。In step S13, based on the frequency domain signal of the reference frame and the frequency domain signal of the supporting frame, the supporting frame and the reference frame are aligned to obtain aligned multi-frame images.
快速傅里叶变换能够将参考帧和支持帧从空域转换到频域,对频域图像进行对齐能够加速对齐的计算速度,避免多次遍历图像的像素点,降低计算复杂度。Fast Fourier transform can convert reference frames and support frames from the spatial domain to the frequency domain. Aligning frequency domain images can speed up the calculation of alignment, avoid multiple traversals of pixels in the image, and reduce computational complexity.
根据本公开实施例,从终端采集的多帧图像中,获取参考帧和支持帧,利用快速傅里叶变换将参考帧和支持帧从空域转换到频域,能够实现在多帧图像在频域上进行对齐,降低了计算复杂度,加快对齐速度。According to the embodiments of the present disclosure, reference frames and supporting frames are obtained from multi-frame images collected by the terminal, and fast Fourier transform is used to convert the reference frames and supporting frames from the spatial domain to the frequency domain, which can realize multi-frame images in the frequency domain. Alignment is performed on the image, which reduces the computational complexity and speeds up the alignment.
图2是根据一示例性实施例示出的一种多帧图像对齐方法的流程图,如图2所示,多帧图像对齐方法用于终端中,本公开实施例对多帧图像对齐方法所应用的终端种类不作限定。基于参考帧的频域信号和支持帧的频域信号,对齐支持帧和参考帧的方法包括以下步骤。Figure 2 is a flow chart of a multi-frame image alignment method according to an exemplary embodiment. As shown in Figure 2, the multi-frame image alignment method is used in a terminal. The embodiment of the present disclosure applies the multi-frame image alignment method The type of terminal is not limited. Based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame, the method of aligning the support frame and the reference frame includes the following steps.
在步骤S21中,基于参考帧的频域信号和支持帧的频域信号,确定第一幅值和第二幅值;第一幅值为参考帧的频域信号对应的幅值,第二幅值为支持帧的频域信号对应的幅值。In step S21, the first amplitude and the second amplitude are determined based on the frequency domain signal of the reference frame and the frequency domain signal of the supporting frame; the first amplitude is the amplitude corresponding to the frequency domain signal of the reference frame, and the second amplitude The value is the amplitude corresponding to the frequency domain signal of the supporting frame.
在本公开实施例中,利用快速傅里叶变换将参考帧和支持帧从空域转换到频域,得到参考帧和支持帧的频谱图,频谱图描述了信号的频率与幅度的关系,也可以理解为是频率的分布曲线。其中,频率分布曲线的自变量是频率,即横轴是频率,纵轴是该频率信号的幅度。获取参考帧的频域信号对应的幅值,后续称为第一幅值,获取支持帧的频域信号对应的幅值,后续称为第二幅值。In the embodiment of the present disclosure, fast Fourier transform is used to convert the reference frame and the support frame from the spatial domain to the frequency domain to obtain the spectrogram of the reference frame and the support frame. The spectrogram describes the relationship between the frequency and amplitude of the signal. It can also be It is understood as a frequency distribution curve. Among them, the independent variable of the frequency distribution curve is frequency, that is, the horizontal axis is frequency, and the vertical axis is the amplitude of the frequency signal. Obtain the amplitude corresponding to the frequency domain signal of the reference frame, which is later called the first amplitude. Get the amplitude corresponding to the frequency domain signal of the support frame, which is later called the second amplitude.
在步骤S22中,基于第一幅值和第二幅值,确定参考帧和支持帧之间的对齐参数,对齐参数包括偏移量、旋转量以及缩放量中至少一种。In step S22, based on the first amplitude value and the second amplitude value, an alignment parameter between the reference frame and the support frame is determined, where the alignment parameter includes at least one of an offset amount, a rotation amount, and a scaling amount.
在本公开实施例中,由于手持终端存在抖动,终端连续采集得到的多帧图像是没有对 齐的。参考帧与支持帧会存在位置上的偏移,角度的旋转以及图像大小缩放其中的至少一种对齐参数。基于第一幅值和第二幅值,计算参考帧与支持帧的对齐参数,实现多帧图像对齐。In the embodiment of the present disclosure, due to the jitter of the handheld terminal, the multiple frames of images continuously collected by the terminal are not aligned. The reference frame and the supporting frame will have at least one alignment parameter including positional offset, angle rotation, and image size scaling. Based on the first amplitude and the second amplitude, the alignment parameters of the reference frame and the support frame are calculated to achieve multi-frame image alignment.
在步骤S23中,基于对齐参数,对齐支持帧和参考帧。In step S23, the support frame and the reference frame are aligned based on the alignment parameters.
在本公开实施例中,根据对齐参数,确定支持帧相对于参考帧需要做的偏移、旋转以及缩放中的至少一种后,对齐支持帧和参考帧。In the embodiment of the present disclosure, after determining at least one of offset, rotation, and scaling that the support frame needs to perform relative to the reference frame according to the alignment parameters, the support frame and the reference frame are aligned.
在本公开实施例中,根据相关性定律来进行参考帧和支持帧的对齐操作。当参考帧和支持帧的匹配度最高的时候,相关度也就达到了最大。用支持帧的傅里叶变换乘参考帧傅里叶变换的复共轭,可得到两个图像的互相关的傅里叶变换,即计算出参考帧和支持帧的相关度,基于相关度的最大值确定偏移量。In the embodiment of the present disclosure, the alignment operation of the reference frame and the support frame is performed according to the correlation law. When the matching degree between the reference frame and the supporting frame is the highest, the correlation reaches the maximum. By multiplying the Fourier transform of the support frame by the complex conjugate of the Fourier transform of the reference frame, the cross-correlated Fourier transform of the two images can be obtained, that is, the correlation between the reference frame and the support frame is calculated. Based on the correlation The maximum value determines the offset.
在一示例中,当参考帧和支持帧之间的对齐参数为偏移量时,参考帧为f(x,y),支持帧为g(x,y)。f(x,y)与g(x,y)没有对齐,存在x和y方向的位移Δx和Δy,后续称为偏移量,也就是说g(x,y)=f(x-Δx,y-Δy)。对参考帧进行快速傅里叶变换,得到参考帧的频域信号,获取第一幅值F(u,v)。对支持帧进行快速傅里叶变换,得到支持帧的频域信号,获取第二幅值G(u,v)。根据相关性定律F(CC)=F *(u,v)G(u,v),可计算出参考帧与支持帧的相关度。其中F *(u,v)代表F(u,v)的复共轭,F(CC)代表参考帧和支持帧互相关的傅里叶变换。多帧图像对齐的过程,可以表示为计算两个图像之间的相关度的过程,当两个图像之间匹配度最高的时候,相关度也达到了最大。因此,根据F(CC)的最大值,确定参考帧和支撑帧在x和y方向的位移Δx和Δy,得到偏移量。 In an example, when the alignment parameter between the reference frame and the supporting frame is an offset, the reference frame is f(x,y) and the supporting frame is g(x,y). f(x,y) and g(x,y) are not aligned, there are displacements Δx and Δy in the x and y directions, which are later called offsets, that is to say g(x,y)=f(x-Δx, y-Δy). Perform fast Fourier transform on the reference frame to obtain the frequency domain signal of the reference frame and obtain the first amplitude F(u,v). Perform fast Fourier transform on the support frame to obtain the frequency domain signal of the support frame, and obtain the second amplitude G(u,v). According to the correlation law F(CC)=F * (u,v)G(u,v), the correlation between the reference frame and the support frame can be calculated. Where F * (u, v) represents the complex conjugate of F (u, v), and F (CC) represents the Fourier transform of the cross-correlation between the reference frame and the support frame. The process of multi-frame image alignment can be expressed as the process of calculating the correlation between two images. When the matching degree between the two images is the highest, the correlation reaches the maximum. Therefore, according to the maximum value of F(CC), the displacements Δx and Δy of the reference frame and the support frame in the x and y directions are determined, and the offset is obtained.
根据本公开的实施例,f(x,y)和g(x,y)互相关的定义如下:According to an embodiment of the present disclosure, the mutual correlation between f(x,y) and g(x,y) is defined as follows:
Figure PCTCN2022099957-appb-000001
Figure PCTCN2022099957-appb-000001
CC(u,v)代表参考帧与支持帧的互相关,计算CC(u,v)在(u,v)处的值,需要遍历所有的(x,y),而计算CC(u,v)所有的值,需要多次遍历所有的(x,y),计算复杂度非常高。因此对参考帧进行快速傅里叶变换,得到参考帧的频域信号,并对支持帧进行快速傅里叶变换,得到支持帧的频域信号。能够将参考帧和支持帧从空域转换为频域,在频域上进行对齐能够降低计算相关度的复杂性,加快对齐速度,提升图像对齐效果。CC(u,v) represents the cross-correlation between the reference frame and the support frame. Calculating the value of CC(u,v) at (u,v) requires traversing all (x,y), and calculating CC(u,v ) all values require traversing all (x, y) multiple times, and the computational complexity is very high. Therefore, fast Fourier transform is performed on the reference frame to obtain the frequency domain signal of the reference frame, and fast Fourier transform is performed on the support frame to obtain the frequency domain signal of the support frame. The reference frame and supporting frame can be converted from the spatial domain to the frequency domain. Alignment in the frequency domain can reduce the complexity of calculating correlation, speed up the alignment, and improve the image alignment effect.
在本公开实施例中,当参考帧和支持帧之间的对齐参数为偏移量、旋转量以及缩放量时,参考帧f(x,y)与支持帧g(x,y)没有对齐,存在x和y方向的位移Δx和Δy,以及旋转量θ 0和缩放量s,那么参考帧f(x,y)和支持帧g(x,y)的关系是 In the embodiment of the present disclosure, when the alignment parameters between the reference frame and the supporting frame are offset, rotation and scaling, the reference frame f(x,y) and the supporting frame g(x,y) are not aligned, There are displacements Δx and Δy in the x and y directions, as well as a rotation amount θ 0 and a scaling amount s, then the relationship between the reference frame f (x, y) and the support frame g (x, y) is
g(x,y)=f(s(xcosθ 0+ysinθ 0)-Δx,s(-xsinθ 0+ycosθ 0)-Δy) g(x,y)=f(s(xcosθ 0 +ysinθ 0 )-Δx,s(-xsinθ 0 +ycosθ 0 )-Δy)
对参考帧f(x,y)进行快速傅里叶变换,得到参考帧的频域信号,获取参考帧频域信号对应的幅值M F(u,v),后续称为第一幅值。对支持帧g(x,y)进行快速傅里叶变换,得到支持帧的频域信号,获取支持帧频域信号对应的幅值M G(u,v),后续称为第二幅值。那么可以得到 Perform fast Fourier transform on the reference frame f (x, y) to obtain the frequency domain signal of the reference frame, and obtain the amplitude M F (u, v) corresponding to the frequency domain signal of the reference frame, which is subsequently called the first amplitude. Perform fast Fourier transform on the support frame g(x,y) to obtain the frequency domain signal of the support frame, and obtain the amplitude M G (u,v) corresponding to the frequency domain signal of the support frame, which is subsequently called the second amplitude. then you can get
M G(u,v)=s 2M F(s -1(ucosθ 0+vsinθ 0),s -1(-usinθ 0+vcosθ 0)) M G (u,v)=s 2 M F (s -1 (ucosθ 0 +vsinθ 0 ),s -1 (-usinθ 0 +vcosθ 0 ))
将M G(u,v)和M F(u,v)转换到极坐标(λ,θ)中,可以得到M GLP(λ,θ)=s 2M FLP(λ-logs,θ-θ 0),其中logs为参考帧和支持帧的幅值在极坐标下弧度的差值,θ 0为角度的差值。 Convert M G (u, v) and M F (u, v) into polar coordinates (λ, θ), we can get M GLP (λ, θ) = s 2 M FLP (λ-logs, θ-θ 0 ), where logs is the difference in radians between the amplitudes of the reference frame and the support frame in polar coordinates, and θ 0 is the difference in angle.
其中,M FLP(λ,θ)为参考帧在极坐标下的幅值,后续称为第一极坐标幅值,M GLP(λ,θ)为支持帧在极坐标下的幅值,后续称为第二极坐标幅值。根据相关性定律可计算出参考帧与支持帧的相关度,其中,相关性计算公式为: Among them, M FLP (λ, θ) is the amplitude of the reference frame in polar coordinates, which is later called the first polar coordinate amplitude. M GLP (λ, θ) is the amplitude of the support frame in polar coordinates, which is later called is the second polar coordinate amplitude. According to the correlation law, the correlation between the reference frame and the support frame can be calculated. The correlation calculation formula is:
M(CC)=M FLP *(λ,θ)M GLP(λ,θ), M(CC)=M FLP * (λ,θ)M GLP (λ,θ),
其中,M FLP *(λ,θ)代表M FLP(λ,θ)的复共轭,M(CC)代表参考帧和支持帧在极坐标下互相关的傅里叶变换。多帧图像对齐的过程,可以表示为计算两个图像之间的相关度的过程,当两个图像之间匹配度最高的时候,相关度也达到了最大。因此,本公开实施例中将M(CC)的最大值所对应极坐标的弧度,作为参考帧与支持帧之间的缩放量。将M(CC)的最大值所对应极坐标的角度,作为参考帧与支持帧之间的旋转量。 Among them, M FLP * (λ, θ) represents the complex conjugate of M FLP (λ, θ), and M (CC) represents the Fourier transform of the cross-correlation between the reference frame and the support frame in polar coordinates. The process of multi-frame image alignment can be expressed as the process of calculating the correlation between two images. When the matching degree between the two images is the highest, the correlation reaches the maximum. Therefore, in the embodiment of the present disclosure, the arc of the polar coordinate corresponding to the maximum value of M(CC) is used as the scaling amount between the reference frame and the support frame. The angle of the polar coordinate corresponding to the maximum value of M(CC) is used as the rotation amount between the reference frame and the support frame.
其中,本公开实施例中可以通过计算出的缩放量和旋转量,实现参考帧与支持帧的对齐。Among them, in the embodiment of the present disclosure, the alignment of the reference frame and the support frame can be achieved through the calculated scaling amount and rotation amount.
根据本公开实施例,不仅可以计算出支持帧相对于参考帧的偏移量,还可以计算出支持帧相对于参考帧的旋转量和/或缩放量,使对齐精度进一步提升,获得更好的对齐效果,提高用户体验。According to the embodiments of the present disclosure, not only the offset of the support frame relative to the reference frame can be calculated, but also the rotation amount and/or scaling amount of the support frame relative to the reference frame can be calculated, so as to further improve the alignment accuracy and obtain better Align effects and improve user experience.
图3是根据一示例性实施例示出的又一种多帧图像对齐方法的流程图,如图3所示,多帧图像对齐方法用于终端中,本公开实施例对多帧图像对齐方法所应用的终端种类不作限定。多帧图像对齐方法包括步骤S31、步骤S32和步骤S33。其中,步骤S31和图2中步骤S21的执行步骤相类似,本公开在此不再赘述。Figure 3 is a flowchart of yet another multi-frame image alignment method according to an exemplary embodiment. As shown in Figure 3, the multi-frame image alignment method is used in a terminal. The embodiments of the present disclosure describe the multi-frame image alignment method. The type of terminal used is not limited. The multi-frame image alignment method includes step S31, step S32 and step S33. Among them, the execution steps of step S31 and step S21 in FIG. 2 are similar, and will not be described again in this disclosure.
在步骤S32中,确定第一幅值和第二幅值的交叉功率谱。In step S32, the cross power spectrum of the first amplitude and the second amplitude is determined.
在本公开实施例中,在计算参考帧和支持帧的相关度时,没有对图像像素的亮度做归一化操作。如果两张图像的曝光时间或者ISO有差别,导致图像的亮度有差别,那么无法找到可以让两张图像对齐的位置。因此本公开引入归一化因子,获取参考帧的频域信号和支持帧的频域信号的交叉功率谱,降低图像亮度对于对齐精度的影响。In the embodiment of the present disclosure, when calculating the correlation between the reference frame and the supporting frame, no normalization operation is performed on the brightness of the image pixels. If the exposure time or ISO of the two images is different, resulting in a difference in the brightness of the images, then it is impossible to find a position where the two images can be aligned. Therefore, the present disclosure introduces a normalization factor to obtain the cross power spectrum of the frequency domain signal of the reference frame and the frequency domain signal of the support frame, thereby reducing the impact of image brightness on alignment accuracy.
对参考帧进行快速傅里叶变换,得到参考帧的频域信号,获取第一幅值F(u,v)。对支 持帧进行快速傅里叶变换,得到支持帧的频域信号,获取第二幅值G(u,v)。通过Perform fast Fourier transform on the reference frame to obtain the frequency domain signal of the reference frame and obtain the first amplitude F(u,v). Perform fast Fourier transform on the support frame to obtain the frequency domain signal of the support frame and obtain the second amplitude G(u,v). pass
Figure PCTCN2022099957-appb-000002
Figure PCTCN2022099957-appb-000002
计算参考帧的频域信号和支持帧的频域信号的交叉功率谱,其中F *(u,v)代表F(u,v)的复共轭,Q(u,v)代表交叉功率谱。 Calculate the cross power spectrum of the frequency domain signal of the reference frame and the frequency domain signal of the support frame, where F * (u, v) represents the complex conjugate of F (u, v), and Q (u, v) represents the cross power spectrum.
在步骤S33中,对交叉功率谱进行快速傅里叶逆变换后得到峰值,基于峰值确定参考帧和支持帧之间的对齐参数。In step S33, the peak value is obtained after performing inverse fast Fourier transform on the cross power spectrum, and the alignment parameter between the reference frame and the support frame is determined based on the peak value.
本公开实施例中基于峰值确定的对齐参数可以包括平移量、旋转量和缩放量中的至少一项。The alignment parameter determined based on the peak value in the embodiment of the present disclosure may include at least one of a translation amount, a rotation amount, and a scaling amount.
以下,对基于交叉功率谱进行快速傅里叶逆变换得到峰值,并基于峰值确定对齐参数的过程进行示例性说明。The following is an exemplary explanation of the process of performing inverse fast Fourier transform based on the cross power spectrum to obtain the peak value, and determining the alignment parameters based on the peak value.
在本公开实施例一种实施方式中,通过如下公式对交叉功率谱进行逆变换得到峰值:In one implementation of this disclosure, the peak value is obtained by inversely transforming the cross power spectrum through the following formula:
Figure PCTCN2022099957-appb-000003
Figure PCTCN2022099957-appb-000003
其中,
Figure PCTCN2022099957-appb-000004
代表快速傅里叶逆变换,获取
Figure PCTCN2022099957-appb-000005
的峰值,
Figure PCTCN2022099957-appb-000006
的峰值代表参考帧和支持帧相关性最强的位置。
in,
Figure PCTCN2022099957-appb-000004
Represents the inverse fast Fourier transform, obtaining
Figure PCTCN2022099957-appb-000005
Peak,
Figure PCTCN2022099957-appb-000006
The peak of represents the position with the strongest correlation between the reference frame and the supporting frame.
其中,峰值所在的位置对应的横坐标为支持帧相对于参考帧的水平偏移量Δx,峰值所在的位置对应的纵坐标为支持帧相对于参考帧的竖直偏移量Δy。Among them, the abscissa corresponding to the position of the peak is the horizontal offset Δx of the support frame relative to the reference frame, and the ordinate corresponding to the position of the peak is the vertical offset Δy of the support frame relative to the reference frame.
进一步的,本公开实施例中,在确定参考帧和支持帧之间的旋转量θ 0和/或缩放量s时,将参考帧f(x,y)和支持帧g(x,y)的关系转换为: Further, in the embodiment of the present disclosure, when determining the rotation amount θ 0 and/or the scaling amount s between the reference frame and the support frame, the reference frame f (x, y) and the support frame g (x, y) are The relationship translates to:
g(x,y)=f(s(xcosθ 0+ysinθ 0)-Δx,s(-xsinθ 0+ycosθ 0)-Δy) g(x,y)=f(s(xcosθ 0 +ysinθ 0 )-Δx,s(-xsinθ 0 +ycosθ 0 )-Δy)
对参考帧和支持帧进行快速傅里叶变换,得到第一幅值M F(u,v)和第二幅值M G(u,v),将第一幅值和第二幅值转换到极坐标(λ,θ)中,可以得到极坐标下的第一幅值M FLP(λ,θ)和极坐标下的第二幅值M GLP(λ,θ)。进而,极坐标的情况下,第一幅值和第二幅值之间可以具有如下对应关系: Perform fast Fourier transform on the reference frame and the support frame to obtain the first amplitude M F (u, v) and the second amplitude M G (u, v), and convert the first amplitude and the second amplitude to In polar coordinates (λ, θ), the first amplitude M FLP (λ, θ) in polar coordinates and the second amplitude M GLP (λ, θ) in polar coordinates can be obtained. Furthermore, in the case of polar coordinates, the first amplitude and the second amplitude can have the following corresponding relationship:
M GLP(λ,θ)=s 2M FLP(λ-logs,θ-θ 0), M GLP (λ,θ)=s 2 M FLP (λ-logs,θ-θ 0 ),
其中,log s为参考帧和支持帧的幅值在极坐标下弧度的差值,θ 0为角度的差值。 Among them, log s is the difference in radians between the amplitudes of the reference frame and the support frame in polar coordinates, and θ 0 is the difference in angle.
在计算极坐标下参考帧的频域信号和支持帧的频域信号在极坐标下的交叉功率谱时,可以采用如下公式:When calculating the cross power spectrum of the frequency domain signal of the reference frame and the frequency domain signal of the support frame in polar coordinates, the following formula can be used:
Figure PCTCN2022099957-appb-000007
Figure PCTCN2022099957-appb-000007
其中,M FLP *(λ,θ)代表M FLP(λ,θ)的复共轭,Q(λ,θ)代表交叉功率谱。 Among them, M FLP * (λ, θ) represents the complex conjugate of M FLP (λ, θ), and Q (λ, θ) represents the cross power spectrum.
进一步的,通过如下公式对交叉功率谱进行快速傅里叶逆变换:Further, the inverse fast Fourier transform is performed on the cross power spectrum through the following formula:
Figure PCTCN2022099957-appb-000008
Figure PCTCN2022099957-appb-000008
其中,
Figure PCTCN2022099957-appb-000009
代表快速傅里叶逆变换。
in,
Figure PCTCN2022099957-appb-000009
stands for Inverse Fast Fourier Transform.
本公开实施例中,将
Figure PCTCN2022099957-appb-000010
的峰值所对应极坐标的弧度,作为参考帧和支持帧之间的缩放量。将
Figure PCTCN2022099957-appb-000011
的峰值所对应极坐标的角度,作为参考帧和支持帧之间的旋转量。
In this disclosed embodiment, the
Figure PCTCN2022099957-appb-000010
The radian of the polar coordinate corresponding to the peak value is used as the scaling amount between the reference frame and the supporting frame. Will
Figure PCTCN2022099957-appb-000011
The angle of the polar coordinate corresponding to the peak value is used as the rotation amount between the reference frame and the support frame.
根据本公开实施例,通过获取参考帧的频域信号和支持帧的频域信号的交叉功率谱,并对交叉功率谱进行快速傅里叶逆变换,实现了对图像亮度的归一化操作,进而基于交叉功率谱确定的峰值进行参考帧和支持帧之间对齐参数的确定,并进行参考帧与支持帧的对齐,能够提高对齐精度,降低图像亮度对于对齐精度的影响。According to embodiments of the present disclosure, by obtaining the cross power spectrum of the frequency domain signal of the reference frame and the frequency domain signal of the support frame, and performing an inverse fast Fourier transform on the cross power spectrum, the normalization operation of the image brightness is achieved, Then, the alignment parameters between the reference frame and the support frame are determined based on the peak value determined by the cross power spectrum, and the reference frame and the support frame are aligned, which can improve the alignment accuracy and reduce the impact of image brightness on the alignment accuracy.
图4是根据一示例性实施例示出的又一种多帧图像对齐方法的流程图,如图4所示,多帧图像对齐方法用于终端中,本公开实施例对多帧图像对齐方法所应用的终端种类不作限定。Figure 4 is a flow chart of yet another multi-frame image alignment method according to an exemplary embodiment. As shown in Figure 4, the multi-frame image alignment method is used in a terminal. The type of terminal used is not limited.
参照图4,分别对参考帧和支持帧进行Y通道下采样后进行快速傅里叶变换,得到参考帧和支持帧的频域信号。确定参考帧和支持帧的频域信号的交叉功率谱,对交叉功率谱进行快速傅里叶逆变换并获取峰值,根据峰值确定参考帧和支持帧的对齐参数,进而实现参考帧和支持帧的对齐操作。根据峰值确定参考帧和支持帧的对齐参数与图3中的步骤S33相类似,本公开在此不再赘述。Referring to Figure 4, Y-channel downsampling is performed on the reference frame and the support frame respectively and then fast Fourier transform is performed to obtain the frequency domain signals of the reference frame and the support frame. Determine the cross power spectrum of the frequency domain signals of the reference frame and the support frame, perform inverse fast Fourier transform on the cross power spectrum and obtain the peak value, determine the alignment parameters of the reference frame and the support frame based on the peak value, and then realize the alignment of the reference frame and the support frame. Alignment operations. Determining the alignment parameters of the reference frame and the support frame according to the peak value is similar to step S33 in FIG. 3 , and will not be described again in this disclosure.
在本公开实施例中,Y通道下采样可以选择开启或者关闭,当对齐精度要求较低时,可以开启Y通道下采样,将参考帧和支持帧的分辨率相应地降低。在降低分辨率的图像上进行多帧图像对齐,能够加快对齐速度。In the embodiment of the present disclosure, Y channel downsampling can be selectively turned on or off. When the alignment accuracy requirement is low, Y channel downsampling can be turned on to reduce the resolution of the reference frame and the support frame accordingly. Aligning multiple frames on a reduced-resolution image can speed up the alignment.
需要说明的是,本领域内技术人员可以理解,本公开实施例上述涉及的各种实施方式/实施例中可以配合前述的实施例使用,也可以是独立使用。无论是单独使用还是配合前述的实施例一起使用,其实现原理类似。本公开实施中,部分实施例中是以一起使用的实施方式进行说明的。当然,本领域内技术人员可以理解,这样的举例说明并非对本公开实施例的限定。It should be noted that those skilled in the art can understand that the various implementations/embodiments mentioned above in the embodiments of the present disclosure can be used in conjunction with the foregoing embodiments or can be used independently. Whether used alone or in conjunction with the foregoing embodiments, the implementation principles are similar. In the implementation of the present disclosure, some embodiments are described in terms of implementations used together. Of course, those skilled in the art can understand that such illustrations do not limit the embodiments of the present disclosure.
基于相同的构思,本公开实施例还提供一种多帧图像对齐装置。Based on the same concept, embodiments of the present disclosure also provide a multi-frame image alignment device.
可以理解的是,本公开实施例提供的多帧图像对齐装置为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。结合本公开实施例中所公开的各示例的单元及算法步骤,本公开实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能 究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以对每个特定的应用来使用不同的方法来实现所描述的功能,但是这种实现不应认为超出本公开实施例的技术方案的范围。It can be understood that, in order to implement the above functions, the multi-frame image alignment device provided by the embodiment of the present disclosure includes hardware structures and/or software modules corresponding to each function. Combined with the units and algorithm steps of each example disclosed in the embodiments of the present disclosure, the embodiments of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or by computer software driving the hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to go beyond the scope of the technical solutions of the embodiments of the present disclosure.
图5是根据一示例性实施例示出的一种多帧图像对齐装置框图100。参照图5,该装置包括获取单元101和处理单元102。FIG. 5 is a block diagram 100 of a multi-frame image alignment device according to an exemplary embodiment. Referring to FIG. 5 , the device includes an acquisition unit 101 and a processing unit 102 .
该获取单元101被配置为获取多帧图像的参考帧和支持帧。The acquisition unit 101 is configured to acquire reference frames and support frames of multi-frame images.
该处理单元102被配置为对参考帧进行快速傅里叶变换,得到参考帧的频域信号,并对支持帧进行快速傅里叶变换,得到支持帧的频域信号;以及基于参考帧的频域信号和支持帧的频域信号,对齐支持帧和参考帧,得到多帧对齐的图像。The processing unit 102 is configured to perform fast Fourier transform on the reference frame to obtain the frequency domain signal of the reference frame, perform fast Fourier transform on the support frame to obtain the frequency domain signal of the support frame; and perform frequency domain signal based on the reference frame. domain signal and the frequency domain signal of the supporting frame, align the supporting frame and the reference frame, and obtain a multi-frame aligned image.
在本公开实施例中,处理单元102处理单元采用如下方式基于参考帧的频域信号和支持帧的频域信号,对齐支持帧和参考帧:基于参考帧的频域信号和支持帧的频域信号,确定第一幅值和第二幅值,第一幅值为参考帧的频域信号对应的幅值,第二幅值为支持帧的频域信号对应的幅值;基于第一幅值和第二幅值,确定参考帧和参考帧之间的对齐参数,对齐参数包括以下至少一种:偏移量、旋转量以及缩放量;基于对齐参数,对齐支持帧和参考帧。In the embodiment of the present disclosure, the processing unit 102 uses the following method to align the supporting frame and the reference frame based on the frequency domain signal of the reference frame and the frequency domain signal of the supporting frame: based on the frequency domain signal of the reference frame and the frequency domain signal of the supporting frame signal, determine the first amplitude and the second amplitude. The first amplitude is the amplitude corresponding to the frequency domain signal of the reference frame, and the second amplitude is the amplitude corresponding to the frequency domain signal of the support frame; based on the first amplitude and a second amplitude to determine an alignment parameter between the reference frame and the reference frame, where the alignment parameter includes at least one of the following: offset, rotation, and scaling; based on the alignment parameter, align the support frame and the reference frame.
在本公开实施例中,对齐参数包括偏移量;处理单元102采用如下方式基于第一幅值和第二幅值,确定参考帧和参考帧之间的对齐参数:基于第一幅值和第二幅值,确定参考帧的频域信号和支持帧的频域信号的相关度;基于相关度的最大值,确定参考帧和支持帧之间的偏移量。In the embodiment of the present disclosure, the alignment parameter includes an offset; the processing unit 102 determines the alignment parameter between the reference frame and the reference frame based on the first amplitude and the second amplitude in the following manner: based on the first amplitude and the second amplitude. The two amplitude values determine the correlation between the frequency domain signal of the reference frame and the frequency domain signal of the support frame; based on the maximum value of the correlation, determine the offset between the reference frame and the support frame.
在本公开实施例中,对齐参数包括旋转量和/或缩放量;处理单元102采用如下方式基于第一幅值和第二幅值,确定参考帧和支持帧之间的对齐参数:将第一幅值和第二幅值分别转换到极坐标,得到第一极坐标幅值和第二极坐标幅值;基于第一极坐标幅值和第二极坐标幅值,确定参考帧和支持帧之间的旋转量和/或缩放量。In the embodiment of the present disclosure, the alignment parameter includes a rotation amount and/or a scaling amount; the processing unit 102 determines the alignment parameter between the reference frame and the supporting frame based on the first amplitude value and the second amplitude value in the following manner: convert the first The amplitude and the second amplitude are converted to polar coordinates respectively to obtain the first polar coordinate amplitude and the second polar coordinate amplitude; based on the first polar coordinate amplitude and the second polar coordinate amplitude, the reference frame and the support frame are determined. The amount of rotation and/or scaling between
在本公开实施例中,处理单元102采用如下方式基于第一幅值和第二幅值,确定所述参考帧和支持帧之间的对齐参数:确定第一幅值和第二幅值的交叉功率谱;对交叉功率谱进行快速傅里叶逆变换后得到峰值,基于峰值确定参考帧和支持帧之间的对齐参数。In the embodiment of the present disclosure, the processing unit 102 determines the alignment parameter between the reference frame and the supporting frame based on the first amplitude and the second amplitude in the following manner: determining the intersection of the first amplitude and the second amplitude. Power spectrum; perform inverse fast Fourier transform on the cross power spectrum to obtain the peak value, and determine the alignment parameters between the reference frame and the support frame based on the peak value.
在本公开实施例中,处理单元102采用如下方式对参考帧进行快速傅里叶变换,得到参考帧的频域信号,并对支持帧进行快速傅里叶变换,得到支持帧的频域信号:对参考帧进行Y通道下采样后进行快速傅里叶变换,得到参考帧的频域信号,并对支持帧进行Y通道下采样后进行快速傅里叶变换,得到支持帧的频域信号。In the embodiment of the present disclosure, the processing unit 102 performs fast Fourier transform on the reference frame in the following manner to obtain the frequency domain signal of the reference frame, and performs fast Fourier transform on the support frame to obtain the frequency domain signal of the support frame: The reference frame is subjected to Y channel downsampling and then fast Fourier transform is performed to obtain the frequency domain signal of the reference frame. The support frame is Y channel downsampled and then fast Fourier transformed is performed to obtain the frequency domain signal of the support frame.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实 施例中进行了详细描述,此处将不做详细阐述说明。Regarding the devices in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be described in detail here.
图6是根据一示例性实施例示出的一种用于多帧图像对齐的装置200的框图。例如,装置200可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。FIG. 6 is a block diagram of a device 200 for multi-frame image alignment according to an exemplary embodiment. For example, the device 200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
参照图6,装置200可以包括以下一个或多个组件:处理组件202,存储器204,电力组件206,多媒体组件208,音频组件210,输入/输出(I/O)接口212,传感器组件214,以及通信组件216。Referring to Figure 6, device 200 may include one or more of the following components: processing component 202, memory 204, power component 206, multimedia component 208, audio component 210, input/output (I/O) interface 212, sensor component 214, and Communication component 216.
处理组件202通常控制装置200的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件202可以包括一个或多个处理器220来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件202可以包括一个或多个模块,便于处理组件202和其他组件之间的交互。例如,处理组件202可以包括多媒体模块,以方便多媒体组件208和处理组件202之间的交互。 Processing component 202 generally controls the overall operations of device 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 202 may include one or more modules that facilitate interaction between processing component 202 and other components. For example, processing component 202 may include a multimedia module to facilitate interaction between multimedia component 208 and processing component 202.
存储器204被配置为存储各种类型的数据以支持在装置200的操作。这些数据的示例包括用于在装置200上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器204可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。 Memory 204 is configured to store various types of data to support operations at device 200 . Examples of such data include instructions for any application or method operating on device 200, contact data, phonebook data, messages, pictures, videos, etc. Memory 204 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
电力组件206为装置200的各种组件提供电力。电力组件206可以包括电源管理系统,一个或多个电源,及其他与为装置200生成、管理和分配电力相关联的组件。 Power component 206 provides power to various components of device 200 . Power components 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 200 .
多媒体组件208包括在所述装置200和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件208包括一个前置摄像头和/或后置摄像头。当装置200处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。 Multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action. In some embodiments, multimedia component 208 includes a front-facing camera and/or a rear-facing camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
音频组件210被配置为输出和/或输入音频信号。例如,音频组件210包括一个麦克风(MIC),当装置200处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器204或经由通信 组件216发送。在一些实施例中,音频组件210还包括一个扬声器,用于输出音频信号。 Audio component 210 is configured to output and/or input audio signals. For example, audio component 210 includes a microphone (MIC) configured to receive external audio signals when device 200 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 204 or sent via communications component 216. In some embodiments, audio component 210 also includes a speaker for outputting audio signals.
I/O接口212为处理组件202和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 212 provides an interface between the processing component 202 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
传感器组件214包括一个或多个传感器,用于为装置200提供各个方面的状态评估。例如,传感器组件214可以检测到装置200的打开/关闭状态,组件的相对定位,例如所述组件为装置200的显示器和小键盘,传感器组件214还可以检测装置200或装置200一个组件的位置改变,用户与装置200接触的存在或不存在,装置200方位或加速/减速和装置200的温度变化。传感器组件214可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件214还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件214还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor component 214 includes one or more sensors for providing various aspects of status assessment for device 200 . For example, the sensor component 214 can detect the open/closed state of the device 200, the relative positioning of components, such as the display and keypad of the device 200, and the sensor component 214 can also detect a change in position of the device 200 or a component of the device 200. , the presence or absence of user contact with the device 200 , device 200 orientation or acceleration/deceleration and temperature changes of the device 200 . Sensor assembly 214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 214 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件216被配置为便于装置200和其他设备之间有线或无线方式的通信。装置200可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件216经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件216还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。 Communication component 216 is configured to facilitate wired or wireless communication between apparatus 200 and other devices. Device 200 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 216 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 216 also includes a near field communications (NFC) module to facilitate short-range communications. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,装置200可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, apparatus 200 may be configured by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the above method.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器204,上述指令可由装置200的处理器220执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as a memory 204 including instructions, which can be executed by the processor 220 of the device 200 to complete the above method is also provided. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
进一步可以理解的是,本公开中“多个”是指两个或两个以上,其它量词与之类似。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。It can be further understood that “plurality” in this disclosure refers to two or more, and other quantifiers are similar. "And/or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the related objects are in an "or" relationship. The singular forms "a", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
进一步可以理解的是,术语“第一”、“第二”等用于描述各种信息,但这些信息不应 限于这些术语。这些术语仅用来将同一类型的信息彼此区分开,并不表示特定的顺序或者重要程度。实际上,“第一”、“第二”等表述完全可以互换使用。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。It is further understood that the terms "first", "second", etc. are used to describe various information, but the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other and do not imply a specific order or importance. In fact, expressions such as "first" and "second" can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information may also be called second information, and similarly, the second information may also be called first information.
进一步可以理解的是,本公开实施例中尽管在附图中以特定的顺序描述操作,但是不应将其理解为要求按照所示的特定顺序或是串行顺序来执行这些操作,或是要求执行全部所示的操作以得到期望的结果。在特定环境中,多任务和并行处理可能是有利的。It will be further understood that although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, this should not be understood as requiring that these operations be performed in the specific order shown or in a serial order, or that it is required that Perform all operations shown to obtain the desired results. In certain circumstances, multitasking and parallel processing may be advantageous.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the disclosure. .
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利范围来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the disclosure is limited only by the appended rights.

Claims (14)

  1. 一种多帧图像对齐方法,其特征在于,应用于终端,所述方法包括:A multi-frame image alignment method, characterized in that, applied to a terminal, the method includes:
    获取多帧图像的参考帧和支持帧;Obtain the reference frames and supporting frames of multi-frame images;
    对所述参考帧进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行快速傅里叶变换,得到所述支持帧的频域信号;Perform fast Fourier transform on the reference frame to obtain the frequency domain signal of the reference frame, and perform fast Fourier transform on the support frame to obtain the frequency domain signal of the support frame;
    基于所述参考帧的频域信号和所述支持帧的频域信号,对齐所述支持帧和所述参考帧,得到多帧对齐的图像。Based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame, the support frame and the reference frame are aligned to obtain a multi-frame aligned image.
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述参考帧的频域信号和所述支持帧的频域信号,对齐所述支持帧和所述参考帧,包括:The method of claim 1, wherein aligning the support frame and the reference frame based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame includes:
    基于所述参考帧的频域信号和所述支持帧的频域信号,确定第一幅值和第二幅值,所述第一幅值为所述参考帧的频域信号对应的幅值,所述第二幅值为所述支持帧的频域信号对应的幅值;Based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame, determine a first amplitude and a second amplitude, where the first amplitude is the amplitude corresponding to the frequency domain signal of the reference frame, The second amplitude is the amplitude corresponding to the frequency domain signal of the support frame;
    基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数,所述对齐参数包括以下至少一种:偏移量、旋转量以及缩放量;Based on the first amplitude and the second amplitude, an alignment parameter between the reference frame and the support frame is determined, the alignment parameter including at least one of the following: an offset, a rotation, and a scaling. ;
    基于所述对齐参数,对齐所述支持帧和所述参考帧。The support frame and the reference frame are aligned based on the alignment parameter.
  3. 根据权利要求2所述的方法,其特征在于,所述对齐参数包括偏移量;The method of claim 2, wherein the alignment parameter includes an offset;
    所述基于所述第一幅值和所述第二幅值,确定所述参考帧和所述参考帧之间的对齐参数,包括:Determining the alignment parameter between the reference frame and the reference frame based on the first amplitude value and the second amplitude value includes:
    基于所述第一幅值和所述第二幅值,确定所述参考帧的频域信号和所述支持帧的频域信号的相关度;Based on the first amplitude and the second amplitude, determine the correlation between the frequency domain signal of the reference frame and the frequency domain signal of the support frame;
    基于所述相关度的最大值,确定所述参考帧和所述支持帧之间的偏移量。Based on the maximum value of the correlation, an offset between the reference frame and the support frame is determined.
  4. 根据权利要求2所述的方法,其特征在于,所述对齐参数包括旋转量和/或缩放量;The method according to claim 2, wherein the alignment parameter includes a rotation amount and/or a scaling amount;
    所述基于所述第一幅值和所述第二幅值,确定所述参考帧和所述参考帧之间的对齐参数,包括:Determining the alignment parameter between the reference frame and the reference frame based on the first amplitude value and the second amplitude value includes:
    将所述第一幅值和所述第二幅值分别转换到极坐标,得到第一极坐标幅值和第二极坐标幅值;Convert the first amplitude value and the second amplitude value to polar coordinates respectively to obtain the first polar coordinate amplitude value and the second polar coordinate amplitude value;
    基于所述第一极坐标幅值和所述第二极坐标幅值,确定所述参考帧和所述支持帧之间的旋转量和/或缩放量。An amount of rotation and/or scaling between the reference frame and the support frame is determined based on the first polar magnitude and the second polar magnitude.
  5. 根据权利要求2至4中任意一项所述的方法,其特征在于,所述基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数,包括:The method according to any one of claims 2 to 4, wherein the alignment between the reference frame and the support frame is determined based on the first amplitude value and the second amplitude value. Parameters, including:
    确定所述第一幅值和所述第二幅值的交叉功率谱;determining a cross power spectrum of the first amplitude and the second amplitude;
    对所述交叉功率谱进行快速傅里叶逆变换后得到峰值,基于所述峰值确定所述参考帧和所述支持帧之间的对齐参数。A peak value is obtained after performing an inverse fast Fourier transform on the cross power spectrum, and an alignment parameter between the reference frame and the support frame is determined based on the peak value.
  6. 根据权利要求1所述的方法,其特征在于,对所述参考帧进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行快速傅里叶变换,得到所述支持帧的频域信号,包括:The method according to claim 1, characterized in that, fast Fourier transform is performed on the reference frame to obtain the frequency domain signal of the reference frame, and fast Fourier transform is performed on the support frame to obtain the The frequency domain signals that support frames include:
    对所述参考帧进行Y通道下采样后进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行Y通道下采样后进行快速傅里叶变换,得到所述支持帧的频域信号。Perform Y-channel downsampling on the reference frame and then perform fast Fourier transform to obtain the frequency domain signal of the reference frame. Perform Y-channel downsampling on the support frame and then perform fast Fourier transform to obtain the Supports framed frequency domain signals.
  7. 一种多帧图像对齐装置,其特征在于,应用于终端,所述装置包括:A multi-frame image alignment device, characterized in that it is applied to a terminal, and the device includes:
    获取单元,用于获取多帧图像的参考帧和支持帧;An acquisition unit is used to acquire the reference frame and support frame of the multi-frame image;
    处理单元,用于对所述参考帧进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行快速傅里叶变换,得到所述支持帧的频域信号;并基于所述参考帧的频域信号和所述支持帧的频域信号,对齐所述支持帧和所述参考帧,得到多帧对齐的图像。A processing unit configured to perform fast Fourier transform on the reference frame to obtain the frequency domain signal of the reference frame, and perform fast Fourier transform on the support frame to obtain the frequency domain signal of the support frame; And based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame, the support frame and the reference frame are aligned to obtain a multi-frame aligned image.
  8. 根据权利要求7所述的装置,其特征在于,所述处理单元采用如下方式基于所述参考帧的频域信号和所述支持帧的频域信号,对齐所述支持帧和所述参考帧:The device according to claim 7, wherein the processing unit aligns the supporting frame and the reference frame based on the frequency domain signal of the reference frame and the frequency domain signal of the supporting frame in the following manner:
    基于所述参考帧的频域信号和所述支持帧的频域信号,确定第一幅值和第二幅值,所述第一幅值为所述参考帧的频域信号对应的幅值,所述第二幅值为所述支持帧的频域信号对应的幅值;Based on the frequency domain signal of the reference frame and the frequency domain signal of the support frame, determine a first amplitude and a second amplitude, where the first amplitude is the amplitude corresponding to the frequency domain signal of the reference frame, The second amplitude is the amplitude corresponding to the frequency domain signal of the support frame;
    基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数,所述对齐参数包括以下至少一种:偏移量、旋转量以及缩放量;Based on the first amplitude and the second amplitude, an alignment parameter between the reference frame and the support frame is determined, the alignment parameter including at least one of the following: an offset, a rotation, and a scaling. ;
    基于所述对齐参数,对齐所述支持帧和所述参考帧。The support frame and the reference frame are aligned based on the alignment parameter.
  9. 根据权利要求8所述的装置,其特征在于,所述对齐参数包括偏移量;The device of claim 8, wherein the alignment parameter includes an offset;
    所述处理单元采用如下方式基于所述第一幅值和所述第二幅值,确定所述参考帧和所述参考帧之间的对齐参数:The processing unit determines the alignment parameter between the reference frame and the reference frame based on the first amplitude value and the second amplitude value in the following manner:
    基于所述第一幅值和所述第二幅值,确定所述参考帧的频域信号和所述支持帧的频域信号的相关度;Based on the first amplitude and the second amplitude, determine the correlation between the frequency domain signal of the reference frame and the frequency domain signal of the support frame;
    基于所述相关度的最大值,确定所述参考帧和所述支持帧之间的偏移量。Based on the maximum value of the correlation, an offset between the reference frame and the support frame is determined.
  10. 根据权利要求8所述的装置,其特征在于,所述对齐参数包括旋转量和/或缩放量;The device according to claim 8, wherein the alignment parameter includes an amount of rotation and/or an amount of scaling;
    所述处理单元采用如下方式基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数:The processing unit determines the alignment parameter between the reference frame and the support frame based on the first amplitude and the second amplitude in the following manner:
    将所述第一幅值和所述第二幅值分别转换到极坐标,得到第一极坐标幅值和第二极坐 标幅值;Convert the first amplitude and the second amplitude to polar coordinates respectively to obtain the first polar coordinate amplitude and the second polar coordinate amplitude;
    基于所述第一极坐标幅值和所述第二极坐标幅值,确定所述参考帧和所述参考帧之间的旋转量和/或缩放量。An amount of rotation and/or scaling between the reference frame and the reference frame is determined based on the first polar magnitude and the second polar magnitude.
  11. 根据权利要求8至10中任意一项所述的装置,其特征在于,所述处理单元采用如下方式基于所述第一幅值和所述第二幅值,确定所述参考帧和所述支持帧之间的对齐参数:The device according to any one of claims 8 to 10, characterized in that the processing unit determines the reference frame and the support based on the first amplitude and the second amplitude in the following manner: Alignment parameters between frames:
    确定所述第一幅值和所述第二幅值的交叉功率谱;determining a cross power spectrum of the first amplitude and the second amplitude;
    对所述交叉功率谱进行快速傅里叶逆变换后得到峰值,基于所述峰值确定所述参考帧和所述支持帧之间的对齐参数。A peak value is obtained after performing an inverse fast Fourier transform on the cross power spectrum, and an alignment parameter between the reference frame and the support frame is determined based on the peak value.
  12. 根据权利要求7所述的装置,其特征在于,所述处理单元采用如下方式对所述参考帧进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行快速傅里叶变换,得到所述支持帧的频域信号:The device according to claim 7, characterized in that the processing unit performs fast Fourier transform on the reference frame in the following manner to obtain the frequency domain signal of the reference frame, and performs fast Fourier transformation on the support frame. Fourier transform is used to obtain the frequency domain signal of the support frame:
    对所述参考帧进行Y通道下采样后进行快速傅里叶变换,得到所述参考帧的频域信号,并对所述支持帧进行Y通道下采样后进行快速傅里叶变换,得到所述支持帧的频域信号。Perform Y-channel downsampling on the reference frame and then perform fast Fourier transform to obtain the frequency domain signal of the reference frame. Perform Y-channel downsampling on the support frame and then perform fast Fourier transform to obtain the Supports framed frequency domain signals.
  13. 一种多帧图像对齐装置,其特征在于,包括:A multi-frame image alignment device, characterized by including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;Memory used to store instructions executable by the processor;
    其中,所述处理器被配置为:执行权利要求1至6中任一项所述的多帧图像对齐方法。Wherein, the processor is configured to perform the multi-frame image alignment method according to any one of claims 1 to 6.
  14. 一种非临时性计算机可读存储介质,当所述存储介质中的指令由终端的处理器执行时,使得终端能够执行权利要求1至6中任一项所述的多帧图像对齐方法。A non-transitory computer-readable storage medium that, when instructions in the storage medium are executed by a processor of a terminal, enables the terminal to perform the multi-frame image alignment method described in any one of claims 1 to 6.
PCT/CN2022/099957 2022-06-20 2022-06-20 Method for aligning multiple image frames, apparatus for aligning multiple image frames, and storage medium WO2023245383A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202280004289.7A CN117616455A (en) 2022-06-20 2022-06-20 Multi-frame image alignment method, multi-frame image alignment device and storage medium
PCT/CN2022/099957 WO2023245383A1 (en) 2022-06-20 2022-06-20 Method for aligning multiple image frames, apparatus for aligning multiple image frames, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/099957 WO2023245383A1 (en) 2022-06-20 2022-06-20 Method for aligning multiple image frames, apparatus for aligning multiple image frames, and storage medium

Publications (1)

Publication Number Publication Date
WO2023245383A1 true WO2023245383A1 (en) 2023-12-28

Family

ID=89378969

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099957 WO2023245383A1 (en) 2022-06-20 2022-06-20 Method for aligning multiple image frames, apparatus for aligning multiple image frames, and storage medium

Country Status (2)

Country Link
CN (1) CN117616455A (en)
WO (1) WO2023245383A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6373970B1 (en) * 1998-12-29 2002-04-16 General Electric Company Image registration using fourier phase matching
CN105425216A (en) * 2015-11-24 2016-03-23 西安电子科技大学 Image-segmentation-based registration method of polarized InSAR image in repeated passing
CN108876826A (en) * 2017-05-10 2018-11-23 深圳先进技术研究院 A kind of image matching method and system
CN110650295A (en) * 2019-11-26 2020-01-03 展讯通信(上海)有限公司 Image processing method and device
CN111353948A (en) * 2018-12-24 2020-06-30 Tcl集团股份有限公司 Image noise reduction method, device and equipment
CN113313707A (en) * 2021-06-25 2021-08-27 西安紫光展锐科技有限公司 Original image processing method, device, equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6373970B1 (en) * 1998-12-29 2002-04-16 General Electric Company Image registration using fourier phase matching
CN105425216A (en) * 2015-11-24 2016-03-23 西安电子科技大学 Image-segmentation-based registration method of polarized InSAR image in repeated passing
CN108876826A (en) * 2017-05-10 2018-11-23 深圳先进技术研究院 A kind of image matching method and system
CN111353948A (en) * 2018-12-24 2020-06-30 Tcl集团股份有限公司 Image noise reduction method, device and equipment
CN110650295A (en) * 2019-11-26 2020-01-03 展讯通信(上海)有限公司 Image processing method and device
CN113313707A (en) * 2021-06-25 2021-08-27 西安紫光展锐科技有限公司 Original image processing method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN117616455A (en) 2024-02-27

Similar Documents

Publication Publication Date Title
KR101772177B1 (en) Method and apparatus for obtaining photograph
US9661223B2 (en) Method and device for photographing including camera shake
JP6348611B2 (en) Automatic focusing method, apparatus, program and recording medium
JP6335289B2 (en) Method and apparatus for generating an image filter
WO2016090829A1 (en) Image shooting method and device
WO2020042826A1 (en) Video stream denoising method and apparatus, electronic device and storage medium
WO2021104227A1 (en) Photographing method and electronic device
JP7167244B2 (en) Occluded Image Detection Method, Apparatus, and Medium
WO2021104226A1 (en) Photographing method and electronic device
WO2022266907A1 (en) Processing method, terminal device and storage medium
CN105323491A (en) Image shooting method and device
WO2018053722A1 (en) Panoramic photo capture method and device
CN112799522A (en) Mobile terminal control method and device, mobile terminal and storage medium
WO2023245383A1 (en) Method for aligning multiple image frames, apparatus for aligning multiple image frames, and storage medium
US11555696B2 (en) Electronic terminal, photographing method and device, and storage medium
WO2023225910A1 (en) Video display method and apparatus, terminal device, and computer storage medium
CN114979321A (en) Notification information display method and device, terminal and storage medium
WO2023206475A1 (en) Image processing method and apparatus, electronic device and storage medium
CN112188095B (en) Photographing method, photographing device and storage medium
CN111986097B (en) Image processing method and device
WO2023245343A1 (en) Image processing method, image processing device, and storage medium
US20220308638A1 (en) Method for obtaining data indicating direction, electronic device and storage medium
KR101324809B1 (en) Mobile terminal and controlling method thereof
CN114339015B (en) Photographing processing method, photographing processing device and storage medium
WO2023220868A1 (en) Image processing method and apparatus, terminal, and storage medium