WO2021114883A1 - Image registration method, terminal, and storage medium - Google Patents

Image registration method, terminal, and storage medium Download PDF

Info

Publication number
WO2021114883A1
WO2021114883A1 PCT/CN2020/122474 CN2020122474W WO2021114883A1 WO 2021114883 A1 WO2021114883 A1 WO 2021114883A1 CN 2020122474 W CN2020122474 W CN 2020122474W WO 2021114883 A1 WO2021114883 A1 WO 2021114883A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
registration
rotation
time
terminal
Prior art date
Application number
PCT/CN2020/122474
Other languages
French (fr)
Chinese (zh)
Inventor
权威
马元蛟
罗俊
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2021114883A1 publication Critical patent/WO2021114883A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Definitions

  • the embodiments of the present application relate to the field of image processing technology, and in particular, to an image registration method, terminal, and storage medium.
  • Image registration is a process of matching and superimposing two or more images acquired at different times, different sensors (imaging equipment) or under different conditions (weather, illuminance, camera position and angle, etc.).
  • block matching, feature detection or optical flow methods are commonly used to detect the movement of picture pixels, and then use the above results to re-move the pixels to generate a new image to match the image content.
  • the current image registration method will have the problem of reduced accuracy and greatly reduced processing speed when moving between larger frames.
  • the embodiments of the present application provide an image registration method, terminal, and storage medium, which effectively improve the processing speed and the accuracy of image registration during image registration processing.
  • an embodiment of the present application provides an image registration method, the method including:
  • the second image is acquired at the second moment
  • a movement parameter between the first registration image and the second image is determined, and registration processing is performed on the first registration image according to the movement parameter to obtain a second registration image.
  • an embodiment of the present application provides a terminal, the terminal includes: an acquisition part, a determination part, a registration part,
  • the acquiring part is configured to acquire a second image at a second time after acquiring the first image at the first time;
  • the determining part is configured to determine a rotation parameter between the first time and the second time
  • the registration part is configured to perform registration processing on the first image according to the rotation parameter to obtain a first registered image
  • the determining part is further configured to determine a movement parameter between the first registration image and the second image
  • the registration part is further configured to perform registration processing on the first registration image according to the movement parameter to obtain a second registration image.
  • an embodiment of the present application provides a terminal.
  • the terminal includes a processor and a memory storing executable instructions of the processor. When the instructions are executed by the processor, the above-mentioned Image registration method.
  • an embodiment of the present application provides a computer-readable storage medium with a program stored thereon and applied to a terminal.
  • the program is executed by a processor, the image registration method as described above is implemented.
  • the embodiments of the present application provide an image registration method, terminal, and storage medium. After acquiring the first image at the first time, the terminal acquires the second image at the second time; determining the rotation between the first time and the second time Parameters, and perform registration processing on the first image according to the rotation parameters to obtain the first registration image; determine the movement parameters between the first registration image and the second image, and register the first registration image according to the movement parameters Alignment processing to obtain a second registered image. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time.
  • the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
  • Figure 1 is the first schematic diagram of the implementation process of the image registration method
  • Figure 2 is a second schematic diagram of the implementation process of the image registration method
  • Figure 3 is the third schematic diagram of the implementation process of the image registration method
  • Figure 4 is a schematic diagram of the amount of rotation in a spatial direction
  • Fig. 5 is a schematic diagram of the rotation of the imaging surface
  • Fig. 6 is the first schematic diagram of the projection sequence in the y-axis direction
  • Fig. 7 is the second schematic diagram of the projection number sequence in the y-axis direction
  • Figure 8 is a schematic diagram of the amount of movement in the x-axis plane direction
  • Figure 9 is a schematic diagram of the amount of movement in the y-axis plane direction
  • Figure 10 is a schematic diagram of a terminal structure
  • Figure 11 is a second schematic diagram of the terminal structure.
  • Image registration is a common method in image processing. In the shooting of multi-frame images, due to the movement of the shooting device, the content of the captured images will have slight differences, which often requires priority in multi-frame image processing. After global registration is performed on the image, various other processings are performed. In other words, image registration is the process of matching and superimposing two or more images acquired at different times, different sensors (imaging equipment) or under different conditions (weather, illuminance, camera position and angle, etc.). It is widely used in remote sensing data analysis, computer vision, image processing and other fields.
  • Image registration methods are mainly divided into three categories: pixel-based registration methods, feature-based registration methods, and model-based registration methods.
  • the first two methods are global image registration techniques, which require the assumption of The reason for the change of the object is often caused by motion.
  • the third method is suitable for the local nonlinear deformation correction of the object holder in the image. This distortion is usually caused by the nonlinearity of the spatial encoding of the imaging system.
  • the terminal can first perform feature detection processing to obtain feature points, and then can find matching feature point pairs by performing similarity measurement to complete feature matching; then pass The matched feature point pairs obtain the image space coordinate transformation parameters, and finally the image registration is performed by the coordinate transformation parameters to obtain the matching image.
  • the terminal can record the rotation between the first time and the second time while acquiring the first image and the second image at the first time and the second time.
  • Parameters and movement parameters first use the rotation parameter to correct the change of the image content caused by the terminal rotation, and then use the movement parameter to correct the change of the image content caused by the terminal translation, so that the first image can be realized from different aspects.
  • the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
  • FIG. 1 is a schematic diagram of the implementation process of the image registration method.
  • the method for the terminal to perform image registration may include The following steps:
  • Step 101 After acquiring the first image at the first moment, acquire the second image at the second moment.
  • the terminal may first obtain the first image at the first time, and then obtain the second image at the second time.
  • the second moment is any moment after the first moment.
  • the terminal can be any device with communication and storage functions, such as: tablet computer, mobile phone, e-reader, remote control, personal computer (PC), notebook computer , In-vehicle equipment, Internet TV, wearable devices and other equipment.
  • tablet computer mobile phone
  • e-reader remote control
  • PC personal computer
  • notebook computer In-vehicle equipment
  • Internet TV Internet TV
  • wearable devices and other equipment.
  • the terminal may be equipped with a photographing device, so that the photographing device may be used to sequentially acquire the first image and the second image.
  • the photographing device may be an image sensor.
  • the photographing device may be a charge-coupled device (CCD) or a complementary metal oxide semiconductor (Complementary Metal Oxide Semiconductor, CMOS) configured with a terminal.
  • CCD is a detection element that expresses the signal size by the amount of charge and transmits the signal in a coupling mode. It has self-scanning, wide sensing spectrum range, small distortion, small size, light weight, low system noise, low power consumption, and longevity.
  • CMOS refers to a technology used to manufacture large-scale integrated circuit chips or chips manufactured by this technology. It is a readable and writable random access memory (RAM) chip on a computer motherboard. Because of the readable and writable characteristics, it is used to save the data after the hardware parameters of the Basic Input Output System (BIOS) are set on the computer motherboard. This chip is only used to store the data.
  • BIOS Basic Input Output System
  • the terminal may use a photographing device to sequentially photograph and obtain two frames of images at the first time and the second time, that is, the first image and the second image. Specifically, the terminal may first use the camera to capture the first image at the first moment, and then use the camera to capture the second image at the second moment.
  • the terminal may define the first image corresponding to the first moment as the image to be registered, that is, the image used for registration processing.
  • the terminal may define the second image corresponding to the second moment as a reference image, that is, an image used as a reference reference.
  • the terminal may also be equipped with a gyroscope, so as to use the gyroscope to detect the rotation of the terminal.
  • the gyroscope is an angular motion detection device that uses the moment-of-momentum-sensitive housing of a high-speed rotating body to rotate one or two axes orthogonal to the rotation axis relative to the inertial space.
  • Angular motion detection devices made by other principles are also called gyroscopes that perform the same function.
  • the terminal can use the configured gyroscope to perform real-time detection, so as to obtain each rotation data corresponding to each moment.
  • the rotation data may include angular velocity data in different spatial directions.
  • the terminal may use a gyroscope to detect angular velocities on the x-axis, y-axis, and z-axis.
  • Step 102 Determine the rotation parameter between the first time and the second time, and perform registration processing on the first image according to the rotation parameter to obtain the first registered image.
  • the terminal after the terminal obtains the first image and the second image at the first time and the second time respectively, it can first determine the rotation parameters between the first time and the second time, and then can determine the rotation parameters between the first time and the second time.
  • the parameter performs registration processing on the first image, thereby obtaining the first registered image.
  • the terminal may first use the configured gyroscope to collect and obtain each rotation data corresponding to each time. And store these rotation data.
  • the terminal when the terminal determines the rotation parameter between the first time and the second time, it can first read the difference between the first time and the second time from the address where the rotation parameter is stored. Then, based on the rotation data between the first time and the second time, the rotation parameters between the first time and the second time can be further generated.
  • the rotation parameter may be used to determine the specific rotation amount of the terminal between the first time and the second time.
  • the rotation data may include angular velocity data in different spatial directions
  • the rotation parameters generated by the terminal based on the rotation data between the first time and the second time may also include different Different amounts of rotation in the spatial direction.
  • the rotation parameter may be the angle of change on the x-axis, the y-axis, and the z-axis generated by the terminal between the first moment and the second moment.
  • the rotation parameter when the terminal uses the second image collected at the second time as the reference image, and the first image collected at the first time is the image to be registered for image registration, the rotation parameter needs to be used. , Wherein the rotation parameter is determined by multiple rotation data between the first time and the second time detected by the gyroscope.
  • the gyroscope configured on the terminal when the gyroscope configured on the terminal is collecting rotation data, the higher the sampling frequency, the better.
  • the gyroscope can use With a sampling frequency higher than 200HZ, the angular velocities in the three different spatial directions of the x-axis, the y-axis and the z-axis are collected, so as to obtain multiple rotation data between the first moment and the second moment.
  • a higher sampling frequency is more conducive to a more accurate registration effect.
  • the terminal after the terminal determines the rotation parameter between the first time and the second time, it can perform registration processing on the first image according to the rotation parameter, so that the registration result can be obtained, that is, The first registration image.
  • the terminal since the rotation parameter includes a plurality of rotation amounts corresponding to a plurality of spatial directions, where one spatial direction corresponds to a rotation amount, the terminal performs the first image according to the rotation parameters.
  • a plurality of rotation amounts may be used to generate a rotation matrix, and then the first image is rotated according to the rotation matrix to complete the registration of the first image and the second image.
  • the rotation matrix is used to determine the rotation of the terminal between the first time and the second time, that is, to characterize the rotation change when the terminal takes the first image and the second image.
  • the terminal uses the rotation matrix to perform image registration processing, which can be used to compensate for the difference between the first image and the second image caused by the rotation of the terminal.
  • the rotation matrix is a multi-dimensional matrix composed of multiple rotation quantities in multiple spatial directions.
  • the rotation parameters are the angle values on the x-axis, y-axis, and z-axis
  • the rotation can first construct an angle matrix in each spatial direction based on the amount of rotation in each spatial direction, and then use all the spatial directions All the angle matrices above constitute the rotation matrix of the terminal between the first moment and the second moment.
  • the terminal when the terminal generates a rotation matrix using multiple rotations, it may first construct multiple sub-matrices based on the multiple rotations, and then generate the rotation matrix based on the multiple sub-matrices.
  • the terminal when the terminal performs rotation processing on the first image based on the rotation matrix, it can first determine all the pixel coordinates corresponding to all the pixels in the first image, and then use the rotation matrix and all the pixel coordinates.
  • the pixel coordinates are subjected to a dot product operation, so that the rotation processing of the first image can be completed. That is, in this application, the terminal can obtain all the pixel coordinates corresponding to all the pixels in the first image, and then use the rotation matrix to rotate all the pixel coordinates, so as to obtain the first registration image to realize the image registration. Quasi-processing.
  • Step 103 Determine a movement parameter between the first registration image and the second image, and perform registration processing on the first registration image according to the movement parameter to obtain a second registration image.
  • the terminal determines the rotation parameter between the first time and the second time, and performs registration processing on the first image according to the rotation parameter, and after obtaining the first registered image, it can continue to determine the first image.
  • the movement parameters between the registered image and the second image can then be registered with the first registered image according to the movement parameters, so that the second registered image can be obtained.
  • the gyroscope since the gyroscope records the angle of the terminal's rotation between the first time and the second time, it cannot completely monitor the terminal's rotation between the first time and the second time. The movement situation is determined. Therefore, after the terminal realizes the correction of the rotation of the terminal through the first registration image, it can continue to determine the movement of the terminal, that is, perform a translation search.
  • the terminal when the terminal performs a translation search, it can determine the amount of movement of the first registration image in different plane directions based on the second image (reference image), so as to obtain The movement parameter between the first registered image and the second image.
  • the movement parameter can be used to determine the specific movement amount of the terminal between the first time and the second time. That is, in this application, the movement parameter may include multiple movement amounts corresponding to multiple plane directions. Exemplarily, the movement parameter may be the changing distance on the x-axis and the y-axis generated by the terminal between the first time and the second time.
  • the terminal may first determine a plurality of projection series corresponding to the first registration image and the second image along a plurality of different plane directions, and then may use the first registration image
  • the correlation between the two projection numbers in the same plane direction as the second image can determine the amount of movement between the two in the plane direction, which can then determine how much the first registered image and the second image are. Multiple amounts of movement in each plane direction. That is, in this application, when determining the movement parameter between the first registration image and the second image, the terminal may first determine multiple first projection sequences of the first registration image in multiple plane directions. At the same time, multiple second projection numbers in multiple plane directions can be determined for the second image; then multiple first projection numbers and multiple second projection numbers can be used to determine multiple shifts between the two. the amount.
  • the terminal after the terminal determines the movement parameter between the first moment and the second moment, it can perform registration processing on the first registered image according to the movement parameter, so that the registration result can be obtained. , Which is the second registration image.
  • the terminal is performing the first registration according to the movement parameters.
  • a plurality of movement amounts may be used to perform translation processing on the first registration image to complete the re-registration of the first registration image and the second image.
  • the movement parameter is used to determine the movement of the terminal from the first moment to the second moment, that is, to characterize the movement change when the terminal takes the first image and the second image.
  • the terminal uses the movement parameters to perform image registration processing, which can be used to compensate for the difference between the first image and the second image caused by the movement of the terminal.
  • the method proposed in step 102 above can be used to correct the rotation change of the terminal when performing image registration, and can realize rough alignment of the first image and the second image.
  • the method proposed in step 103 above can be used to correct the movement changes of the terminal when performing image registration, and can also achieve coarse alignment of the first image and the second image.
  • FIG. 2 is a second schematic diagram of the implementation process of the image registration method.
  • the terminal performs registration processing on the first registered image according to the movement parameters to obtain the second registration method.
  • the method for the terminal to perform image registration may further include the following steps:
  • Step 104 Determine the pixel movement amount corresponding to the second registration image by using the movement parameter.
  • Step 105 Perform registration processing according to the pixel shift amount to obtain a third registered image.
  • the terminal after the terminal performs registration processing on the first registration image according to the movement parameters to obtain the second registration image, it may continue to use the movement parameters to determine the pixel movement amount corresponding to the second registration image. Then, the translation processing can be performed according to the pixel shift amount, so that the fourth registration image can be obtained to complete the registration processing of the first image and the second image.
  • the terminal in order to obtain a higher-precision registration result, that is, to achieve fine alignment between the first image and the second image, the terminal may continue after obtaining the second registered image Using the movement parameters to perform pixel translation processing on the second registered image.
  • the terminal may first use the movement parameters to further search to obtain all pixel movement amounts corresponding to all pixels in the second registration image, and then may use all pixel movement amounts to perform translation processing on all pixels In this way, a third registration image can be obtained to complete the fine alignment between the first image and the second image.
  • FIG. 3 is the third schematic diagram of the implementation process of the image registration method.
  • the terminal performs registration processing on the first image according to the rotation parameter to obtain the first registered image
  • the method for the terminal to perform image registration may further include the following steps:
  • Step 106 Determine a movement parameter between the first registration image and the second image, and determine the pixel movement amount corresponding to the second registration image according to the movement parameter.
  • Step 107 Perform translation processing according to the pixel shift amount to obtain a fourth registered image.
  • the terminal determines the rotation parameter between the first time and the second time, and performs registration processing on the first image according to the rotation parameter. After obtaining the first registration image, it can continue to determine the first registration.
  • the movement parameter between the quasi-image and the second image is further determined according to the movement parameter and the pixel movement amount corresponding to the second registration image.
  • the terminal in order to obtain a higher-precision registration result, that is, to achieve fine alignment between the first image and the second image, the terminal may skip to the first image after obtaining the first registered image.
  • the movement parameters are directly used to perform pixel translation processing on the first registration image.
  • the terminal may first use the movement parameters to further search to obtain all pixel movement amounts corresponding to all pixels in the first registration image, and then use all pixel movement amounts to perform translation processing on all pixels In this way, a fourth registration image can be obtained to complete the fine alignment between the first image and the second image.
  • the terminal when the terminal performs image registration, it can first use the method proposed in step 102 to correct the rotation change of the terminal, so as to realize the rough alignment of the first image and the second image; Directly using the method proposed in step 106 and step 107 above, when correcting the movement change of the terminal, the first image and the second image are directly aligned to obtain the fourth registered image.
  • a terminal acquires a first image at a first time, and then acquires a second image at a second time; determines the rotation parameter between the first time and the second time, and determines the rotation parameter according to the rotation Parameter performs registration processing on the first image to obtain the first registration image; determines the movement parameter between the first registration image and the second image, and performs registration processing on the first registration image according to the movement parameter to obtain the first registration image Two registration images. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time.
  • the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
  • the terminal may use a gyroscope to detect the rotation of the terminal. Specifically, the terminal uses the gyroscope to perform real-time detection, so that each rotation corresponding to each moment can be obtained. data.
  • the rotation data may be angular velocity data in different spatial directions.
  • the terminal may use a gyroscope to detect each angular velocity on the x-axis, y-axis, and z-axis corresponding to each moment.
  • the terminal can use the configured gyroscope to record the real-time angular velocity of the terminal in the three directions of the x-axis, the y-axis, and the z-axis.
  • the terminal may obtain the rotation parameters between the first time and the second time based on the rotation data.
  • the gyroscope detects multiple angular velocities on the x-axis, y-axis, and z-axis between the first time t1 and the second time t2, and then the x-axis, the y-axis, and the z-axis can be adjusted on the time axis.
  • the multiple angular velocities on the y-axis and the z-axis are integrated to obtain the rotation amount of the terminal in the x-axis, y-axis, and z-axis directions between the first time t1 and the second time t2. That is, the rotation parameters between the first moment and the second moment are obtained.
  • Fig. 4 is a schematic diagram of the amount of rotation in a spatial direction. As shown in Fig.
  • the angular velocities w1, w2, and w2 of a spatial direction collected by the gyroscope at t1, t2, t3, t4, t5, t6, t7, t8, and t9 w3, w4, w5, w6, w7, w8, and w9 are discretely distributed.
  • the terminal smooths the angular velocity in the spatial direction on the time t axis and then integrates, and finally the terminal's angular velocity in the time period from t1 to t9 can be obtained. ,
  • the terminal may use the multiple rotation quantities to generate a rotation matrix. Specifically, the terminal may first construct multiple sub-matrices based on multiple rotation amounts; and then generate corresponding rotation matrices based on the multiple sub-matrices.
  • the terminal performs interpolation and smoothing processing on the rotation data in the x-axis, y-axis, and z-axis directions according to the time series, and the corresponding rotation amount in the x-axis direction is obtained by integration as ⁇ , and the corresponding rotation in the y-axis direction
  • the rotation amount of is ⁇
  • the corresponding rotation amount in the z-axis direction is ⁇
  • the terminal can use the following formula to obtain the corresponding sub-matrix R x in the x-axis direction, the corresponding sub-matrix R y in the y-axis direction, and the z-axis
  • the corresponding sub-matrix R z in the direction :
  • the terminal can use the corresponding sub-matrix R x in the x-axis direction, the corresponding sub-matrix R y in the y- axis direction, and the corresponding sub-matrix R z in the z-axis direction to further generate the rotation matrix, as follows:
  • the terminal can calculate and obtain three rotation amounts in the x-axis, y-axis, and z-axis directions in the above-mentioned manner.
  • the imaging surface obtained by the photographing device also rotates accordingly. Therefore, the terminal can correct the movement caused by the rotation of the terminal by applying this rotation to the imaging surface.
  • Figure 5 is a schematic diagram of the rotation of the imaging surface. As shown in Figure 5, the center of rotation is selected as the middle position of the image plane (the cross of the dashed line), and the terminal can be generated by the amount of rotation based on the x-axis, y-axis, and z-axis direction.
  • the rotation matrix of, the imaging surface is corrected, and the corrected imaging surface is obtained. It should be noted that due to the existence of translation, the center of rotation also has a corresponding offset. Therefore, the motion of the screen caused by the rotation of the terminal cannot be completely corrected. However, it has been proved that this method can perform the motion of the screen caused by the rotation of the terminal. Preliminary estimation, so it can be used to initially align images.
  • the terminal may further perform rotation processing on the first image based on the rotation matrix to obtain the first registered image. Specifically, the terminal may first obtain all the pixel coordinates corresponding to all the pixels in the first image, and then use the rotation matrix to rotate all the pixel coordinates, so as to obtain the first registered image.
  • the terminal uses the rotation matrix to perform rotation processing on the first image.
  • the rotation matrix can be used to perform dot product calculations on all pixel coordinates corresponding to all pixels in the first image to obtain the calculation results, and then project the calculation results in the z-axis direction, so that the coordinates of the rotated pixels can be obtained .
  • the specific formula is as follows:
  • the terminal can move the point with the projection coordinates (x, y) to the position with the projection coordinates (x', y'), and finally can complete the rotation processing of the pixel coordinates of the pixel point. Accordingly, After the terminal completes the rotation processing of all pixel coordinates in the first image based on the rotation matrix, the first registration image can be obtained, thereby completing the preliminary registration of the first image.
  • the terminal needs to perform interpolation processing to obtain pixel values of integer points.
  • the interpolation method can only win bilinear interpolation or bicubic interpolation, which is not specifically limited in this application.
  • the rotation matrix obtained by calculation can be used to correct the rotation change of the terminal, so as to realize the rough alignment of the first image and the second image.
  • a terminal acquires a first image at a first time, and then acquires a second image at a second time; determines the rotation parameter between the first time and the second time, and determines the rotation parameter according to the rotation Parameter performs registration processing on the first image to obtain the first registration image; determines the movement parameter between the first registration image and the second image, and performs registration processing on the first registration image according to the movement parameter to obtain the first registration image Two registration images. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time.
  • the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
  • the first registered image obtained by the terminal performing registration processing on the first image according to the rotation parameter has largely corrected the image content brought about by the terminal rotation
  • the gyroscope since the gyroscope only records the angle information when the terminal is rotating, it cannot record the movement information of the terminal. Therefore, the terminal still needs to perform further registration processing on the first registration image through a translation search.
  • the movement parameter determined by the terminal may include multiple movement amounts corresponding to multiple plane directions.
  • the movement parameter may be that the terminal moves between the first time and the second time. The resulting two movements on the x-axis and y-axis.
  • the terminal when it determines the movement parameters, it may first determine the first registration image and the first registration image along a plurality of different plane directions, such as the x-axis direction and the y-axis direction. Multiple projection sequences corresponding to the two images. That is to say, since the first registration image has corrected most of the rotation changes, in order to speed up the image registration, the terminal can directly search for the movement amount of the x-axis and the y-axis by means of a translation search.
  • the terminal may perform an averaging operation on the first registered image and the second image along the x-axis direction and the y-axis direction, respectively, so as to obtain two projection numbers in the x-axis direction and the y-axis direction.
  • the terminal may add and average the image data of the first column of the first registration image to obtain the result of the first column projection in the y-axis direction, and then sequentially calculate and obtain the y-axis direction of the first registration image. Projection sequence on the.
  • the terminal can add the image data of the first column of the second image and average it, so as to obtain the result of the first column projection in the y-axis direction, and then sequentially calculate and obtain the projection number sequence in the y-axis direction of the second image. .
  • the terminal can respectively calculate and obtain the projection number sequence of the first registered image and the second image in the x-axis direction and the y-axis direction.
  • FIG. 6 is a schematic diagram 1 of the projection number sequence in the y-axis direction. As shown in FIG. 6, based on the image data of the first registration degree image, each column of image data is projected along the y-axis direction to obtain the first projection number sequence.
  • Fig. 7 is the second schematic diagram of the projection number sequence in the y-axis direction. As shown in Fig. 7, based on the image data of the second image, each column of image data is projected along the y-axis direction to obtain the second projection number sequence.
  • the terminal when determining the movement parameter between the first registration image and the second image, may first determine multiple first projection sequences of the first registration image in multiple plane directions. At the same time, multiple second projection number sequences of the second image in multiple plane directions can be determined, and then multiple first projection number sequences and multiple second projection number sequences can be used to determine multiple movement amounts. Specifically, the terminal can determine the correlation between the first registration image and the second image in the same plane direction based on the first projection number sequence and the second projection number sequence in the same plane direction, and then can use the correlation between the two The amount of movement between the two in the plane direction is determined, and finally, the amount of movement in the multiple plane directions of the first registered image and the second image can be determined.
  • the terminal uses the correlation between the first projection number sequence and the second projection number sequence in the y-axis plane direction to determine the amount of movement between the two in the y-axis plane direction
  • the first The first projection sequence of a registered image is fixed, and then the second projection sequence of the second image is moved along the x-axis plane direction.
  • the correlation between the first projection sequence and the moved second projection sequence For real-time determination, when the correlation between the first projection number sequence and the moved second projection number sequence is the largest, the movement distance of the second projection number sequence in the x-axis plane direction at this time can be determined as the first registration image and The amount of movement of the second image in the x-axis plane direction.
  • the terminal uses the correlation between the first projection number sequence and the second projection number sequence in the x-axis plane direction to determine the amount of movement between the two in the x-axis plane direction
  • the first The first projection sequence of the registered image is fixed, and then the second projection sequence of the second image is moved along the y-axis plane direction.
  • the correlation between the first projection sequence and the moved second projection sequence is performed Real-time determination, when the correlation between the first projection number sequence and the moved second projection number sequence is the largest, the movement distance of the second projection number sequence in the y-axis plane direction at this time can be determined as the first registration image and the second projection number sequence. 2.
  • a zero cross-correlation algorithm or an average absolute difference can be used.
  • Algorithm mean absolute difference, MAD is used for calculation, which is not specifically limited in this application.
  • Figure 8 is a schematic diagram of the amount of movement in the x-axis plane direction.
  • the first projection number sequence in the y-axis plane direction is fixed, and the second projection number sequence in the y-axis plane direction is performed along the x-axis direction.
  • the correlation between the first projection number sequence and the second projection number sequence is the largest.
  • d1 can be used as the movement amount of the first registration image and the second image in the x-axis plane direction mv x .
  • Figure 9 is a schematic diagram of the amount of movement in the y-axis plane direction.
  • the first projection number sequence in the x-axis plane direction is fixed, and the second projection number sequence in the x-axis plane direction is performed along the y-axis direction. Translation.
  • the movement distance is d2
  • the correlation between the first projection number sequence and the second projection number sequence is the largest.
  • d2 can be used as the movement amount of the first registration image and the second image in the y-axis plane direction mv y .
  • the terminal may use the multiple movement amounts to perform translation processing on the first registration image. For example, the terminal may Use the movement amount mv x in the x-axis plane direction to translate the first registered image along the x-axis direction, and at the same time, use the movement amount mv y in the y-axis plane direction to move the first registered image along the y-axis By performing translation processing in the direction, the further alignment of the first registration image can be completed, and the second registration image can be obtained.
  • the movement parameters can be obtained through translation search processing, which can be used to correct the movement changes of the terminal, and the rough alignment of the first image and the second image can also be achieved.
  • the terminal may continue to use the movement after performing registration processing on the first registration image according to the movement parameters to obtain the second registration image.
  • the parameters further finely align the second registration image.
  • the terminal may use the movement parameter to perform pixel translation processing on the second registered image.
  • the terminal may use the movement parameter to obtain the pixel movement amount of the second registered image, where the pixel movement amount is used to perform translation processing of the pixel points.
  • the terminal may use the amount of movement of the moving amount mv mv x plane x-axis direction and the y-axis obtained above y planar direction, as a starting point for a search for a second registration image, to obtain a further second registration The more accurate pixel shift corresponding to the image.
  • the terminal may use multiple methods to determine the pixel movement amount, such as an optical flow method or a block search method. That is to say, in this application, movement parameters including multiple movement amounts corresponding to multiple plane directions can be used as the initial value of fine alignment and input into the registration algorithm to speed up the registration process. This application does not deal with the search method of fine alignment. limited.
  • the terminal may directly use the movement parameters to perform the adjustment of the first registration image. Perform pixel translation processing.
  • the terminal can directly use the movement parameters to search for all pixel movement amounts corresponding to all pixels in the first registration image, and then use all pixel movement amounts to perform translation processing on all pixels, so as to obtain the fourth registration image , To complete the fine alignment between the first image and the second image.
  • a terminal acquires a first image at a first time, and then acquires a second image at a second time; determines the rotation parameter between the first time and the second time, and determines the rotation parameter according to the rotation Parameter performs registration processing on the first image to obtain the first registration image; determines the movement parameter between the first registration image and the second image, and performs registration processing on the first registration image according to the movement parameter to obtain the first registration image Two registration images. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time.
  • the terminal can perform registration processing on the first image and the second image through the real-time collection of rotation parameters and the movement parameters obtained by the translation search processing by the gyroscope, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
  • FIG. 10 is a schematic diagram 1 of the composition structure of the terminal.
  • the terminal 10 proposed in the embodiment of the present application may include an acquiring part 11, a determining part 12, and a configuration. Standard part 13, storage part 14.
  • the acquiring part 11 is configured to acquire a second image at a second time after acquiring the first image at the first time;
  • the determining part 12 is configured to determine a rotation parameter between the first time and the second time
  • the registration part 13 is configured to perform registration processing on the first image according to the rotation parameter to obtain a first registered image
  • the determining part 12 is further configured to determine a movement parameter between the first registration image and the second image
  • the registration part 13 is further configured to perform registration processing on the first registration image according to the movement parameter to obtain a second registration image.
  • the rotation parameter includes a plurality of rotation amounts corresponding to a plurality of spatial directions
  • the registration part 13 is specifically configured to generate a rotation matrix using the plurality of rotation amounts;
  • the rotation matrix performs rotation processing on the first image to obtain the first registration image.
  • the registration part 13 is further specifically configured to construct a plurality of sub-matrices according to the plurality of rotation amounts; and generate the rotation matrix based on the plurality of sub-matrices.
  • the registration part 13 is further specifically configured to obtain all pixel coordinates corresponding to all pixels in the first image; and perform the calculation of all the pixel coordinates by using the rotation matrix. Rotate processing to obtain the first registered image.
  • the movement parameter includes a plurality of movement amounts corresponding to a plurality of plane directions
  • the determining part 12 is specifically configured to determine that the first registration image is in the plurality of plane directions.
  • a plurality of first projection number sequences of the second image are determined in the plurality of plane directions; the plurality of first projection number sequences and the plurality of second projection number sequences are used to determine the Multiple moves.
  • the acquisition part 11 is specifically configured to perform translation processing on the first registration image by using the plurality of movement amounts to obtain the second registration image.
  • the determining part 12 is further configured to perform registration processing on the first registration image according to the movement parameter, and after obtaining the second registration image, use the movement The parameter determines the pixel shift amount corresponding to the second registration image;
  • the acquiring part 11 is further configured to perform translation processing according to the pixel shift amount to obtain a third registered image.
  • the determining part 12 is further configured to perform registration processing on the first image according to the rotation parameter, and after obtaining the first registration image, determine the first registration The movement parameter between the quasi image and the second image, and determining the pixel movement amount corresponding to the second registration image according to the movement parameter;
  • the acquiring part 11 is further configured to perform translation processing according to the pixel shift amount to obtain a fourth registered image.
  • the acquiring part 11 is further configured to perform real-time collection through a gyroscope before determining the rotation parameter between the first time and the second time to obtain each time Each corresponding rotation data;
  • the storage part 14 is configured to store each of the rotation data.
  • the determining part 12 is further specifically configured to read a plurality of rotation data between the first moment and the second moment; determine according to the plurality of rotation data The rotation parameter between the first time and the second time.
  • FIG. 11 is a schematic diagram of the composition structure of the terminal.
  • the terminal 10 proposed in the embodiment of the present application may further include a processor 15 and a memory 16 storing executable instructions of the processor 15. Further, the terminal 10 may also It includes a communication interface 17 and a bus 18 for connecting the processor 15, the memory 16 and the communication interface 17.
  • the above-mentioned processor 15 may be an Application Specific Integrated Circuit (ASIC), a digital signal processor (Digital Signal Processor, DSP), or a digital signal processing device (Digital Signal Processing Device, DSPD). ), Programmable Logic Device (ProgRAMmable Logic Device, PLD), Field Programmable Gate Array (Field ProgRAMmable Gate Array, FPGA), Central Processing Unit (CPU), Controller, Microcontroller, Microprocessor At least one of. It is understandable that, for different devices, the electronic devices used to implement the above-mentioned processor functions may also be other, which is not specifically limited in the embodiment of the present application.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Signal Processor
  • DSPD Digital Signal Processing Device
  • PLD Programmable Logic Device
  • Field Programmable Gate Array Field ProgRAMmable Gate Array
  • CPU Central Processing Unit
  • Controller Microcontroller
  • Microprocessor At least one of. It is understandable that, for different devices, the electronic devices used to implement the above-mentioned
  • the terminal 10 may also include a memory 16, which may be connected to the processor 15, wherein the memory 16 is used to store executable program code, the program code includes computer operation instructions, the memory 16 may include a high-speed RAM memory, or may also include Non-volatile memory, for example, at least two disk memories.
  • the bus 18 is used to connect the communication interface 17, the processor 15, the memory 16, and the mutual communication among these devices.
  • the memory 16 is used to store instructions and data.
  • the above-mentioned processor 15 is configured to acquire a second image at a second time after acquiring the first image at the first time; determine whether the first time and the second time are different And perform registration processing on the first image according to the rotation parameter to obtain a first registration image; determine the movement parameter between the first registration image and the second image, and Performing registration processing on the first registration image according to the movement parameter to obtain a second registration image.
  • the aforementioned memory 16 may be a volatile memory (volatile memory), such as a random-access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and send it to the processor 15 Provide instructions and data.
  • volatile memory such as a random-access memory (Random-Access Memory, RAM)
  • non-volatile memory such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and send it to the processor 15 Provide instructions and data.
  • the functional modules in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be realized in the form of hardware or software function module.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this embodiment is essentially or correct
  • the part that the prior art contributes or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer).
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • An embodiment of the present application proposes a terminal. After acquiring the first image at the first time, the terminal acquires the second image at the second time; determines the rotation parameter between the first time and the second time, and compares the rotation parameters according to the rotation parameter.
  • the first image undergoes registration processing to obtain the first registration image; the movement parameters between the first registration image and the second image are determined, and the first registration image is registered according to the movement parameters to obtain the second registration image. Quasi-image. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time.
  • the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
  • the embodiment of the present application provides a computer-readable storage medium on which a program is stored, and when the program is executed by a processor, the above-mentioned image registration method is implemented.
  • the program instructions corresponding to an image registration method in this embodiment can be stored on storage media such as optical disks, hard disks, USB flash drives, etc., when the program instructions corresponding to an image registration method in the storage medium When being read or executed by an electronic device, it includes the following steps:
  • the second image is acquired at the second moment
  • a movement parameter between the first registration image and the second image is determined, and registration processing is performed on the first registration image according to the movement parameter to obtain a second registration image.
  • this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device realizes the functions specified in one or more processes in the schematic diagram and/or one block or more in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in one or more processes in the schematic diagram and/or one block or more in the block diagram.
  • the terminal after acquiring the first image at the first time, acquires the second image at the second time; determines the rotation parameter between the first time and the second time, and configures the first image according to the rotation parameter.
  • a registration process is performed to obtain a first registration image; a movement parameter between the first registration image and the second image is determined, and registration processing is performed on the first registration image according to the movement parameter to obtain a second registration image. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time.
  • the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.

