A multi-image stitching method for UAV aerial photography based on OpenCV

By using OpenCV CUDA parallel processing and memory management mechanism on the GPU, memory allocation is optimized, and the problems of limited computing resources and slow processing speed in drone aerial image stitching are solved, achieving efficient and stable image stitching effect.

CN119444561BActive Publication Date: 2025-08-01GUANGXI NORMAL UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411474678.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-08-01
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

When processing large-scale, high-resolution drone aerial images, the prior art has limited computing resources, slow processing speed, and frequent memory allocation and release, resulting in system performance degradation.

Method used

The OpenCV CUDA parallel processing technology is adopted to perform image preprocessing on the GPU, and combined with the memory management mechanism, dynamically calculate the memory block size, optimize memory allocation, and use CUDA to process image stitching tasks in parallel, and adopt a smooth transition algorithm and automatic verification mechanism to reduce stitching traces.

Benefits of technology

It significantly improves image processing speed and efficiency, reduces memory fragmentation, ensures system stability and splicing quality, adapts to different lighting and angle changes, and improves splicing accuracy and naturalness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444561B_ABST
    Figure CN119444561B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for stitching multiple aerial images of an unmanned aerial vehicle based on OpenCV, comprising the following steps: S1, obtaining an aerial image data set, and using the OpenCV CUDA parallel processing technology to preprocess the image information of the aerial image data set on the GPU; S2, establishing a memory management mechanism, and during the preprocessing process, combining the parallel computing power of CUDA to dynamically calculate the memory size request of the image information, and predefined memory blocks of different sizes in the memory management mechanism to optimize memory allocation; S3, grouping the preprocessed image information according to the feature information of the image information, and using CUDA to parallelize the image stitching tasks within each group; By using the OpenCV CUDA parallel processing technology to preprocess the aerial images on the GPU, the speed and efficiency of image processing are significantly improved. Utilizing the parallel computing power of CUDA to dynamically calculate the memory size request of the image information and optimize memory allocation, thereby further enhancing the overall performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method for stitching multiple aerial images of drones based on OpenCV. Background Art

[0002] Image stitching technology, also known as image mosaicing, is an important technology in the field of computer vision. It can stitch multiple images into a complete and continuous image. In practical applications, image stitching technology is widely used in fields such as panoramic image generation, virtual reality, and image restoration.

[0003] The application of image stitching technology in the field of drone aerial photography is crucial. It can stitch multiple images taken by drones into a panoramic image of a large scene, providing more comprehensive and intuitive information.

[0004] However, when dealing with large-scale and high-resolution aerial images, the existing technology often faces problems such as limited computing resources and slow processing speed, which affect the real-time performance and efficiency of image processing. Moreover, during the image processing process, dynamic memory allocation and release are frequent, which easily leads to memory fragmentation, further increasing the number of system calls and reducing performance.

[0005] Therefore, there is an urgent need for a method for stitching multiple aerial images of drones based on OpenCV to solve the technical problems existing in the above-mentioned existing technology. Summary of the Invention

[0006] The present invention overcomes the deficiencies of the existing technology and provides a method for stitching multiple aerial images of drones based on OpenCV.

[0007] To achieve the above object, the technical solution adopted by the present invention is: a method for stitching multiple aerial images of drones based on OpenCV, comprising the following steps:

[0008] S1. Obtain an aerial image dataset, and use the OpenCV CUDA parallel processing technology to preprocess the image information of the aerial image dataset on the GPU;

[0009] S2. Establish a memory management mechanism. During the preprocessing process, combine the parallel computing ability of CUDA to dynamically calculate the memory size request of the image information, and predefined memory blocks of different sizes in the memory management mechanism to optimize memory allocation;

[0010] S3. According to the feature information of the image information, group the preprocessed image information, and use CUDA parallelization to process the image stitching tasks within each group.

[0011] In a preferred embodiment of the present invention, the memory allocation of the memory management mechanism includes the following steps:

