Method and device for determining feature point set, storage medium and electronic device

By merging the feature point sets of corner and spot detection algorithms and using the BRISK algorithm to generate feature descriptors, the problem of poor feature detection accuracy in image splicing is solved and the splicing effect is improved.

CN118552401APending Publication Date: 2024-08-27HUANENG CLEAN ENERGY RES INST +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410301351.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

The accuracy of feature detection in the existing technology during the image stitching process is poor, resulting in poor stitching results. In particular, there are flaws in the processing of noise-sensitive, weak texture areas and dense corner scenes.

Method used

Combining the corner detection algorithm and the spot detection algorithm, by merging the feature point sets of the two, removing duplicate feature points within the distance or scale threshold, using the BRISK algorithm to generate feature descriptors, and determining the transformation model through feature matching for image splicing.

Benefits of technology

It improves the accuracy of feature detection in the image stitching process, enhances the stitching effect, and overcomes the problems of false detection and missed detection in noise, weak texture areas and dense corner scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552401A
    Figure CN118552401A
Patent Text Reader

Abstract

The invention discloses a feature point set determination method and device, a storage medium and an electronic device, and relates to the field of image detection, and the method comprises the steps: obtaining a first image to be subjected to feature detection; performing feature detection on the first image by using a corner detection algorithm to obtain a corner set; performing feature detection on the first image by using a spot detection algorithm to obtain a spot set; and combining the angular point set and the spot set to obtain a first feature point set. By adopting the technical scheme, the problem that the image splicing effect is poor due to the fact that the accuracy of feature detection on the image is poor in the image splicing process is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image detection, and in particular, to a method and device for determining a feature point set, a storage medium, and an electronic device. Background Art

[0002] Since photovoltaic panels are widely distributed, aerial images taken by drones often cannot contain all the information of large-scale photovoltaic panels. Therefore, it is necessary to stitch multiple consecutive aerial images of photovoltaic panels collected by drones.

[0003] In the process of image stitching, it is necessary to perform feature detection on the images to be stitched, but the current feature detection is to select a corner detection algorithm or a spot detection algorithm for feature detection according to the detection requirements.

[0004] However, the corner detection algorithm has the following disadvantages: 1. Sensitive to image noise: The corner detection algorithm is sensitive to image noise, which may lead to false detection or missed detection. 2. Not applicable to some areas with weak texture: For areas with weak texture, the corner detection algorithm may not be able to accurately detect the corners. 3. Not applicable to scenes with dense corners: In some scenes with dense corners, the corner detection algorithm may generate a large number of redundant feature points, increasing the computation and storage overhead.

[0005] The blob detection algorithm has the following disadvantages: 1. Sensitive to illumination changes and image noise: When the illumination changes greatly or the image contains a lot of noise, the blob detection algorithm is prone to false detection or missed detection. 2. Unstable to scale changes: When the scale changes greatly, the blob detection algorithm may not be able to accurately detect the blob. 3. Parameters need to be set manually: Some blob detection algorithms require manual parameter setting and are sensitive to parameter selection. Different parameter settings may result in different detection results.

[0006] In view of the problem in the related art that, during the image stitching process, the accuracy of feature detection on images is poor, resulting in poor image stitching effect, no effective solution has been proposed yet.

[0007] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention

[0008] Embodiments of the present invention provide a method and device for determining a feature point set, a storage medium, and an electronic device to solve the problem that, at least in the process of image stitching, the accuracy of feature detection on an image is poor, resulting in a poor image stitching effect.

[0009] According to one aspect of an embodiment of the present invention, a method for determining a feature point set is provided, comprising: acquiring a first image to be subjected to feature detection; performing feature detection on the first image using a corner point detection algorithm to obtain a corner point set; and performing feature detection on the first image using a spot detection algorithm to obtain a spot set; merging the corner point set and the spot set to obtain a first feature point set.

[0010] In an exemplary embodiment, the corner point set and the spot set are merged to obtain a first feature point set, including: adding feature points in the corner point set to the first feature point set, and adding feature points in the spot set to the first feature point set; in the case where there are first feature points and second feature points in the first feature point set, deleting one of the first feature points and the second feature point from the first feature point set; wherein the first feature point is a feature point in the corner point set, the second feature point is a feature point in the spot set, and the distance between the first feature point and the second feature point is less than a first preset threshold.

[0011] In an exemplary embodiment, deleting one of the first feature point and the second feature point from the first feature point set includes: when the scale values ​​of the first feature point and the second feature point are both less than or equal to a second preset threshold or both greater than or equal to the second preset threshold, deleting any one of the first feature point and the second feature point from the first feature point set; when one of the first feature point and the second feature point has a scale value less than the second preset threshold and the other feature point has a scale value greater than the second preset threshold, deleting the feature point whose scale value is less than the second preset threshold from the first feature point set.

