Method and device for splicing artillery barrel bore images
The method uses edge detection and weighted fusion to address image boundary issues in gun barrel bore imaging, resulting in high-resolution, detailed, and naturally appearing images.
Patent Information
- Application Number
- CN202411085499.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-17
AI Technical Summary
Existing image stitching methods for gun barrel bores suffer from obvious image boundaries due to light and angle variations during image acquisition, affecting the observation effect.
A method involving edge detection algorithms to extract edge information images, followed by feature point registration and weighted fusion techniques to partition and fuse overlapping areas, using a combination of weighted and Laplacian pyramid fusion algorithms.
Produces high-resolution, natural-looking images of gun barrel bores with retained details, improving extraction efficiency and image quality.
Smart Images

Figure CN119151971A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for splicing images of the inner bore of a gun barrel. Background Art
[0002] The quality of the gun bore has a great impact on its accuracy and service life. During the gun firing process, the barrel bore may suffer from defects such as ablation, cracking, and positive line wear due to high temperature. By observing the bore image, the damage area and type of the bore can be determined, thereby determining the subsequent maintenance method for the bore.
[0003] In order to obtain a high-resolution 360° bore image, multiple small images need to be stitched and fused into a high-definition bore image. Due to the influence of light and angle during image acquisition, when two images are directly stitched based on the feature of the rotating field of view scale, obvious image boundaries will be generated, affecting the image observation effect.
[0004] How to obtain natural-looking high-resolution images of the interior of a gun is a technical problem that needs to be solved. Summary of the invention
[0005] The present invention provides a method and device for splicing images of the inner bore of a gun barrel, so as to solve the defects existing in the prior art.
[0006] The present invention provides a method for splicing images of the inner bore of a gun barrel, comprising:
[0007] Acquire multiple images to be stitched, and extract edge information images of each image to be stitched using a target edge detection algorithm;
[0008] Extracting and registering feature points of the edge information image to obtain an initial stitched image; wherein the initial stitched image includes an image overlapping area;
[0009] The overlapping areas of the images are partitioned and fused to obtain a target stitching image of the inner bore of the gun barrel.
[0010] According to a method for splicing images of the inner bore of a gun barrel provided by the present invention, before obtaining an edge information image of each image to be spliced by a target edge detection algorithm, the method further comprises:
[0011] Performing image grayscale processing on the multiple images to be stitched to obtain multiple grayscale images;
[0012] Performing Gaussian filtering on the multiple grayscale images to filter out Gaussian noise and obtain multiple de-noised grayscale images;
[0013] A histogram equalization process is performed on the plurality of denoised grayscale images to correct brightness of the plurality of denoised grayscale images.
[0014] According to a method for stitching images of the inner bore of a gun barrel provided by the present invention, the feature point extraction and registration of the edge information image to obtain an initial stitched image includes:
[0015] Extract feature points from each edge information image, and determine the corresponding relationship between feature point pairs in different edge information images;
[0016] Based on the corresponding relationship of the feature point pairs, multiple edge information images are registered to obtain an initial spliced image.
[0017] According to a method for stitching images of the inner bore of a gun barrel provided by the present invention, the method comprises: registering a plurality of edge information images based on the correspondence relationship of the feature point pairs to obtain an initial stitched image, comprising:
[0018] Calculating the spatial transformation relationship of multiple edge information images based on the corresponding relationship of the feature point pairs;
[0019] The multiple edge information images are registered based on the spatial transformation relationship of the multiple edge information images to obtain an initial spliced image.
[0020] According to a method for stitching images of the inner bore of a gun barrel provided by the present invention, the image overlapping area is an overlapping area of a first edge information image and a second edge information image, and the first edge information image and the second edge information image are images that need to be fused among a plurality of edge information images;
[0021] The partitioning and fusion processing of the overlapping areas of the images to obtain a target stitching image of the inner bore of the gun barrel includes:
[0022] Divide the image overlapping area into a first area, a second area and a third area; wherein the first area is an area adjacent to the first edge information image, the second area is an area adjacent to the second edge information image, and the third area is an area in the image overlapping area excluding the first area and the second area;
[0023] The first region and the second region are fused by a first fusion algorithm, and the third region is fused by a second fusion algorithm to obtain a target spliced image of the inner bore of a gun barrel.
[0024] According to a method for stitching images of the inner bore of a gun barrel provided by the present invention, the formula for the fusion processing is as follows:
[0025]
[0026] Where: I(x,y) represents the pixel value of point (x,y); I a (x, y) represents the pixel value of the non-overlapping area of the first edge information image; l (x, y) represents the pixel value of the first edge information image; r (x, y) represents the pixel value of the second edge information image; c (x, y) represents the pixel value after fusion using the second fusion algorithm in the third area; e (x, y) represents the pixel value of the non-overlapping area of the second edge information image; w l and w r are the weights of the weighted fusion of the first edge information image and the second edge information image respectively.
[0027] According to a method for stitching images of the inner bore of a gun barrel provided by the present invention, the first fusion algorithm is a weighted fusion algorithm, and the second fusion algorithm is a Laplace pyramid fusion algorithm.
[0028] The present invention also provides a device for splicing images of the inner bore of a gun barrel, comprising:
[0029] An extraction module is used to obtain a plurality of images to be stitched, and extract an edge information image of each image to be stitched by using a target edge detection algorithm;
[0030] A registration module, used for extracting and registering feature points of the edge information image to obtain an initial stitched image; wherein the initial stitched image includes an image overlapping area;
[0031] The fusion module is used to partition and fuse the overlapping areas of the images to obtain a target spliced image of the inner bore of the gun barrel.
[0032] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for splicing the inner bore image of a gun barrel as described in any one of the above is implemented.
[0033] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for splicing images of the inner bore of a gun barrel as described in any one of the above is implemented.
[0034] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for splicing images of the inner bore of a gun barrel as described in any one of the above is implemented.
[0035] The present invention provides a method and device for stitching images of the inner bore of a gun barrel, wherein a plurality of images to be stitched are obtained, and an edge information image of each image to be stitched is extracted by a target edge detection algorithm; feature points are extracted and registered on the edge information image to obtain an initial stitched image, wherein the initial stitched image includes an image overlap region; the image overlap region is partitioned and fused to obtain a target stitched image of the inner bore of the gun barrel. It can be seen that the present invention can improve the extraction efficiency by replacing the original image with an edge information image to extract features, and the overlapping region after registration is partitioned and fused to obtain a high-resolution image with a natural look and feel while retaining image details to the greatest extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 It is a schematic flow chart of a method for splicing images of the inner bore of a gun barrel provided by the present invention;
[0038] Figure 2 This is one of the schematic diagrams of the effect of extracting edge information images using multiple edge detection algorithms provided by the present invention;
[0039] Figure 3 This is the second schematic diagram of the effect of extracting edge information images using multiple edge detection algorithms provided by the present invention;
[0040] Figure 4 It is a schematic diagram of the initial splicing image area division provided by the present invention;
[0041] Figure 5 It is a schematic diagram of the effect of the method for splicing images of the inner bore of a gun barrel provided by the present invention;
[0042] Figure 6 It is a schematic structural diagram of a device for splicing images of the inner bore of a gun barrel provided by the present invention;
[0043] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] Combine the following Figure 1-Figure 7 The invention describes a method and device for splicing images of the inner bore of a gun barrel.
[0046] It should be noted that the quality of the gun bore has a great impact on its accuracy and service life. During the gun firing process, the barrel bore may suffer from defects such as ablation, cracking, and positive line wear due to high temperature. By observing the bore image, the damage area and type of the bore can be determined, thereby determining the subsequent maintenance method for the bore.
[0047] In order to obtain a high-resolution 360° bore image, it is necessary to stitch and fuse multiple small images into a high-definition bore image. In the prior art, stitching and fusion based on feature points are usually adopted, and the algorithms for extracting feature points include the more traditional SIFT (Scale-invariant feature transform) algorithm, SURF (Speeded Up Robust Features) algorithm, etc. Due to the influence of light and angle during the image acquisition process, when two images are directly stitched based on the features of the rotating field of view scale, obvious image boundaries will be generated, affecting the image observation effect. Based on this, this embodiment proposes a method for stitching the bore image of a gun barrel to solve the above problem.
[0048] Figure 1 FIG. 1 is a flow chart of a method for splicing images of the inner bore of a gun barrel provided in this embodiment. Figure 1 As shown, the method for stitching the inner bore image of a gun barrel provided in this embodiment includes:
[0049] Step 100: Acquire multiple images to be stitched, and extract edge information images of each image to be stitched using a target edge detection algorithm.
[0050] It should be noted that the bore peek detection equipment for obtaining the inner bore of the gun barrel to be stitched mainly includes a bore peek head and a host computer. The bore peek head is composed of a CCD camera, an LED lighting source and a stepper motor. The stepper motor drives the front end of the bore peek head to rotate, and the CCD camera obtains a sequence of small images of the inner bore of the gun during the rotation process, and obtains a high-definition image of the inner bore by stitching the images.
[0051] Before obtaining the edge information image of each image to be spliced by using the target edge detection algorithm, the method further includes:
[0052] Performing image grayscale processing on the multiple images to be stitched to obtain multiple grayscale images;
[0053] Performing Gaussian filtering on the multiple grayscale images to filter out Gaussian noise and obtain multiple de-noised grayscale images;
[0054] A histogram equalization process is performed on the plurality of denoised grayscale images to correct brightness of the plurality of denoised grayscale images.
[0055] This embodiment improves image quality and ensures subsequent image stitching effects by preprocessing a plurality of images to be stitched.
[0056] It should be noted that the SIFT algorithm is mainly based on typical features such as points, lines, edges and contours in the image. For smoothbore guns and rifled guns in artillery weapons and equipment, the inner wall of the smoothbore gun is relatively smooth, and the inside of the rifled gun is smooth except for the spiral negative and positive lines. The detailed information inside the obtained image is not significant, which adds unnecessary calculations to the detection features of these smooth areas.
[0057] Specifically, this embodiment adopts an edge detection algorithm, such as Roberts, Sobel and Canny. The target image to be stitched is any one of the images to be stitched.
[0058] In one embodiment, Figure 2 FIG. 1 is one of the schematic diagrams showing the effect of extracting edge information images using multiple edge detection algorithms provided in this embodiment. Figure 2 As shown in the figure, experiments were conducted on the inner image of the gun barrel using Roberts, Sobel and Canny edge detection algorithms respectively. In the absence of noise interference, Canny edge detection can obtain the image edge more accurately, while Roberts and Sobel edge detection can detect most of the edges, but the effects of the two are weaker than Canny edge detection.
[0059] In another embodiment, Figure 3 FIG. 2 is a second schematic diagram of the effect of extracting edge information images using multiple edge detection algorithms provided in this embodiment. Figure 3 As shown in the figure, since the obtained images to be stitched usually have certain noise interference, Gaussian noise is added to the target images to be stitched, and then the Roberts, Sobel and Canny edge detection are used to extract the edges of the images. Figure 3, Noise has a certain interference on the edges extracted by the three methods, and the noise points are detected as edge points. However, the results obtained by Canny edge detection are more accurate and clearer than those obtained by Roberts and Sobel edge detection. Therefore, the Canny edge detection algorithm is finally used to extract the edge information image of the image to be spliced.
[0060] Step 200: extract and register feature points of the edge information image to obtain an initial stitched image; wherein the initial stitched image includes an image overlapping area.
[0061] Furthermore, the step of extracting and registering feature points of the edge information image to obtain an initial stitched image includes:
[0062] Extract feature points from each edge information image, and determine the corresponding relationship between feature point pairs in different edge information images;
[0063] Based on the corresponding relationship of the feature point pairs, multiple edge information images are registered to obtain an initial spliced image.
[0064] The registering of the plurality of edge information images based on the correspondence between the feature point pairs to obtain an initial spliced image includes:
[0065] Calculating the spatial transformation relationship of multiple edge information images based on the corresponding relationship of the feature point pairs;
[0066] The multiple edge information images are registered based on the spatial transformation relationship of the multiple edge information images to obtain an initial spliced image.
[0067] Specifically, after the edge information images are extracted, the SIFT algorithm is applied to these edge information images to extract feature points. The SIFT algorithm searches for local extreme points in the scale space and the rotation space, and calculates the descriptors of these points, so that these descriptors have certain invariance to scale, rotation, and illumination changes. Then, by matching the SIFT feature points in different edge information images, the correspondence between the feature point pairs can be established. The correspondence between the feature point pairs is used to estimate the transformation relationship between the images (such as translation, rotation, scaling, etc.). This transformation relationship can be optimized by the least squares method, the RANSAC (random sampling consensus) algorithm or other optimization algorithms. Finally, the corresponding relationship of the feature point pairs is projected back to the original image to be spliced, so that the image registration and splicing can be achieved, that is, the initial spliced image is obtained.
[0068] This embodiment uses edge information images to replace original images to extract features. When the approximate overlapping area is known, the sub-area with the richest edge information in the overlapping area is found to replace the entire image for SIFT feature extraction and registration, and the results are mapped to the source image, which can improve efficiency.
[0069] Step 300: partition and fuse the overlapping areas of the images to obtain a target stitching image of the inner bore of the gun barrel.
[0070] The image overlapping area is an overlapping area of a first edge information image and a second edge information image, and the first edge information image and the second edge information image are images that need to be fused among a plurality of edge information images;
[0071] The partitioning and fusion processing of the overlapping areas of the images to obtain a target stitching image of the inner bore of the gun barrel includes:
[0072] Divide the image overlapping area into a first area, a second area and a third area; wherein the first area is an area adjacent to the first edge information image, the second area is an area adjacent to the second edge information image, and the third area is an area in the image overlapping area excluding the first area and the second area;
[0073] The first region and the second region are fused by a first fusion algorithm, and the third region is fused by a second fusion algorithm to obtain a target spliced image of the inner bore of a gun barrel.
[0074] It should be noted that, in this embodiment, the first fusion algorithm is a weighted fusion algorithm, and the second fusion algorithm is a Laplacian pyramid fusion algorithm.
[0075] When collecting images to be stitched, the LED light source will cause obvious brightness differences in the fusion area of two adjacent images obtained by rotational scanning, and directly fused images will have unnatural stitching seams. The weighted fusion method generally uses fixed weights for image fusion, which has low computational complexity and fast stitching speed. It may cause the stitching gaps to be more conspicuous, making the fused image feel severely fragmented; the pyramid fusion method mainly reconstructs the fused image at different resolutions based on the Gaussian pyramid of the image to make the image transition more natural. This embodiment combines the two fusion methods. First, the transition areas b, c, and d are divided in the overlapping area of the image, and then different fusion methods are used in different transition areas.
[0076] In one embodiment, Figure 4 is a schematic diagram of the initial stitching image area division provided in this embodiment, such as Figure 4As shown in the figure, b, c, and d represent the overlapping areas of the images, b is the first area, d is the second area, and c is the third area; a and e represent non-overlapping areas; the Laplace pyramid fusion algorithm is used in the transition area c, and the nonlinear weighted fusion algorithm based on the Sigmoid function is used in the transition areas b and d. The sizes of areas b, d, and c are 1 / 4, 1 / 4, and 1 / 2 of the size of the overlapping area of the images, respectively.
[0077] Specifically, the weighted fusion algorithm usually uses fixed weights or linear weights to fuse two images. The effect of image fusion depends greatly on the selection of weights. Figure 4 , after the fusion of area b, the position is relatively on the left, so the pixel value of the spliced left image occupies a larger weight, which is beneficial to improve the fusion effect after splicing. Similarly, the pixel weight of the corresponding position of the spliced right image in area d should also be dominant. In this embodiment, the Sigmoid function is selected to nonlinearly assign the pixel weight according to the position of the overlapping area, as shown in formula (1):
[0078] σ(x)=1 / (1+exp(-x))(1)
[0079] The domain of the Sigmoid function is the set of all real numbers, and its range is (0,1). The function is differentiable everywhere and is a smooth curve. As the pixel position changes, the weight changes smoothly, resulting in a better fusion effect. Let the center of the overlapped area of the image be the position where the pixel weights of the left and right images are equal, so as to transform the coordinates, as shown in formula (2):
[0080]
[0081] Among them, min represents the leftmost column of the first area, max represents the rightmost column of the first area, and j represents the column number of a column in areas b and d.
[0082] The weights of the two graphs are further obtained, see formula (3):
[0083]
[0084] The final fusion formula can be found in formula (4):
[0085]
[0086] Among them, I(x,y) represents the pixel value of point (x,y); I a (x, y) represents the pixel value of the non-overlapping area of the first edge information image; l (x, y) represents the pixel value of the first edge information image; r (x, y) represents the pixel value of the second edge information image;c (x, y) represents the pixel value after fusion using the second fusion algorithm in the third area; e (x, y) represents the pixel value of the non-overlapping area of the second edge information image; w l and w r are the weights of the weighted fusion of the first edge information image and the second edge information image respectively.
[0087] Further, Figure 5 FIG. 1 is a schematic diagram showing the effect of the method for splicing the inner bore images of a gun barrel provided in this embodiment. Figure 5 As shown, the method for stitching the inner bore image of the gun barrel provided in this embodiment uses Sigmoid nonlinear fusion and Laplace pyramid fusion in the overlapping area segmentation after registration, so as to obtain a high-resolution image with natural appearance while retaining the image details to the greatest extent.
[0088] The above is a description of the steps of the method for stitching images of the inner bore of a gun barrel provided in this embodiment. From the description of the above steps, it can be seen that according to the method for stitching images of the inner bore of a gun barrel provided in this embodiment, multiple images to be stitched are obtained, and the edge information image of each image to be stitched is extracted by the target edge detection algorithm; feature points are extracted and registered on the edge information image to obtain an initial stitched image, wherein the initial stitched image includes an image overlapping area; the image overlapping area is partitioned and fused to obtain a target stitched image of the inner bore of the gun barrel. It can be seen that the present invention can improve the extraction efficiency by replacing the original image with an edge information image to extract features, and the overlapping area partitions after registration are fused to obtain a high-resolution image with a natural look and feel while retaining the image details to the greatest extent.
[0089] The following is a description of the gun barrel inner bore image stitching device provided by the present invention. The gun barrel inner bore image stitching device described below and the gun barrel inner bore image stitching method described above can correspond to each other.
[0090] Figure 6 is a schematic diagram of the structure of the splicing device for the inner bore image of the gun barrel provided in this embodiment. Figure 6 As shown, the splicing device for the inner bore image of a gun barrel provided in this embodiment includes:
[0091] An extraction module 601 is used to obtain a plurality of images to be stitched, and extract an edge information image of each image to be stitched by using a target edge detection algorithm;
[0092] A registration module 602 is used to extract and register feature points of the edge information image to obtain an initial stitched image; wherein the initial stitched image includes an image overlap area;
[0093] The fusion module 603 is used to partition and fuse the overlapping areas of the images to obtain a target spliced image of the inner bore of the gun barrel.
[0094] The splicing device for the inner bore image of a gun barrel provided in this embodiment obtains a plurality of images to be spliced, and extracts an edge information image of each image to be spliced through a target edge detection algorithm; extracts and aligns feature points of the edge information image to obtain an initial spliced image, wherein the initial spliced image includes an image overlap region; and partitions and fuses the image overlap region to obtain a target spliced image of the inner bore of the gun barrel. It can be seen that the present invention can improve the extraction efficiency by replacing the original image with an edge information image to extract features, and can obtain a natural-looking high-resolution image while retaining image details to the greatest extent by partitioning the overlap region after registration.
[0095] Based on the above embodiment, in this embodiment, the device further includes a preprocessing module, which is specifically used for:
[0096] Performing image grayscale processing on the multiple images to be stitched to obtain multiple grayscale images;
[0097] Performing Gaussian filtering on the multiple grayscale images to filter out Gaussian noise and obtain multiple de-noised grayscale images;
[0098] A histogram equalization process is performed on the plurality of denoised grayscale images to correct brightness of the plurality of denoised grayscale images.
[0099] Based on the above embodiment, in this embodiment, the registration module 602 is specifically used for:
[0100] Extract feature points from each edge information image, and determine the corresponding relationship between feature point pairs in different edge information images;
[0101] Based on the corresponding relationship of the feature point pairs, multiple edge information images are registered to obtain an initial spliced image.
[0102] Based on the above embodiment, in this embodiment, the registration module 602 is specifically used for:
[0103] Calculating the spatial transformation relationship of multiple edge information images based on the corresponding relationship of the feature point pairs;
[0104] The multiple edge information images are registered based on the spatial transformation relationship of the multiple edge information images to obtain an initial spliced image.
[0105] Based on the above embodiment, in this embodiment, the image overlapping area is an overlapping area of a first edge information image and a second edge information image, and the first edge information image and the second edge information image are images that need to be fused among a plurality of edge information images;
[0106] The fusion module 603 is specifically used for:
[0107] Divide the image overlapping area into a first area, a second area and a third area; wherein the first area is an area adjacent to the first edge information image, the second area is an area adjacent to the second edge information image, and the third area is an area in the image overlapping area excluding the first area and the second area;
[0108] The first region and the second region are fused by a first fusion algorithm, and the third region is fused by a second fusion algorithm to obtain a target spliced image of the inner bore of a gun barrel.
[0109] Based on the above embodiment, in this embodiment, the formula for the fusion process is as follows:
[0110]
[0111] Where: I(x,y) represents the pixel value of point (x,y); I a (x, y) represents the pixel value of the non-overlapping area of the first edge information image; l (x, y) represents the pixel value of the first edge information image; r (x, y) represents the pixel value of the second edge information image; c (x, y) represents the pixel value after fusion using the second fusion algorithm in the third area; e (x, y) represents the pixel value of the non-overlapping area of the second edge information image; w l and w r are the weights of the weighted fusion of the first edge information image and the second edge information image respectively.
[0112] Based on the above embodiment, in this embodiment, the first fusion algorithm is a weighted fusion algorithm, and the second fusion algorithm is a Laplacian pyramid fusion algorithm.
[0113] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the method for splicing the inner bore image of the gun barrel, and the method includes:
[0114] Acquire multiple images to be stitched, and extract edge information images of each image to be stitched using a target edge detection algorithm;
[0115] Extracting and registering feature points of the edge information image to obtain an initial stitched image; wherein the initial stitched image includes an image overlapping area;
[0116] The overlapping areas of the images are partitioned and fused to obtain a target stitching image of the inner bore of the gun barrel.
[0117] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0118] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the method for stitching the inner bore image of the gun barrel provided by the above methods, the method comprising:
[0119] Acquire multiple images to be stitched, and extract edge information images of each image to be stitched using a target edge detection algorithm;
[0120] Extracting and registering feature points of the edge information image to obtain an initial stitched image; wherein the initial stitched image includes an image overlapping area;
[0121] The overlapping areas of the images are partitioned and fused to obtain a target stitching image of the inner bore of the gun barrel.
[0122] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for splicing the inner bore images of a gun barrel provided by the above methods is implemented, and the method comprises:
[0123] Acquire multiple images to be stitched, and extract edge information images of each image to be stitched using a target edge detection algorithm;
[0124] Extracting and registering feature points of the edge information image to obtain an initial stitched image; wherein the initial stitched image includes an image overlapping area;
[0125] The overlapping areas of the images are partitioned and fused to obtain a target stitching image of the inner bore of the gun barrel.
[0126] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for splicing images of the inner bore of a gun barrel, characterized in that: include: Acquire multiple images to be stitched, and extract edge information images of each image to be stitched using a target edge detection algorithm; Extracting and registering feature points of the edge information image to obtain an initial stitched image; wherein the initial stitched image includes an image overlapping area; The overlapping areas of the images are partitioned and fused to obtain a target stitching image of the inner bore of the gun barrel.
2. The method for splicing the inner bore images of a gun barrel according to claim 1, characterized in that: Before obtaining the edge information image of each image to be spliced by using the target edge detection algorithm, the method further includes: Performing image grayscale processing on the multiple images to be stitched to obtain multiple grayscale images; Performing Gaussian filtering on the multiple grayscale images to filter out Gaussian noise and obtain multiple de-noised grayscale images; A histogram equalization process is performed on the plurality of denoised grayscale images to correct brightness of the plurality of denoised grayscale images.
3. The method for splicing images of the inner bore of a gun barrel according to claim 1, characterized in that: The step of extracting and registering feature points of the edge information image to obtain an initial spliced image includes: Extract feature points from each edge information image, and determine the corresponding relationship between feature point pairs in different edge information images; Based on the corresponding relationship of the feature point pairs, multiple edge information images are registered to obtain an initial spliced image.
4. The method for splicing the inner bore images of a gun barrel according to claim 3, characterized in that: The registering of the plurality of edge information images based on the correspondence between the feature point pairs to obtain an initial spliced image includes: Calculating the spatial transformation relationship of multiple edge information images based on the corresponding relationship of the feature point pairs; The multiple edge information images are registered based on the spatial transformation relationship of the multiple edge information images to obtain an initial spliced image.
5. The method for splicing images of the inner bore of a gun barrel according to claim 1, characterized in that: The image overlapping area is an overlapping area of a first edge information image and a second edge information image, and the first edge information image and the second edge information image are images that need to be fused among a plurality of edge information images; The partitioning and fusion processing of the overlapping areas of the images to obtain a target stitching image of the inner bore of the gun barrel includes: Divide the image overlapping area into a first area, a second area and a third area; wherein the first area is an area adjacent to the first edge information image, the second area is an area adjacent to the second edge information image, and the third area is an area in the image overlapping area excluding the first area and the second area; The first region and the second region are fused by a first fusion algorithm, and the third region is fused by a second fusion algorithm to obtain a target spliced image of the inner bore of a gun barrel.
6. The method for splicing the inner bore images of a gun barrel according to claim 5, characterized in that: The formula for the fusion process is as follows: Where: I(x,y) represents the pixel value of point (x,y); I a (x, y) represents the pixel value of the non-overlapping area of the first edge information image; l (x, y) represents the pixel value of the first edge information image; r (x, y) represents the pixel value of the second edge information image; c (x, y) represents the pixel value after fusion using the second fusion algorithm in the third area; e (x, y) represents the pixel value of the non-overlapping area of the second edge information image; w l and w r are the weights of the weighted fusion of the first edge information image and the second edge information image respectively.
7. The method for splicing the inner bore images of a gun barrel according to claim 5 or 6, characterized in that: The first fusion algorithm is a weighted fusion algorithm, and the second fusion algorithm is a Laplacian pyramid fusion algorithm.
8. A device for splicing images of the inner bore of a gun barrel, characterized in that: include: An extraction module is used to obtain a plurality of images to be stitched, and extract an edge information image of each image to be stitched by using a target edge detection algorithm; A registration module, used for extracting and registering feature points of the edge information image to obtain an initial stitched image; wherein the initial stitched image includes an image overlapping area; The fusion module is used to partition and fuse the overlapping areas of the images to obtain a target spliced image of the inner bore of the gun barrel.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for stitching the inner bore image of the gun barrel as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for stitching images of the inner bore of a gun barrel as described in any one of claims 1 to 7 is implemented.