[0012] S201. Create linked lists of free memory blocks at multiple levels according to predefined memory block sizes, where each level corresponds to a memory block of a fixed size;

[0013] S202. When a memory allocation request is made, dynamically calculate the smallest and appropriate memory block size and the corresponding level according to the requested size, and retrieve a memory block from the free list of the corresponding level; if there are no available memory blocks in the free list of this level, apply for a new memory block from the operating system and return it to the user;

[0014] S203. When the user releases memory, extract the header information of the memory block to determine its level, and insert the memory block into the free list of the corresponding level.

[0015] In a preferred embodiment of the present invention, a thread-safe mechanism is adopted within the memory management mechanism, and the thread-safe mechanism is organized into thread blocks and grids, and the image stitching task is decomposed into multiple sub-tasks that can be processed in parallel.

[0016] In a preferred embodiment of the present invention, the stitching process of the image stitching task includes the following steps:

[0017] S301. Use machine learning or deep learning techniques to automatically extract and group image features, where the basis for grouping includes the overlapping area, shooting angle, timestamp, image similarity, and illumination condition changes of the image information;

[0018] S302. Dynamically adjust the allocation of memory blocks according to the size and complexity of the image information features, and adopt a transformation model and a fusion algorithm based on the image information features to reduce stitching artifacts;

[0019] At the stitching seam of the image stitching, a smooth transition algorithm is adopted to reduce the visual discontinuity. At the same time, the stitching result is automatically verified by comparing the overlapping area of the stitched image and the original image and checking the smoothness of the stitching seam.

[0020] In a preferred embodiment of the present invention, the stitching process of the image stitching task includes feature point detection, feature point description, feature point matching, feature point alignment, image fusion, and image optimization, where feature point alignment is used to calculate the relative displacement and angle between images, and the least squares method is used to fit the process expression of the image stitching:

[0021] M = argmin i , x , 2 , i , M ∑ x ||x′ i - Mx i || 2

[0022] In the formula, M is the transformation matrix, which is used to represent the feature points after image stitching; x i is the feature point in the original image; x i ′ is the feature point corresponding to x i during the stitching process.

[0023] In a preferred embodiment of the present invention, during the image stitching process, a smooth transition algorithm is adopted, and a weighted smooth transition mechanism is used, where the weight changes with the distance from the stitching edge, and its formula expression is:

[0024] I out (x, y) = αI1(x, y) + (1 - α)I2(x, y)

[0025] In the formula, I out is the output image; I1 and I2 are respectively the two images to be stitched; α is the weight coefficient, which changes with the position.

[0026] In a preferred embodiment of the present invention, the automatic verification is realized by comparing the overlapping area of the stitched image and the original image and checking the smoothness of the stitching seam, and its formula expression is:

[0027]

[0028] In the formula, μ x and μ y are respectively the averages of images x and y; and are the variances; σ xy is the covariance; C1 and C2 are constants used to stabilize the denominator; the value range of A is between 0 and 1, and the value closer to 1 indicates that the images are more similar.

[0029] In a preferred embodiment of the present invention, a multi-image stitching system for UAV aerial photography based on opencv is applied to the above-mentioned multi-image stitching method for UAV aerial photography based on opencv, and includes a GPU image preprocessing module, an image grouping and parallel stitching module, and an efficient memory pool management module; the GPU image preprocessing module is used to crop and perform histogram equalization on the aerial photography images using opencv CUDA; the image grouping and parallel stitching module is used to group the preprocessed images and perform parallel processing of the image stitching tasks within each group on the GPU; the efficient memory pool management module is used to dynamically calculate and allocate memory blocks, optimize memory management, and improve the efficiency of memory allocation and release.

[0030] In a preferred embodiment of the present invention, the efficient memory pool management module further includes: an initialization sub-module, a memory allocation sub-module, and a memory release sub-module; the initialization sub-module is used to create linked lists of free memory blocks of multiple levels according to predefined memory block sizes; the memory allocation sub-module is used to dynamically calculate and allocate memory blocks according to the size requested by the user; the memory release sub-module is used to insert the released memory blocks into the free linked list of the corresponding level.