[0012] In an exemplary embodiment, after merging the corner point set and the spot set to obtain a first feature point set, the method further includes: determining a second image and a second feature point set of the second image, wherein the second image is an image to be stitched with the first image; performing feature matching on the feature points in the first feature point set and the second feature point set to obtain a feature point pair set; determining a transformation model based on the feature point pair set, wherein the transformation model is used to transform the coordinates of the pixel points in the first image from the first coordinate system to the second coordinate system, or to transform the coordinates of the pixel points in the second image from the second coordinate system to the first coordinate system; and using the transformation model to stitch the first image and the second image.

[0013] In an exemplary embodiment, feature matching is performed on feature points in the first feature point set and the second feature point set to obtain a feature point pair set, including: determining a feature point pair in the feature point pair set in the following manner to obtain the feature point pair set: determining in the second feature point set a first target feature point that is closest to the i-th feature point in the first feature point set and a second target feature point that is second closest to the i-th feature point; when a ratio of the first distance to the second distance is less than a third preset threshold, determining that the i-th feature point and the first target feature point constitute a feature point pair, wherein the first distance is the distance between the i-th feature point and the first target feature point, and the second distance is the distance between the i-th feature point and the second target feature point.

[0014] In an exemplary embodiment, the method further includes: determining a first distance between the i-th feature point and the first target feature point by the following method: determining a first feature descriptor of the i-th feature point and a second feature descriptor of the first target feature point, wherein the feature descriptor is an n-bit binary number, the feature descriptor includes the first feature descriptor and the second feature descriptor, and n is a positive integer greater than or equal to 2; the first distance is calculated by the following formula: Wherein, D(A,B) is the first distance, A is the first feature descriptor, B is the second feature descriptor, and A=a1a2…a n , B=a1a2…a n , Represents the exclusive OR operation.

[0015] In an exemplary embodiment, determining the first feature descriptor of the i-th feature point and the second feature descriptor of the first target feature point includes: using a binary robust invariant scalable key point (BRISK) algorithm in the first image to determine the first feature descriptor of the i-th feature point; and using the BRISK algorithm in the second image to determine the second feature descriptor of the first target feature point.

[0016] In an exemplary embodiment, a transformation model is determined based on the feature point pair set, including: determining a first feature point pair set from the feature point pair set, and calculating a reference transformation model based on the first feature point pair set; using a reference change model to determine the number of feature point pairs that meet preset requirements in a second feature point pair set, and when the number of feature point pairs that meet the preset requirements is greater than a fourth preset threshold, determining the transformation model as the reference transformation model; wherein the feature point pairs in the feature point pair set other than the first feature point pair set constitute the second feature point pair set, and the preset requirements include: when the feature point pair is (feature point X, feature point Y), the distance between feature point Z and feature point Y is less than a fifth preset threshold, and the feature point Z is a feature point obtained after the feature point Y is transformed using the reference transformation model.

[0017] In an exemplary embodiment, the first image and the second image are stitched using the transformation model, including: using the transformation model to transform the coordinates of the pixel points in the first image from the first coordinate system to the second coordinate system to obtain a first pixel point set after the coordinate transformation; using a bilinear interpolation method to determine the pixel value of each pixel point in the first pixel point set to obtain the pixel value of each pixel point in the transformed first image; using the following formula to stitch the first image and the second image to determine the pixel value of each pixel point in the stitched image to obtain the stitched image:

[0018]

[0019] Among them, f1 is the first pixel point set, f2 is the second pixel point set of the second image, (x, y) is the coordinate of the pixel point, (x, y)∈the union of f1 and f2, f1(x, y) is the pixel value of the pixel point in the transformed first image, f2(x, y) is the pixel value of the pixel point in the second image, f(x, y) is the pixel value of the pixel point in the spliced ​​image, and k1 and k2 are weight coefficients.

[0020] According to another aspect of an embodiment of the present invention, a device for determining a feature point set is also provided, including: an acquisition module, used to acquire a first image to be subjected to feature detection; a detection module, used to perform feature detection on the first image using a corner point detection algorithm to obtain a corner point set; and used to perform feature detection on the first image using a spot detection algorithm to obtain a spot set; and a merging module, used to merge the corner point set and the spot set to obtain a first feature point set.

[0021] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for determining a feature point set when running.

[0022] According to another aspect of an embodiment of the present invention, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for determining the feature point set through the computer program.

[0023] Through the present invention, a corner detection algorithm and a spot detection algorithm are used to detect an image at the same time, thereby taking into account the advantages of the corner detection algorithm and the spot detection algorithm, improving the accuracy of feature detection on the image, and thus solving the problem of poor accuracy of feature detection on the image and resulting poor image stitching effect during image stitching, thereby improving the stitching effect of image stitching. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0026] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for determining a feature point set according to an embodiment of the present invention;

[0027] Figure 2 is a flow chart of a method for determining a feature point set according to an embodiment of the present invention;

[0028] Figure 3 is a schematic diagram of the principle of an improved feature detection algorithm according to an embodiment of the present invention;

[0029] Figure 4 is a schematic diagram of obtaining a sampling point according to an embodiment of the present invention;

[0030] Figure 5 is a schematic diagram of the principle of a bilinear interpolation method according to an embodiment of the present invention;