Abstract

Disclosed in embodiments of the present application are an image registration method, a terminal, and a storage medium. The image registration method comprises: obtaining a first image at a first moment, and then obtaining a second image at a second moment; determining a rotation parameter between the first moment and the second moment, and performing registration processing on the first image according to the rotation parameter to obtain a first registration image; and determining a movement parameter between the first registration image and the second image, and performing registration processing on the first registration image according to the movement parameter to obtain a second registration image.

Description

图像配准方法、终端及存储介质Image registration method, terminal and storage medium
本申请基于申请号为201911260229.8、申请日为2019年12月10日、申请名称为“图像配准方法、终端及存储介质”的在先中国专利申请提出,并要求该在先中国专利申请的优先权,该在先中国专利申请的全部内容在此引入本申请作为参考。This application is based on a prior Chinese patent application with the application number 201911260229.8, the application date being December 10, 2019, and the application name "Image registration method, terminal and storage medium", and the priority of the prior Chinese patent application is required Right, the entire content of the prior Chinese patent application is hereby incorporated into this application as a reference.
技术领域Technical field
本申请实施例涉及图像处理技术领域,尤其涉及一种图像配准方法、终端及存储介质。The embodiments of the present application relate to the field of image processing technology, and in particular, to an image registration method, terminal, and storage medium.
背景技术Background technique
图像配准是将不同时间、不同传感器(成像设备)或不同条件下(天候、照度、摄像位置和角度等)获取的两幅或多幅图像进行匹配、叠加的过程。目前常用块匹配,特征检测或者光流法来检测出画面像素的移动,再利用上述结果重新移动像素生成新图像来匹配图像内容。Image registration is a process of matching and superimposing two or more images acquired at different times, different sensors (imaging equipment) or under different conditions (weather, illuminance, camera position and angle, etc.). At present, block matching, feature detection or optical flow methods are commonly used to detect the movement of picture pixels, and then use the above results to re-move the pixels to generate a new image to match the image content.
由于拍摄过程中拍摄装置的旋转和移动,连拍或视频图像的连续多帧图像之间会存在较大的帧间运动。而目前的图像配准方法在较大帧间运动时会出现精度下降,处理速度大幅降低的问题。Due to the rotation and movement of the shooting device during the shooting process, there will be a large inter-frame motion between continuous shooting or continuous multiple frames of video images. However, the current image registration method will have the problem of reduced accuracy and greatly reduced processing speed when moving between larger frames.
发明内容Summary of the invention
本申请实施例提供了一种图像配准方法、终端及存储介质,在进行图像配准处理时,有效提高了处理速度,同时提升图像配准的精度。The embodiments of the present application provide an image registration method, terminal, and storage medium, which effectively improve the processing speed and the accuracy of image registration during image registration processing.
本申请实施例的技术方案是这样实现的:The technical solutions of the embodiments of the present application are implemented as follows:
第一方面,本申请实施例提供了一种图像配准方法,所述方法包括:In the first aspect, an embodiment of the present application provides an image registration method, the method including:
在第一时刻获取第一图像之后,在第二时刻获取第二图像;After the first image is acquired at the first moment, the second image is acquired at the second moment;
确定所述第一时刻与所述第二时刻之间的转动参数,并根据所述转动参数对所述第一图像进行配准处理,获得第一配准图像;Determining a rotation parameter between the first time and the second time, and performing registration processing on the first image according to the rotation parameter to obtain a first registration image;
确定所述第一配准图像和所述第二图像之间的移动参数,并根据所述移动参数对所述第一配准图像进行配准处理,获得第二配准图像。A movement parameter between the first registration image and the second image is determined, and registration processing is performed on the first registration image according to the movement parameter to obtain a second registration image.
第二方面,本申请实施例提供了一种终端,所述终端包括:获取部分,确定部分,配准部分,In a second aspect, an embodiment of the present application provides a terminal, the terminal includes: an acquisition part, a determination part, a registration part,
所述获取部分,配置为在第一时刻获取第一图像之后,在第二时刻获取第二图像;The acquiring part is configured to acquire a second image at a second time after acquiring the first image at the first time;
所述确定部分,配置为确定所述第一时刻与所述第二时刻之间的转动 参数;The determining part is configured to determine a rotation parameter between the first time and the second time;
所述配准部分,配置为根据所述转动参数对所述第一图像进行配准处理,获得第一配准图像;The registration part is configured to perform registration processing on the first image according to the rotation parameter to obtain a first registered image;
所述确定部分,还配置为确定所述第一配准图像和所述第二图像之间的移动参数;The determining part is further configured to determine a movement parameter between the first registration image and the second image;
所述配准部分,还配置为根据所述移动参数对所述第一配准图像进行配准处理,获得第二配准图像。The registration part is further configured to perform registration processing on the first registration image according to the movement parameter to obtain a second registration image.
第三方面,本申请实施例提供了一种终端,所述终端包括处理器、存储有所述处理器可执行指令的存储器,当所述指令被所述处理器执行时,实现如上所述的图像配准方法。In a third aspect, an embodiment of the present application provides a terminal. The terminal includes a processor and a memory storing executable instructions of the processor. When the instructions are executed by the processor, the above-mentioned Image registration method.
第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有程序,应用于终端中,所述程序被处理器执行时,实现如上所述的图像配准方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium with a program stored thereon and applied to a terminal. When the program is executed by a processor, the image registration method as described above is implemented.
本申请实施例提供了一种图像配准方法、终端及存储介质,终端在第一时刻获取第一图像之后,在第二时刻获取第二图像;确定第一时刻与第二时刻之间的转动参数,并根据转动参数对第一图像进行配准处理,获得第一配准图像;确定第一配准图像和第二图像之间的移动参数,并根据移动参数对第一配准图像进行配准处理,获得第二配准图像。也就是说,在本申请的实施例中,终端可以在第一时刻和第二时刻获取第一图像和第二图像的同时,记录第一时刻与第二时刻之间的转动参数和移动参数,先利用转动参数对由于终端旋转造成的图像内容的改变进行补正,再利用移动参数对由于终端平移造成的图像内容的改变进行补正,从而可以从不同的方面实现对第一图像和第二图像的对齐处理,从而可以以更快的速度获得效果更好的配准图像。也就是说,在本申请中,终端可以通过陀螺仪对转动参数的实时采集和平移搜索处理获得的移动参数,分别对第一图像和第二图像进行配准处理,不但可以加快图像配准的速度,还可以提升图像配准的精度。The embodiments of the present application provide an image registration method, terminal, and storage medium. After acquiring the first image at the first time, the terminal acquires the second image at the second time; determining the rotation between the first time and the second time Parameters, and perform registration processing on the first image according to the rotation parameters to obtain the first registration image; determine the movement parameters between the first registration image and the second image, and register the first registration image according to the movement parameters Alignment processing to obtain a second registered image. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time. First use the rotation parameter to correct the change of the image content caused by the terminal rotation, and then use the movement parameter to correct the change of the image content caused by the terminal translation, so that the first image and the second image can be achieved from different aspects. Alignment processing, which can obtain better registered images at a faster speed. That is to say, in this application, the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
附图说明Description of the drawings
图1为图像配准方法的实现流程示意图一;Figure 1 is the first schematic diagram of the implementation process of the image registration method;
图2为图像配准方法的实现流程示意图二;Figure 2 is a second schematic diagram of the implementation process of the image registration method;
图3为图像配准方法的实现流程示意图三;Figure 3 is the third schematic diagram of the implementation process of the image registration method;
图4为一个空间方向上的转动量的示意图;Figure 4 is a schematic diagram of the amount of rotation in a spatial direction;
图5为成像面转动的示意图;Fig. 5 is a schematic diagram of the rotation of the imaging surface;
图6为y轴方向的投影数列示意图一;Fig. 6 is the first schematic diagram of the projection sequence in the y-axis direction;
图7为y轴方向的投影数列示意图二;Fig. 7 is the second schematic diagram of the projection number sequence in the y-axis direction;
图8为x轴平面方向上的移动量的示意图;Figure 8 is a schematic diagram of the amount of movement in the x-axis plane direction;
图9为y轴平面方向上的移动量的示意图;Figure 9 is a schematic diagram of the amount of movement in the y-axis plane direction;
图10为终端的组成结构示意图一;Figure 10 is a schematic diagram of a terminal structure;
图11为终端的组成结构示意图二。Figure 11 is a second schematic diagram of the terminal structure.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅仅用于解释相关申请,而非对该申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关申请相关的部分。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It is understandable that the specific embodiments described here are only used to explain the related application, but not to limit the application. In addition, it should be noted that, for ease of description, only the parts related to the relevant application are shown in the drawings.
图像配准(Image registration)是图像处理中的一种常见方法,在多帧图像的拍摄中,由于拍摄装置移动,拍摄的图像在内容上会产生微小差别,在多帧图像处理中往往需要优先对图像进行全局配准(global registration)后再进行各种其他处理。也就是说,图像配准是将不同时间、不同传感器(成像设备)或不同条件下(天候、照度、摄像位置和角度等)获取的两幅或多幅图像进行匹配、叠加的过程,它已经被广泛地应用于遥感数据分析、计算机视觉、图像处理等领域。Image registration is a common method in image processing. In the shooting of multi-frame images, due to the movement of the shooting device, the content of the captured images will have slight differences, which often requires priority in multi-frame image processing. After global registration is performed on the image, various other processings are performed. In other words, image registration is the process of matching and superimposing two or more images acquired at different times, different sensors (imaging equipment) or under different conditions (weather, illuminance, camera position and angle, etc.). It is widely used in remote sensing data analysis, computer vision, image processing and other fields.
图像配准的方法主要分为基于像素的配准方法、基于特征的配准方法以及基于模型的配准方法这三类,其中,前两种方法是全局图像配准技术,需要假设图像中的对象的改变原因往往是由运动引起的,第三中方法适合图像中的对象支架局部的非线性的变形校正,这种失真通常由于成像系统空间编码的非线性引起的。Image registration methods are mainly divided into three categories: pixel-based registration methods, feature-based registration methods, and model-based registration methods. Among them, the first two methods are global image registration techniques, which require the assumption of The reason for the change of the object is often caused by motion. The third method is suitable for the local nonlinear deformation correction of the object holder in the image. This distortion is usually caused by the nonlinearity of the spatial encoding of the imaging system.
正式由于图像配准是将图像内容经过变换后对齐的一种技术手段,因此常用块匹配,特征检测或者光流法来检测出画面像素的移动,再利用上述结果重新移动像素生成新图像来匹配图像内容。在基于特征检测的图像配方法中,对于输入的多个图像,终端可以先进行特征检测处理,获得特征点,然后可以通过进行相似性度量找到匹配的特征点对,完成特征匹配;接下来通过匹配的特征点对得到图像空间坐标变换参数,最后由坐标变换参数进行图像配准,获得匹配图像。Formally, because image registration is a technical means to align image content after transformation, block matching, feature detection or optical flow methods are often used to detect the movement of picture pixels, and then use the above results to re-move the pixels to generate a new image to match Image content. In the image matching method based on feature detection, for the input multiple images, the terminal can first perform feature detection processing to obtain feature points, and then can find matching feature point pairs by performing similarity measurement to complete feature matching; then pass The matched feature point pairs obtain the image space coordinate transformation parameters, and finally the image registration is performed by the coordinate transformation parameters to obtain the matching image.
然而,如果连续多帧图像之间存在较大的帧间运动情况,利用块匹配,特征检测或者光流法进行图像匹配时,匹配的过程会更加复杂,相应地,配准精度和匹配效率都会受到影响。However, if there is a large inter-frame motion between consecutive multiple frames of images, the matching process will be more complicated when using block matching, feature detection or optical flow method for image matching. Correspondingly, the registration accuracy and matching efficiency will be both affected.
综上所述,由于拍摄过程中拍摄装置的旋转和移动,连拍或视频图像的连续多帧图像之间会存在较大的帧间运动。而目前的图像配准方法在较大帧间运动时会出现精度下降,处理速度大幅降低的问题。为了克服上述缺陷,本申请所提出的一种图像配准方法,终端可以在第一时刻和第二时刻获取第一图像和第二图像的同时,记录第一时刻与第二时刻之间的转动参数和移动参数,先利用转动参数对由于终端旋转造成的图像内容的改变进行补正,再利用移动参数对由于终端平移造成的图像内容的改变进行补正,从而可以从不同的方面实现对第一图像和第二图像的对齐处理,从而 可以以更快的速度获得效果更好的配准图像。也就是说,在本申请中,终端可以通过陀螺仪对转动参数的实时采集和平移搜索处理获得的移动参数,分别对第一图像和第二图像进行配准处理,不但可以加快图像配准的速度,还可以提升图像配准的精度。To sum up, due to the rotation and movement of the shooting device during the shooting process, there will be a large inter-frame motion between consecutive multiple frames of continuous shooting or video images. However, the current image registration method will have the problem of reduced accuracy and greatly reduced processing speed when moving between larger frames. In order to overcome the above shortcomings, an image registration method proposed in this application, the terminal can record the rotation between the first time and the second time while acquiring the first image and the second image at the first time and the second time. Parameters and movement parameters, first use the rotation parameter to correct the change of the image content caused by the terminal rotation, and then use the movement parameter to correct the change of the image content caused by the terminal translation, so that the first image can be realized from different aspects. Alignment processing with the second image, so that a better registered image can be obtained at a faster speed. That is to say, in this application, the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
本申请一实施例提供了一种图像配准方法,图1为图像配准方法的实现流程示意图一,如图1所示,在本申请的实施例中,终端进行图像配准的方法可以包括以下步骤:An embodiment of the present application provides an image registration method. FIG. 1 is a schematic diagram of the implementation process of the image registration method. As shown in FIG. 1, in the embodiment of the present application, the method for the terminal to perform image registration may include The following steps:
步骤101、在第一时刻获取第一图像之后,在第二时刻获取第二图像。Step 101: After acquiring the first image at the first moment, acquire the second image at the second moment.
在本申请的实施例中,终端可以先在第一时刻获取第一图像,然后再在第二时刻获取第二图像。其中,第二时刻为第一时刻之后的任意时刻。In the embodiment of the present application, the terminal may first obtain the first image at the first time, and then obtain the second image at the second time. Among them, the second moment is any moment after the first moment.
需要说明的是,在本申请的实施例中,终端可以为任何具备通信和存储功能的设备,例如:平板电脑、手机、电子阅读器、遥控器、个人计算机(Personal Computer,PC)、笔记本电脑、车载设备、网络电视、可穿戴设备等设备。It should be noted that in the embodiments of the present application, the terminal can be any device with communication and storage functions, such as: tablet computer, mobile phone, e-reader, remote control, personal computer (PC), notebook computer , In-vehicle equipment, Internet TV, wearable devices and other equipment.
可以理解的是,在本申请的实施例中,终端可以配置有拍摄装置,从而可以利用拍摄装置依次获取第一图像和第二图像。其中,拍摄装置可以为图像传感器。示例性的,拍摄装置可以为终端配置的电荷耦合器件(Charge-coupled Device,CCD)或者互补金属氧化物半导体(Complementary Metal Oxide Semiconductor,CMOS)。具体地,CCD是一种用电荷量表示信号大小,用耦合方式传输信号的探测元件,具有自扫描、感受波谱范围宽、畸变小、体积小、重量轻、系统噪声低、功耗小、寿命长、可靠性高等一系列优点,并可做成集成度非常高的组合件。CMOS是指制造大规模集成电路芯片用的一种技术或用这种技术制造出来的芯片,是电脑主板上的一块可读写的随机存取存储器(Random Access Memory,RAM)芯片。因为可读写的特性,所以在电脑主板上用来保存基本输入输出系统(Basic Input Output System,BIOS)设置完硬件参数后的数据,这个芯片仅仅是用来存放数据的。It can be understood that, in the embodiment of the present application, the terminal may be equipped with a photographing device, so that the photographing device may be used to sequentially acquire the first image and the second image. Among them, the photographing device may be an image sensor. Exemplarily, the photographing device may be a charge-coupled device (CCD) or a complementary metal oxide semiconductor (Complementary Metal Oxide Semiconductor, CMOS) configured with a terminal. Specifically, CCD is a detection element that expresses the signal size by the amount of charge and transmits the signal in a coupling mode. It has self-scanning, wide sensing spectrum range, small distortion, small size, light weight, low system noise, low power consumption, and longevity. A series of advantages such as long, high reliability, etc., and can be made into a highly integrated assembly. CMOS refers to a technology used to manufacture large-scale integrated circuit chips or chips manufactured by this technology. It is a readable and writable random access memory (RAM) chip on a computer motherboard. Because of the readable and writable characteristics, it is used to save the data after the hardware parameters of the Basic Input Output System (BIOS) are set on the computer motherboard. This chip is only used to store the data.
进一步地,在本申请的实施例中,终端可以通过拍摄装置,依次在第一时刻和第二时刻拍摄获得两帧图像,即第一图像和第二图像。具体地,终端可以先利用拍摄装置在第一时刻采集第一图像,然后利用拍摄装置在第二时刻采集第二图像。Further, in the embodiment of the present application, the terminal may use a photographing device to sequentially photograph and obtain two frames of images at the first time and the second time, that is, the first image and the second image. Specifically, the terminal may first use the camera to capture the first image at the first moment, and then use the camera to capture the second image at the second moment.
需要说明的是,在本申请的实施例中,终端在获得第一图像和第二图像之后,可以将第一时刻对应的第一图像定义为待配准图,即用于进行配准处理的图像,同时,终端可以将第二时刻对应的第二图像定义为基准图,即用于作为基准参照的图像。It should be noted that, in the embodiment of the present application, after obtaining the first image and the second image, the terminal may define the first image corresponding to the first moment as the image to be registered, that is, the image used for registration processing. At the same time, the terminal may define the second image corresponding to the second moment as a reference image, that is, an image used as a reference reference.
进一步地,在本申请的实施例中,终端还可以配置有陀螺仪,以利用 陀螺仪对终端的转动情况进行检测。其中,陀螺仪是用高速回转体的动量矩敏感壳体相对惯性空间绕正交于自转轴的一个或二个轴的角运动检测装置。利用其他原理制成的角运动检测装置起同样功能的也称陀螺仪。Further, in the embodiment of the present application, the terminal may also be equipped with a gyroscope, so as to use the gyroscope to detect the rotation of the terminal. Among them, the gyroscope is an angular motion detection device that uses the moment-of-momentum-sensitive housing of a high-speed rotating body to rotate one or two axes orthogonal to the rotation axis relative to the inertial space. Angular motion detection devices made by other principles are also called gyroscopes that perform the same function.
可以理解的是,在本申请的实施例中,终端可以利用配置的陀螺仪进行实时检测,从而可以获得每一个时刻对应的每一个转动数据。其中,转动数据可以包括不同空间方向上的角速度数据,例如,终端可以利用陀螺仪检测获得x轴、y轴以及z轴上的角速度。It can be understood that, in the embodiment of the present application, the terminal can use the configured gyroscope to perform real-time detection, so as to obtain each rotation data corresponding to each moment. The rotation data may include angular velocity data in different spatial directions. For example, the terminal may use a gyroscope to detect angular velocities on the x-axis, y-axis, and z-axis.
步骤102、确定第一时刻与第二时刻之间的转动参数,并根据转动参数对第一图像进行配准处理,获得第一配准图像。Step 102: Determine the rotation parameter between the first time and the second time, and perform registration processing on the first image according to the rotation parameter to obtain the first registered image.
在本申请的实施例中,终端在第一时刻和第二时刻分别获取第一图像和第二图像之后,便可以先确定第一时刻和第二时刻之间的转动参数,然后便可以根据转动参数对第一图像进行配准处理,从而获得第一配准图像。In the embodiment of the present application, after the terminal obtains the first image and the second image at the first time and the second time respectively, it can first determine the rotation parameters between the first time and the second time, and then can determine the rotation parameters between the first time and the second time. The parameter performs registration processing on the first image, thereby obtaining the first registered image.
需要说明的是,在本申请的实施例中,终端在确定第一时刻与第二时刻之间的转动参数之前,可以先利用配置的陀螺仪采集获得的每一个时刻对应的每一个转动数据,并对这些转动数据进行存储。It should be noted that, in the embodiment of the present application, before determining the rotation parameter between the first time and the second time, the terminal may first use the configured gyroscope to collect and obtain each rotation data corresponding to each time. And store these rotation data.
进一步地,在本申请的实施例中,终端在确定第一时刻与第二时刻之间的转动参数时,便可以先从存储有转动参数的地址中,读取第一时刻与第二时刻之间的转动数据,然后便可以基于第一时刻与第二时刻之间的转动数据,进一步生成第一时刻与第二时刻之间的转动参数。Further, in the embodiment of the present application, when the terminal determines the rotation parameter between the first time and the second time, it can first read the difference between the first time and the second time from the address where the rotation parameter is stored. Then, based on the rotation data between the first time and the second time, the rotation parameters between the first time and the second time can be further generated.
可以理解的是,在本申请的实施例中,转动参数可以用于对终端在第一时刻与第二时刻之间的具体转动量进行确定。It can be understood that, in the embodiment of the present application, the rotation parameter may be used to determine the specific rotation amount of the terminal between the first time and the second time.
进一步地,在本申请的实施例中,由于转动数据可以包括不同空间方向上的角速度数据,相应地,终端基于第一时刻与第二时刻之间的转动数据生成的转动参数,也可以包括不同空间方向上的不同转动量。示例性的,转动参数可以为终端在第一时刻与第二时刻之间产生的x轴、y轴以及z轴上的变化角度。Further, in the embodiment of the present application, since the rotation data may include angular velocity data in different spatial directions, correspondingly, the rotation parameters generated by the terminal based on the rotation data between the first time and the second time may also include different Different amounts of rotation in the spatial direction. Exemplarily, the rotation parameter may be the angle of change on the x-axis, the y-axis, and the z-axis generated by the terminal between the first moment and the second moment.
需要说明的是,在本申请的实施例中,终端以第二时刻采集的第二图像为基准图像,以第一时刻采集的第一图像为待配准图像进行图像配准时,需要利用转动参数,其中,转动参数是由陀螺仪检测的第一时刻与第二时刻之间的多个转动数据确定的。It should be noted that, in the embodiment of the present application, when the terminal uses the second image collected at the second time as the reference image, and the first image collected at the first time is the image to be registered for image registration, the rotation parameter needs to be used. , Wherein the rotation parameter is determined by multiple rotation data between the first time and the second time detected by the gyroscope.
可以理解的是,在本申请的实施例中,终端配置的陀螺仪在进行转动数据的采集时,采样频率越高越好,例如,陀螺仪可以在第一时至第二时刻之间,利用高于200HZ的采样频率,采集x轴、y轴以及z轴三个不同空间方向上的角速度,从而获得第一时刻与第二时刻之间的多个转动数据。也就是说,终端利用陀螺仪进行转动数据的采集时,越高的采样频率更有助于更佳精确的配准效果。It is understandable that, in the embodiment of the present application, when the gyroscope configured on the terminal is collecting rotation data, the higher the sampling frequency, the better. For example, the gyroscope can use With a sampling frequency higher than 200HZ, the angular velocities in the three different spatial directions of the x-axis, the y-axis and the z-axis are collected, so as to obtain multiple rotation data between the first moment and the second moment. In other words, when the terminal uses the gyroscope to collect rotation data, a higher sampling frequency is more conducive to a more accurate registration effect.
进一步地,在本申请的实施例中,终端在确定第一时刻与第二时刻之间的转动参数之后,便可以根据转动参数对第一图像进行配准处理,从而 可以获得配准结果,即第一配准图像。Further, in the embodiment of the present application, after the terminal determines the rotation parameter between the first time and the second time, it can perform registration processing on the first image according to the rotation parameter, so that the registration result can be obtained, that is, The first registration image.
需要说明的是,在本申请的实施例中,由于转动参数包括多个空间方向对应的多个转动量,其中,一个空间方向对应一个转动量,因此,终端在根据转动参数对第一图像进行配准处理时,可以利用多个转动量生成转动矩阵,然后根据转动矩阵对第一图像进行旋转处理,以完成第一图像和第二图像的配准。It should be noted that, in the embodiment of the present application, since the rotation parameter includes a plurality of rotation amounts corresponding to a plurality of spatial directions, where one spatial direction corresponds to a rotation amount, the terminal performs the first image according to the rotation parameters. During the registration process, a plurality of rotation amounts may be used to generate a rotation matrix, and then the first image is rotated according to the rotation matrix to complete the registration of the first image and the second image.
进一步地,在本申请的实施例中,转动矩阵用于对终端在第一时刻到第二时刻之间的转动情况进行确定,即表征终端拍摄第一图像和第二图像时的转动变化,因此,终端利用转动矩阵进行图像配准处理,可以用来弥补由于终端转动所造成的第一图像和第二图像之间的差别。Further, in the embodiment of the present application, the rotation matrix is used to determine the rotation of the terminal between the first time and the second time, that is, to characterize the rotation change when the terminal takes the first image and the second image. The terminal uses the rotation matrix to perform image registration processing, which can be used to compensate for the difference between the first image and the second image caused by the rotation of the terminal.
需要说明的是,在本申请的实施例中,由于转动参数是多个空间方向对应的多个转动量,因此,转动矩阵为多个空间方向的多个转动量构成的多维矩阵。示例性的,当转动参数为x轴、y轴以及z轴上的角度值时,转动可以先基于每一个空间方向上的转动量构建每一个空间方向上的一个角度矩阵,然后利用全部空间方向上的全部角度矩阵,构成终端在第一时刻至第二时刻之间的转动矩阵。也就是说,终端在利用多个转动量生成转动矩阵时,可以先根据多个转动量构建多个子矩阵,然后再基于多个子矩阵,生成转动矩阵。It should be noted that, in the embodiment of the present application, since the rotation parameters are multiple rotation quantities corresponding to multiple spatial directions, the rotation matrix is a multi-dimensional matrix composed of multiple rotation quantities in multiple spatial directions. Exemplarily, when the rotation parameters are the angle values on the x-axis, y-axis, and z-axis, the rotation can first construct an angle matrix in each spatial direction based on the amount of rotation in each spatial direction, and then use all the spatial directions All the angle matrices above constitute the rotation matrix of the terminal between the first moment and the second moment. In other words, when the terminal generates a rotation matrix using multiple rotations, it may first construct multiple sub-matrices based on the multiple rotations, and then generate the rotation matrix based on the multiple sub-matrices.
可以理解的是,在本申请的实施例中,终端在基于转动矩阵对第一图像进行旋转处理时,可以先确定第一图像中的全部像素点对应的全部像素坐标,然后利用转动矩阵与全部像素坐标进行点积运算,从而可以完成对第一图像的旋转处理。也就是说,在本申请中,终端可以获取第一图像中全部像素点对应的全部像素坐标,然后利用转动矩阵对全部像素坐标进行旋转处理,从而可以获得第一配准图像,以实现图像配准处理。It is understandable that, in the embodiment of the present application, when the terminal performs rotation processing on the first image based on the rotation matrix, it can first determine all the pixel coordinates corresponding to all the pixels in the first image, and then use the rotation matrix and all the pixel coordinates. The pixel coordinates are subjected to a dot product operation, so that the rotation processing of the first image can be completed. That is, in this application, the terminal can obtain all the pixel coordinates corresponding to all the pixels in the first image, and then use the rotation matrix to rotate all the pixel coordinates, so as to obtain the first registration image to realize the image registration. Quasi-processing.
步骤103、确定第一配准图像和第二图像之间的移动参数,并根据移动参数对第一配准图像进行配准处理,获得第二配准图像。Step 103: Determine a movement parameter between the first registration image and the second image, and perform registration processing on the first registration image according to the movement parameter to obtain a second registration image.
在本申请的实施例中,终端在确定第一时刻与第二时刻之间的转动参数,并根据转动参数对第一图像进行配准处理,获得第一配准图像之后,可以继续确定第一配准图像和第二图像之间的移动参数,然后便可以根据移动参数对第一配准图像进行配准处理,从而可以获得第二配准图像。In the embodiment of the present application, the terminal determines the rotation parameter between the first time and the second time, and performs registration processing on the first image according to the rotation parameter, and after obtaining the first registered image, it can continue to determine the first image. The movement parameters between the registered image and the second image can then be registered with the first registered image according to the movement parameters, so that the second registered image can be obtained.
可以理解的是,在本申请的实施例中,由于陀螺仪记录的是终端在第一时刻与第二时刻之间转动的角度,并不能完全对终端在第一时刻和第二时刻之间的移动情况进行确定,因此,终端在通过第一配准图像实现对终端转动的补正之后,可以继续对终端的移动进行确定,即进行平移搜索。It is understandable that, in the embodiment of the present application, since the gyroscope records the angle of the terminal's rotation between the first time and the second time, it cannot completely monitor the terminal's rotation between the first time and the second time. The movement situation is determined. Therefore, after the terminal realizes the correction of the rotation of the terminal through the first registration image, it can continue to determine the movement of the terminal, that is, perform a translation search.
需要说明的是,在本申请的实施例中,终端在进行平移搜索时,可以基于第二图像(基准图像),对第一配准图像按照不同的平面方向进行移动量的确定,从而可以获得第一配准图像和第二图像之间的移动参数。It should be noted that, in the embodiment of the present application, when the terminal performs a translation search, it can determine the amount of movement of the first registration image in different plane directions based on the second image (reference image), so as to obtain The movement parameter between the first registered image and the second image.
可以理解的是,在本申请的实施例中,移动参数可以用于对终端在第 一时刻与第二时刻之间的具体移动量进行确定。也就是说,在本申请中,移动参数可以包括多个平面方向对应的多个移动量。示例性的,移动参数可以为终端在第一时刻与第二时刻之间产生的x轴和y轴上的变化距离。It can be understood that, in the embodiment of the present application, the movement parameter can be used to determine the specific movement amount of the terminal between the first time and the second time. That is, in this application, the movement parameter may include multiple movement amounts corresponding to multiple plane directions. Exemplarily, the movement parameter may be the changing distance on the x-axis and the y-axis generated by the terminal between the first time and the second time.
具体地,在本申请的实施例中,终端可以先沿着多个不同的平面方向,分别确定出第一配准图像和第二图像对应的多个投影数列,然后可以利用第一配准图像和第二图像在相同的平面方向上的两个投影数列之间的相关性,确定出该平面方向上两者之间的移动量,进而可以确定出第一配准图像和第二图像在多个平面方向上的多个移动量。也就是说,在本申请中,终端在确定第一配准图像和第二图像之间的移动参数时,可以先确定第一配准图像在多个平面方向上的多个第一投影数列,同时,可以确定第二图像在多个平面方向上的多个第二投影数列;然后便可以利用多个第一投影数列和多个第二投影数列,分别确定出两者之间的多个移动量。Specifically, in the embodiment of the present application, the terminal may first determine a plurality of projection series corresponding to the first registration image and the second image along a plurality of different plane directions, and then may use the first registration image The correlation between the two projection numbers in the same plane direction as the second image can determine the amount of movement between the two in the plane direction, which can then determine how much the first registered image and the second image are. Multiple amounts of movement in each plane direction. That is, in this application, when determining the movement parameter between the first registration image and the second image, the terminal may first determine multiple first projection sequences of the first registration image in multiple plane directions. At the same time, multiple second projection numbers in multiple plane directions can be determined for the second image; then multiple first projection numbers and multiple second projection numbers can be used to determine multiple shifts between the two. the amount.
进一步地,在本申请的实施例中,终端在确定第一时刻与第二时刻之间的移动参数之后,便可以根据移动参数对第一配准图像进行配准处理,从而可以获得配准结果,即第二配准图像。Further, in the embodiment of the present application, after the terminal determines the movement parameter between the first moment and the second moment, it can perform registration processing on the first registered image according to the movement parameter, so that the registration result can be obtained. , Which is the second registration image.
需要说明的是,在本申请的实施例中,由于移动参数包括多个平面方向对应的多个移动量,其中,一个平面方向对应一个移动量,因此,终端在根据移动参数对第一配准图像进行配准处理时,可以利用多个移动量对第一配准图像进行平移处理,以完成第一配准图像和第二图像的再次配准。It should be noted that, in the embodiment of the present application, since the movement parameters include multiple movement amounts corresponding to multiple plane directions, where one plane direction corresponds to one movement amount, the terminal is performing the first registration according to the movement parameters. When the image is subjected to registration processing, a plurality of movement amounts may be used to perform translation processing on the first registration image to complete the re-registration of the first registration image and the second image.
进一步地,在本申请的实施例中,移动参数用于对终端在第一时刻到第二时刻之间的移动情况进行确定,即表征终端拍摄第一图像和第二图像时的移动变化,因此,终端利用移动参数进行图像配准处理,可以用来弥补由于终端移动所造成的第一图像和第二图像之间的差别。Further, in the embodiment of the present application, the movement parameter is used to determine the movement of the terminal from the first moment to the second moment, that is, to characterize the movement change when the terminal takes the first image and the second image. The terminal uses the movement parameters to perform image registration processing, which can be used to compensate for the difference between the first image and the second image caused by the movement of the terminal.
可以理解的是,在本申请的实施例中,上述步骤102提出的方法,可以在进行图像配准时,用于对终端的转动变化进行补正,可以实现对第一图像和第二图像的粗对齐;上述步骤103提出的方法,可以在进行图像配准时,用于对终端的移动变化进行补正,同样可以实现对第一图像和第二图像的粗对齐。It is understandable that, in the embodiment of the present application, the method proposed in step 102 above can be used to correct the rotation change of the terminal when performing image registration, and can realize rough alignment of the first image and the second image. The method proposed in step 103 above can be used to correct the movement changes of the terminal when performing image registration, and can also achieve coarse alignment of the first image and the second image.
在本申请的实施例中,进一步地,图2为图像配准方法的实现流程示意图二,如图2所示,终端在根据移动参数对第一配准图像进行配准处理,获得第二配准图像之后,即步骤103之后,终端进行图像配准的方法还可以包括以下步骤:In the embodiment of the present application, further, FIG. 2 is a second schematic diagram of the implementation process of the image registration method. As shown in FIG. 2, the terminal performs registration processing on the first registered image according to the movement parameters to obtain the second registration method. After the image is aligned, that is, after step 103, the method for the terminal to perform image registration may further include the following steps:
步骤104、利用移动参数确定第二配准图像对应的像素移动量。Step 104: Determine the pixel movement amount corresponding to the second registration image by using the movement parameter.
步骤105、根据像素移动量进行配准处理,获得第三配准图像。Step 105: Perform registration processing according to the pixel shift amount to obtain a third registered image.
在本申请的实施例中,终端在根据移动参数对第一配准图像进行配准处理,获得第二配准图像之后,还可以继续利用移动参数确定出第二配准图像对应的像素移动量,然后可以根据像素移动量进行平移处理,从而可以获得第四配准图像,以完成第一图像和第二图像的配准处理。In the embodiment of the present application, after the terminal performs registration processing on the first registration image according to the movement parameters to obtain the second registration image, it may continue to use the movement parameters to determine the pixel movement amount corresponding to the second registration image. Then, the translation processing can be performed according to the pixel shift amount, so that the fourth registration image can be obtained to complete the registration processing of the first image and the second image.
需要说明的是,在本申请的实施例中,为了获得精度更高的配准结果,即实现第一图像和第二图像之间的精对齐,终端在获得第二配准图像之后,可以继续利用移动参数对第二配准图像进行像素的平移处理。It should be noted that, in the embodiment of the present application, in order to obtain a higher-precision registration result, that is, to achieve fine alignment between the first image and the second image, the terminal may continue after obtaining the second registered image Using the movement parameters to perform pixel translation processing on the second registered image.
进一步地,在本申请的实施例中,终端可以先利用移动参数,进一步搜索得到第二配准图中的全部像素对应的全部像素移动量,然后可以利用全部像素移动量对全部像素进行平移处理,从而可以获得第三配准图像,以完成对第一图像和第二图像之间的精对齐。Further, in the embodiment of the present application, the terminal may first use the movement parameters to further search to obtain all pixel movement amounts corresponding to all pixels in the second registration image, and then may use all pixel movement amounts to perform translation processing on all pixels In this way, a third registration image can be obtained to complete the fine alignment between the first image and the second image.
在本申请的实施例中,进一步地,图3为图像配准方法的实现流程示意图三,如图3所示,终端在根据转动参数对第一图像进行配准处理,获得第一配准图像之后,即步骤102之后,终端进行图像配准的方法还可以包括以下步骤:In the embodiment of the present application, further, FIG. 3 is the third schematic diagram of the implementation process of the image registration method. As shown in FIG. 3, the terminal performs registration processing on the first image according to the rotation parameter to obtain the first registered image After that, that is, after step 102, the method for the terminal to perform image registration may further include the following steps:
步骤106、确定第一配准图像和第二图像之间的移动参数,并根据移动参数确定第二配准图像对应的像素移动量。Step 106: Determine a movement parameter between the first registration image and the second image, and determine the pixel movement amount corresponding to the second registration image according to the movement parameter.
步骤107、根据像素移动量进行平移处理,获得第四配准图像。Step 107: Perform translation processing according to the pixel shift amount to obtain a fourth registered image.
在本申请的实施例中,终端确定第一时刻与第二时刻之间的转动参数,并根据转动参数对第一图像进行配准处理,获得第一配准图像之后,可以继续确定第一配准图像和第二图像之间的移动参数,然后进一步根据移动参数确定第二配准图像对应的像素移动量。In the embodiment of the present application, the terminal determines the rotation parameter between the first time and the second time, and performs registration processing on the first image according to the rotation parameter. After obtaining the first registration image, it can continue to determine the first registration. The movement parameter between the quasi-image and the second image is further determined according to the movement parameter and the pixel movement amount corresponding to the second registration image.
可以理解的是,在本申请的实施例中,为了获得精度更高的配准结果,即实现第一图像和第二图像之间的精对齐,终端在获得第一配准图像之后,可以跳过利用移动参数对第一配准图像的粗对齐,而是直接利用移动参数对第一配准图像进行像素的平移处理。It is understandable that, in the embodiments of the present application, in order to obtain a higher-precision registration result, that is, to achieve fine alignment between the first image and the second image, the terminal may skip to the first image after obtaining the first registered image. Instead of coarsely aligning the first registration image by using the movement parameters, the movement parameters are directly used to perform pixel translation processing on the first registration image.
进一步地,在本申请的实施例中,终端可以先利用移动参数,进一步搜索得到第一配准图中的全部像素对应的全部像素移动量,然后可以利用全部像素移动量对全部像素进行平移处理,从而可以获得第四配准图像,以完成对第一图像和第二图像之间的精对齐。Further, in the embodiment of the present application, the terminal may first use the movement parameters to further search to obtain all pixel movement amounts corresponding to all pixels in the first registration image, and then use all pixel movement amounts to perform translation processing on all pixels In this way, a fourth registration image can be obtained to complete the fine alignment between the first image and the second image.
也就是说,在本申请的实施例中,终端在进行图像配准时,可以先利用上述步骤102提出的方法对终端的转动变化进行补正,实现对第一图像和第二图像的粗对齐;然后直接利用上述步骤106和步骤107提出的方法,在对终端的移动变化进行补正时,直接对第一图像和第二图像进行精对齐,获得第四配准图像。That is to say, in the embodiment of the present application, when the terminal performs image registration, it can first use the method proposed in step 102 to correct the rotation change of the terminal, so as to realize the rough alignment of the first image and the second image; Directly using the method proposed in step 106 and step 107 above, when correcting the movement change of the terminal, the first image and the second image are directly aligned to obtain the fourth registered image.
本申请实施例提出的一种图像配准方法,终端在第一时刻获取第一图像之后,在第二时刻获取第二图像;确定第一时刻与第二时刻之间的转动参数,并根据转动参数对第一图像进行配准处理,获得第一配准图像;确定第一配准图像和第二图像之间的移动参数,并根据移动参数对第一配准图像进行配准处理,获得第二配准图像。也就是说,在本申请的实施例中,终端可以在第一时刻和第二时刻获取第一图像和第二图像的同时,记录第一时刻与第二时刻之间的转动参数和移动参数,先利用转动参数对由于终 端旋转造成的图像内容的改变进行补正,再利用移动参数对由于终端平移造成的图像内容的改变进行补正,从而可以从不同的方面实现对第一图像和第二图像的对齐处理,从而可以以更快的速度获得效果更好的配准图像。也就是说,在本申请中,终端可以通过陀螺仪对转动参数的实时采集和平移搜索处理获得的移动参数,分别对第一图像和第二图像进行配准处理,不但可以加快图像配准的速度,还可以提升图像配准的精度。According to an image registration method proposed in an embodiment of the present application, a terminal acquires a first image at a first time, and then acquires a second image at a second time; determines the rotation parameter between the first time and the second time, and determines the rotation parameter according to the rotation Parameter performs registration processing on the first image to obtain the first registration image; determines the movement parameter between the first registration image and the second image, and performs registration processing on the first registration image according to the movement parameter to obtain the first registration image Two registration images. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time. First use the rotation parameter to correct the change of the image content caused by the terminal rotation, and then use the movement parameter to correct the change of the image content caused by the terminal translation, so that the first image and the second image can be achieved from different aspects. Alignment processing, which can obtain better registered images at a faster speed. That is to say, in this application, the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
基于上述实施例,在本申请的另一实施例中,终端可以利用陀螺仪对终端的转动情况进行检测,具体地,终端通过陀螺仪进行实时检测,从而可以获得每一个时刻对应的每一个转动数据。其中,转动数据可以为不同空间方向上的角速度数据,例如,终端可以利用陀螺仪检测获得每一个时刻对应的x轴、y轴以及z轴上的每一个角速度。Based on the above-mentioned embodiment, in another embodiment of the present application, the terminal may use a gyroscope to detect the rotation of the terminal. Specifically, the terminal uses the gyroscope to perform real-time detection, so that each rotation corresponding to each moment can be obtained. data. The rotation data may be angular velocity data in different spatial directions. For example, the terminal may use a gyroscope to detect each angular velocity on the x-axis, y-axis, and z-axis corresponding to each moment.
也就是说,在本申请中,终端可以利用配置的陀螺仪记录终端在x轴、y轴以及z轴这三个方向的实时角速度。That is to say, in this application, the terminal can use the configured gyroscope to record the real-time angular velocity of the terminal in the three directions of the x-axis, the y-axis, and the z-axis.
进一步地,在本申请的实施例中,终端在获取陀螺仪检测的第一时刻与第二时刻之间的转动数据之后,可以基于转动数据,获得第一时刻与第二时刻之间的转动参数。Further, in the embodiment of the present application, after obtaining the rotation data between the first time and the second time detected by the gyroscope, the terminal may obtain the rotation parameters between the first time and the second time based on the rotation data. .
示例性的,在本申请中,陀螺仪检测第一时刻t1与第二时刻t2之间的x轴、y轴以及z轴上的多个角速度,然后可以通过在时间轴上分别对x轴、y轴以及z轴上的多个角速度进行积分,获得第一时刻t1与第二时刻t2之间的终端在x轴、y轴以及z轴方向上的转动量。即获得第一时刻与第二时刻之间的转动参数。Exemplarily, in this application, the gyroscope detects multiple angular velocities on the x-axis, y-axis, and z-axis between the first time t1 and the second time t2, and then the x-axis, the y-axis, and the z-axis can be adjusted on the time axis. The multiple angular velocities on the y-axis and the z-axis are integrated to obtain the rotation amount of the terminal in the x-axis, y-axis, and z-axis directions between the first time t1 and the second time t2. That is, the rotation parameters between the first moment and the second moment are obtained.
需要说明的是,在本申请的实施例中,终端在基于转动数据获得第一时刻与第二时刻之间的转动参数时。由于陀螺仪检测的转动数据是离散的,因此终端需要按照时间序列对转动数据进行插值平滑处理,从而获得相应地转动参数。图4为一个空间方向上的转动量的示意图,如图4所示,陀螺仪在t1、t2、t3、t4、t5、t6、t7、t8、t9采集的一个空间方向的角速度w1、w2、w3、w4、w5、w6、w7、w8、w9为离散分布的,终端在时间t轴上对该空间方向上的角速度量进行平滑后再积分,最终可以获得终端在t1至t9时间段内的、该空间方向上的转动量。It should be noted that, in the embodiment of the present application, when the terminal obtains the rotation parameter between the first time and the second time based on the rotation data. Since the rotation data detected by the gyroscope is discrete, the terminal needs to perform interpolation and smoothing processing on the rotation data according to the time series, so as to obtain the corresponding rotation parameters. Fig. 4 is a schematic diagram of the amount of rotation in a spatial direction. As shown in Fig. 4, the angular velocities w1, w2, and w2 of a spatial direction collected by the gyroscope at t1, t2, t3, t4, t5, t6, t7, t8, and t9 w3, w4, w5, w6, w7, w8, and w9 are discretely distributed. The terminal smooths the angular velocity in the spatial direction on the time t axis and then integrates, and finally the terminal's angular velocity in the time period from t1 to t9 can be obtained. , The amount of rotation in the spatial direction.
进一步地,在本申请的实施例中,终端在依次计算获得个空间方向对应的多个转动量之后,便可以利用多个转动量生成转动矩阵。具体地,终端可以先根据多个转动量构建多个子矩阵;然后再基于多个子矩阵,生成对应的转动矩阵。Further, in the embodiment of the present application, after the terminal sequentially calculates and obtains multiple rotation quantities corresponding to each spatial direction, it may use the multiple rotation quantities to generate a rotation matrix. Specifically, the terminal may first construct multiple sub-matrices based on multiple rotation amounts; and then generate corresponding rotation matrices based on the multiple sub-matrices.
示例性的,在本申请中,终端在按照时间序列对x轴、y轴以及z轴方向上转动数据进行插值平滑处理,积分获得x轴方向上对应的转动量为λ,y轴方向上对应的转动量为γ,z轴方向上对应的转动量为ρ,那么,终端可以利用以下公式分别获得x轴方向上对应的子矩阵R x,y轴方向上对应的子矩阵R y,z轴方向上对应的子矩阵R zExemplarily, in this application, the terminal performs interpolation and smoothing processing on the rotation data in the x-axis, y-axis, and z-axis directions according to the time series, and the corresponding rotation amount in the x-axis direction is obtained by integration as λ, and the corresponding rotation in the y-axis direction The rotation amount of is γ, the corresponding rotation amount in the z-axis direction is ρ, then the terminal can use the following formula to obtain the corresponding sub-matrix R x in the x-axis direction, the corresponding sub-matrix R y in the y-axis direction, and the z-axis The corresponding sub-matrix R z in the direction:
Figure PCTCN2020122474-appb-000001
Figure PCTCN2020122474-appb-000001
Figure PCTCN2020122474-appb-000002
Figure PCTCN2020122474-appb-000002
Figure PCTCN2020122474-appb-000003
Figure PCTCN2020122474-appb-000003
接下来,终端便可以利用x轴方向上对应的子矩阵R x,y轴方向上对应的子矩阵R y,z轴方向上对应的子矩阵R z进一步生成转动矩阵,具体如下式: Next, the terminal can use the corresponding sub-matrix R x in the x-axis direction, the corresponding sub-matrix R y in the y- axis direction, and the corresponding sub-matrix R z in the z-axis direction to further generate the rotation matrix, as follows:
R=R x×R y×R z      (4) R=R x ×R y ×R z (4)
可以理解的是,在本申请中,终端通过上述方式可以计算获得x轴、y轴以及z轴方向的三个转动量。由于终端在转动的时候,拍摄装置拍摄获得的成像面也相应随之转动,因此,终端可以通过把这一转动施加在成像面上来补正终端转动所带来的移动。图5为成像面转动的示意图,如图5所示,将旋转中心选择为该像面的中间位置(虚线十字交叉处),终端可以利用基于x轴、y轴以及z轴方向的转动量生成的转动矩阵,对成像面进行补正,获得补正后的成像面。需要说明的是,由于平动的存在,转动中心也相应存在偏移,因此不能完全补正由于终端的转动带来的画面的运动,但是经证实该方法可以对终端的转动而产生的画面运动进行初步估算,因此可以用于初步对齐图像。It can be understood that, in the present application, the terminal can calculate and obtain three rotation amounts in the x-axis, y-axis, and z-axis directions in the above-mentioned manner. As the terminal rotates, the imaging surface obtained by the photographing device also rotates accordingly. Therefore, the terminal can correct the movement caused by the rotation of the terminal by applying this rotation to the imaging surface. Figure 5 is a schematic diagram of the rotation of the imaging surface. As shown in Figure 5, the center of rotation is selected as the middle position of the image plane (the cross of the dashed line), and the terminal can be generated by the amount of rotation based on the x-axis, y-axis, and z-axis direction. The rotation matrix of, the imaging surface is corrected, and the corrected imaging surface is obtained. It should be noted that due to the existence of translation, the center of rotation also has a corresponding offset. Therefore, the motion of the screen caused by the rotation of the terminal cannot be completely corrected. However, it has been proved that this method can perform the motion of the screen caused by the rotation of the terminal. Preliminary estimation, so it can be used to initially align images.
进一步地,在本申请的实施例中,终端在利用多个转动量生成转动矩阵之后,便可以进一步基于转动矩阵对第一图像进行旋转处理,获得第一配准图像。具体地,终端可以先获取第一图像中全部像素点对应的全部像素坐标,然后再利用转动矩阵对全部像素坐标进行旋转处理,从而可以获得第一配准图像。Further, in the embodiment of the present application, after the terminal generates a rotation matrix using multiple rotation amounts, it may further perform rotation processing on the first image based on the rotation matrix to obtain the first registered image. Specifically, the terminal may first obtain all the pixel coordinates corresponding to all the pixels in the first image, and then use the rotation matrix to rotate all the pixel coordinates, so as to obtain the first registered image.
示例性的,在本申请中,终端在利用转动矩阵对第一图像进行旋转处理时。可以利用转动矩阵,分别与第一图像中的全部像素点对应的全部像素坐标进行点积运算,获得运算结果,然后将运算结果向z轴方向投影,从而便可以获得旋转后的像素点的坐标,具体如下式:Exemplarily, in this application, the terminal uses the rotation matrix to perform rotation processing on the first image. The rotation matrix can be used to perform dot product calculations on all pixel coordinates corresponding to all pixels in the first image to obtain the calculation results, and then project the calculation results in the z-axis direction, so that the coordinates of the rotated pixels can be obtained , The specific formula is as follows:
[x',y',z']=[x,y,0]·R      (5)[x',y',z']=[x,y,0]·R (5)
也就是说,终端可以将投影坐标为(x,y)的点移动到投影坐标为(x′, y′)的位置,最终便可以完成对该像素点的像素坐标的旋转处理,相应地,终端基于转动矩阵完成第一图像中的全部像素坐标的旋转处理之后,便可以获得第一配准图像,从而完成了对第一图像的初步配准。That is to say, the terminal can move the point with the projection coordinates (x, y) to the position with the projection coordinates (x', y'), and finally can complete the rotation processing of the pixel coordinates of the pixel point. Accordingly, After the terminal completes the rotation processing of all pixel coordinates in the first image based on the rotation matrix, the first registration image can be obtained, thereby completing the preliminary registration of the first image.
需要说明的是,在本申请的实施例中,如果旋转后的投影坐标(x′,y′)为非整数点位,那么终端就需要进行插值处理以获得整数点位的像素值。插值方法可以才赢双线性插值或双三次插值,本申请不做具体限定。It should be noted that in the embodiment of the present application, if the rotated projection coordinates (x′, y′) are non-integer points, then the terminal needs to perform interpolation processing to obtain pixel values of integer points. The interpolation method can only win bilinear interpolation or bicubic interpolation, which is not specifically limited in this application.
综上所述,终端在进行图像配准时,可以利用计算获得的转动矩阵对终端的转动变化进行补正,进而实现对第一图像和第二图像的粗对齐。In summary, when the terminal performs image registration, the rotation matrix obtained by calculation can be used to correct the rotation change of the terminal, so as to realize the rough alignment of the first image and the second image.
本申请实施例提出的一种图像配准方法,终端在第一时刻获取第一图像之后,在第二时刻获取第二图像;确定第一时刻与第二时刻之间的转动参数,并根据转动参数对第一图像进行配准处理,获得第一配准图像;确定第一配准图像和第二图像之间的移动参数,并根据移动参数对第一配准图像进行配准处理,获得第二配准图像。也就是说,在本申请的实施例中,终端可以在第一时刻和第二时刻获取第一图像和第二图像的同时,记录第一时刻与第二时刻之间的转动参数和移动参数,先利用转动参数对由于终端旋转造成的图像内容的改变进行补正,再利用移动参数对由于终端平移造成的图像内容的改变进行补正,从而可以从不同的方面实现对第一图像和第二图像的对齐处理,从而可以以更快的速度获得效果更好的配准图像。也就是说,在本申请中,终端可以通过陀螺仪对转动参数的实时采集和平移搜索处理获得的移动参数,分别对第一图像和第二图像进行配准处理,不但可以加快图像配准的速度,还可以提升图像配准的精度。According to an image registration method proposed in an embodiment of the present application, a terminal acquires a first image at a first time, and then acquires a second image at a second time; determines the rotation parameter between the first time and the second time, and determines the rotation parameter according to the rotation Parameter performs registration processing on the first image to obtain the first registration image; determines the movement parameter between the first registration image and the second image, and performs registration processing on the first registration image according to the movement parameter to obtain the first registration image Two registration images. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time. First use the rotation parameter to correct the change of the image content caused by the terminal rotation, and then use the movement parameter to correct the change of the image content caused by the terminal translation, so that the first image and the second image can be achieved from different aspects. Alignment processing, which can obtain better registered images at a faster speed. That is to say, in this application, the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
基于上述实施例,在本申请的再一实施例中,终端根据转动参数对第一图像进行配准处理所获得第一配准图像已经较大程度的补正了由终端转动所带来的图像内容的变化,但是,由于陀螺仪只记录终端转动时的角度信息,无法对终端的移动信息进行记录,因此,终端仍需要通过平移搜索对第一配准图像进行进一步的配准处理。Based on the foregoing embodiment, in another embodiment of the present application, the first registered image obtained by the terminal performing registration processing on the first image according to the rotation parameter has largely corrected the image content brought about by the terminal rotation However, since the gyroscope only records the angle information when the terminal is rotating, it cannot record the movement information of the terminal. Therefore, the terminal still needs to perform further registration processing on the first registration image through a translation search.
可以理解的是,在本申请的实施例中,终端确定的移动参数可以包括多个平面方向对应的多个移动量,示例性的,移动参数可以为终端在第一时刻与第二时刻之间产生的、x轴和y轴上的两个移动量。It can be understood that, in the embodiment of the present application, the movement parameter determined by the terminal may include multiple movement amounts corresponding to multiple plane directions. For example, the movement parameter may be that the terminal moves between the first time and the second time. The resulting two movements on the x-axis and y-axis.
具体地,在本申请的实施例中,终端在进行移动参数的确定时,可以先沿着多个不同的平面方向,如x轴方向和y轴方向,分别确定出第一配准图像和第二图像对应的多个投影数列。也就是说,由于第一配准图像已经补正了大部分的转动变化,为了加速图像配准,终端可以直接采用平移搜索的方式搜索x轴和y轴的移动量。Specifically, in the embodiment of the present application, when the terminal determines the movement parameters, it may first determine the first registration image and the first registration image along a plurality of different plane directions, such as the x-axis direction and the y-axis direction. Multiple projection sequences corresponding to the two images. That is to say, since the first registration image has corrected most of the rotation changes, in order to speed up the image registration, the terminal can directly search for the movement amount of the x-axis and the y-axis by means of a translation search.
示例性的,在本申请中,终端可以将第一配准图像和第二图像分别沿x轴方向和y轴方向进行平均运算,从而可以得到x轴方向和y轴方向的两个投影数列。具体地,终端可以对第一配准图像的第一列图像数据加和后求平均,从而计算获得y轴方向投影的第一列结果,然后再依次计算获得 第一配准图像的y轴方向上的投影数列。相应地,终端可以对第二图像的第一列图像数据加和后求平均,从而计算获得y轴方向投影的第一列结果,然后再依次计算获得第二图像的y轴方向上的投影数列。以此类推,终端可以分别计算获得第一配准图像和第二图像在x轴方向和y轴方向的投影数列。图6为y轴方向的投影数列示意图一,如图6所示,基于第一配准度图像的图像数据,沿着y轴方向对每一列图像数据进行投影,获得第一投影数列。图7为y轴方向的投影数列示意图二,如图7所示,基于第二图像的图像数据,沿着y轴方向对每一列图像数据进行投影,获得第二投影数列。Exemplarily, in this application, the terminal may perform an averaging operation on the first registered image and the second image along the x-axis direction and the y-axis direction, respectively, so as to obtain two projection numbers in the x-axis direction and the y-axis direction. Specifically, the terminal may add and average the image data of the first column of the first registration image to obtain the result of the first column projection in the y-axis direction, and then sequentially calculate and obtain the y-axis direction of the first registration image. Projection sequence on the. Correspondingly, the terminal can add the image data of the first column of the second image and average it, so as to obtain the result of the first column projection in the y-axis direction, and then sequentially calculate and obtain the projection number sequence in the y-axis direction of the second image. . By analogy, the terminal can respectively calculate and obtain the projection number sequence of the first registered image and the second image in the x-axis direction and the y-axis direction. FIG. 6 is a schematic diagram 1 of the projection number sequence in the y-axis direction. As shown in FIG. 6, based on the image data of the first registration degree image, each column of image data is projected along the y-axis direction to obtain the first projection number sequence. Fig. 7 is the second schematic diagram of the projection number sequence in the y-axis direction. As shown in Fig. 7, based on the image data of the second image, each column of image data is projected along the y-axis direction to obtain the second projection number sequence.
也就是说,在本申请中,终端在确定第一配准图像和第二图像之间的移动参数时,可以先确定第一配准图像在多个平面方向上的多个第一投影数列,同时,可以确定第二图像在多个平面方向上的多个第二投影数列,然后可以利用多个第一投影数列和多个第二投影数列,确定多个移动量。具体地,终端可以基于相同平面方向上的第一投影数列和第二投影数列,确定出第一配准图像和第二图像在相同的平面方向上的相关性,进而可以利用两者的相关性确定出该平面方向上两者之间的移动量,最终便可以确定出第一配准图像和第二图像在多个平面方向上的多个移动量。That is, in this application, when determining the movement parameter between the first registration image and the second image, the terminal may first determine multiple first projection sequences of the first registration image in multiple plane directions. At the same time, multiple second projection number sequences of the second image in multiple plane directions can be determined, and then multiple first projection number sequences and multiple second projection number sequences can be used to determine multiple movement amounts. Specifically, the terminal can determine the correlation between the first registration image and the second image in the same plane direction based on the first projection number sequence and the second projection number sequence in the same plane direction, and then can use the correlation between the two The amount of movement between the two in the plane direction is determined, and finally, the amount of movement in the multiple plane directions of the first registered image and the second image can be determined.
示例性的,在本申请中,终端在利用y轴平面方向上的第一投影数列和第二投影数列的相关性对y轴平面方向上两者之间的移动量进行确定时,可以将第一配准图像的第一投影数列进行固定,然后沿着x轴平面方向移动第二图像的第二投影数列进行移动,同时对第一投影数列和移动后的第二投影数列之间的相关性进行实时确定,当第一投影数列和移动后的第二投影数列之间的相关性最大时,可以将此时第二投影数列在x轴平面方向上的移动距离确定为第一配准图像和第二图像在x轴平面方向上的移动量。Exemplarily, in this application, when the terminal uses the correlation between the first projection number sequence and the second projection number sequence in the y-axis plane direction to determine the amount of movement between the two in the y-axis plane direction, the first The first projection sequence of a registered image is fixed, and then the second projection sequence of the second image is moved along the x-axis plane direction. At the same time, the correlation between the first projection sequence and the moved second projection sequence For real-time determination, when the correlation between the first projection number sequence and the moved second projection number sequence is the largest, the movement distance of the second projection number sequence in the x-axis plane direction at this time can be determined as the first registration image and The amount of movement of the second image in the x-axis plane direction.
相应地,在本申请中,终端在利用x轴平面方向上的第一投影数列和第二投影数列的相关性对x轴平面方向上两者之间的移动量进行确定时,可以将第一配准图像的第一投影数列进行固定,然后沿着y轴平面方向移动第二图像的第二投影数列进行移动,同时对第一投影数列和移动后的第二投影数列之间的相关性进行实时确定,当第一投影数列和移动后的第二投影数列之间的相关性最大时,可以将此时第二投影数列在y轴平面方向上的移动距离确定为第一配准图像和第二图像在y轴平面方向上的移动量。Correspondingly, in this application, when the terminal uses the correlation between the first projection number sequence and the second projection number sequence in the x-axis plane direction to determine the amount of movement between the two in the x-axis plane direction, the first The first projection sequence of the registered image is fixed, and then the second projection sequence of the second image is moved along the y-axis plane direction. At the same time, the correlation between the first projection sequence and the moved second projection sequence is performed Real-time determination, when the correlation between the first projection number sequence and the moved second projection number sequence is the largest, the movement distance of the second projection number sequence in the y-axis plane direction at this time can be determined as the first registration image and the second projection number sequence. 2. The amount of movement of the image in the direction of the y-axis plane.
可以理解的是,在本申请的实施例中,在确定第一投影数列和移动后的第二投影数列之间的相关性时,可以用零互相关算法(zero cross-correlation)或者平均绝对差算法(mean absolute difference,MAD)进行计算,本申请不作具体限定。It can be understood that, in the embodiment of the present application, when determining the correlation between the first projection sequence and the moved second projection sequence, a zero cross-correlation algorithm or an average absolute difference can be used. Algorithm (mean absolute difference, MAD) is used for calculation, which is not specifically limited in this application.
图8为x轴平面方向上的移动量的示意图,如图8所示,y轴平面方向上的第一投影数列固定不动,y轴平面方向上的第二投影数列沿着x轴方向进行平移,在移动距离为d1时,第一投影数列和第二投影数列之间的相关 性最大,此时,可以将d1作为第一配准图像和第二图像在x轴平面方向上的移动量mv xFigure 8 is a schematic diagram of the amount of movement in the x-axis plane direction. As shown in Figure 8, the first projection number sequence in the y-axis plane direction is fixed, and the second projection number sequence in the y-axis plane direction is performed along the x-axis direction. Translation, when the moving distance is d1, the correlation between the first projection number sequence and the second projection number sequence is the largest. At this time, d1 can be used as the movement amount of the first registration image and the second image in the x-axis plane direction mv x .
图9为y轴平面方向上的移动量的示意图,如图9所示,x轴平面方向上的第一投影数列固定不动,x轴平面方向上的第二投影数列沿着y轴方向进行平移,在移动距离为d2时,第一投影数列和第二投影数列之间的相关性最大,此时,可以将d2作为第一配准图像和第二图像在y轴平面方向上的移动量mv yFigure 9 is a schematic diagram of the amount of movement in the y-axis plane direction. As shown in Figure 9, the first projection number sequence in the x-axis plane direction is fixed, and the second projection number sequence in the x-axis plane direction is performed along the y-axis direction. Translation. When the movement distance is d2, the correlation between the first projection number sequence and the second projection number sequence is the largest. At this time, d2 can be used as the movement amount of the first registration image and the second image in the y-axis plane direction mv y .
需要说明的是,基于上述图和图,无论终端在利用图进行x轴平面方向上的移动量的确定,还是利用图进行y轴平面方向上的移动量的确定,计算第一投影数列和第二投影数列之间的相关性时,仅以第一投影数列和移动后的第二投影数列之间公共部分为基准。It should be noted that, based on the above figures and figures, whether the terminal uses the figure to determine the amount of movement in the x-axis plane direction or uses the figure to determine the amount of movement in the y-axis plane direction, calculate the first projection sequence and the first When the correlation between the two projection number series is concerned, only the common part between the first projection number series and the moved second projection number series is used as a reference.
进一步地,在本申请的实施例中,终端在确定出多个平面方向对应的多个移动量之后,便可以利用多个移动量对第一配准图像进行平移处理,示例性的,终端可以利用x轴平面方向上的移动量mv x将第一配准图像沿着x轴方向进行平移处理,同时,可以利用y轴平面方向上的移动量mv y将第一配准图像沿着y轴方向进行平移处理,从而可以完成对第一配准图像的进一步对齐,获得第二配准图像。 Further, in the embodiment of the present application, after determining multiple movement amounts corresponding to multiple plane directions, the terminal may use the multiple movement amounts to perform translation processing on the first registration image. For example, the terminal may Use the movement amount mv x in the x-axis plane direction to translate the first registered image along the x-axis direction, and at the same time, use the movement amount mv y in the y-axis plane direction to move the first registered image along the y-axis By performing translation processing in the direction, the further alignment of the first registration image can be completed, and the second registration image can be obtained.
综上所述,终端在进行图像配准时,可以通过平移搜索处理获得移动参数,用于对终端的移动变化进行补正,同样可以实现对第一图像和第二图像的粗对齐。In summary, when the terminal performs image registration, the movement parameters can be obtained through translation search processing, which can be used to correct the movement changes of the terminal, and the rough alignment of the first image and the second image can also be achieved.
在本申请的实施例中,进一步地,为了获得精度更好的配准结果,终端在根据移动参数对第一配准图像进行配准处理,获得第二配准图像之后,还可以继续利用移动参数对第二配准图像进行进一步的精对齐。具体地,终端可以利用移动参数对第二配准图像进行像素的平移处理。In the embodiment of the present application, further, in order to obtain a more accurate registration result, the terminal may continue to use the movement after performing registration processing on the first registration image according to the movement parameters to obtain the second registration image. The parameters further finely align the second registration image. Specifically, the terminal may use the movement parameter to perform pixel translation processing on the second registered image.
具体地,在本申请中,终端可以利用移动参数获得第二配准图像的像素移动量,其中,像素移动量用于进行像素点的平移处理。示例性的,终端可以利用上述得到的x轴平面方向上的移动量mv x和y轴平面方向上的移动量mv y,作为起始点对第二配准图像进行搜索,进一步获得第二配准图像对应的、更精确的像素移动量。 Specifically, in this application, the terminal may use the movement parameter to obtain the pixel movement amount of the second registered image, where the pixel movement amount is used to perform translation processing of the pixel points. Exemplary, the terminal may use the amount of movement of the moving amount mv mv x plane x-axis direction and the y-axis obtained above y planar direction, as a starting point for a search for a second registration image, to obtain a further second registration The more accurate pixel shift corresponding to the image.
需要说明的是,在本申请的实施例中,终端可以采用多种方法对像素移动量进行确定,例如光流法或者块搜索方式。也就是说,在本申请中,包括多个平面方向对应的多个移动量的移动参数可以作为精对齐的初始值输入到配准算法中加速配准过程,本申请对精对齐的搜索方式不作限定。It should be noted that, in the embodiment of the present application, the terminal may use multiple methods to determine the pixel movement amount, such as an optical flow method or a block search method. That is to say, in this application, movement parameters including multiple movement amounts corresponding to multiple plane directions can be used as the initial value of fine alignment and input into the registration algorithm to speed up the registration process. This application does not deal with the search method of fine alignment. limited.
可以理解的是,在本申请的实施例中,为了实现第一图像和第二图像之间的精对齐,终端在获得第一配准图像之后,还可以直接利用移动参数对第一配准图像进行像素的平移处理。也就是说,终端可以直接利用移动参数搜索得到第一配准图中的全部像素对应的全部像素移动量,然后可以利用全部像素移动量对全部像素进行平移处理,从而可以获得第四配准图 像,以完成对第一图像和第二图像之间的精对齐。It is understandable that, in the embodiment of the present application, in order to achieve fine alignment between the first image and the second image, after obtaining the first registration image, the terminal may directly use the movement parameters to perform the adjustment of the first registration image. Perform pixel translation processing. In other words, the terminal can directly use the movement parameters to search for all pixel movement amounts corresponding to all pixels in the first registration image, and then use all pixel movement amounts to perform translation processing on all pixels, so as to obtain the fourth registration image , To complete the fine alignment between the first image and the second image.
本申请实施例提出的一种图像配准方法,终端在第一时刻获取第一图像之后,在第二时刻获取第二图像;确定第一时刻与第二时刻之间的转动参数,并根据转动参数对第一图像进行配准处理,获得第一配准图像;确定第一配准图像和第二图像之间的移动参数,并根据移动参数对第一配准图像进行配准处理,获得第二配准图像。也就是说,在本申请的实施例中,终端可以在第一时刻和第二时刻获取第一图像和第二图像的同时,记录第一时刻与第二时刻之间的转动参数和移动参数,先利用转动参数对由于终端旋转造成的图像内容的改变进行补正,再利用移动参数对由于终端平移造成的图像内容的改变进行补正,从而可以从不同的方面实现对第一图像和第二图像的对齐处理,从而可以以更快的速度获得效果更好的配准图像。也就是说,在本申请中,终端可以通过陀螺仪对转动参数的实时采集和平移搜索处理获得的移动参数,分别对第一图像和第二图像进行配准处理,不但可以加快图像配准的速度,还可以提升图像配准的精度。According to an image registration method proposed in an embodiment of the present application, a terminal acquires a first image at a first time, and then acquires a second image at a second time; determines the rotation parameter between the first time and the second time, and determines the rotation parameter according to the rotation Parameter performs registration processing on the first image to obtain the first registration image; determines the movement parameter between the first registration image and the second image, and performs registration processing on the first registration image according to the movement parameter to obtain the first registration image Two registration images. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time. First use the rotation parameter to correct the change in the image content caused by the terminal rotation, and then use the movement parameter to correct the change in the image content caused by the terminal translation, so that the first image and the second image can be adjusted from different aspects. Alignment processing, which can obtain better registered images at a faster speed. That is to say, in this application, the terminal can perform registration processing on the first image and the second image through the real-time collection of rotation parameters and the movement parameters obtained by the translation search processing by the gyroscope, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
基于上述实施例,在本申请的再一实施例中,图10为终端的组成结构示意图一,如图10所示,本申请实施例提出的终端10可以包括获取部分11,确定部分12,配准部分13,存储部分14。Based on the above-mentioned embodiment, in another embodiment of the present application, FIG. 10 is a schematic diagram 1 of the composition structure of the terminal. As shown in FIG. 10, the terminal 10 proposed in the embodiment of the present application may include an acquiring part 11, a determining part 12, and a configuration. Standard part 13, storage part 14.
所述获取部分11,配置为在第一时刻获取第一图像之后,在第二时刻获取第二图像;The acquiring part 11 is configured to acquire a second image at a second time after acquiring the first image at the first time;
所述确定部分12,配置为确定所述第一时刻与所述第二时刻之间的转动参数;The determining part 12 is configured to determine a rotation parameter between the first time and the second time;
所述配准部分13,配置为根据所述转动参数对所述第一图像进行配准处理,获得第一配准图像;The registration part 13 is configured to perform registration processing on the first image according to the rotation parameter to obtain a first registered image;
所述确定部分12,还配置为确定所述第一配准图像和所述第二图像之间的移动参数;The determining part 12 is further configured to determine a movement parameter between the first registration image and the second image;
所述配准部分13,还配置为根据所述移动参数对所述第一配准图像进行配准处理,获得第二配准图像。The registration part 13 is further configured to perform registration processing on the first registration image according to the movement parameter to obtain a second registration image.
进一步地,在本申请的实施例中,所述转动参数包括多个空间方向对应的多个转动量,所述配准部分13,具体配置为利用所述多个转动量生成转动矩阵;基于所述转动矩阵对所述第一图像进行旋转处理,获得所述第一配准图像。Further, in an embodiment of the present application, the rotation parameter includes a plurality of rotation amounts corresponding to a plurality of spatial directions, and the registration part 13 is specifically configured to generate a rotation matrix using the plurality of rotation amounts; The rotation matrix performs rotation processing on the first image to obtain the first registration image.
进一步地,在本申请的实施例中,所述配准部分13,还具体配置为根据所述多个转动量构建多个子矩阵;基于所述多个子矩阵,生成所述转动矩阵。Further, in the embodiment of the present application, the registration part 13 is further specifically configured to construct a plurality of sub-matrices according to the plurality of rotation amounts; and generate the rotation matrix based on the plurality of sub-matrices.
进一步地,在本申请的实施例中,所述配准部分13,还具体配置为获取所述第一图像中全部像素点对应的全部像素坐标;利用所述转动矩阵对所述全部像素坐标进行旋转处理,获得所述第一配准图像。Further, in the embodiment of the present application, the registration part 13 is further specifically configured to obtain all pixel coordinates corresponding to all pixels in the first image; and perform the calculation of all the pixel coordinates by using the rotation matrix. Rotate processing to obtain the first registered image.
进一步地,在本申请的实施例中,所述移动参数包括多个平面方向对 应的多个移动量,所述确定部分12,具体配置为确定第一配准图像在所述多个平面方向上的多个第一投影数列,确定第二图像在所述多个平面方向上的多个第二投影数列;利用所述多个第一投影数列和所述多个第二投影数列,确定所述多个移动量。Further, in the embodiment of the present application, the movement parameter includes a plurality of movement amounts corresponding to a plurality of plane directions, and the determining part 12 is specifically configured to determine that the first registration image is in the plurality of plane directions. A plurality of first projection number sequences of the second image are determined in the plurality of plane directions; the plurality of first projection number sequences and the plurality of second projection number sequences are used to determine the Multiple moves.
进一步地,在本申请的实施例中,所述获取部分11,具体配置为利用所述多个移动量对所述第一配准图像进行平移处理,获得所述第二配准图像。Further, in the embodiment of the present application, the acquisition part 11 is specifically configured to perform translation processing on the first registration image by using the plurality of movement amounts to obtain the second registration image.
进一步地,在本申请的实施例中,所述确定部分12,还配置为根据所述移动参数对所述第一配准图像进行配准处理,获得第二配准图像之后,利用所述移动参数确定所述第二配准图像对应的像素移动量;Further, in the embodiment of the present application, the determining part 12 is further configured to perform registration processing on the first registration image according to the movement parameter, and after obtaining the second registration image, use the movement The parameter determines the pixel shift amount corresponding to the second registration image;
所述获取部分11,还配置为根据所述像素移动量进行平移处理,获得第三配准图像。The acquiring part 11 is further configured to perform translation processing according to the pixel shift amount to obtain a third registered image.
进一步地,在本申请的实施例中,所述确定部分12,还配置为根据所述转动参数对所述第一图像进行配准处理,获得第一配准图像之后,确定所述第一配准图像和所述第二图像之间的移动参数,并根据所述移动参数确定所述第二配准图像对应的像素移动量;Further, in the embodiment of the present application, the determining part 12 is further configured to perform registration processing on the first image according to the rotation parameter, and after obtaining the first registration image, determine the first registration The movement parameter between the quasi image and the second image, and determining the pixel movement amount corresponding to the second registration image according to the movement parameter;
所述获取部分11,还配置为根据所述像素移动量进行平移处理,获得第四配准图像。The acquiring part 11 is further configured to perform translation processing according to the pixel shift amount to obtain a fourth registered image.
进一步地,在本申请的实施例中,所述获取部分11,还配置为确定所述第一时刻与所述第二时刻之间的转动参数之前,通过陀螺仪进行实时采集,获得每一个时刻对应的每一个转动数据;Further, in the embodiment of the present application, the acquiring part 11 is further configured to perform real-time collection through a gyroscope before determining the rotation parameter between the first time and the second time to obtain each time Each corresponding rotation data;
所述存储部分14,配置为存储所述每一个转动数据。The storage part 14 is configured to store each of the rotation data.
进一步地,在本申请的实施例中,所述确定部分12,还具体配置为读取所述第一时刻与所述第二时刻之间的多个转动数据;根据所述多个转动数据确定所述第一时刻与所述第二时刻之间的所述转动参数。Further, in the embodiment of the present application, the determining part 12 is further specifically configured to read a plurality of rotation data between the first moment and the second moment; determine according to the plurality of rotation data The rotation parameter between the first time and the second time.
图11为终端的组成结构示意图二,如图11所示,本申请实施例提出的终端10还可以包括处理器15、存储有处理器15可执行指令的存储器16,进一步地,终端10还可以包括通信接口17,和用于连接处理器15、存储器16以及通信接口17的总线18。FIG. 11 is a schematic diagram of the composition structure of the terminal. As shown in FIG. 11, the terminal 10 proposed in the embodiment of the present application may further include a processor 15 and a memory 16 storing executable instructions of the processor 15. Further, the terminal 10 may also It includes a communication interface 17 and a bus 18 for connecting the processor 15, the memory 16 and the communication interface 17.
在本申请的实施例中,上述处理器15可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DSPD)、可编程逻辑装置(ProgRAMmable Logic Device,PLD)、现场可编程门阵列(Field ProgRAMmable Gate Array,FPGA)、中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述处理器功能的电子器件还可以为其它,本申请实施例不作具体限定。终端10还可以包括存储器16,该存储器16可以与处理器15连接,其中,存储器16用于存储可执行程序代码, 该程序代码包括计算机操作指令,存储器16可能包含高速RAM存储器,也可能还包括非易失性存储器,例如,至少两个磁盘存储器。In the embodiment of the present application, the above-mentioned processor 15 may be an Application Specific Integrated Circuit (ASIC), a digital signal processor (Digital Signal Processor, DSP), or a digital signal processing device (Digital Signal Processing Device, DSPD). ), Programmable Logic Device (ProgRAMmable Logic Device, PLD), Field Programmable Gate Array (Field ProgRAMmable Gate Array, FPGA), Central Processing Unit (CPU), Controller, Microcontroller, Microprocessor At least one of. It is understandable that, for different devices, the electronic devices used to implement the above-mentioned processor functions may also be other, which is not specifically limited in the embodiment of the present application. The terminal 10 may also include a memory 16, which may be connected to the processor 15, wherein the memory 16 is used to store executable program code, the program code includes computer operation instructions, the memory 16 may include a high-speed RAM memory, or may also include Non-volatile memory, for example, at least two disk memories.
在本申请的实施例中,总线18用于连接通信接口17、处理器15以及存储器16以及这些器件之间的相互通信。In the embodiment of the present application, the bus 18 is used to connect the communication interface 17, the processor 15, the memory 16, and the mutual communication among these devices.
在本申请的实施例中,存储器16,用于存储指令和数据。In the embodiment of the present application, the memory 16 is used to store instructions and data.
进一步地,在本申请的实施例中,上述处理器15,用于在第一时刻获取第一图像之后,在第二时刻获取第二图像;确定所述第一时刻与所述第二时刻之间的转动参数,并根据所述转动参数对所述第一图像进行配准处理,获得第一配准图像;确定所述第一配准图像和所述第二图像之间的移动参数,并根据所述移动参数对所述第一配准图像进行配准处理,获得第二配准图像。Further, in the embodiment of the present application, the above-mentioned processor 15 is configured to acquire a second image at a second time after acquiring the first image at the first time; determine whether the first time and the second time are different And perform registration processing on the first image according to the rotation parameter to obtain a first registration image; determine the movement parameter between the first registration image and the second image, and Performing registration processing on the first registration image according to the movement parameter to obtain a second registration image.
在实际应用中,上述存储器16可以是易失性存储器(volatile memory),例如随机存取存储器(Random-Access Memory,RAM);或者非易失性存储器(non-volatile memory),例如只读存储器(Read-Only Memory,ROM),快闪存储器(flash memory),硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向处理器15提供指令和数据。In practical applications, the aforementioned memory 16 may be a volatile memory (volatile memory), such as a random-access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and send it to the processor 15 Provide instructions and data.
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, the functional modules in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be realized in the form of hardware or software function module.
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or correct The part that the prior art contributes or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer). A computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the method in this embodiment. The aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
本申请实施例提出的一种终端,该终端在第一时刻获取第一图像之后,在第二时刻获取第二图像;确定第一时刻与第二时刻之间的转动参数,并根据转动参数对第一图像进行配准处理,获得第一配准图像;确定第一配准图像和第二图像之间的移动参数,并根据移动参数对第一配准图像进行配准处理,获得第二配准图像。也就是说,在本申请的实施例中,终端可以在第一时刻和第二时刻获取第一图像和第二图像的同时,记录第一时刻与第二时刻之间的转动参数和移动参数,先利用转动参数对由于终端旋转造成的图像内容的改变进行补正,再利用移动参数对由于终端平移造成的 图像内容的改变进行补正,从而可以从不同的方面实现对第一图像和第二图像的对齐处理,从而可以以更快的速度获得效果更好的配准图像。也就是说,在本申请中,终端可以通过陀螺仪对转动参数的实时采集和平移搜索处理获得的移动参数,分别对第一图像和第二图像进行配准处理,不但可以加快图像配准的速度,还可以提升图像配准的精度。An embodiment of the present application proposes a terminal. After acquiring the first image at the first time, the terminal acquires the second image at the second time; determines the rotation parameter between the first time and the second time, and compares the rotation parameters according to the rotation parameter. The first image undergoes registration processing to obtain the first registration image; the movement parameters between the first registration image and the second image are determined, and the first registration image is registered according to the movement parameters to obtain the second registration image. Quasi-image. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time. First use the rotation parameter to correct the change in the image content caused by the terminal rotation, and then use the movement parameter to correct the change in the image content caused by the terminal translation, so that the first image and the second image can be adjusted from different aspects Alignment processing, which can obtain better registered images at a faster speed. That is to say, in this application, the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.
本申请实施例提供一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现如上所述的图像配准方法。The embodiment of the present application provides a computer-readable storage medium on which a program is stored, and when the program is executed by a processor, the above-mentioned image registration method is implemented.
具体来讲,本实施例中的一种图像配准方法对应的程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种图像配准方法对应的程序指令被一电子设备读取或被执行时,包括如下步骤:Specifically, the program instructions corresponding to an image registration method in this embodiment can be stored on storage media such as optical disks, hard disks, USB flash drives, etc., when the program instructions corresponding to an image registration method in the storage medium When being read or executed by an electronic device, it includes the following steps:
在第一时刻获取第一图像之后,在第二时刻获取第二图像;After the first image is acquired at the first moment, the second image is acquired at the second moment;
确定所述第一时刻与所述第二时刻之间的转动参数,并根据所述转动参数对所述第一图像进行配准处理,获得第一配准图像;Determining a rotation parameter between the first time and the second time, and performing registration processing on the first image according to the rotation parameter to obtain a first registration image;
确定所述第一配准图像和所述第二图像之间的移动参数,并根据所述移动参数对所述第一配准图像进行配准处理,获得第二配准图像。A movement parameter between the first registration image and the second image is determined, and registration processing is performed on the first registration image according to the movement parameter to obtain a second registration image.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的实现流程示意图和/或方框图来描述的。应理解可由计算机程序指令实现流程示意图和/或方框图中的每一流程和/或方框、以及实现流程示意图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to the schematic diagrams and/or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the application. It should be understood that each process and/or block in the schematic flow diagram and/or block diagram can be realized by computer program instructions, and the combination of processes and/or blocks in the schematic flow diagram and/or block diagram can be realized. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing equipment to generate a machine, so that instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device for realizing the functions specified in one or more processes in the schematic flow chart and/or one block or more blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device realizes the functions specified in one or more processes in the schematic diagram and/or one block or more in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing functions specified in one or more processes in the schematic diagram and/or one block or more in the block diagram.
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保 护范围。The above are only preferred embodiments of the present application, and are not used to limit the protection scope of the present application.
工业实用性Industrial applicability
本申请实施例中,终端在第一时刻获取第一图像之后,在第二时刻获取第二图像;确定第一时刻与第二时刻之间的转动参数,并根据转动参数对第一图像进行配准处理,获得第一配准图像;确定第一配准图像和第二图像之间的移动参数,并根据移动参数对第一配准图像进行配准处理,获得第二配准图像。也就是说,在本申请的实施例中,终端可以在第一时刻和第二时刻获取第一图像和第二图像的同时,记录第一时刻与第二时刻之间的转动参数和移动参数,先利用转动参数对由于终端旋转造成的图像内容的改变进行补正,再利用移动参数对由于终端平移造成的图像内容的改变进行补正,从而可以从不同的方面实现对第一图像和第二图像的对齐处理,从而可以以更快的速度获得效果更好的配准图像。也就是说,在本申请中,终端可以通过陀螺仪对转动参数的实时采集和平移搜索处理获得的移动参数,分别对第一图像和第二图像进行配准处理,不但可以加快图像配准的速度,还可以提升图像配准的精度。In the embodiment of this application, after acquiring the first image at the first time, the terminal acquires the second image at the second time; determines the rotation parameter between the first time and the second time, and configures the first image according to the rotation parameter. A registration process is performed to obtain a first registration image; a movement parameter between the first registration image and the second image is determined, and registration processing is performed on the first registration image according to the movement parameter to obtain a second registration image. That is, in the embodiment of the present application, the terminal can record the rotation parameter and the movement parameter between the first time and the second time while acquiring the first image and the second image at the first time and the second time. First use the rotation parameter to correct the change of the image content caused by the terminal rotation, and then use the movement parameter to correct the change of the image content caused by the terminal translation, so that the first image and the second image can be achieved from different aspects. Alignment processing, which can obtain better registered images at a faster speed. That is to say, in this application, the terminal can perform registration processing on the first image and the second image through the real-time collection of the rotation parameters by the gyroscope and the movement parameters obtained by the translation search processing, which can not only speed up the image registration. Speed can also improve the accuracy of image registration.