[0031] In a preferred embodiment of the present invention, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned method and system are implemented.

[0032] The present invention solves the defects existing in the background technology, and the present invention has the following beneficial effects:

[0033] (1) By adopting the OpenCV CUDA parallel processing technology, the present invention preprocesses aerial images on the GPU, significantly improving the speed and efficiency of image processing. Utilizing the parallel computing power of CUDA, it dynamically calculates the memory size request for image information and optimizes memory allocation, thereby further enhancing the overall performance.

[0034] (2) By establishing an efficient memory management mechanism, the present invention pre-manages memory blocks of different sizes, optimizing the efficiency of memory allocation and release, reducing frequent system calls, lowering the risk of memory fragmentation, and the memory pool adopts a thread-safe mechanism to ensure stable operation in a multi-threaded environment, thereby further improving the reliability and stability of the system.

[0035] (3) According to the characteristic information of the image information, the present invention groups the preprocessed image information and uses CUDA to parallelize the image stitching tasks within each group, improving the accuracy and naturalness of stitching. At the same time, during the image stitching process, a smooth transition algorithm and a weighted smooth transition mechanism are adopted to reduce stitching artifacts and visual discontinuities, and through an automatic verification mechanism, the stitching results are automatically inspected and optimized to ensure the quality and continuity of the stitched images.

[0036] (4) By combining FAST feature point detection and BRIEF feature description and using an improved version with rotational invariance, the present invention improves the detection speed and robustness, enabling the algorithm to better adapt to changes in different lighting conditions and shooting angles. And in image fusion, multiple factors such as image quality, frequency components, and regional features are comprehensively considered, and appropriate weight coefficients are selected to achieve a better fusion effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings;

[0038] Figure 1 is the image stitching flowchart of the preferred embodiment of the present invention;

[0039] Figure 2 is the working flowchart of the memory management mechanism of the preferred embodiment of the present invention;

[0040] Figure 3 is the comparison chart of the stitching results of multiple input images by the multi-image stitching method of UAV aerial photography of the present invention. Detailed implementation manners

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0042] Many specific details are set forth in the following description in order to fully understand the present invention, but the present invention can also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited by the specific embodiments disclosed below.

[0043] As Figure 1 shown, a multi-image stitching method for UAV aerial photography based on opencv includes the following steps:

[0044] S1. Obtain the aerial photography image dataset, and use the OpenCV CUDA parallel processing technology to preprocess the image information of the aerial photography image dataset on the GPU;

[0045] Further, gray-scale the input aerial photography image to reduce the computational complexity, and then perform Gaussian blur processing to reduce the influence of noise on feature extraction. By constructing a Difference of Gaussian pyramid (DoG), find the extreme points in the scale space as feature points, detect the interest points in the image using the determinant of the Hessian matrix, and accelerate the calculation through the integral image. Combine FAST feature point detection and BRIEF feature description, and use an improved version with rotation invariance to improve the detection speed and robustness.

[0046] Calculate the gradient direction and magnitude around the feature point to generate a 64-dimensional or 128-dimensional description vector. Then, use the binary descriptor to generate a description vector by comparing the brightness difference of the pixels around the feature point. Then, use Euclidean distance, Hamming distance (for binary descriptors) or other distance measurement methods to calculate the similarity of the feature point descriptors in the two images.

[0047] like Figure 2 As shown, S2, a memory management mechanism is established. During the preprocessing process, the parallel computing capability of CUDA is combined to dynamically calculate the memory size request of the image information, and memory blocks of different sizes are predefined in the memory management mechanism to optimize memory allocation;