[0031] Figure 6 It is a structural block diagram of a device for determining a feature point set according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution 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. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for determining a feature point set according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0035] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the feature point set in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0036] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0037] In this embodiment, a method for determining a feature point set is provided. Figure 2 is a flow chart of a method for determining a feature point set according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps S202-S206:

[0038] Step S202: Acquire a first image to be subjected to feature detection;

[0039] Step S204: performing feature detection on the first image using a corner detection algorithm to obtain a corner point set; and performing feature detection on the first image using a spot detection algorithm to obtain a spot set;

[0040] As an optional example, the corner point detection algorithm is the Harris corner point detection algorithm, and the spot detection algorithm is the SURF feature point detection algorithm.

[0041] It should be noted that the Harris corner point detection algorithm has the advantage of strong stability, and the SURF feature point detection algorithm has the advantage of scale invariance.

[0042] As an optional example, when the corner detection algorithm or the spot detection algorithm performs feature detection on the first image, the position and scale value of each feature point are also determined.

[0043] Step S206: merging the corner point set and the spot set to obtain a first feature point set.

[0044] Through the above steps, the image is detected using the corner detection algorithm and the spot detection algorithm at the same time, thereby taking into account the advantages of the corner detection algorithm and the spot detection algorithm, improving the accuracy of feature detection on the image, and thus solving the problem of poor accuracy of feature detection on the image and resulting in poor image stitching effect in the process of image stitching, thereby improving the stitching effect of image stitching.

[0045] In an exemplary embodiment, the above step S206 includes the following steps S11-S12:

[0046] Step S11: adding feature points in the corner point set to the first feature point set, and adding feature points in the spot set to the first feature point set;

[0047] Step S12: when the first feature point set includes a first feature point and a second feature point, deleting one of the first feature point and the second feature point from the first feature point set;

[0048] It should be noted that the first feature point is a feature point in the corner point set, the second feature point is a feature point in the spot set, and the distance between the first feature point and the second feature point is less than a first preset threshold.

[0049] Optionally, the distance between the first feature point and the second feature point may be a Euclidean distance.

[0050] That is to say, in this embodiment, it is necessary to remove repeated feature points in the corner point set and the spot set, and merge the remaining feature points to obtain a first feature point set with a large number of feature points and a relatively uniform distribution.

[0051] In an exemplary embodiment, deleting one of the first feature point and the second feature point from the first feature point set includes: when the scale values ​​of the first feature point and the second feature point are both less than or equal to a second preset threshold or both greater than or equal to the second preset threshold, deleting any one of the first feature point and the second feature point from the first feature point set; when one of the first feature point and the second feature point has a scale value less than the second preset threshold and the other feature point has a scale value greater than the second preset threshold, deleting the feature point whose scale value is less than the second preset threshold from the first feature point set.

[0052] It should be noted that if the scale value of a feature point is smaller than the second preset threshold, it means that the scale invariance performance of this feature point is poor.

[0053] That is to say, in this embodiment, if the scale invariance performance of the first feature point and the second feature point are both poor or good, a feature point is randomly selected from the first feature point and the second feature point and deleted from the first feature point set; if one of the first feature point and the second feature point has poor scale invariance performance and the other has good scale invariance performance, the feature point with poor scale invariance performance is deleted from the first feature point set.

[0054] In an exemplary embodiment, after the above step S206, the following steps S21-S24 are further included:

[0055] Step S21: determining a second image and a second feature point set of the second image, wherein the second image is an image to be stitched with the first image;

[0056] Optionally, the method for determining the second feature point set of the second image is the same as the method for determining the first feature point set of the first image, see steps S202-S206 for details.

[0057] Step S22: performing feature matching on the feature points in the first feature point set and the second feature point set to obtain a feature point pair set;

[0058] In an exemplary embodiment, the step S22 includes: determining a feature point pair in the feature point pair set through the following steps S31-S32 to obtain the feature point pair set:

[0059] Step S31: determining in the second feature point set a first target feature point that is closest to the i-th feature point in the first feature point set and a second target feature point that is second closest to the i-th feature point;

[0060] In an exemplary embodiment, the first distance between the i-th feature point and the first target feature point is determined by the following steps S311-S312:

[0061] Step S311: determining a first feature descriptor of the i-th feature point and a second feature descriptor of the first target feature point, wherein the feature descriptor is an n-bit binary number, the feature descriptor includes the first feature descriptor and the second feature descriptor, and n is a positive integer greater than or equal to 2;

[0062] In an exemplary embodiment, n is 512.

[0063] Step S312: Calculate the first distance using the following formula: Wherein, D(A,B) is the first distance, A is the first feature descriptor, B is the second feature descriptor, and A=a1a2…a n , B=a1a2…a n , Represents the exclusive OR operation.

[0064] It should be noted that the method for determining the second distance between the i-th feature point and the second target feature point is the same as the method for determining the first distance between the i-th feature point and the first target feature point, and this application will not elaborate on it here.