Claims (13)

  1. 一种图像配准方法,所述方法包括:An image registration method, the method includes:
    在第一时刻获取第一图像之后,在第二时刻获取第二图像;After the first image is acquired at the first moment, the second image is acquired at the second moment;
    确定所述第一时刻与所述第二时刻之间的转动参数,并根据所述转动参数对所述第一图像进行配准处理,获得第一配准图像;Determining a rotation parameter between the first time and the second time, and performing registration processing on the first image according to the rotation parameter to obtain a first registration image;
    确定所述第一配准图像和所述第二图像之间的移动参数,并根据所述移动参数对所述第一配准图像进行配准处理,获得第二配准图像。A movement parameter between the first registration image and the second image is determined, and registration processing is performed on the first registration image according to the movement parameter to obtain a second registration image.
  2. 根据权利要求1所述的方法,其中,所述转动参数包括多个空间方向对应的多个转动量,所述根据所述转动参数对所述第一图像进行配准处理,获得第一配准图像,包括:The method according to claim 1, wherein the rotation parameter includes a plurality of rotation amounts corresponding to a plurality of spatial directions, and the first image is registered according to the rotation parameter to obtain a first registration Images, including:
    利用所述多个转动量生成转动矩阵;Generating a rotation matrix using the plurality of rotation amounts;
    基于所述转动矩阵对所述第一图像进行旋转处理,获得所述第一配准图像。Performing rotation processing on the first image based on the rotation matrix to obtain the first registration image.
  3. 根据权利要求2所述的方法,其中,所述利用所述多个转动量生成转动矩阵,包括:The method according to claim 2, wherein the generating a rotation matrix using the plurality of rotation amounts comprises:
    根据所述多个转动量构建多个子矩阵;Construct a plurality of sub-matrices according to the plurality of rotation amounts;
    基于所述多个子矩阵,生成所述转动矩阵。Based on the plurality of sub-matrices, the rotation matrix is generated.
  4. 根据权利要求2所述的方法,其中,所述基于所述转动矩阵对所述第一图像进行旋转处理,获得所述第一配准图像,包括:The method according to claim 2, wherein the performing rotation processing on the first image based on the rotation matrix to obtain the first registered image comprises:
    获取所述第一图像中全部像素点对应的全部像素坐标;Acquiring all pixel coordinates corresponding to all pixels in the first image;
    利用所述转动矩阵对所述全部像素坐标进行旋转处理,获得所述第一配准图像。Using the rotation matrix to perform rotation processing on all the pixel coordinates to obtain the first registration image.
  5. 根据权利要求1所述的方法,其中,所述移动参数包括多个平面方向对应的多个移动量,所述确定所述第一配准图像和所述第二图像之间的移动参数,包括:The method according to claim 1, wherein the movement parameter includes a plurality of movement amounts corresponding to a plurality of plane directions, and the determining the movement parameter between the first registration image and the second image includes :
    确定第一配准图像在所述多个平面方向上的多个第一投影数列,确定第二图像在所述多个平面方向上的多个第二投影数列;Determining a plurality of first projection numbers of the first registration image in the plurality of plane directions, and determining a plurality of second projection numbers of the second image in the plurality of plane directions;
    利用所述多个第一投影数列和所述多个第二投影数列,确定所述多个移动量。The plurality of movement amounts are determined by using the plurality of first projection number series and the plurality of second projection number series.
  6. 根据权利要求5所述的方法,其中,所述根据所述移动参数对所述第一配准图像进行配准处理,获得第二配准图像,包括:The method according to claim 5, wherein said performing registration processing on said first registration image according to said movement parameter to obtain a second registration image comprises:
    利用所述多个移动量对所述第一配准图像进行平移处理,获得所述第二配准图像。Performing translation processing on the first registration image by using the plurality of movement amounts to obtain the second registration image.
  7. 根据权利要求1所述的方法,其中,所述根据所述移动参数对所述第一配准图像进行配准处理,获得第二配准图像之后,所述方法还包括:The method according to claim 1, wherein, after performing registration processing on the first registration image according to the movement parameter, and after obtaining a second registration image, the method further comprises:
    利用所述移动参数确定所述第二配准图像对应的像素移动量;Determine the pixel movement amount corresponding to the second registration image by using the movement parameter;
    根据所述像素移动量进行平移处理,获得第三配准图像。Perform translation processing according to the pixel shift amount to obtain a third registered image.
  8. 根据权利要求1所述的方法,其中,所述根据所述转动参数对所述第一图像进行配准处理,获得第一配准图像之后,所述方法还包括:The method according to claim 1, wherein, after performing registration processing on the first image according to the rotation parameter, and after obtaining the first registered image, the method further comprises:
    确定所述第一配准图像和所述第二图像之间的移动参数,并根据所述移动参数确定所述第二配准图像对应的像素移动量;Determining a movement parameter between the first registration image and the second image, and determining a pixel movement amount corresponding to the second registration image according to the movement parameter;
    根据所述像素移动量进行平移处理,获得第四配准图像。Perform translation processing according to the pixel shift amount to obtain a fourth registered image.
  9. 根据权利要求1所述的方法,其中,所述确定所述第一时刻与所述第二时刻之间的转动参数之前,所述方法还包括:The method according to claim 1, wherein, before the determining the rotation parameter between the first time and the second time, the method further comprises:
    通过陀螺仪进行实时采集,获得每一个时刻对应的每一个转动数据;Real-time collection through gyroscope to obtain every rotation data corresponding to every moment;
    存储所述每一个转动数据。Store each of the rotation data.
  10. 根据权利要求9所述的方法,其中,所述确定所述第一时刻与所述第二时刻之间的转动参数,包括:The method according to claim 9, wherein the determining the rotation parameter between the first time and the second time comprises:
    读取所述第一时刻与所述第二时刻之间的多个转动数据;Reading a plurality of rotation data between the first time and the second time;
    根据所述多个转动数据确定所述第一时刻与所述第二时刻之间的所述转动参数。The rotation parameter between the first time and the second time is determined according to the plurality of rotation data.
  11. 一种终端,所述终端包括:获取部分,确定部分,配准部分,A terminal, the terminal includes: an acquisition part, a determination part, a registration part,
    所述获取部分,配置为在第一时刻获取第一图像之后,在第二时刻获取第二图像;The acquiring part is configured to acquire a second image at a second time after acquiring the first image at the first time;
    所述确定部分,配置为确定所述第一时刻与所述第二时刻之间的转动参数;The determining part is configured to determine a rotation parameter between the first time and the second time;
    所述配准部分,配置为根据所述转动参数对所述第一图像进行配准处理,获得第一配准图像;The registration part is configured to perform registration processing on the first image according to the rotation parameter to obtain a first registered image;
    所述确定部分,还配置为确定所述第一配准图像和所述第二图像之间的移动参数;The determining part is further configured to determine a movement parameter between the first registration image and the second image;
    所述配准部分,还配置为根据所述移动参数对所述第一配准图像进行配准处理,获得第二配准图像。The registration part is further configured to perform registration processing on the first registration image according to the movement parameter to obtain a second registration image.
  12. 一种终端,所述终端包括处理器、存储有所述处理器可执行指令的存储器,当所述指令被所述处理器执行时,实现如权利要求1-10任一项所述的方法。A terminal comprising a processor and a memory storing executable instructions of the processor, and when the instructions are executed by the processor, the method according to any one of claims 1-10 is implemented.
  13. 一种计算机可读存储介质,其上存储有程序,应用于终端中,所述程序被处理器执行时,实现如权利要求1-10任一项所述的方法。A computer-readable storage medium with a program stored thereon and applied to a terminal. When the program is executed by a processor, the method according to any one of claims 1-10 is implemented.