[0048] It's worth noting that the memory pool optimizes memory allocation and deallocation efficiency by pre-managing memory blocks of different sizes. Its workflow is as follows: During initialization, the memory pool creates multiple levels of free memory block lists based on predefined memory block sizes. Each level corresponds to a fixed-size memory block. When a user requests memory allocation, the memory pool calculates the minimum appropriate memory block size and the corresponding level based on the requested size. If an available memory block is in the free list for that level, it is directly retrieved and returned to the user. If not, a new memory block is requested from the operating system and returned. When a user releases memory, the memory pool extracts the memory block header information, determines its level, and then inserts the memory block into the corresponding level's free list for subsequent use. This approach enables rapid memory block allocation and deallocation, reduces frequent system calls, mitigates the risk of memory fragmentation, and improves overall performance. The memory pool also employs thread-safe mechanisms to ensure stable operation in multi-threaded environments.

[0049] Furthermore, the memory allocation of the memory management mechanism includes the following steps:

[0050] S201. Create multiple levels of free memory block linked lists based on predefined memory block sizes, where each level corresponds to a memory block of a fixed size.

[0051] S202: When a user requests memory allocation, the system dynamically calculates the minimum and appropriate memory block size and the corresponding level based on the requested size, and retrieves a memory block from the free list of the corresponding level. If there is no available memory block in the free list of the corresponding level, the system requests a new memory block from the operating system and returns it to the user.

[0052] S203: When the user releases memory, the header information of the memory block is extracted to determine the level to which it belongs, and the memory block is inserted into the free list of the corresponding level.

[0053] Furthermore, a thread-safe mechanism is adopted within the memory management mechanism, and the thread-safe mechanism is organized into thread blocks and grids, and the image stitching task is decomposed into multiple sub-tasks that can be processed in parallel.

[0054] S3. According to the characteristic information of the image information, group the preprocessed image information, and use CUDA to parallelize the image stitching tasks within each group.

[0055] Furthermore, the stitching process of the image stitching task includes the following steps:

[0056] S301. Use machine learning or deep learning techniques to automatically extract and group image features. Among them, the basis for grouping includes the overlapping area, shooting angle, timestamp, image similarity, and change in illumination conditions of the image information;

[0057] 303. Dynamically adjust the allocation of memory blocks according to the size and complexity of the image information characteristics. Based on the image information characteristics, adopt a transformation model and a fusion algorithm to reduce stitching traces;

[0058] At the stitching seam of the image stitching, a smooth transition algorithm is adopted to reduce the visual discontinuity. At the same time, the stitching result is automatically verified by comparing the overlapping area of the stitched image and the original image and checking the smoothness of the stitching seam.

[0059] The stitching process of the image stitching task includes feature point detection, feature point description, feature point matching, feature point alignment, image fusion, and image optimization. Among them, feature point alignment is used to calculate the relative displacement and angle between images, and the least squares method is used to fit the process expression of image stitching:

[0060] M=argmin M ∑ x ||x′ i -Mx i || 2

[0061] In the formula, M is the transformation matrix, which is used to represent the feature points after image stitching; x i is the feature point in the original image; x′ i is the feature point corresponding to x i during the stitching process.

[0062] Furthermore, during the image stitching process, a smooth transition algorithm is adopted, and a weighted smooth transition mechanism is used, where the weight changes with the distance from the stitching edge, and its formula expression is:

[0063] I out (x,y)=αI1(x,y)+(1-α)I2(x,y)

[0064] In the formula, I out is the output image; I1 and I2 are the two images to be stitched respectively; α is the weight coefficient, which varies with the position.

[0065] In image fusion, it is crucial to select an appropriate weight coefficient α, as it directly affects the quality and visual effect of the fused image. The determination of the weight coefficient α is based on the following factors:

[0066] Image quality: Determine the weight according to the quality indicators such as the clarity and contrast of the image. A higher-quality image can be assigned a larger weight to ensure that more details and clarity are retained in the fused image. For example, indicators such as the local variance and gradient of the image can be used to measure the image quality and allocate weights accordingly;