[0065] In an exemplary embodiment, determining a first feature descriptor of the i-th feature point and a second feature descriptor of the first target feature point includes: determining the first feature descriptor of the i-th feature point in the first image using a Binary Robust Invariant Scalable Keypoints (BRISK) algorithm; and determining the second feature descriptor of the first target feature point in the second image using the BRISK algorithm.

[0066] It should be noted that the process of using the BRISK algorithm defect feature descriptor is detailed below and will not be described here.

[0067] Step S32: When the ratio of the first distance to the second distance is less than a third preset threshold, determine that the i-th feature point and the first target feature point constitute a feature point pair, wherein the first distance is the distance between the i-th feature point and the first target feature point, and the second distance is the distance between the i-th feature point and the second target feature point.

[0068] As an optional example, the value of the third preset threshold is between 0.4 and 0.6.

[0069] Step S23: determining a transformation model according to the set of feature point pairs, wherein the transformation model is used to transform the coordinates of the pixel points in the first image from the first coordinate system to the second coordinate system, or to transform the coordinates of the pixel points in the second image from the second coordinate system to the first coordinate system;

[0070] In an exemplary embodiment, the above step S23 can be implemented by the following steps S41-S42:

[0071] Step S41: determining a first feature point pair set from the feature point pair sets, and calculating a reference transformation model according to the first feature point pair set;

[0072] As an optional example, n feature point pairs may be randomly selected from the feature point pair set to obtain a first feature point pair set.

[0073] Step S42: using the reference change model to determine the number of feature point pairs in the second feature point pair set that meet the preset requirements, and when the number of feature point pairs that meet the preset requirements is greater than a fourth preset threshold, determining the transformation model as the reference transformation model;

[0074] Among them, the feature point pairs in the feature point pair set other than the first feature point pair set constitute the second feature point pair set, and the preset requirements include: when the feature point pair is (feature point X, feature point Y), the distance between feature point Z and feature point Y is less than the fifth preset threshold, and the feature point Z is the feature point obtained after the feature point Y is transformed using the reference transformation model.

[0075] As an optional example, in the process of using the reference change model to determine the number of feature point pairs in the second feature point pair set that meet preset requirements, the feature point pairs in the second feature point pair set that do not meet the preset requirements are deleted to update the feature point pair set.

[0076] As an optional example, when the number of feature point pairs that meet the preset requirements is less than or equal to a fourth preset threshold, the first feature point pair set is re-determined in the feature point pair set, and the reference transformation model is recalculated based on the first feature point pair set, and the same method is used to continue to verify the reference transformation model.

[0077] Step S24: Use the transformation model to perform image stitching on the first image and the second image.

[0078] In an exemplary embodiment, the above step S24 includes the following steps S51 - S53:

[0079] Step S51: Use the transformation model to transform the coordinates of the pixel points in the first image from the first coordinate system to the second coordinate system, obtaining a set of first pixel points after coordinate transformation;

[0080] Step S52: Use the bilinear interpolation method to determine the pixel value of each pixel point in the set of first pixel points, obtaining the pixel value of each pixel point in the transformed first image;

[0081] It should be noted that the process of using the bilinear interpolation method to determine the pixel value of each pixel point in the set of first pixel points is specifically described in detail below and will not be elaborated here.

[0082] Step S53: Use the following formula to perform image stitching on the first image and the second image, determining the pixel value of each pixel point in the stitched image to obtain the stitched image:

[0083]

[0084] where f1 is the set of first pixel points, f2 is the set of second pixel points of the second image, (x, y) is the coordinate of the pixel point, (x, y) ∈ the union of f1 and f2, f1(x, y) is the pixel value of the pixel point in the transformed first image, f2(x, y) is the pixel value of the pixel point in the second image, f(x, y) is the pixel value of the pixel point in the stitched image, and k1 and k2 are weight coefficients.

[0085] It should be noted that k1 and k2 respectively represent the weight values of the two images to be fused in the overlapping area, and k1 + k2 = 1, 0 < k1k2 < 1. Their values are related to the width of the overlapping area. When the value of k1 gradually changes from 0 to 1 and the value of k2 gradually changes from 1 to 0, a smooth transition between f1 = (x, y) and f2 = (x, y) of the images to be fused in the overlapping area can be achieved. Finally, the images can be quickly and accurately stitched to obtain a complete photovoltaic panel image.

[0086] It should be noted that an image is composed of pixels. After determining the coordinates and pixel values of each pixel point in the image, this image can be obtained.

[0087] Obviously, the above-described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. To better understand the above method, the following will describe the above process in conjunction with embodiments, but it is not used to limit the technical solutions of the embodiments of the present invention. Specifically:

[0088] In an optional embodiment, the present application performs feature detection on the image through an improved SURF algorithm (the improved SURF algorithm is described below in detail), and then describes the feature points through the BRISK algorithm, and then uses the Hamming distance for coarse feature matching, uses the RANSAC algorithm for precise feature matching and establishes a transformation model, and uses bilinear interpolation to interpolate the image, and finally performs image fusion through weighted average fusion method, thereby realizing the stitching of large-scale aerial images of photovoltaic panels.