PCT/CN2020/122474 2019-12-10 2020-10-21 Image registration method, terminal, and storage medium WO2021114883A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911260229.8A CN111127528A (en) 2019-12-10 2019-12-10 Image registration method, terminal and storage medium
CN201911260229.8 2019-12-10

Publications (1)

Publication Number Publication Date
WO2021114883A1 true WO2021114883A1 (en) 2021-06-17

Family

ID=70498098

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/122474 WO2021114883A1 (en) 2019-12-10 2020-10-21 Image registration method, terminal, and storage medium

Country Status (2)

Country Link
CN (1) CN111127528A (en)
WO (1) WO2021114883A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111127528A (en) * 2019-12-10 2020-05-08 Oppo广东移动通信有限公司 Image registration method, terminal and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103413274A (en) * 2013-07-25 2013-11-27 沈阳东软医疗系统有限公司 Image compensation method and device
US20150279016A1 (en) * 2014-03-27 2015-10-01 Electronics And Telecommunications Research Institute Image processing method and apparatus for calibrating depth of depth sensor
CN107230199A (en) * 2017-06-23 2017-10-03 歌尔科技有限公司 Image processing method, device and augmented reality equipment
CN108550104A (en) * 2018-02-28 2018-09-18 北京集光通达科技股份有限公司 Method for registering images, device
CN109068121A (en) * 2018-09-04 2018-12-21 珠海康弘医疗科技有限公司 3-D imaging system, 3-D imaging system calibration method and device
CN111127528A (en) * 2019-12-10 2020-05-08 Oppo广东移动通信有限公司 Image registration method, terminal and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8238612B2 (en) * 2008-05-06 2012-08-07 Honeywell International Inc. Method and apparatus for vision based motion determination
CN104104939B (en) * 2014-07-11 2017-02-08 西安电子科技大学 Wide viewing angle integrated imaging three-dimensional display system
US10121091B2 (en) * 2017-02-09 2018-11-06 Rosemount Aerospace Inc. IMU-aided image registration
CN110148177A (en) * 2018-02-11 2019-08-20 百度在线网络技术(北京)有限公司 For determining the method, apparatus of the attitude angle of camera, calculating equipment, computer readable storage medium and acquisition entity

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103413274A (en) * 2013-07-25 2013-11-27 沈阳东软医疗系统有限公司 Image compensation method and device
US20150279016A1 (en) * 2014-03-27 2015-10-01 Electronics And Telecommunications Research Institute Image processing method and apparatus for calibrating depth of depth sensor
CN107230199A (en) * 2017-06-23 2017-10-03 歌尔科技有限公司 Image processing method, device and augmented reality equipment
CN108550104A (en) * 2018-02-28 2018-09-18 北京集光通达科技股份有限公司 Method for registering images, device
CN109068121A (en) * 2018-09-04 2018-12-21 珠海康弘医疗科技有限公司 3-D imaging system, 3-D imaging system calibration method and device
CN111127528A (en) * 2019-12-10 2020-05-08 Oppo广东移动通信有限公司 Image registration method, terminal and storage medium