[0067] Spatial frequency: Determine the weight according to the energy distribution of different frequency components of the image. High-frequency components usually contain the detailed information of the image, while low-frequency components contain the overall information of the image. The wavelet transform or Fourier transform of the image can be performed to analyze its spectral characteristics and allocate weights according to the spectral features;

[0068] Regional features: Determine the weight according to the features (such as edges, textures, etc.) of different regions in the image. For example, a larger weight can be assigned to the edge region to retain the detailed information of the image;

[0069] Pixel intensity and global gradient: Combine pixel intensity, local gradient, and global gradient information to construct an adaptive weight function, thereby effectively fusing multi-exposure images;

[0070] Experimental verification: Verify the effects of different weight settings and fusion algorithms through a large number of experiments to find the solution that is most suitable for the current task. For example, in multi-exposure image fusion, the optimal weights of different exposure images can be determined through experiments to improve the dynamic range and detail retention of the fused image;

[0071] Adaptive weight function: In some advanced fusion algorithms, an adaptive weight function is constructed, which can dynamically adjust the weight coefficient according to the image content and usually requires the use of machine learning or deep learning techniques to implement;

[0072] Weighted average method: In the simple weighted average method, the weight coefficients α and (1 - α) (for the other image), usually their sum is 1, that is, α+(1 - α)=1. This method is simple and easy to implement, but the values of α and β need to be adjusted according to the specific situation to obtain the best fusion effect;

[0073] Deep learning technology: In the image fusion method based on deep learning, the optimal weight coefficient can be learned through the training process, thereby achieving a better fusion effect.

[0074] In summary, when selecting an appropriate weight coefficient α, it is necessary to comprehensively consider the image quality, frequency components, regional features, and specific application scenarios. In practical applications, the optimal weight coefficient needs to be determined through experiments and adjustments.

[0075] In a preferred embodiment, a multi-band fusion algorithm, such as Laplacian pyramid fusion or gradient domain fusion, is adopted to reduce the stitching artifacts and improve the naturalness and continuity of the image.

[0076] Automatic verification is achieved by comparing the overlapping regions of the stitched image and the original image and checking the smoothness of the stitching seam. Its formula expression is:

[0077]

[0078] In the formula, μ x and μ y are the average values of images x and y respectively; and are variances; σ xy is the covariance; C1 and C2 are constants used to stabilize the denominator; the value range of A is between 0 and 1, and the value closer to 1 indicates that the images are more similar.

[0079] In a preferred embodiment, the calculation of A can be implemented based on a local window, that is, each time a window with a size of N×N is taken from the picture for calculating the A index, and after traversing the entire image, the values of all windows are averaged as the A index of the entire image, so as to better simulate the human eye's perception of the image because the human eye is more sensitive to local regions of the image.

[0080] Furthermore, a multi-image stitching system for UAV aerial photography based on OpenCV is provided, which is applied to the above-mentioned multi-image stitching method for UAV aerial photography based on OpenCV, and includes a GPU image preprocessing module, an image grouping and parallel stitching module, and an efficient memory pool management module; the GPU image preprocessing module is used to crop and perform histogram equalization on the aerial photography images by using OpenCV CUDA; the image grouping and parallel stitching module is used to group the preprocessed images and perform parallel processing of the image stitching tasks within each group on the GPU; the efficient memory pool management module is used to dynamically calculate and allocate memory blocks, optimize memory management, and improve the efficiency of memory allocation and release.

[0081] Among them, the efficient memory pool management module further includes: an initialization sub-module, a memory allocation sub-module, and a memory release sub-module; the initialization sub-module is used to create linked lists of free memory blocks at multiple levels according to predefined memory block sizes; the memory allocation sub-module is used to dynamically calculate and allocate memory blocks according to the size requested by the user; the memory release sub-module is used to insert the released memory blocks into the free linked list of the corresponding level.

[0082] As Figure 3 shown, the left figure is the result of image stitching using the opendrone platform, and the right figure is the result of image stitching using the present invention. Under the same memory, for the same number of data sets, by comparing the opendrone platform with the present invention, it can be seen that under the same memory, the result of the present invention is clearer.