[0089] It should be noted that an improved SURF algorithm feature detection algorithm is: using the SURF spot detection algorithm to detect image feature points and using the Harris corner detection algorithm to detect feature points in the image, and removing the duplicate features in the two feature point sets, and merging the remaining feature points to obtain a new feature point set with a large number of feature points and a more uniform distribution. It should be noted that the corner points in the image are an important local feature of the image, with rich texture and distinguishability. The algorithm principle is shown in detail as follows Figure 3 shown.

[0090] Specifically, the specific steps of using the improved SURF feature detection algorithm to perform feature detection on aerial images of photovoltaic panels are as follows:

[0091] Step 1: Use the Harris corner detection algorithm to detect corners of the aerial image of the photovoltaic panel and obtain the image corner point set S1;

[0092] Step 2: Use the SURF spot detection algorithm to detect feature points of the photovoltaic panel image, so as to obtain the spot set S2 of the image;

[0093] In the above steps 1 and 2, the position and scale value of each feature point need to be determined. It should be noted that the feature points include corner points and spots.

[0094] Step 3: Combine steps 1 and 2 to obtain a new feature point set. If the Euclidean distance between a corner point a in S1 and a spot b in S2 is less than a certain threshold, the two points are considered to be repeated. Then, one of the repeated feature points needs to be removed (the feature points with poor scale-invariant performance) and merged with the remaining non-repeated feature points to obtain a new feature point set, that is, the feature point set S obtained by detecting feature points of aerial images of photovoltaic panels using the improved SURF feature point detection algorithm.

[0095] For a better understanding, the following is a detailed description of the feature points using the BRISK algorithm:

[0096] The BRISK algorithm is used to describe the feature points. The main purpose is to generate feature descriptors through the relationship between pixels in the neighborhood of the feature points. The sampling model takes the feature point as the center, constructs concentric circles with different radii, and then takes a certain number of equally spaced sampling points in each concentric circle. Figure 4 As shown, Figure 4 The blue dots in the figure are sampling points. There are N sampling points (usually 60), including feature points. In order to avoid the grayscale aliasing effect of the sampling model affecting the sampling results, each sampling point needs to be Gaussian filtered. Figure 4 The red circle in the figure is a schematic diagram of Gaussian filtering. The radius of the red circle is proportional to the standard deviation of the Gaussian filter kernel. There are N*(N-1) / 2 sampling point pairs for N sampling points. Suppose a sampling point pair (P i , P j ) After Gaussian filtering, the gray values ​​are I(P i , σ i ) and I(P j , σ j ), σ is the scale, then the local gradient of the sampling point pair is:

[0097]

[0098] Suppose the set of all sampling point pairs is:

[0099] A={(P i , P j )∈R 2 *R 2 |i <N∧j<i∧i,j∈N};

[0100] According to the distance between the sampling point pairs, the A set is divided into two subsets, namely the long-distance point pair set L and the short-distance point pair set S:

[0101]

[0102]

[0103] Among them, the distance thresholds of the sampling points are set to δ max =9.75t,δ min =13.67t (t is the scale of the feature point).

[0104] Then the main direction of the feature point is:

[0105]

[0106] In order to solve the problems of rotation invariance and scale invariance, the feature points are first rotated by an angle α = arctan2(g x ,gy ), then compare the 512 sampling point pairs in the set S and generate a binary descriptor b,

[0107] in,

[0108] Among them, p i ∝ Indicates P i The sample points obtained after rotation by angle α.

[0109] It should be noted that the image stitching process also includes feature coarse matching and feature fine matching in image registration. Feature coarse matching is the feature points after feature detection and feature description. It is necessary to match the feature points in two adjacent images, that is, to establish a corresponding relationship between feature points reflecting the same physical position. First, the features are roughly matched to preliminarily obtain matching feature point pairs, in which the Hamming distance is used to measure the similarity between the binary feature descriptors obtained by the BRISK feature description algorithm, and the nearest neighbor and next nearest neighbor distance ratio algorithm is used to perform feature coarse matching.

[0110] Assume that the two feature descriptors obtained by the BRISK feature description algorithm are A=a1a2a3…a 512 ,B=a1a2a3…a 512 ,but

[0111]

[0112] in, Represents an XOR operation. The smaller the Hamming distance, the higher the similarity between the feature descriptors, and vice versa. Assume that for any feature point a in the image A to be stitched i Search for the nearest neighbor point b in the image B to be stitched. m and the next nearest neighbor b n , their distances are d m and d n , when the ratio of the nearest neighbor distances satisfies:

[0113]

[0114] It can be preliminarily considered that the feature point a i and b m They match each other. The value of T is usually between 0.4 and 0.6.