Also Published As

Publication number Publication date
CN111127528A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN110009681B (en) IMU (inertial measurement unit) assistance-based monocular vision odometer pose processing method
US8493459B2 (en) Registration of distorted images
US8493460B2 (en) Registration of differently scaled images
CN111147741B (en) Focusing processing-based anti-shake method and device, electronic equipment and storage medium
US8681230B2 (en) Picture processing device, picture processing method, program for picture processing, and imaging device
US10915998B2 (en) Image processing method and device
CN112017216B (en) Image processing method, device, computer readable storage medium and computer equipment
CN111127524A (en) Method, system and device for tracking trajectory and reconstructing three-dimensional image
Larsson et al. Revisiting radial distortion absolute pose
US11042984B2 (en) Systems and methods for providing image depth information
CN113556464B (en) Shooting method and device and electronic equipment
KR100951309B1 (en) New Calibration Method of Multi-view Camera for a Optical Motion Capture System
WO2022028594A1 (en) Image processing method and, apparatus, computer-readable storage medium and computer device
CN114926514B (en) Registration method and device of event image and RGB image
WO2021114883A1 (en) Image registration method, terminal, and storage medium
CN113838151B (en) Camera calibration method, device, equipment and medium
CN111882655A (en) Method, apparatus, system, computer device and storage medium for three-dimensional reconstruction
TWI496115B (en) Video frame stabilization method for the moving camera
CN115705651A (en) Video motion estimation method, device, equipment and computer readable storage medium
TW201915438A (en) Phase detection auto-focus-based positioning method and system thereof
Dasari et al. A joint visual-inertial image registration for mobile HDR imaging
WO2023160445A1 (en) Simultaneous localization and mapping method and apparatus, electronic device, and readable storage medium
CN103489165A (en) Decimal lookup table generation method for video stitching
US11270412B2 (en) Image signal processor, method, and system for environmental mapping
CN109374919B (en) Method and device for determining moving speed based on single shooting device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20897952

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20897952

Country of ref document: EP

Kind code of ref document: A1