[0083] Comparison in terms of running time:

[0084] Table 1

[0085]

[0086] It can be obtained from Table 1 that the stitching method of the present invention is significantly superior to the Opendrone platform in terms of running time. Whether it is for small-scale or large-scale image data sets, the present invention can complete the stitching task faster. Therefore, from the perspective of running time, the present invention is a more efficient method for multi-image stitching of drone aerial photography.

[0087] When the present invention is used, it includes the following steps:

[0088] GPU image preprocessing module: Obtain the aerial photography image data set, and use the OpenCV CUDA parallel processing technology to preprocess the images on the GPU. Grayscale the input aerial photography images to reduce the computational complexity, perform Gaussian blur processing to reduce the influence of noise on feature extraction, and construct a Difference of Gaussian (DoG) pyramid to find extreme points in the scale space as feature points. Use the determinant of the Hessian matrix to detect the interest points in the image. By combining FAST feature point detection and BRIEF feature description, use an improved version with rotational invariance to improve the detection speed and robustness. Then, calculate the gradient direction and magnitude around the feature points to generate a descriptor vector, and use binary descriptors to accelerate the calculation. Use Euclidean distance, Hamming distance, or other distance metric methods to calculate the similarity of the feature point descriptors in two images.

[0089] Efficient Memory Pool Management Module: Establish a memory management mechanism, combine with the parallel computing ability of CUDA, dynamically calculate the memory size requests of image information, pre-define memory blocks of different sizes within the memory management mechanism, optimize the efficiency of memory allocation and release. The memory pool realizes the fast allocation and recycling of memory blocks by pre-managing memory blocks of different sizes, reduces frequent system calls, and reduces the risk of memory fragmentation. A thread-safe mechanism is adopted within the memory management mechanism to ensure stable operation in a multi-threaded environment. Finally, the memory management mechanism is decomposed into an initialization sub-module, a memory allocation sub-module, and a memory release sub-module, which are responsible for creating a linked list of free memory blocks, dynamically calculating and allocating memory blocks, and inserting the released memory blocks into the corresponding-level free linked list respectively.

[0090] Image Grouping and Parallel Stitching Module: According to the characteristic information of the image information, group the pre-processed image information, and use CUDA to parallelize the image stitching tasks within each group to improve the stitching efficiency. The image stitching process includes steps such as feature point detection, feature point description, feature point matching, feature point alignment, image fusion, and image optimization. At the stitching area of the image stitching, a smooth transition algorithm is adopted to reduce the visual discontinuity. The stitching result is automatically verified by comparing the overlapping area of the stitched image and the original image and checking the smoothness of the stitching area.

[0091] Based on the ideal embodiments of the present invention as an inspiration, through the above description, relevant personnel can completely make various changes and modifications without departing from the technical idea of this invention. The technical scope of this invention is not limited to the content in the specification, and the technical scope must be determined according to the scope of the claims.

Claims