[0115] Feature precise matching uses the RANSAC algorithm to precisely match the matching point pairs obtained through feature rough matching, removes the mismatched point pairs, and establishes a transformation model between the images to be spliced. First, randomly select n pairs of matching point pairs obtained after feature rough matching to establish the transformation model, and then use the transformation model to calculate the distance between the two feature points in the remaining matching point pairs. If the distance is less than the set threshold, the matching point pairs are retained and the number of matching point pairs is increased by one, and the matching point pairs with a distance greater than the set threshold are removed. When the number of matching point pairs reaches a certain number, it means that the currently calculated transformation model is the final transformation model established, otherwise the matching point pairs are randomly selected again and the transformation model is iteratively calculated. When the number of iterations exceeds the set threshold and a suitable transformation model is still not obtained, it means that the feature precise matching has failed.

[0116] Image interpolation, after obtaining the transformation model between the images to be spliced, the images must be transformed to the same coordinates according to the transformation model. However, the coordinates of each point after the transformation are not all integer values, which may cause gaps between pixels. In order to solve this problem, it is necessary to obtain pixel values ​​of non-integer coordinates through image interpolation. It should be noted that bilinear interpolation is an interpolation method with high interpolation accuracy and fast calculation speed. Therefore, this application uses bilinear interpolation to interpolate images.

[0117] The basic principle of bilinear interpolation is to calculate the gray value of an interpolation point by using the pixel values ​​of the four nearest neighboring pixels. Figure 5 As shown, assume that the coordinates of the four nearest pixels A, B, C, and D of the interpolation point P (x, y) are (i, j), (i+1, j), (i, j+1), and (i+1, j+1), and the pixel values ​​are I A ,I B ,I C ,I D The pixel changes in the enclosed area are linear, so the pixel values ​​of points E and F can be calculated as:

[0118] I E =(xi)(I B -I A )+I A ;

[0119] I F =(xi)(I D -I C )+I C ;

[0120] Then the pixel value of the interpolation point value P is

[0121] I P =(yi)(IF -I E )+I E ;

[0122] It should be noted that image fusion refers to the process of mutually superimposing and fusing the overlapping regions between two or more images through a mathematical model, enabling the spliced image to have a smooth transition in the overlapping region, thereby generating a new image that more accurately and comprehensively describes the image information. This application uses an image weighted average algorithm for image fusion. The advantages of this algorithm are that it can reduce the redundant information provided by two or more images and improve the signal-to-noise ratio of the fused image, enhance the reliability of the fusion result, and it has a fast operation speed and is simple and easy to implement. Assuming that the two images to be fused are respectively f1=(x,y) and f2=(x,y), then the fused image f=(x,y) is:

[0123]

[0124] where k1 and k2 respectively represent the weight values of the two images to be fused in the overlapping region, and k1 + k2 = 1, 0 < k1, k2 < 1. Their values are related to the width of the overlapping region. When the value of k1 gradually changes from 0 to 1 and the value of k2 gradually changes from 1 to 0, a smooth transition between the images to be fused from f1=(x,y) to f2=(x,y) in the overlapping region can be achieved. Finally, the images are quickly and accurately spliced to obtain a complete photovoltaic panel image.

[0125] It should be noted that this application is based on an improved SURF - BRISK unmanned aerial vehicle (UAV) aerial photography image recognition splicing technology. This algorithm not only utilizes the advantage of the strong stability of the Harris corner detection algorithm but also retains the advantage of the scale invariance of the SURF feature detection algorithm, thereby improving the accuracy of feature detection in the image splicing process.

[0126] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0127] In this embodiment, a device for determining a feature point set is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0128] Figure 6 is a structural block diagram of a device for determining a feature point set according to an embodiment of the present invention, the device comprising:

[0129] An acquisition module 62, used for acquiring a first image to be subjected to feature detection;

[0130] A detection module 64 is configured to perform feature detection on the first image using a corner detection algorithm to obtain a set of corner points; and to perform feature detection on the first image using a spot detection algorithm to obtain a set of spots;

[0131] The merging module 66 is used to merge the corner point set and the spot set to obtain a first feature point set.

[0132] Through the above device, the image is detected using the corner detection algorithm and the spot detection algorithm at the same time, thereby taking into account the advantages of the corner detection algorithm and the spot detection algorithm, improving the accuracy of feature detection on the image, and thus solving the problem of poor accuracy of feature detection on the image and resulting poor image stitching effect in the process of image stitching, thereby improving the stitching effect of image stitching.

[0133] In an exemplary embodiment, the merging module 66 is also used to add feature points in the corner point set to the first feature point set, and to add feature points in the spot set to the first feature point set; in a case where there are first feature points and second feature points in the first feature point set, one of the first feature points and the second feature point is deleted from the first feature point set; wherein the first feature point is a feature point in the corner point set, the second feature point is a feature point in the spot set, and the distance between the first feature point and the second feature point is less than a first preset threshold.

[0134] In an exemplary embodiment, the merging module 66 is also used to delete any one of the first feature point and the second feature point from the first feature point set when the scale values ​​of the first feature point and the second feature point are both less than or equal to the second preset threshold or both greater than or equal to the second preset threshold; and to delete the feature point whose scale value is less than the second preset threshold among the first feature point and the second feature point from the first feature point set when the scale value of one feature point is less than the second preset threshold and the scale value of the other feature point is greater than the second preset threshold.

[0135] In an exemplary embodiment, the device also includes: a stitching module, used to merge the corner point set and the spot set to obtain a first feature point set, and then determine a second image and a second feature point set of the second image, wherein the second image is the image to be stitched with the first image; feature matching the feature points in the first feature point set and the second feature point set to obtain a feature point pair set; determining a transformation model based on the feature point pair set, wherein the transformation model is used to transform the coordinates of the pixel points in the first image from the first coordinate system to the second coordinate system, or to transform the coordinates of the pixel points in the second image from the second coordinate system to the first coordinate system; and use the transformation model to stitch the first image and the second image.

[0136] In an exemplary embodiment, the stitching module is also used to determine a feature point pair in the feature point pair set in the following manner to obtain the feature point pair set: determine in the second feature point set a first target feature point that is closest to the i-th feature point in the first feature point set and a second target feature point that is second closest to the i-th feature point; when the ratio of the first distance to the second distance is less than a third preset threshold, determine that the i-th feature point and the first target feature point constitute a feature point pair, wherein the first distance is the distance between the i-th feature point and the first target feature point, and the second distance is the distance between the i-th feature point and the second target feature point.

[0137] In an exemplary embodiment, the stitching module is further used to determine a first distance between the i-th feature point and the first target feature point by the following method: determine a first feature descriptor of the i-th feature point and a second feature descriptor of the first target feature point, wherein the feature descriptor is an n-bit binary number, the feature descriptor includes the first feature descriptor and the second feature descriptor, and n is a positive integer greater than or equal to 2; the first distance is calculated by the following formula: Wherein, D(A,B) is the first distance, A is the first feature descriptor, B is the second feature descriptor, and A=a1a2…a n , B=a1a2…a n , Represents the exclusive OR operation.

[0138] In an exemplary embodiment, the stitching module is further used to determine a first feature descriptor of the i-th feature point in the first image using a binary robust invariant scalable key point BRISK algorithm; and to determine a second feature descriptor of the first target feature point in the second image using the BRISK algorithm.

[0139] In an exemplary embodiment, the stitching module is also used to determine a first feature point pair set from the feature point pair set, and calculate a reference transformation model based on the first feature point pair set; use the reference change model to determine the number of feature point pairs in the second feature point pair set that meet the preset requirements, and when the number of feature point pairs that meet the preset requirements is greater than a fourth preset threshold, determine the transformation model as the reference transformation model; wherein the feature point pairs in the feature point pair set other than the first feature point pair set constitute the second feature point pair set, and the preset requirements include: when the feature point pair is (feature point X, feature point Y), the distance between feature point Z and feature point Y is less than a fifth preset threshold, and the feature point Z is the feature point obtained after the feature point Y is transformed using the reference transformation model.

[0140] In an exemplary embodiment, the stitching module is further used to transform the coordinates of the pixel points in the first image from the first coordinate system to the second coordinate system using the transformation model to obtain a first pixel point set after the coordinate transformation; determine the pixel value of each pixel point in the first pixel point set using a bilinear interpolation method to obtain the pixel value of each pixel point in the transformed first image; and stitch the first image and the second image using the following formula to determine the pixel value of each pixel point in the stitched image to obtain the stitched image:

[0141]

[0142] Among them, f1 is the first pixel point set, f2 is the second pixel point set of the second image, (x, y) is the coordinate of the pixel point, (x, y)∈the union of f1 and f2, f1(x, y) is the pixel value of the pixel point in the transformed first image, f2(x, y) is the pixel value of the pixel point in the second image, f(x, y) is the pixel value of the pixel point in the spliced ​​image, and k1 and k2 are weight coefficients.

[0143] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0144] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0145] S1, acquiring a first image to be subjected to feature detection;

[0146] S2, performing feature detection on the first image using a corner detection algorithm to obtain a set of corner points; and performing feature detection on the first image using a spot detection algorithm to obtain a set of spots;

[0147] S3: Merge the corner point set and the spot set to obtain a first feature point set.

[0148] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0149] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0150] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0151] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0152] S1, acquiring a first image to be subjected to feature detection;

[0153] S2, performing feature detection on the first image using a corner detection algorithm to obtain a set of corner points; and performing feature detection on the first image using a spot detection algorithm to obtain a set of spots;

[0154] S3: Merge the corner point set and the spot set to obtain a first feature point set.

[0155] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0156] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0157] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0158] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for determining a feature point set, characterized in that: include: Acquire a first image to be subjected to feature detection; Perform feature detection on the first image using a corner detection algorithm to obtain a corner point set; and performing feature detection on the first image using a spot detection algorithm to obtain a spot set; The corner point set and the spot set are combined to obtain a first feature point set.

2. The method according to claim 1, characterized in that The corner point set and the spot set are combined to obtain a first feature point set, including: Adding feature points in the corner point set to the first feature point set, and adding feature points in the spot set to the first feature point set; In the case that a first feature point and a second feature point exist in the first feature point set, one of the first feature point and the second feature point is deleted from the first feature point set; wherein the first feature point is a feature point in the corner point set, the second feature point is a feature point in the spot set, and the distance between the first feature point and the second feature point is less than a first preset threshold.