1. A method for stitching multiple images taken by an unmanned aerial vehicle based on OpenCV, characterized in that, It includes the following steps: S1. Obtain an aerial image dataset, and use the OpenCV CUDA parallel processing technology to preprocess the image information of the aerial image dataset on the GPU; S2. Establish a memory management mechanism. During the preprocessing process, utilize the parallel computing power of CUDA to dynamically calculate the memory size request of the image information, and predefine memory blocks of different sizes within the memory management mechanism to optimize memory allocation; S3. According to the feature information of the image information, group the preprocessed image information, and use CUDA to parallelize the image stitching tasks within each group; The memory allocation of the memory management mechanism includes the following steps: S201. According to the predefined memory block sizes, create linked lists of free memory blocks at multiple levels, with each level corresponding to a memory block of a fixed size; S202. When requesting memory allocation, dynamically calculate the smallest and appropriate memory block size and the corresponding level according to the requested size, and retrieve a memory block from the free list of the corresponding level; if there is no available memory block in the free list of this level, apply to the operating system for a new memory block and return it to the user; S203. When the user releases memory, extract the header information of the memory block to determine its belonging level, and insert the memory block into the free list of the corresponding level; A thread-safe mechanism is adopted within the memory management mechanism, and the thread-safe mechanism is organized into thread blocks and grids, and the image stitching task is decomposed into multiple sub-tasks that can be processed in parallel; The stitching process of the image stitching task includes the following steps: S301. Use machine learning or deep learning techniques to automatically extract and group image features. Among them, the basis for grouping includes the overlapping area, shooting angle, timestamp, image similarity, and change in lighting conditions of the image information; S302. Dynamically adjust the allocation of memory blocks according to the size and complexity of the image information features. Based on the image information features, adopt a transformation model and a fusion algorithm to reduce stitching traces; S303. At the stitching seam of the image stitching, adopt a smooth transition algorithm to reduce the visual discontinuity. At the same time, automatically verify the stitching result by comparing the overlapping area of the stitched image and the original image and checking the smoothness of the stitching seam; The stitching process of the image stitching task includes feature point detection, feature point description, feature point matching, feature point alignment, image fusion, and image optimization. Among them, feature point alignment is used to calculate the relative displacement and angle between images, and the least squares method is used to fit the process expression of image stitching: M = argmin M ∑ x ||x′ i - Mx i || 2 Wherein, M is a transformation matrix for representing the feature points after image stitching; x i is the feature point in the original image; x' i is the feature point corresponding to x i during the stitching process.

2. The method for stitching multiple aerial images of an unmanned aerial vehicle based on OpenCV according to claim 1, characterized in that: During the image stitching process, a smooth transition algorithm is adopted, and a weighted smooth transition mechanism is used, where the weight changes with the distance from the stitching edge, and its formula expression is: I out (x,y) = αI1(x,y) + (1 - α)I2(x,y) Wherein, I out is the output image; I1 and I2 are two images to be stitched respectively; α is a weight coefficient that varies with position.

3. A method for stitching multiple aerial images of an unmanned aerial vehicle based on OpenCV according to claim 1, characterized in that: The automatic verification is achieved by comparing the overlapping area of the stitched image and the original image and checking the smoothness of the stitching seam, and its formula expression is: where μ x and μ y are the average values of images x and y respectively; and are variances; σ xy is covariance; C1 and C2 are constants used to stabilize the denominator; the value of A ranges from 0 to 1, and the closer the value is to 1, the more similar the images are.

4. A multi-image stitching system for UAV aerial photography based on OpenCV, based on the method for multi-image stitching of UAV aerial photography based on OpenCV according to any one of the above claims 1-3, characterized in that: It includes a GPU image preprocessing module, an image grouping and parallel stitching module, and an efficient memory pool management module; the GPU image preprocessing module is used to crop and perform histogram equalization on aerial images using opencv CUDA; the image grouping and parallel stitching module is used to group the preprocessed images and parallelly process the image stitching tasks within each group on the GPU; the efficient memory pool management module is used to dynamically calculate and allocate memory blocks, optimize memory management, and improve the efficiency of memory allocation and release.

5. The multi-image stitching system for UAV aerial photography based on OpenCV according to claim 4, characterized in that: The efficient memory pool management module further includes: an initialization sub-module, a memory allocation sub-module, and a memory release sub-module; the initialization sub-module is used to create linked lists of free memory blocks at multiple levels according to predefined memory block sizes; the memory allocation sub-module is used to dynamically calculate and allocate memory blocks according to the size requested by the user; the memory release sub-module is used to insert the released memory blocks into the free linked lists at the corresponding levels.

6. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Quantified evaluation method of image mosaic algorithms

    CN102169576A

  • Video stitching method and system

    CN105915804A

  • Video image rapid splicing method and system based on feature extraction matching

    CN111696040A

  • Memory management method and device, equipment and storage medium

    CN117033002A