3. The method according to claim 2, characterized in that Deleting one of the first feature point and the second feature point from the first feature point set includes: When the scale values ​​of the first feature point and the second feature point are both less than or equal to a second preset threshold or both are greater than or equal to the second preset threshold, deleting any one of the first feature point and the second feature point from the first feature point set; When one of the first feature points and the second feature points has a scale value smaller than the second preset threshold and the other feature point has a scale value larger than the second preset threshold, the feature point whose scale value is smaller than the second preset threshold among the first feature points and the second feature points is deleted from the first feature point set.

4. The method according to claim 1, characterized in that: After merging the corner point set and the spot set to obtain a first feature point set, the method further includes: Determine a second image and a second feature point set of the second image, wherein the second image is an image to be stitched with the first image; Perform feature matching on the feature points in the first feature point set and the second feature point set to obtain a feature point pair set; Determine a transformation model according to the set of feature point pairs, wherein the transformation model is used to transform the coordinates of the pixel points in the first image from the first coordinate system to the second coordinate system, or to transform the coordinates of the pixel points in the second image from the second coordinate system to the first coordinate system; The first image and the second image are stitched using the transformation model.

5. The method according to claim 4, characterized in that Performing feature matching on the feature points in the first feature point set and the second feature point set to obtain a feature point pair set includes: Determine a feature point pair in the feature point pair set in the following manner to obtain the feature point pair set: Determine, in the second feature point set, a first target feature point that is closest to an i-th feature point in the first feature point set and a second target feature point that is second closest to the i-th feature point; When the ratio of the first distance to the second distance is less than a third preset threshold, it is determined that the i-th feature point and the first target feature point constitute a feature point pair, wherein the first distance is the distance between the i-th feature point and the first target feature point, and the second distance is the distance between the i-th feature point and the second target feature point.

6. The method according to claim 5, characterized in that The method further comprises: The first distance between the i-th feature point and the first target feature point is determined by the following method: Determine a first feature descriptor of the i-th feature point and a second feature descriptor of the first target feature point, wherein the feature descriptor is an n-bit binary number, the feature descriptor includes the first feature descriptor and the second feature descriptor, and n is a positive integer greater than or equal to 2; The first distance is calculated by the following formula: Wherein, D(A,B) is the first distance, A is the first feature descriptor, B is the second feature descriptor, and A=a1a2...a n , B=a1a2...a n , Represents the exclusive OR operation.

7. The method according to claim 6, characterized in that Determining a first feature descriptor of the i-th feature point and a second feature descriptor of the first target feature point includes: Determine a first feature descriptor of the i-th feature point in the first image using a binary robust invariant scalable key point (BRISK) algorithm; and The second feature descriptor of the first target feature point is determined in the second image using the BRISK algorithm.

8. The method according to claim 4, characterized in that Determining a transformation model according to the feature point pair set includes: Determine a first feature point pair set from the feature point pair sets, and calculate a reference transformation model based on the first feature point pair set; Determine the number of feature point pairs that meet preset requirements in the second feature point pair set using the reference change model, and determine the transformation model as the reference transformation model when the number of feature point pairs that meet the preset requirements is greater than a fourth preset threshold; Among them, the feature point pairs in the feature point pair set other than the first feature point pair set constitute the second feature point pair set, and the preset requirements include: when the feature point pair is (feature point X, feature point Y), the distance between feature point Z and feature point Y is less than the fifth preset threshold, and the feature point Z is the feature point obtained after the feature point Y is transformed using the reference transformation model.

9. The method according to claim 4, characterized in that Using the transformation model to perform image stitching on the first image and the second image includes: Using the transformation model, transform the coordinates of the pixel points in the first image from the first coordinate system to the second coordinate system to obtain a first pixel point set after the coordinate transformation; Determine the pixel value of each pixel in the first pixel set using a bilinear interpolation method to obtain the pixel value of each pixel in the transformed first image; The first image and the second image are stitched together using the following formula to determine the pixel value of each pixel in the stitched image to obtain the stitched image: Wherein, f1 is the first pixel point set, f2 is the second pixel point set of the second image, (x, y) is the coordinate of the pixel point, (x, y)∈the union of f1 and f2, f1(x, y) is the pixel value of the pixel point in the transformed first image, f2(x, y) is the pixel value of the pixel point in the second image, f(x, y) is the pixel value of the pixel point in the spliced ​​image, and k1 and k2 are weight coefficients.

10. A device for determining a feature point set, characterized in that: include: An acquisition module, used for acquiring a first image to be subjected to feature detection; A detection module, configured to perform feature detection on the first image using a corner point detection algorithm to obtain a corner point set; And using a spot detection algorithm to perform feature detection on the first image to obtain a spot set; a merging module is used to merge the corner point set and the spot set to obtain a first feature point set.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 9 when executed.

12. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 9 through the computer program.

Citation Information

Cited By

  • Remote sensing image feature point extraction method and device, electronic equipment and storage medium

    CN120070925A