Image processing method, device and computer equipment
By constructing affine transformation space and multi-dimensional descriptor matching in image processing, the problem of inefficiency of the ASIFT algorithm is solved and high-precision and efficient feature point matching is achieved.
Patent Information
- Application Number
- CN202210107648.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-01-28
AI Technical Summary
The existing ASIFT algorithm has high time complexity when matching feature points, resulting in low efficiency and difficulty in meeting the high-precision and efficient matching requirements in large-angle sequence images.
By simulating the perspective changes of the target image, an affine transformation space is constructed, feature point detection and description are performed, and target feature points and binary feature descriptors with affine invariance are obtained, and are sampled and integrated under multiple feature point description dimensions. Generate rich binary descriptors for matching.
It improves the accuracy and efficiency of feature point matching and reduces the time complexity. Especially in the application of large-angle sequence images, it significantly improves the matching speed and accuracy.
Smart Images

Figure CN114494746B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, specifically to the field of image processing technology, and in particular to an image processing method, apparatus and computer equipment. Background Art
[0002] Image matching refers to the process of establishing a correspondence between two images by finding content or structures with the same or similar feature points in the two images; that is, image matching can essentially be understood as feature point matching between two images. At present, for an image that needs to be matched with feature points, the ASIFT (Affine-SIFT) algorithm is usually used to obtain the feature points and corresponding feature descriptors in the image, and then the feature points of the image are matched based on the acquired feature descriptors. Specifically, the ASIFT algorithm mainly detects the feature points and corresponding feature descriptors of the image based on the assumption that the object can be approximated as a plane locally and the perspective effect can be ignored. Although the ASIFT algorithm can solve the problem of feature point matching, its time complexity is high, which leads to low efficiency of feature point matching. Summary of the invention
[0003] The embodiments of the present application provide an image processing method, apparatus, and computer device, which can reduce time complexity and improve matching efficiency while ensuring the accuracy of feature point matching.
[0004] On the one hand, an embodiment of the present application provides an image processing method, the method comprising:
[0005] Acquire a reference image from an affine transformation space of a target image, wherein the affine transformation space includes: one or more images obtained by simulating a change in viewing angle of the target image, wherein the reference image is one of the images in the affine transformation space;
[0006] Performing feature point detection on the reference image to obtain reference feature points; and performing pixel sampling in the neighborhood of the reference feature points to obtain N pixel pairs of the reference feature points, where N is a positive integer;
[0007] In one or more feature point description dimensions, the reference feature point is described according to the attribute information of each pixel point pair of the reference feature point to obtain H binary descriptors of the reference feature point, where H is a positive integer;
[0008] Integrate the H binary descriptors of the reference feature point to obtain a binary feature descriptor of the reference feature point;
[0009] The reference feature points are mapped to the target image by performing an inverse perspective transformation on the reference feature points to obtain target feature points of the target image; and the binary feature descriptors of the reference feature points are used as the binary feature descriptors of the target feature points to perform feature point matching on the target image based on the binary feature descriptors.
[0010] On the other hand, an embodiment of the present application provides an image processing device, the device comprising:
[0011] An acquisition unit, configured to acquire a reference image from an affine transformation space of a target image, wherein the affine transformation space includes: one or more images obtained by simulating a change in viewing angle of the target image, wherein the reference image is one of the images in the affine transformation space;
[0012] A processing unit, configured to perform feature point detection on the reference image to obtain reference feature points; and perform pixel sampling in the neighborhood of the reference feature points to obtain N pixel pairs of the reference feature points, where N is a positive integer;
[0013] The processing unit is further configured to describe the reference feature point according to the attribute information of each pixel point pair of the reference feature point under one or more feature point description dimensions to obtain H binary descriptors of the reference feature point, where H is a positive integer;
[0014] The processing unit is further used to integrate the H binary descriptors of the reference feature point to obtain a binary feature descriptor of the reference feature point;
[0015] The processing unit is also used to map the reference feature points to the target image by performing inverse perspective transformation on the reference feature points to obtain target feature points of the target image; and use the binary feature descriptors of the reference feature points as the binary feature descriptors of the target feature points to perform feature point matching on the target image based on the binary feature descriptors.
[0016] In another aspect, an embodiment of the present application provides a computer device, the computer device comprising an input interface and an output interface, the computer device further comprising:
[0017] a processor adapted to implement one or more instructions; and,
[0018] A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the following steps:
[0019] Acquire a reference image from an affine transformation space of a target image, wherein the affine transformation space includes: one or more images obtained by simulating a change in viewing angle of the target image, wherein the reference image is one of the images in the affine transformation space;
[0020] Performing feature point detection on the reference image to obtain reference feature points; and performing pixel sampling in the neighborhood of the reference feature points to obtain N pixel pairs of the reference feature points, where N is a positive integer;
[0021] In one or more feature point description dimensions, the reference feature point is described according to the attribute information of each pixel point pair of the reference feature point to obtain H binary descriptors of the reference feature point, where H is a positive integer;
[0022] Integrate the H binary descriptors of the reference feature point to obtain a binary feature descriptor of the reference feature point;
[0023] The reference feature points are mapped to the target image by performing an inverse perspective transformation on the reference feature points to obtain target feature points of the target image; and the binary feature descriptors of the reference feature points are used as the binary feature descriptors of the target feature points to perform feature point matching on the target image based on the binary feature descriptors.
[0024] On the other hand, an embodiment of the present application provides a computer storage medium, which stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the above-mentioned image processing method.
[0025] On the other hand, an embodiment of the present application provides a computer program product, which includes a computer program; when the computer program is executed by a processor, the above-mentioned image processing method is implemented.
[0026] The embodiment of the present application constructs the affine transformation space of the target image by simulating the change of the viewing angle of the target image, and by performing feature point detection and feature point description in the affine transformation space of the target image, the target feature points of the target image finally obtained and the corresponding binary feature descriptors can have affine invariance, so that the feature point matching can be performed more accurately based on the binary feature descriptors in the future. In addition, the binary feature descriptors of the target feature points and the binary feature descriptors of the reference feature points are the same, and the embodiment of the present application obtains H binary descriptors by describing the reference feature points according to the attribute information of each pixel point pair sampled in the neighborhood of the reference feature point under one or more feature point description dimensions, so that each binary descriptor has description information of different dimensions, then by integrating these H binary descriptors to obtain the binary feature descriptors, the description information of the binary feature descriptors can be effectively enriched, so that the information simplification of the binary feature descriptors can be avoided, thereby further improving the accuracy of feature point matching based on the binary feature descriptors. Furthermore, since the binary feature descriptor is binary, matching feature points using the binary feature descriptor can effectively reduce time complexity and improve matching efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0028] Figure 1a is a schematic diagram of an affine transformation space provided in an embodiment of the present application;
[0029] Figure 1b is a schematic diagram of a feature point matching result provided in an embodiment of the present application;
[0030] Figure 1c is a schematic diagram of a large viewing angle sequence image provided by an embodiment of the present application;
[0031] Figure 1d It is a schematic diagram of a terminal and a server jointly executing a feature point matching solution provided in an embodiment of the present application;
[0032] Figure 2 It is a flowchart of an image processing method provided in an embodiment of the present application;
[0033] Figure 3a is a schematic diagram of a sampling result provided in an embodiment of the present application;
[0034] Figure 3bis a schematic diagram of a partial image in an affine transformation space of a target image provided by an embodiment of the present application;
[0035] Figure 4 is a flowchart of an image processing method provided by another embodiment of the present application;
[0036] Figure 5a is a schematic diagram of constructing a mask image provided by an embodiment of the present application;
[0037] Figure 5b is a schematic diagram of determining a valid image area provided by an embodiment of the present application;
[0038] Figure 5c is a schematic diagram of processing each image in an affine transformation space provided by an embodiment of the present application;
[0039] Figure 6a is a schematic diagram of a test result provided in an embodiment of the present application;
[0040] Figure 6b is a schematic diagram of another test result provided in an embodiment of the present application;
[0041] Figure 6c is a schematic diagram of another test result provided in an embodiment of the present application;
[0042] Figure 7 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;
[0043] Figure 8 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0045] The embodiment of the present application is based on artificial intelligence (AI) technology, and proposes a feature point matching solution based on affine transformation space to ensure the accuracy of feature point matching while reducing time accuracy and time complexity, thereby improving the matching efficiency of feature points. Among them, AI technology refers to the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science; it mainly produces a new intelligent machine that can respond in a similar way to human intelligence by understanding the essence of intelligence, so that the intelligent machine has multiple functions such as perception, reasoning and decision-making. Correspondingly, AI technology is a comprehensive discipline, which mainly includes several major directions such as computer vision technology (Computer Vision, CV), speech processing technology, natural language processing technology and machine learning (Machine Learning, ML) / deep learning.
[0046] Among them, computer vision technology is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further perform graphic processing to make computer processing into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D (three-dimensional) technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0047] The feature point matching scheme based on the affine transformation space proposed in the embodiment of the present application mainly relates to the computer vision technology mentioned above; wherein, the affine transformation space can be understood as: for any image, by simulating the possible perspective changes of multiple images, a group of images representing different degrees of perspective changes are obtained. The feature point matching scheme can be applied to a variety of machine vision systems (or computer vision systems) such as three-dimensional reconstruction systems, photogrammetry systems, panoramic image stitching systems, image recognition systems, and moving target processing systems. For example, in a three-dimensional reconstruction system, the feature point matching scheme can be used to achieve high-precision matching of feature points between images when the number of image frames is small or there is a large perspective difference between adjacent images, thereby achieving three-dimensional reconstruction based on the feature point matching results, which can effectively overcome the problems of low reconstruction accuracy and slow speed caused by the small number of image frames or large perspective changes. For another example, in a moving target processing system, the feature point matching scheme can be used to achieve high-precision feature point matching between the two frames of images before and after the moving target, thereby determining the position of the moving target in the next frame of the image based on the feature point matching results, thereby obtaining information such as the motion trajectory of the moving target.
[0048] In a specific implementation, the principle of the feature point matching solution based on affine transformation space is as follows: for images A and B to be matched with feature points, the perspective changes of images A and B can be simulated respectively to obtain the affine transformation space of image A and the affine transformation space of image B. Figure 1a As shown, Figure 1a A square in the image represents an image after a change in viewing angle, a series of squares marked with A on the left constitute the affine transformation space of image A, and a series of squares marked with B on the right constitute the affine transformation space of image B; wherein, image A and image B after the same change in viewing angle correspond to each other through an arrow. Then, by performing a series of feature point detection and feature point description processing in the affine transformation space of image A and the affine transformation space of image B, each feature point A of image A and the corresponding binary feature descriptor, and each feature point B of image B and the corresponding binary feature descriptor can be obtained, so that based on the similarity between the binary feature descriptors of each feature point A and the binary feature descriptors of each feature point B, feature point matching processing is performed on images A and B to obtain the feature point matching results between images A and B. Exemplarily, black dots are used to represent feature points A of image A, and white dots are used to represent feature points B of image B, then the feature point matching results can be intuitively expressed using Figure 1b To express.
[0049] Among them, the method of obtaining each feature point A of image A and the corresponding binary feature descriptor by performing a series of feature point detection and feature point description processing in the affine transformation space of image A can be: first, feature point detection is performed on all or part of the image in the affine transformation space of image A to obtain one or more feature points a, and each feature point a is described under one or more feature point description dimensions to obtain one or more binary descriptors of each feature point a, thereby integrating each binary descriptor of each feature point a to obtain the binary feature descriptor of each feature point a; then, each feature point a is mapped to image A to obtain each feature point A of image A, one feature point a corresponds to one feature point A, and the binary feature descriptor of any feature point A is the same as the binary feature descriptor of the corresponding feature point a. Similarly, the method of obtaining each feature point B and the corresponding binary feature descriptor by performing a series of feature point detection and feature point description in the affine transformation space of image B is similar to the method of obtaining each feature point A and the corresponding binary feature descriptor mentioned here, and will not be repeated here.
[0050] It should be noted that the above-mentioned image A and image B can be two images in an ordinary scene or two images in a wide-angle sequence image. Among them, an ordinary scene refers to a scene where an ordinary image is collected. An ordinary image can be understood as an image containing multiple frames of images arranged in sequence, and the difference in the viewing angle between two adjacent frames of images is less than or equal to the target threshold. On the contrary, a wide-angle sequence image refers to an image that meets the following conditions: it contains multiple frames of images arranged in sequence, and the difference in the viewing angle between two adjacent frames of images is greater than the target threshold; for example, see Figure 1c As shown in the figure, since the perspective differences between adjacent images in Image 1 are relatively large, Image 1 belongs to a large perspective sequence image. In a large perspective sequence image with large perspective changes, the accuracy and speed of matching continuous feature points between adjacent image frames have high requirements.
[0051] In a specific implementation, the feature point matching scheme mentioned above can be executed by a computer device, which can be a terminal or a server. The terminals mentioned here can include but are not limited to: smart phones, computers (such as tablet computers, laptops, desktop computers, etc.), smart wearable devices (such as smart watches, smart glasses), smart voice interaction devices, smart home appliances (such as smart TVs), vehicle terminals or aircraft, etc. The server mentioned here can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and big data and artificial intelligence platforms and other basic cloud computing services, etc. Further, the computer device can be located inside or outside the blockchain network, without limitation. Furthermore, the computer device can also upload any data stored inside to the blockchain network for storage to prevent the data stored inside from being tampered with and improve data security.
[0052] Alternatively, the feature point matching scheme mentioned above can also be performed by the terminal and the server together. Figure 1d As shown, the terminal may send image A and image B to the server, and the server constructs the affine transformation space of image A and the affine transformation space of image B, and is responsible for performing a series of feature point detection and feature point description processing in each affine transformation space, thereby obtaining each feature point A of image A and the corresponding binary feature descriptor, and each feature point B of image B and the corresponding binary feature descriptor, and the steps of sending them to the terminal, and the terminal performs feature point matching processing based on the binary feature descriptors of each feature point A and the binary feature descriptors of each feature point B. For another example, the terminal may be responsible for constructing the affine transformation space of image A and the affine transformation space of image B, and then send the two constructed affine transformation spaces to the server, so that the server performs a series of feature point detection and feature point description processing based on the two affine transformation spaces, thereby returning each feature point A of image A and the corresponding binary feature descriptor, and each feature point B of image B and the corresponding binary feature descriptor to the terminal, and the terminal performs subsequent feature point matching processing. It should be understood that two specific implementations of how the terminal and the server jointly perform the feature point matching solution are merely listed here by way of example, and are not exhaustive.
[0053] Practice has shown that the feature point matching scheme proposed in the embodiment of the present application has the following beneficial effects: by simulating the change of the viewing angle of the image to construct the affine transformation space of the image, and by performing feature point detection and feature point description in the affine transformation space of the image, the feature points of the image finally obtained and the corresponding binary feature descriptors can have affine invariance, which can effectively improve the accuracy of feature point matching. Among them, affine invariance means that for any image in the two images, the property of the image with the same viewing angle as the any image can always be found in the affine transformation space of the other image; for the image with affine invariance, its corresponding feature points and corresponding binary feature descriptors also have affine invariance. In addition, by describing the feature points under multiple feature point description dimensions, the binary feature descriptors finally obtained can have rich description information, which can avoid the simplification of the information of the binary feature descriptors, thereby further improving the accuracy of feature point matching based on the binary feature descriptors. In addition, since the binary feature descriptors are binary, the feature point matching through the binary feature descriptors can effectively reduce the time complexity and improve the matching efficiency. In particular, it can solve the problem of low time efficiency in matching feature points between images in a large viewing angle sequence image, and ensure matching accuracy.
[0054] Based on the description of the feature point matching scheme based on the affine transformation space, the present application embodiment proposes an image processing method. The image processing method can be executed by the computer device (terminal or server) mentioned above, or by the terminal and the server together. For the sake of convenience, the present application embodiment takes the computer device executing the image processing method as an example. Please refer to Figure 2 , the image processing method may include the following steps S201-S206:
[0055] S201, obtaining a reference image from the affine transformation space of the target image.
[0056] The target image is an image acquired by a camera, and the shooting angle of view adopted by the camera for the target image can be called the original angle of view of the target image. For example, the target image can be any image acquired in an ordinary scene that needs to be detected for feature points; for another example, the target image can be any frame image in a large-angle sequence image acquired by a camera, or any image in two frames of images in a large-angle sequence image that need to be matched for feature points, without limitation.
[0057] The affine transformation space of the target image may include: one or more images obtained by simulating the change of the viewing angle of the target image, and the reference image is one of the images in the affine transformation space. In the embodiment of the present application, the camera can be regarded as an origin in a spherical coordinate system based on three-dimensional space, so a viewing angle of the target image can be represented by a longitude angle involved in the spherical coordinate system. It should be understood that since the subsequent changes in the viewing angle of the target image are all relative to the original viewing angle of the target image, the original viewing angle of the target image can be regarded as 0, that is, θ=0 to describe the original viewing angle of the target image. Then, the longitude and latitude angles obtained by a series of sampling of longitude and latitude can represent the different degrees of viewing angle changes of the target image. In the specific implementation, the tilt factor t can be used to sample the longitude and latitude angles. The specific steps are as follows:
[0058] (1) Determine the tilt factor t and the longitude angle The sampling relationship between the tilt factor and the latitude angle θ: The sampling relationship between the tilt factor and the longitude angle is as follows: φ=kb / t; where k represents the number of sampling times for the longitude angle, and b represents the sampling interval for the longitude angle; the sampling relationship between the tilt factor and the latitude angle is as follows: θ=arccos(1 / t).
[0059] (2) Determine the tilt factor t and longitude angle The sampling range of latitude angle θ is: The sampling range is [0, π), π = 180°, that is, φ < 180°; the tilt factor t has a sampling upper limit t max , the max The value of can be set by experience, for example, experimentally proved At this time, the corresponding upper limit of the latitude angle θmax = arccos (1 / t max )≈80°.
[0060] (3) Determine the tilt factor t and longitude angle Sampling interval: The sampling interval b of the longitude angle can be related to the sampling size of the tilt factor t, such as b = Δφ = 72° / t; the tilt factor t is sampled regularly according to the geometric series, that is, t = 1, a, a 2 , …a s , a>1, and the value of a can be set according to experience, for example s is a positive integer, and the value of n can be set according to experience; if practice shows that when s is 5, a better matching result can be obtained, then s can be set to 5.
[0061] After determining the sampling relationship, sampling range and sampling interval based on the above description, the target image can be sampled in both longitude and latitude by using the tilt factor t, and then a series of tilted images at different viewing angles can be obtained by performing an affine transformation on the target image based on each sampling result. This series of tilted images at different viewing angles can constitute the affine transformation space of the target image. It can be seen that the affine transformation space of the target image can be obtained by simulating all possible θ and To achieve the affine invariance of the target image. For example, the sampling results can be found in Figure 3a As shown; among them, Figure 3a Any black dot on the left and right sides of the figure can represent the position of the image after the input image is changed in perspective, and the position can be determined by specific θ and Correspondingly, the image of the target image after the viewpoint change in the affine transformation space can be seen in Figure 3b shown.
[0062] S202, performing feature point detection on the reference image to obtain reference feature points.
[0063] In a specific implementation, the computer device can directly use a feature point detector (or feature point detection algorithm) to perform feature point detection on a reference image to obtain reference feature points. The feature point detectors mentioned here may include but are not limited to any of the following: FAST (Features from accelerated segment test) detectors, improved FAST detectors, SIFT (Features from accelerated segment test, used to find extreme points in the spatial scale and extract feature points with position, scale and rotation invariant features) detectors, SURF (Speeded-Up Robust Features) detectors, etc. For ease of explanation, the feature point detection algorithms mentioned later are all described using the improved FAST detector as an example.
[0064] In another specific implementation, research has shown that when an affine transformation is performed on any image, the affine transformation algorithm may transform the image into a parallelogram or other shapes. At this time, the image after the perspective change generated by the affine transformation algorithm is the image corresponding to the minimum circumscribed rectangle of the parallelogram or other shapes. Such an image will contain a large number of invalid filling areas that are not original image information; for example, the aforementioned Figure 3bAs shown in the figure, most images obtained by affine transformation of the target image contain a large number of invalid filling areas that are not original image information. And the study further shows that: when the original image (such as the target image) is square, the area of the invalid filling area in the image after the perspective change (i.e., affine transformation) of the original image can reach 38.898% of the total area; while for a general rectangular image, the area ratio of the invalid filling area in the image after the perspective change is often more than 40%. If in the feature point detection stage, the feature point detector does not distinguish between the target image area where the original image information is located and the invalid filling area, but performs feature point detection by traversing all pixels according to the criterion, it will result in a lot of time spent in the invalid filling area, which will affect the efficiency of feature point detection, thereby affecting the efficiency of subsequent feature point matching, and a certain number of feature points may be detected on the boundary between the target image area and the invalid filling area. These feature points are usually unstable, which will affect the accuracy of subsequent feature point description and feature point matching.
[0065] Based on this, in order to avoid the detection calculation of the detector in the invalid filling area; when the computer device executes step S202, it can first perform image recognition on the reference image to identify the valid image area in the reference image, and the so-called valid image area refers to the image area containing all or part of the image content of the target image. Then, the computer device can use the feature point detector to perform feature point detection on the valid image area in the reference image to obtain reference feature points. Through this detection method, it is possible to effectively avoid the feature point detector performing feature point detection in the whole image, thereby effectively improving the efficiency of feature point detection and effectively saving processing resources; further, when the valid image area refers to the image area containing part of the image content of the target image, it can be understood that the valid image area is a sub-area located in the target image area, that is, the valid image area does not contain the boundary of the target image area, then the feature point detection is performed in the valid image area, which can avoid detecting the reference feature points on the boundary of the target image area and the invalid filling area, so that the stability of the reference feature points can be guaranteed, thereby effectively improving the accuracy of subsequent feature point description and feature point matching.
[0066] In another specific implementation, considering that the feature points obtained by using feature point descriptors such as the improved FAST descriptor usually do not have scale information and direction information, this will limit the usage scenarios of the feature points and affect the accuracy of subsequent feature point matching; therefore, the embodiment of the present application can add scale and direction characteristics to the feature points (such as FAST corner points) to achieve scale invariance and rotation invariance (or direction invariance) of the feature points, thereby enriching the usage scenarios of the feature points and improving the accuracy of subsequent feature point matching.
[0067] To achieve scale invariance, when executing step S202, the computer device may first construct a Gaussian pyramid of the reference image. The so-called Gaussian pyramid can be understood as a multi-scale space composed of a series of images of different scales and different resolutions, wherein images of different scales can be obtained by convolving Gaussian functions of different variances with the original image; specifically, the Gaussian pyramid can be divided into multiple groups of images, each group of images is obtained by downsampling the previous group of images, and each group of images contains multiple layers of images, and different layers of images are generated under Gaussian kernel blurring and smoothing of different sizes. Then, a feature point detector is used to detect feature points of each image in the Gaussian pyramid to obtain reference feature points. The embodiment of the present application constructs a Gaussian pyramid of the reference image and uses a feature point detector to detect feature points in a multi-scale space, so that the feature point detector is not constrained by the image scale of the reference image, thereby achieving scale invariance.
[0068] In order to achieve rotation invariance, it is necessary to make the feature points have directional characteristics; based on this, after detecting the reference feature points, the computer device can also calculate the main direction of the reference feature points so that the reference feature points have directional characteristics, so that when the pixel points are sampled and the descriptor is constructed later, the neighborhood of the reference feature points can be rotated to the main direction first, thereby obtaining rotation invariance. Among them, the main direction of the reference feature point can be understood as: the direction of the intensity center in the neighborhood (or sampling area) of the reference feature point relative to the reference feature point; the so-called neighborhood refers to the image area with a size of j×j centered on the reference feature point, and the value of j can be set according to the empirical value, for example, j is equal to 31, then the neighborhood of the reference feature point can refer to the image area with a size of 31×31 centered on the reference feature point. Specifically, for the reference feature point, any local moment (referred to as moment) in its neighborhood can be defined as follows:
[0069]
[0070] Among them, I(x, y) represents the gray value of any pixel point (x, y) in the neighborhood, and the sum of the values of p and q represents m pq For example, if p = 0 and q = 0, then m pq is the zero-order moment (m 00 ), which is related to the area of an image or a contour; if p = 1 and q = 0, or p = 0 and q = 1, it means that m pq is the first-order moment (m 10 , m 01 ), which is related to the centroid of an image or a contour; if p = 0 and q = 2, or p = 1 and q = 1, or p = 2 and q = 0, then m pq is the second-order moment (m 02 , m 11 , m 20), which is related to the rotation radius of an image or a contour; if p = 0 and q = 3, or p = 1 and q = 2, or p = 2 and q = 1, or p = 3 and q = 0, then m pq is the third-order moment (m 03 , m 12 , m 21 , m 30 ), which is related to the slope or distortion of an image or a contour.
[0071] The position C of the intensity center in the neighborhood can be obtained from the local distance information. Combining the position C with the inverse tangent function (atan2) of the fourth quadrant can obtain the main direction T of the reference feature point. Specifically, the position C and the main direction T can be expressed as follows:
[0072]
[0073]
[0074] It should be noted that the above-mentioned method of detecting feature points based on the effective image area and the method of detecting feature points based on the Gaussian pyramid can be used separately or in combination. When used in combination, the feature point detector can obtain reference feature points with scale, direction and score response in the effective image area of the affine transformation space. Specifically, the computer device can first identify the effective image area in the reference image, and then construct a Gaussian pyramid (i.e., a multi-scale space) based on the effective image area, and then perform feature point detection on each image in the constructed Gaussian pyramid to obtain reference feature points. It should also be noted that the number of reference feature points obtained by step S202 is M, where M is a positive integer; for each reference feature point, subsequent steps S203-S205 can be executed.
[0075] S203, sampling pixels in the neighborhood of the reference feature point to obtain N pixel pairs of the reference feature point; N is a positive integer, and the value of N is set according to an empirical value, for example, N=256.
[0076] In one embodiment, a computer device may randomly sample pixels in the neighborhood of a reference feature point to obtain N pixel pairs of the reference feature point; the pixel pairs herein may also be referred to as sampling pairs, and one pixel pair may include two pixels. In another embodiment, in order to improve the distinguishability of subsequent feature descriptors and reduce the correlation between feature descriptors, the embodiment of the present application may also use a statistical learning method to sample pixels in the neighborhood of a reference feature point, thereby obtaining N pixel pairs of the reference feature point. Specifically, assuming that there are G combinations of pixel pairs in the neighborhood of a reference feature point (G is a positive integer, and the value of G is greater than N), then it is necessary to determine 256 pixel pairs from the G combinations, and ensure that the correlation between each pixel pair is minimized; wherein, the determination method of the 256 pixel pairs is as follows:
[0077] 1) Obtain G pixel pairs in the neighborhood of F (such as 300,000) feature points, respectively. The F feature points include reference feature points and other feature points obtained based on statistical analysis. Also, construct a binary matrix Q of size F×G, which includes F row vectors and G column vectors. A row vector is composed of G pixel pairs corresponding to a feature point, and a column vector is composed of a pixel pair corresponding to each of the F feature points; wherein a pixel pair is used to determine a vector element. 2) Sort the column vectors of the Q matrix according to the distance from the average value of each column in the matrix Q to the benchmark value (such as 0.5). 3) Put the first column vector of the matrix Q into the matrix R. 4) Calculate the correlation between the next column vector of Q and all column vectors in R in sequence. If the calculated correlation is less than a given threshold, put the corresponding column vector in Q into R. 5) Iterate step 4) until the matrix R contains 256 column vectors. At this time, the 256 pixel pairs corresponding to the reference feature points involved in each column vector in the matrix R can be used as the N pixel pairs finally sampled. The correlation between the N pixel pairs obtained in this way is low and the variance is large, which can effectively improve the distinguishability of subsequent feature descriptors and reduce the correlation between feature descriptors.
[0078] S204 , describing the reference feature point according to the attribute information of each pixel point pair of the reference feature point under one or more feature point description dimensions, to obtain H binary descriptors of the reference feature point.
[0079] Among them, H is a positive integer, and one binary descriptor corresponds to one feature point description dimension; that is, under one feature point description dimension, the reference feature point is described according to the attribute information of each pixel point pair of the reference feature point, and a binary descriptor of the reference feature point can be obtained, then the value of H can specifically depend on the number of feature point description dimensions. It should be understood that the number of feature point description dimensions mentioned in the embodiment of the present application can be specifically set according to business needs, and there is no limitation on this.
[0080] In one embodiment, when describing feature points, a computer device may describe reference feature points from the perspective of grayscale contrast between each pixel in a pixel pair; then, one or more feature point description dimensions may include a first feature point description dimension, which refers to: a dimension for describing the reference feature point based on the grayscale contrast between each pixel in the pixel pair.
[0081] In another embodiment, when describing feature points, the computer device may describe the reference feature points from the perspective of the grayscale contrast between the reference feature points and the pixel points in the pixel point pair; then, one or more feature point description dimensions may include a second feature point description dimension, and the second feature point description dimension refers to: the dimension for describing the reference feature points based on the grayscale contrast between the reference feature points and the pixel points in the pixel point pair.
[0082] In another embodiment, although the images under various viewing angles are simulated by constructing an affine transformation space, the sampling interval is fixed and the sampling range is large when constructing the affine transformation space, which may cause the transformed images (images after the viewing angle change) under similar viewing angles between the images to be matched to still have certain viewing angle differences. Due to the influence of viewing angle differences and illumination changes, the grayscale values of the same local area in the images to be matched will change to a certain extent. Therefore, in order to further reduce the sensitivity of the feature descriptors obtained subsequently to illumination and viewing angle changes, the embodiment of the present application will introduce gradient information into the binary feature descriptor. The gradient information can measure the relative change of grayscale in the neighborhood of the feature point, and has a good description of the object contour and edge. Based on this, when describing the feature points, the computer device can describe the reference feature points from the perspective of the gradient comparison between the pixels in the pixel point pair; then, one or more feature point description dimensions may include a third feature point description dimension, which refers to: a dimension for describing the reference feature point based on the gradient comparison between the pixels in the pixel point pair.
[0083] S205 , integrating H binary descriptors of the reference feature point to obtain a binary feature descriptor of the reference feature point.
[0084] In a specific implementation, when the value of H is equal to 1, the computer device may directly use the binary descriptor of the reference feature point as the binary feature descriptor of the reference feature point when executing step S205. When the value of H is greater than 1, the computer device may sum or aggregate the H binary descriptors of the reference feature point when executing step S205 to obtain the binary feature descriptor of the reference feature point, which is essentially a binary feature descriptor.
[0085] S206, mapping the reference feature points to the target image by performing an inverse perspective transformation on the reference feature points to obtain target feature points of the target image; using the binary feature descriptors of the reference feature points as the binary feature descriptors of the target feature points to perform feature point matching on the target image based on the binary feature descriptors.
[0086] In a specific implementation, considering that the detection step and the description step (i.e., steps S202-S205) of the reference feature points are both performed in the affine transformation space of the target image, after obtaining the binary feature descriptor of the reference feature points, the reference feature points can also be subjected to an inverse perspective transformation to remap them to the target image under the original single perspective, thereby obtaining the target feature points based on the affine transformation space and their corresponding binary descriptors. It should be noted that the inverse perspective transformation mentioned here can be understood as the inverse process of the aforementioned affine transformation for the target image, and the embodiments of the present application do not limit the specific methods of the affine transformation and the inverse perspective transformation.
[0087] The embodiment of the present application constructs the affine transformation space of the target image by simulating the change of the viewing angle of the target image, and by performing feature point detection and feature point description in the affine transformation space of the target image, the target feature points of the target image finally obtained and the corresponding binary feature descriptors can have affine invariance, so that the feature point matching can be performed more accurately based on the binary feature descriptors in the future. In addition, the binary feature descriptors of the target feature points and the binary feature descriptors of the reference feature points are the same, and the embodiment of the present application obtains H binary descriptors by describing the reference feature points according to the attribute information of each pixel point pair sampled in the neighborhood of the reference feature point under one or more feature point description dimensions, so that each binary descriptor has description information of different dimensions, then by integrating these H binary descriptors to obtain the binary feature descriptors, the description information of the binary feature descriptors can be effectively enriched, so that the information simplification of the binary feature descriptors can be avoided, thereby further improving the accuracy of feature point matching based on the binary feature descriptors. Furthermore, since the binary feature descriptor is binary, matching feature points using the binary feature descriptor can effectively reduce time complexity and improve matching efficiency.
[0088] Based on the above Figure 2 The method embodiment shown in the figure, the embodiment of the present application further proposes a more specific image processing method; Figure 2 Similarly, the present application embodiment still uses a computer device executing the image processing method as an example for description. Figure 4 , the image processing method may include the following steps S401-S407:
[0089] S401, obtaining a reference image from the affine transformation space of the target image.
[0090] The affine transformation space of the target image is constructed as follows: first, the target image can be obtained; and the target image can be sampled in the longitude direction and the latitude direction according to the tilt factor to obtain one or more sampling results; a sampling result includes: a longitude angle and a latitude angle. Secondly, each of the one or more sampling results can be used to perform an affine transformation on the target image to obtain one or more images, one sampling result corresponds to one image, and then, the one or more images can be used to construct the affine transformation space of the target image.
[0091] Furthermore, in order to avoid the situation where the feature point detector performs detection calculations in the invalid filling area when the feature point detection is subsequently performed on the image in the affine transformation space, the embodiment of the present application can determine the four image boundary corner points of the target image (which can be referred to as boundary corner points, i.e., the points where the four corners of the image are located) when constructing the affine transformation space of the target image, so as to mark the image boundary corner points of the target image, so that a plurality of image boundary corner points are marked in the target image. Since these marked image boundary corner points will also be synchronously transformed into the corresponding image when the target image is affine transformed, each image in the affine transformation space of the target image can include: target boundary corner points corresponding to each image boundary corner point, such as Figure 5a As shown in the left figure in ; in this way, the effective image area of each image can be identified based on the target boundary corner points of each image in the affine transformation space, so that feature point detection can be performed on the effective image area later.
[0092] In one specific implementation, when feature point detection is required for any image in the affine transformation space, the computer device can identify the valid image area of any image in real time based on the image boundary corner points in any image, thereby using the feature point detector to perform feature point detection on the valid image area. In another specific implementation, after constructing the affine transformation space, the computer device can first identify the valid image area in each image based on each target boundary corner point in each image in the affine transformation space; wherein the valid image area refers to the image area containing all or part of the image content of the target image. Then, based on the valid image area in each image, a mask map of each image is constructed respectively, and the so-called mask map refers to an image used to indicate the valid image area. Specifically, the computer device can mark the pixel value of each pixel in the valid image area as a valid value (such as the value 1), and mark the pixel value of each pixel outside the valid image area as an invalid value (such as the value 0), to obtain the mask map of the image; for example, see Figure 5a As shown in the right figure of , the white image area is the valid image area of the image, and the black image area is the invalid filling area of the image. After obtaining the mask map of each image, the mask map of each image can be stored, so that when performing feature point detection later, the corresponding valid image area can be determined according to the corresponding mask map to perform feature point detection.
[0093] Among them, since the method of identifying the effective image area of each image according to each target boundary corner point of each image is the same, the following takes any image in the affine transformation space as an example to explain the process of how to identify the effective image area based on the target boundary corner point. Specifically, for any image in the affine transformation space, the computer device can determine the target image area occupied by the entire image content of the target image in any image according to the position of each target boundary corner point in any image in any image. Specifically, the position coordinates of each target boundary corner point can be determined according to the position of each target boundary corner point in any image in any image, and then multiple boundary line equations are constructed based on the determined position coordinates, and the position coordinates of two adjacent target boundary corner points can determine a boundary line equation. Then, the target image area occupied by the entire image content of the target image in any image can be determined according to the multiple boundary line equations. Of course, in other implementations, the computer device can also obtain the target image area by connecting each target boundary corner point in sequence.
[0094] After determining the target image area, in one embodiment, the computer device may directly use the target image area as the valid image area of any image. In this case, the determined valid image area includes all the image content of the target image. In another embodiment, in order to avoid detecting a large number of unstable feature points at the edge between the target image area and the invalid fill area, the computer device may determine the valid image area from the target image area based on a boundary range of a certain size to remove the feature points on the edge to avoid affecting the accuracy of subsequent feature point description and matching. Specifically, the computer device may traverse each area boundary line of the target image area, and for the current area boundary line currently traversed, draw a new area boundary line in the target image area that is parallel to the current area boundary line according to a preset boundary distance value; after all area boundary lines are traversed, the area formed by the drawn new area boundary lines is determined as the valid image area of any image, such as Figure 5b shown.
[0095] S402: Obtain a mask image of a reference image from the stored mask images, and determine a valid image area from the reference image based on the mask image of the reference image.
[0096] S403, performing feature point detection on the determined effective image area to obtain reference feature points, where the number of reference feature points is M.
[0097] In one embodiment, the computer device may directly use the feature point descriptor to perform feature point detection on the determined effective image area to obtain M reference feature points. In another embodiment, the computer device may intercept the determined effective image area from the reference image to obtain a regional image. Then, a multi-scale space (such as a Gaussian pyramid) of the regional image is constructed, and the multi-scale space includes: multiple scale images obtained by performing multi-scale changes on the regional image. Then, a feature point detector may be used to perform feature point detection on each scale image in the multi-scale space to obtain M reference feature points. It should be noted that after obtaining M reference feature points, subsequent steps S404-S407 may be performed for each reference feature point to obtain the corresponding target feature point and binary feature descriptor.
[0098] S404, sampling pixels in the neighborhood of the reference feature point to obtain N pixel pairs of the reference feature point, where any pixel pair includes a first pixel and a second pixel, and N is a positive integer.
[0099] S405 , describing the reference feature point according to the attribute information of each pixel point pair of the reference feature point under one or more feature point description dimensions, and obtaining H binary descriptors of the reference feature point, where H is a positive integer.
[0100] In one embodiment, the attribute information of any pixel pair may include: the grayscale value corresponding to each pixel in any pixel pair; one or more feature point description dimensions may include a first feature point description dimension, and the first feature point description dimension refers to: the dimension for describing the reference feature point based on the grayscale comparison between each pixel in the pixel pair. Then, the implementation of step S405 may include the following specific steps: under the first feature point description dimension, traverse each pixel pair of the reference feature point, and determine the i-th pixel pair currently traversed, n∈[1,N]. Then, the size between the grayscale values corresponding to each pixel in the i-th pixel pair may be compared to obtain the target grayscale value size relationship; and according to the target grayscale value size relationship, determine a first binary character. Specifically, if the target grayscale value size relationship indicates that the grayscale value corresponding to the corresponding pixel is less than the grayscale value corresponding to the corresponding second pixel, the first value is determined as a first binary character; if the target grayscale value size relationship indicates that the grayscale value corresponding to the first pixel is greater than or equal to the grayscale value corresponding to the corresponding second pixel, the second value is determined as a first binary character.
[0101] The first value and the second value can be set according to empirical values. For example, the first value is equal to 1 and the second value is equal to 0. Then w is used to represent the reference feature point, and I(X i ) represents the gray value corresponding to the first pixel in the i-th pixel pair, and I(Y i ) represents the grayscale value corresponding to the second pixel in the i-th pixel pair, then the first binary character (using τ I (w;X i , Y i The determination method of ) can be seen in the following formula 1.1:
[0102]
[0103] Wherein, otherwise represents other conditions except the if condition. After all pixel pairs of the reference feature point are traversed, the determined N first binary characters are used to construct a string to obtain a first binary string, and the first binary string is used to determine a binary descriptor of the reference feature point. The construction method of the first binary string (expressed by des(w)) can be seen in the following formula 1.2:
[0104]
[0105] It can be seen that the first binary string is an N-dimensional binary descriptor, for example, if N is equal to 256, then the first binary string is a 256-dimensional binary descriptor. Practice has shown that a 256-dimensional binary descriptor only occupies 32 bytes, which is more advantageous in terms of storage and time efficiency than a traditional decimal descriptor.
[0106] It should be noted that the computer device can directly use the grayscale value of any pixel in the reference image as the grayscale value corresponding to any pixel. Alternatively, after Gaussian smoothing the reference image, the grayscale value of any pixel in the Gaussian smoothed reference image is used as the grayscale value corresponding to any pixel. Alternatively, the computer device can also use the comparison of the sum of the grayscale values of each pixel in a small window of v×v (such as 5×5) of a point in the neighborhood to replace the comparison of the original grayscale value of a single pixel, thereby improving the stability and noise resistance of the eigenvalue. In this case, the computer device can use the sum of the grayscale values of each pixel in the small window where any pixel is located as the grayscale value corresponding to any pixel. Optionally, the computer device can also use integral images to accelerate to improve algorithm performance.
[0107] In another implementation, the attribute information of any pixel pair may include: the grayscale value corresponding to each pixel in any pixel pair; one or more feature point description dimensions may include a second feature point description dimension, and the second feature point description dimension refers to: the dimension for describing the reference feature point based on the grayscale contrast between the reference feature point and the pixel in the pixel pair. Then, correspondingly, the implementation of step S405 may include the following specific steps: under the second feature point description dimension, determine the grayscale value of the reference feature point, and traverse each pixel pair of the reference feature point to determine the i-th pixel pair currently traversed, i∈[1,N]. Then, determine the grayscale value contrast information between the reference feature point and each pixel in the i-th pixel pair based on the size relationship between each grayscale value in the attribute information of the i-th pixel pair and the grayscale value of the reference feature point. Specifically, for any pixel point of the i-th pixel pair, if the grayscale value corresponding to any pixel point is less than the grayscale value of the reference feature point, the third numerical value is determined as the grayscale value comparison information between the reference feature point and any pixel point; if the grayscale value corresponding to any pixel point is greater than or equal to the grayscale value of the reference feature point, the fourth numerical value is determined as the grayscale value comparison information between the reference feature point and any pixel point.
[0108] The third value and the fourth value can be set according to empirical values, for example, the third value is equal to 1, and the fourth value is equal to 0; if I(w) is used to represent the gray value of the reference feature point, then the reference feature point and the first pixel point X in the i-th pixel pair are i Gray value contrast information between (P(I; w, X i)), and the second pixel Y in the pair of the reference feature point and the i-th pixel i Gray value contrast information between (P(I; w, Y i The determination methods of )) can be referred to the following formulas 1.3 and 1.4 respectively:
[0109]
[0110]
[0111] After obtaining the grayscale value comparison information between the reference feature point and each pixel in the i-th pixel pair, the computer device can perform consistency detection on the determined grayscale value comparison information and determine a second binary character according to the consistency detection result. Specifically, if the consistency detection result indicates that the determined grayscale value comparison information is consistent, the first value is determined as a second binary character; if the consistency detection result indicates that the determined grayscale value comparison information is not consistent, the second value is determined as a second binary character. Still taking the first value equal to 1 and the second value equal to 0 as an example, the second binary character (using τ w (w;X i , Y i The determination method of ) can be seen in the following formula 1.5:
[0112]
[0113] After all pixel pairs of the reference feature point are traversed, the determined N second binary characters are used to construct a string to obtain a second binary string, and the second binary string is used to determine a binary descriptor of the reference feature point. The construction method of the second binary string (expressed by des'(w)) can be shown in the following formula 1.6:
[0114]
[0115] In another implementation, the attribute information of any pixel pair may include: the gradient of each pixel in any pixel pair in a preset direction (which may be a first-order gradient); one or more feature point description dimensions may include a third feature point description dimension, and the third feature point description dimension refers to: a dimension for describing the reference feature point based on the gradient comparison between each pixel in the pixel pair. Accordingly, the implementation of step S405 may include the following specific steps: under the third feature point description dimension, traverse each pixel pair of the reference feature point, and determine the i-th pixel pair currently traversed, i∈[1,N]. Then, perform direction detection on the gradient of each pixel in the i-th pixel pair in the preset direction to obtain the gradient direction indication information of each pixel in the i-th pixel pair in the preset direction. Specifically, for any pixel point in the i-th pixel point pair, the size of the gradient of any pixel point in the preset direction and the reference gradient can be compared; if the gradient of any pixel point in the preset direction is greater than the reference gradient, the fifth value used to indicate the positive gradient direction is determined as the gradient direction indication information of any pixel point in the preset direction; if the gradient of any pixel point in the preset direction is less than or equal to the reference gradient, the sixth value used to indicate the negative gradient direction is determined as the gradient direction indication information of any pixel point in the preset direction.
[0116] The fifth value, the sixth value and the reference gradient can be set according to empirical values, for example, the fifth value is equal to 1, the sixth value is equal to 0, and the reference gradient is equal to 0; θ Represents the gradient function, using g θ (X i ) represents the first pixel X in the i-th pixel pair i The gradient in the preset direction (such as the first-order gradient) and the use of P'(g θ ;X i ) represents the gradient direction indication information of the first pixel in the preset direction, using g θ (Y i ) represents the second pixel Y in the i-th pixel pair i The gradient in the preset direction, and using P'(g θ ; Y i ) represents the gradient direction indication information of the second pixel in the preset direction, and the determination method of each gradient direction indication information can be respectively referred to as shown in the following formulas 1.7 and 1.8:
[0117]
[0118]
[0119] After obtaining the gradient direction indication information of each pixel in the i-th pixel pair in a preset direction, the computer device can perform consistency detection on the obtained gradient direction indication information, and determine a third binary character according to the consistency detection result. Specifically, if the consistency detection result indicates that the obtained gradient direction indication information is consistent, the first value is determined as a third binary character; if the consistency detection result indicates that the obtained gradient direction indication information is not consistent, the second value is determined as a third binary character. Still taking the first value equal to 1 and the second value equal to 0 as an example, the third binary character (using (w;X i , Y i The determination method of ) can be seen in the following formula 1.9:
[0120]
[0121] After all pixel pairs of the reference feature point are traversed, the determined N third binary characters are used to construct a string to obtain a third binary string, and the third binary string is used to determine a binary descriptor of the reference feature point. The construction method of the third binary string (expressed by des" (w)) can be shown in the following formula 2.0:
[0122]
[0123] It should be noted that the above description is based on one preset direction as an example. In actual applications, multiple preset directions may be set, for example, four preset directions of 0°, 90°, 180° and 270°. Then, based on the above principle, the computer device may count the gradient direction indication information of each pixel point in each pixel point pair of the reference feature point in the four preset directions, thereby constructing the third binary string shown in the following formula 2.1:
[0124]
[0125] It should be noted that the three binary character strings (i.e., binary descriptors) mentioned above can be used individually or in combination according to actual needs, and there is no limitation on this. For example, on the basis of calculating the first binary character string, considering that the first binary character string contains the grayscale contrast information between each pixel in the pixel pair, in order to improve the distinguishability and robustness of the binary descriptor, the computer device can also increase the calculation of the second binary character string containing the grayscale contrast information between the feature point and the pixel. Furthermore, in order to avoid the influence of viewing angle differences and lighting changes, on the basis of calculating the first binary character string and the second binary character string, a third binary character string of grayscale contrast information between each pixel in the pixel pair can be further calculated.
[0126] S406, integrating H binary descriptors of the reference feature point to obtain a binary feature descriptor of the reference feature point.
[0127] Exemplarily, taking H binary descriptors including the binary descriptors shown in the above formula 1.2, formula 1.6 and formula 2.1 as an example, Des(w) is used to represent the binary feature descriptor of the reference feature point, and the binary feature descriptor can be shown in the following formula:
[0128]
[0129] S407, mapping the reference feature points to the target image by performing an inverse perspective transformation on the reference feature points to obtain target feature points of the target image; using the binary feature descriptors of the reference feature points as the binary feature descriptors of the target feature points to perform feature point matching on the target image based on the binary feature descriptors.
[0130] It should be noted that the above description is based on an image frame (i.e., reference image) in the affine transformation space of the target image. In practical applications, each image frame in the affine transformation space of the target image can be processed by the above steps to obtain a large number of target feature points of the target image and corresponding binary feature descriptors, such as Figure 5c shown.
[0131] Furthermore, when the target image refers to any one of the two images in the wide-angle sequence image that need to match feature points, the computer device can also obtain the binary feature descriptor of the target feature points of the other image other than the target image in the two frames of images; it should be understood that the determination method of the target feature points of the other image and the corresponding binary feature descriptor is the same as the determination method of the target feature points and the binary feature descriptor of the target image, and will not be repeated here. Then, the computer device can match the target feature points of the target image with the target feature points of the other image according to the similarity between the binary feature descriptor of the target image and the binary feature descriptor of the other image, and obtain the feature point matching result between the target image and the other image.
[0132] The embodiment of the present application can first simulate the change of viewing angle by constructing the affine transformation space of the target image, so as to obtain affine invariance. Then, by determining the four image boundary corner points of the original target image to mark the effective image area in the image after the viewing angle change, the division of the effective image area can be realized, and the feature point detection in the invalid filling area can be avoided, thereby improving the efficiency of feature point detection. Finally, in the feature point detection and description stage, by establishing a multi-scale space for feature point detection, the feature points can be made scale invariant; and, compared with the traditional ASIFT algorithm, by optimizing the affine transformation space and introducing the binary descriptor into the affine transformation space, the time efficiency of feature point matching is effectively improved. At the same time, on the basis of the grayscale contrast information, the gradient contrast information in multiple directions in the neighborhood of the feature point is added to obtain the final binary feature descriptor, which can improve the description ability in the binary feature descriptor, thereby obtaining a higher matching accuracy, and having more advantages in the feature matching of sequence images.
[0133] In order to prove the advantages of the image processing method proposed in the embodiment of the present application over the existing algorithms, the embodiment of the present application tested the AGORB algorithm and other existing algorithms; wherein, the principle of the AGORB algorithm is the principle of the image processing method proposed in the present application. Specifically, the test contents are as follows:
[0134] (I) A feature point matching test is performed under a large viewing angle data set, where the large viewing angle data set may include an adam (Absolute Tile) data set and a magazine (Transition Tile) data set.
[0135] ① Through the above two data sets, the AGORB algorithm of this application is tested against existing algorithms such as the ASIFT algorithm, ORB algorithm, and SIFT algorithm. The number of valid matching point pairs (i.e., correct matching point pairs) that can be detected is used to evaluate the accuracy of the algorithm. The test results can be found in Figure 6a .in, Figure 6aThe left figure in the figure shows the number of valid matching point pairs detected by each algorithm in the adam data set. Figure 6a The right figure in shows the number of valid matching point pairs detected by each algorithm in the magazine data set. Figure 6a The test results shown show that the accuracy of the AGORB algorithm of the present application is significantly better than that of the existing algorithms.
[0136] ② The AGORB algorithm of this application and the existing ASIFT algorithm were tested using the above two data sets. The time required for feature point matching can be found in the test results. Figure 6b .in, Figure 6b The left figure in the figure shows the time consumed by each algorithm to match feature points in the adam data set. Figure 6b The right figure in shows the time consumed by each algorithm to match feature points in the magazine data set. Figure 6b It can be seen from the test results that the time taken by the AGORB algorithm of the present application is significantly shorter than that of the existing algorithms, which indicates that the AGORB algorithm of the present application has higher detection efficiency.
[0137] (ii) Feature point matching tests were performed between image pairs with large viewing angle changes in a wide viewing angle sequence image. Specifically, the embodiment of the present application selected nine groups of image pairs with different viewing angle changes for feature point matching tests.
[0138] ① Through the above nine groups of images, the AGORB algorithm of this application is tested against existing algorithms such as the ASIFT algorithm, ORB algorithm, and SIFT algorithm. The number of valid matching point pairs that can be detected is used to evaluate the accuracy of the algorithm. The test results can be found in Figure 6c As shown in the left figure. Figure 6a From the test results shown in the left figure, it can be seen that the number of valid matching point pairs of the AGORB algorithm of the present application is higher than the number of valid matching point pairs of the existing algorithm, which indicates that the accuracy of the AGORB algorithm of the present application is significantly better than that of the existing algorithm.
[0139] ② Through the above nine groups of images, the AGORB algorithm of this application and the existing ASIFT algorithm are tested respectively. The time required for feature point matching can be found in the test results. Figure 6c As shown in the right figure in Figure 6c It can be seen from the test results shown in the right figure that the time taken by the AGORB algorithm of the present application is much shorter than that taken by the ASIFT algorithm, which indicates that the AGORB algorithm of the present application has higher detection efficiency.
[0140] Based on the description of the above-mentioned image processing method embodiment, the present application embodiment also discloses an image processing device, which may be a computer program (including program code) running in a computer device. The image processing device may execute Figure 2 or Figure 4 See the image processing method shown in Figure 7 , the image processing device can run the following units:
[0141] An acquisition unit 701 is used to acquire a reference image from an affine transformation space of a target image, wherein the affine transformation space includes: one or more images obtained by simulating a change in viewing angle of the target image, and the reference image is one of the images in the affine transformation space;
[0142] The processing unit 702 is configured to perform feature point detection on the reference image to obtain reference feature points; and perform pixel sampling in the neighborhood of the reference feature points to obtain N pixel pairs of the reference feature points, where N is a positive integer;
[0143] The processing unit 702 is further configured to describe the reference feature point according to the attribute information of each pixel point pair of the reference feature point under one or more feature point description dimensions to obtain H binary descriptors of the reference feature point, where H is a positive integer;
[0144] The processing unit 702 is further configured to integrate the H binary descriptors of the reference feature point to obtain a binary feature descriptor of the reference feature point;
[0145] The processing unit 702 is also used to map the reference feature points to the target image by performing an inverse perspective transformation on the reference feature points to obtain target feature points of the target image; and use the binary feature descriptors of the reference feature points as the binary feature descriptors of the target feature points to perform feature point matching on the target image based on the binary feature descriptors.
[0146] In one implementation, the attribute information of any pixel pair includes: the grayscale value corresponding to each pixel in the any pixel pair; accordingly, the processing unit 702, when used to describe the reference feature point according to the attribute information of each pixel pair of the reference feature point under one or more feature point description dimensions, to obtain H binary descriptors of the reference feature point, can be specifically used to:
[0147] Under the first feature point description dimension, traverse each pixel point pair of the reference feature point, and determine the i-th pixel point pair currently traversed, i∈[1,N];
[0148] Comparing the grayscale values corresponding to the pixels in the i-th pixel pair to obtain a target grayscale value relationship; determining a first binary character according to the target grayscale value relationship;
[0149] After all pixel pairs of the reference feature point are traversed, the determined N first binary characters are used to construct a character string to obtain a first binary character string, and the first binary character string is used to determine a binary descriptor of the reference feature point.
[0150] In another embodiment, any pixel pair includes a first pixel and a second pixel; accordingly, when the processing unit 702 is used to determine a first binary character according to the target gray value magnitude relationship, it can be specifically used to:
[0151] If the target grayscale value magnitude relationship indicates that: the grayscale value corresponding to the corresponding first pixel point is less than the grayscale value corresponding to the corresponding second pixel point, then the first value is determined as a first binary character;
[0152] If the target grayscale value magnitude relationship indicates that the grayscale value corresponding to the corresponding first pixel point is greater than or equal to the grayscale value corresponding to the corresponding second pixel point, the second value is determined as a first binary character.
[0153] In another implementation manner, the attribute information of any pixel pair includes: the grayscale value corresponding to each pixel in the any pixel pair; accordingly, when the processing unit 702 is used to describe the reference feature point according to the attribute information of each pixel pair of the reference feature point under one or more feature point description dimensions to obtain H binary descriptors of the reference feature point, it can be specifically used to:
[0154] Under the second feature point description dimension, determine the grayscale value of the reference feature point, and traverse each pixel pair of the reference feature point to determine the i-th pixel pair currently traversed, i∈[1,N];
[0155] Determine grayscale value comparison information between the reference feature point and each pixel in the i-th pixel pair according to the magnitude relationship between each grayscale value in the attribute information of the i-th pixel pair and the grayscale value of the reference feature point;
[0156] Performing consistency detection on each determined gray value comparison information, and determining a second binary character according to the consistency detection result;
[0157] After all pixel pairs of the reference feature point are traversed, the determined N second binary characters are used to construct a character string to obtain a second binary character string, and the second binary character string is used to determine a binary descriptor of the reference feature point.
[0158] In another implementation manner, when the processing unit 702 is used to determine the grayscale value comparison information between the reference feature point and each pixel in the i-th pixel pair according to the magnitude relationship between each grayscale value in the attribute information of the i-th pixel pair and the grayscale value of the reference feature point, it can be specifically used to:
[0159] For any pixel of the i-th pixel pair, if the grayscale value corresponding to the any pixel is less than the grayscale value of the reference feature point, the third value is determined as grayscale value comparison information between the reference feature point and the any pixel;
[0160] If the grayscale value corresponding to any pixel point is greater than or equal to the grayscale value of the reference feature point, the fourth value is determined as grayscale value comparison information between the reference feature point and any pixel point.
[0161] In another embodiment, the attribute information of any pixel pair includes: the gradient of each pixel in the any pixel pair in a preset direction; accordingly, the processing unit 702, when used to describe the reference feature point according to the attribute information of each pixel pair of the reference feature point under one or more feature point description dimensions, to obtain H binary descriptors of the reference feature point, can be specifically used to:
[0162] Under the third feature point description dimension, traverse each pixel point pair of the reference feature point, and determine the i-th pixel point pair currently traversed, i∈[1,N];
[0163] Performing direction detection on the gradient of each pixel point in the i-th pixel point pair in a preset direction to obtain gradient direction indication information of each pixel point in the i-th pixel point pair in the preset direction;
[0164] Performing consistency detection on each of the obtained gradient direction indication information, and determining a third binary character according to the consistency detection result;
[0165] After all pixel pairs of the reference feature point are traversed, the determined N third binary characters are used to construct a character string to obtain a third binary character string, and the third binary character string is used to determine a binary descriptor of the reference feature point.
[0166] In another implementation manner, when the processing unit 702 is used to perform direction detection on the gradient of each pixel in the i-th pixel pair in a preset direction to obtain the gradient direction indication information of each pixel in the i-th pixel pair in the preset direction, it can be specifically used to:
[0167] For any pixel point in the i-th pixel point pair, compare the gradient of the any pixel point in a preset direction with a reference gradient;
[0168] If the gradient of any pixel point in the preset direction is greater than the reference gradient, a fifth value used to indicate the positive gradient direction is determined as the gradient direction indication information of any pixel point in the preset direction;
[0169] If the gradient of any pixel point in the preset direction is less than or equal to the reference gradient, a sixth value used to indicate the direction of the negative gradient is determined as the gradient direction indication information of any pixel point in the preset direction.
[0170] In another implementation, a viewing angle is described by a longitude angle and a latitude angle; the processing unit 702 may also be used to:
[0171] Get the target image;
[0172] Sampling the target image in the longitude direction and the latitude direction according to the tilt factor to obtain one or more sampling results; one sampling result includes: a longitude angle and a latitude angle;
[0173] Using each of the one or more sampling results respectively, perform affine transformation on the target image to obtain one or more images;
[0174] The one or more images are used to construct an affine transformation space of the target image.
[0175] In another embodiment, the target image is marked with a plurality of image boundary corner points; each image in the affine transformation space includes: target boundary corner points corresponding to each image boundary corner point; accordingly, the processing unit 702 may also be used to:
[0176] According to each target boundary corner point in each image in the affine transformation space, identifying a valid image area in each image; wherein the valid image area refers to an image area containing all or part of the image content of the target image;
[0177] Based on the effective image area in each image, construct a mask image of each image respectively; wherein the mask image refers to an image used to indicate the effective image area;
[0178] The mask images of the respective images are stored.
[0179] In another implementation manner, when the processing unit 702 is used to perform feature point detection on the reference image to obtain reference feature points, it can be specifically used to:
[0180] Acquire a mask image of the reference image from the stored mask images, and determine a valid image area from the reference image based on the mask image of the reference image;
[0181] Feature point detection is performed on the determined effective image area to obtain reference feature points.
[0182] In another implementation manner, the number of the reference feature points is M, where M is a positive integer; accordingly, when the processing unit 702 is used to perform feature point detection on the determined effective image area to obtain the reference feature points, it can be specifically used to:
[0183] Cutting out the determined effective image area from the reference image to obtain a regional image;
[0184] Constructing a multi-scale space of the region image, wherein the multi-scale space includes: a plurality of scale images obtained by performing multi-scale changes on the region image;
[0185] A feature point detector is used to perform feature point detection on each scale image in the multi-scale space to obtain M reference feature points.
[0186] In another implementation manner, when the processing unit 702 is used to identify the valid image area in each image according to each target boundary corner point in each image in the affine transformation space, it can be specifically used to:
[0187] For any image in the affine transformation space, determine a target image area occupied by all image contents of the target image in the any image according to positions of each target boundary corner point in the any image;
[0188] Traversing each region boundary line of the target image region, and for a current region boundary line currently traversed, drawing a new region boundary line in the target image region that is parallel to the current region boundary line according to a preset boundary distance value;
[0189] After all the region boundary lines are traversed, the region formed by the new region boundary lines drawn is determined as the valid image region of any one of the images.
[0190] In another embodiment, the target image refers to any one of the two frames of images in the large viewing angle sequence image that need to perform feature point matching, and the large viewing angle sequence image refers to an image that meets the following conditions: it includes multiple frames of images arranged in sequence, and the viewing angle difference between two adjacent frames of images is greater than the target threshold; accordingly, the processing unit 702 can also be used to:
[0191] Obtain a binary feature descriptor of a target feature point of another image other than the target image in the two frames of images;
[0192] According to the similarity between the binary feature descriptor of the target image and the binary feature descriptor of the other image, a matching process is performed on the target feature points of the target image and the target feature points of the other image to obtain a feature point matching result between the target image and the other image.
[0193] According to another embodiment of the present application, Figure 7 The various units in the image processing device shown can be separately or completely combined into one or several other units to constitute, or one (some) of the units can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, other units can also be included based on the image processing device. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0194] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 or Figure 4 A computer program (including program code) for each step involved in the corresponding method shown in Figure 7 The image processing device shown in the figure can realize the image processing method of the embodiment of the present application. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above-mentioned computing device through the computer-readable recording medium and run therein.
[0195] The embodiment of the present application constructs the affine transformation space of the target image by simulating the change of the viewing angle of the target image, and by performing feature point detection and feature point description in the affine transformation space of the target image, the target feature points of the target image finally obtained and the corresponding binary feature descriptors can have affine invariance, so that the feature point matching can be performed more accurately based on the binary feature descriptors in the future. In addition, the binary feature descriptors of the target feature points and the binary feature descriptors of the reference feature points are the same, and the embodiment of the present application obtains H binary descriptors by describing the reference feature points according to the attribute information of each pixel point pair sampled in the neighborhood of the reference feature point under one or more feature point description dimensions, so that each binary descriptor has description information of different dimensions, then by integrating these H binary descriptors to obtain the binary feature descriptors, the description information of the binary feature descriptors can be effectively enriched, so that the information simplification of the binary feature descriptors can be avoided, thereby further improving the accuracy of feature point matching based on the binary feature descriptors. Furthermore, since the binary feature descriptor is binary, matching feature points using the binary feature descriptor can effectively reduce time complexity and improve matching efficiency.
[0196] Based on the description of the above method embodiment and device embodiment, the present application embodiment also provides a computer device. Figure 8 , the computer device at least includes a processor 801, an input interface 802, an output interface 803 and a computer storage medium 804. Among them, the processor 801, the input interface 802, the output interface 803 and the computer storage medium 804 in the computer device can be connected via a bus or other means. The computer storage medium 804 can be stored in the memory of the computer device, and the computer storage medium 804 is used to store a computer program, and the computer program includes program instructions. The processor 801 is used to execute the program instructions stored in the computer storage medium 804. The processor 801 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to realize the corresponding method flow or corresponding function.
[0197] In one embodiment, the processor 801 described in the embodiment of the present application can be used to perform a series of image processing, specifically including: obtaining a reference image from the affine transformation space of the target image, the affine transformation space including: one or more images obtained by simulating the perspective change of the target image, the reference image is one of the images in the affine transformation space; performing feature point detection on the reference image to obtain reference feature points; and sampling pixels in the neighborhood of the reference feature points to obtain N pixel pairs of the reference feature points, where N is a positive integer; under one or more feature point description dimensions, according to the reference feature points, The reference feature points are described according to the attribute information of each pixel point pair of the reference feature points to obtain H binary descriptors of the reference feature points, where H is a positive integer; the H binary descriptors of the reference feature points are integrated to obtain the binary feature descriptors of the reference feature points; the reference feature points are mapped to the target image by performing an inverse perspective transformation on the reference feature points to obtain the target feature points of the target image; and the binary feature descriptors of the reference feature points are used as the binary feature descriptors of the target feature points to perform feature point matching on the target image based on the binary feature descriptors, and so on.
[0198] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the computer device and the extended storage medium supported by the computer device. The computer storage medium provides a storage space, which stores the operating system of the computer device. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.
[0199] In one embodiment, the processor may load and execute one or more instructions stored in the computer storage medium to implement the above-mentioned Figure 2 or Figure 4 The corresponding steps of the method in the embodiment of the image processing method shown; in a specific implementation, one or more instructions in the computer storage medium are loaded by the processor and execute the following steps:
[0200] Acquire a reference image from an affine transformation space of a target image, wherein the affine transformation space includes: one or more images obtained by simulating a change in viewing angle of the target image, wherein the reference image is one of the images in the affine transformation space;
[0201] Performing feature point detection on the reference image to obtain reference feature points; and performing pixel sampling in the neighborhood of the reference feature points to obtain N pixel pairs of the reference feature points, where N is a positive integer;
[0202] In one or more feature point description dimensions, the reference feature point is described according to the attribute information of each pixel point pair of the reference feature point to obtain H binary descriptors of the reference feature point, where H is a positive integer;
[0203] Integrate the H binary descriptors of the reference feature point to obtain a binary feature descriptor of the reference feature point;
[0204] The reference feature points are mapped to the target image by performing an inverse perspective transformation on the reference feature points to obtain target feature points of the target image; and the binary feature descriptors of the reference feature points are used as the binary feature descriptors of the target feature points to perform feature point matching on the target image based on the binary feature descriptors.
[0205] In one implementation, the attribute information of any pixel pair includes: the grayscale value corresponding to each pixel in the any pixel pair; accordingly, under one or more feature point description dimensions, the reference feature point is described according to the attribute information of each pixel pair of the reference feature point, and when H binary descriptors of the reference feature point are obtained, the one or more instructions may be loaded and specifically executed by the processor:
[0206] Under the first feature point description dimension, traverse each pixel point pair of the reference feature point, and determine the i-th pixel point pair currently traversed, i∈[1,N];
[0207] Comparing the grayscale values corresponding to the pixels in the i-th pixel pair to obtain a target grayscale value relationship; determining a first binary character according to the target grayscale value relationship;
[0208] After all pixel pairs of the reference feature point are traversed, the determined N first binary characters are used to construct a character string to obtain a first binary character string, and the first binary character string is used to determine a binary descriptor of the reference feature point.
[0209] In another embodiment, any pixel pair includes a first pixel and a second pixel; accordingly, when a first binary character is determined according to the target grayscale value relationship, the one or more instructions may be loaded and specifically executed by the processor:
[0210] If the target grayscale value magnitude relationship indicates that: the grayscale value corresponding to the corresponding first pixel point is less than the grayscale value corresponding to the corresponding second pixel point, then the first value is determined as a first binary character;
[0211] If the target grayscale value magnitude relationship indicates that the grayscale value corresponding to the corresponding first pixel point is greater than or equal to the grayscale value corresponding to the corresponding second pixel point, the second value is determined as a first binary character.
[0212] In another implementation, the attribute information of any pixel pair includes: the grayscale value corresponding to each pixel in the any pixel pair; accordingly, under one or more feature point description dimensions, the reference feature point is described according to the attribute information of each pixel pair of the reference feature point to obtain H binary descriptors of the reference feature point, and the one or more instructions can be loaded and specifically executed by the processor:
[0213] Under the second feature point description dimension, determine the grayscale value of the reference feature point, and traverse each pixel pair of the reference feature point to determine the i-th pixel pair currently traversed, i∈[1,N];
[0214] Determine grayscale value comparison information between the reference feature point and each pixel in the i-th pixel pair according to the magnitude relationship between each grayscale value in the attribute information of the i-th pixel pair and the grayscale value of the reference feature point;
[0215] Performing consistency detection on each determined gray value comparison information, and determining a second binary character according to the consistency detection result;
[0216] After all pixel pairs of the reference feature point are traversed, the determined N second binary characters are used to construct a character string to obtain a second binary character string, and the second binary character string is used to determine a binary descriptor of the reference feature point.
[0217] In another implementation, when determining the grayscale value comparison information between the reference feature point and each pixel in the i-th pixel pair according to the magnitude relationship between each grayscale value in the attribute information of the i-th pixel pair and the grayscale value of the reference feature point, the one or more instructions may be loaded and specifically executed by the processor:
[0218] For any pixel of the i-th pixel pair, if the grayscale value corresponding to the any pixel is less than the grayscale value of the reference feature point, the third value is determined as grayscale value comparison information between the reference feature point and the any pixel;
[0219] If the grayscale value corresponding to any pixel point is greater than or equal to the grayscale value of the reference feature point, the fourth value is determined as grayscale value comparison information between the reference feature point and any pixel point.
[0220] In another embodiment, the attribute information of any pixel pair includes: the gradient of each pixel in the any pixel pair in a preset direction; accordingly, under one or more feature point description dimensions, the reference feature point is described according to the attribute information of each pixel pair of the reference feature point, and when H binary descriptors of the reference feature point are obtained, the one or more instructions can be loaded and specifically executed by the processor:
[0221] Under the third feature point description dimension, traverse each pixel point pair of the reference feature point, and determine the i-th pixel point pair currently traversed, i∈[1,N];
[0222] Performing direction detection on the gradient of each pixel point in the i-th pixel point pair in a preset direction to obtain gradient direction indication information of each pixel point in the i-th pixel point pair in the preset direction;
[0223] Performing consistency detection on each of the obtained gradient direction indication information, and determining a third binary character according to the consistency detection result;
[0224] After all pixel pairs of the reference feature point are traversed, the determined N third binary characters are used to construct a character string to obtain a third binary character string, and the third binary character string is used to determine a binary descriptor of the reference feature point.
[0225] In another implementation, when performing direction detection on the gradient of each pixel in the i-th pixel pair in a preset direction to obtain the gradient direction indication information of each pixel in the i-th pixel pair in the preset direction, the one or more instructions may be loaded and specifically executed by the processor:
[0226] For any pixel point in the i-th pixel point pair, compare the gradient of the any pixel point in a preset direction with a reference gradient;
[0227] If the gradient of any pixel point in the preset direction is greater than the reference gradient, a fifth value used to indicate the positive gradient direction is determined as the gradient direction indication information of any pixel point in the preset direction;
[0228] If the gradient of any pixel point in the preset direction is less than or equal to the reference gradient, a sixth value used to indicate the direction of the negative gradient is determined as the gradient direction indication information of any pixel point in the preset direction.
[0229] In another embodiment, a viewing angle is described by a longitude angle and a latitude angle; the one or more instructions may also be loaded and specifically executed by the processor:
[0230] Get the target image;
[0231] Sampling the target image in the longitude direction and the latitude direction according to the tilt factor to obtain one or more sampling results; one sampling result includes: a longitude angle and a latitude angle;
[0232] Using each of the one or more sampling results respectively, perform affine transformation on the target image to obtain one or more images;
[0233] The one or more images are used to construct an affine transformation space of the target image.
[0234] In another implementation manner, the target image is marked with a plurality of image boundary corner points; each image in the affine transformation space includes: target boundary corner points corresponding to each image boundary corner point; accordingly, the one or more instructions may also be loaded and specifically executed by the processor:
[0235] According to each target boundary corner point in each image in the affine transformation space, identifying a valid image area in each image; wherein the valid image area refers to an image area containing all or part of the image content of the target image;
[0236] Based on the effective image area in each image, construct a mask image of each image respectively; wherein the mask image refers to an image used to indicate the effective image area;
[0237] The mask images of the respective images are stored.
[0238] In another implementation, when feature point detection is performed on the reference image to obtain reference feature points, the one or more instructions may be loaded and specifically executed by the processor:
[0239] Acquire a mask image of the reference image from the stored mask images, and determine a valid image area from the reference image based on the mask image of the reference image;
[0240] Feature point detection is performed on the determined effective image area to obtain reference feature points.
[0241] In another implementation manner, the number of the reference feature points is M, where M is a positive integer; accordingly, when feature point detection is performed on the determined valid image area to obtain reference feature points, the one or more instructions may be loaded and specifically executed by the processor:
[0242] Cutting out the determined effective image area from the reference image to obtain a regional image;
[0243] Constructing a multi-scale space of the region image, wherein the multi-scale space includes: a plurality of scale images obtained by performing multi-scale changes on the region image;
[0244] A feature point detector is used to perform feature point detection on each scale image in the multi-scale space to obtain M reference feature points.
[0245] In another implementation, when identifying the valid image area in each image according to each target boundary corner point in each image in the affine transformation space, the one or more instructions may be loaded and specifically executed by the processor:
[0246] For any image in the affine transformation space, determine a target image area occupied by all image contents of the target image in the any image according to positions of each target boundary corner point in the any image;
[0247] Traversing each region boundary line of the target image region, and for a current region boundary line currently traversed, drawing a new region boundary line in the target image region that is parallel to the current region boundary line according to a preset boundary distance value;
[0248] After all the region boundary lines are traversed, the region formed by the new region boundary lines drawn is determined as the valid image region of any one of the images.
[0249] In another embodiment, the target image refers to any one of the two frames of images in the large viewing angle sequence image that need to perform feature point matching, and the large viewing angle sequence image refers to an image that meets the following conditions: it includes multiple frames of images arranged in sequence, and the viewing angle difference between two adjacent frames of images is greater than the target threshold; accordingly, the one or more instructions can also be loaded and specifically executed by the processor:
[0250] Obtain a binary feature descriptor of a target feature point of another image other than the target image in the two frames of images;
[0251] According to the similarity between the binary feature descriptor of the target image and the binary feature descriptor of the other image, a matching process is performed on the target feature points of the target image and the target feature points of the other image to obtain a feature point matching result between the target image and the other image.
[0252] The embodiment of the present application constructs the affine transformation space of the target image by simulating the change of the viewing angle of the target image, and by performing feature point detection and feature point description in the affine transformation space of the target image, the target feature points of the target image finally obtained and the corresponding binary feature descriptors can have affine invariance, so that the feature point matching can be performed more accurately based on the binary feature descriptors in the future. In addition, the binary feature descriptors of the target feature points and the binary feature descriptors of the reference feature points are the same, and the embodiment of the present application obtains H binary descriptors by describing the reference feature points according to the attribute information of each pixel point pair sampled in the neighborhood of the reference feature point under one or more feature point description dimensions, so that each binary descriptor has description information of different dimensions, then by integrating these H binary descriptors to obtain the binary feature descriptors, the description information of the binary feature descriptors can be effectively enriched, so that the information simplification of the binary feature descriptors can be avoided, thereby further improving the accuracy of feature point matching based on the binary feature descriptors. Furthermore, since the binary feature descriptor is binary, matching feature points using the binary feature descriptor can effectively reduce time complexity and improve matching efficiency.
[0253] It should be noted that according to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above Figure 2 or Figure 4 The method provided in various optional manners of the image processing method embodiment shown.
[0254] Furthermore, it should be understood that what is disclosed above is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. An image processing method, characterized in that: include: Acquire a reference image from an affine transformation space of a target image, wherein the affine transformation space includes: one or more images obtained by simulating a change in viewing angle of the target image, wherein the reference image is one of the images in the affine transformation space; Performing feature point detection on the reference image to obtain reference feature points; and performing pixel sampling in the neighborhood of the reference feature points to obtain N pixel pairs of the reference feature points, where N is a positive integer; Under multiple feature point description dimensions, the reference feature point is described according to the attribute information of each pixel pair of the reference feature point to obtain H binary descriptors of the reference feature point, where H is a positive integer; wherein, when the attribute information of any pixel pair includes: the gradient of each pixel in any pixel pair in a preset direction, the process of obtaining the H binary descriptors of the reference feature point includes: under the third feature point description dimension, traversing each pixel pair of the reference feature point, and determining the i-th pixel pair currently traversed, i∈[1,N]; performing direction detection on the gradient of each pixel in the i-th pixel pair in a preset direction to obtain gradient direction indication information of each pixel in the i-th pixel pair in the preset direction; performing consistency detection on the obtained gradient direction indication information, and determining a third binary character according to the consistency detection result; after all pixel pairs of the reference feature point are traversed, using the determined N third binary characters to construct a character string to obtain a third binary character string, and determining a binary descriptor of the reference feature point by the third binary character string; Integrate the H binary descriptors of the reference feature point to obtain a binary feature descriptor of the reference feature point; The reference feature points are mapped to the target image by performing an inverse perspective transformation on the reference feature points to obtain target feature points of the target image; and the binary feature descriptors of the reference feature points are used as the binary feature descriptors of the target feature points to perform feature point matching on the target image based on the binary feature descriptors.
2. The method according to claim 1, characterized in that The attribute information of any pixel pair includes: the grayscale value corresponding to each pixel in the any pixel pair; the reference feature point is described according to the attribute information of each pixel pair of the reference feature point under multiple feature point description dimensions to obtain H binary descriptors of the reference feature point, including: Under the first feature point description dimension, traverse each pixel point pair of the reference feature point, and determine the i-th pixel point pair currently traversed, i∈[1,N]; Comparing the grayscale values corresponding to the pixels in the i-th pixel pair to obtain a target grayscale value relationship; determining a first binary character according to the target grayscale value relationship; After all pixel pairs of the reference feature point are traversed, the determined N first binary characters are used to construct a character string to obtain a first binary character string, and the first binary character string is used to determine a binary descriptor of the reference feature point.
3. The method according to claim 2, characterized in that Any pixel pair includes a first pixel and a second pixel; and determining a first binary character according to the target grayscale value relationship includes: If the target grayscale value magnitude relationship indicates that: the grayscale value corresponding to the corresponding first pixel point is less than the grayscale value corresponding to the corresponding second pixel point, then the first value is determined as a first binary character; If the target grayscale value magnitude relationship indicates that the grayscale value corresponding to the corresponding first pixel point is greater than or equal to the grayscale value corresponding to the corresponding second pixel point, the second value is determined as a first binary character.
4. The method according to claim 1, characterized in that The attribute information of any pixel pair includes: the grayscale value corresponding to each pixel in the any pixel pair; the reference feature point is described according to the attribute information of each pixel pair of the reference feature point under multiple feature point description dimensions to obtain H binary descriptors of the reference feature point, including: Under the second feature point description dimension, determine the grayscale value of the reference feature point, and traverse each pixel pair of the reference feature point to determine the i-th pixel pair currently traversed, i∈[1,N]; Determine grayscale value comparison information between the reference feature point and each pixel in the i-th pixel pair according to the magnitude relationship between each grayscale value in the attribute information of the i-th pixel pair and the grayscale value of the reference feature point; Performing consistency detection on each determined gray value comparison information, and determining a second binary character according to the consistency detection result; After all pixel pairs of the reference feature point are traversed, the determined N second binary characters are used to construct a character string to obtain a second binary character string, and the second binary character string is used to determine a binary descriptor of the reference feature point.
5. The method according to claim 4, characterized in that The determining, according to the magnitude relationship between each grayscale value in the attribute information of the i-th pixel pair and the grayscale value of the reference feature point, grayscale value comparison information between the reference feature point and each pixel in the i-th pixel pair comprises: For any pixel of the i-th pixel pair, if the grayscale value corresponding to the any pixel is less than the grayscale value of the reference feature point, the third value is determined as grayscale value comparison information between the reference feature point and the any pixel; If the grayscale value corresponding to any pixel point is greater than or equal to the grayscale value of the reference feature point, the fourth value is determined as grayscale value comparison information between the reference feature point and any pixel point.
6. The method according to claim 1, characterized in that The step of performing direction detection on the gradient of each pixel in the i-th pixel pair in a preset direction to obtain gradient direction indication information of each pixel in the i-th pixel pair in the preset direction includes: For any pixel point in the i-th pixel point pair, compare the gradient of the any pixel point in a preset direction with a reference gradient; If the gradient of any pixel point in the preset direction is greater than the reference gradient, a fifth value used to indicate the positive gradient direction is determined as the gradient direction indication information of any pixel point in the preset direction; If the gradient of any pixel point in the preset direction is less than or equal to the reference gradient, a sixth value used to indicate the direction of the negative gradient is determined as the gradient direction indication information of any pixel point in the preset direction.
7. The method according to claim 1, characterized in that A viewing angle is described by a longitude angle and a latitude angle; the method comprises: Get the target image; Sampling the target image in the longitude direction and the latitude direction according to the tilt factor to obtain one or more sampling results; one sampling result includes: a longitude angle and a latitude angle; Using each of the one or more sampling results respectively, perform affine transformation on the target image to obtain one or more images; The one or more images are used to construct an affine transformation space of the target image.
8. The method according to claim 7, characterized in that The target image is marked with a plurality of image boundary corner points; Each image in the affine transformation space includes: target boundary corner points corresponding to each image boundary corner point; The method further comprises: According to each target boundary corner point in each image in the affine transformation space, identifying a valid image area in each image; wherein the valid image area refers to an image area containing all or part of the image content of the target image; Based on the effective image area in each image, construct a mask image of each image respectively; wherein the mask image refers to an image used to indicate the effective image area; The mask images of the respective images are stored.
9. The method according to claim 8, characterized in that The performing feature point detection on the reference image to obtain reference feature points includes: Acquire a mask image of the reference image from the stored mask images, and determine a valid image area from the reference image based on the mask image of the reference image; Feature point detection is performed on the determined effective image area to obtain reference feature points.
10. The method according to claim 9, characterized in that The number of the reference feature points is M, where M is a positive integer; the step of performing feature point detection on the determined effective image area to obtain reference feature points includes: Cutting out the determined effective image area from the reference image to obtain a regional image; Constructing a multi-scale space of the region image, wherein the multi-scale space includes: a plurality of scale images obtained by performing multi-scale changes on the region image; A feature point detector is used to perform feature point detection on each scale image in the multi-scale space to obtain M reference feature points.
11. The method according to any one of claims 8 to 10, characterized in that: The identifying, according to each target boundary corner point in each image in the affine transformation space, a valid image area in each image comprises: For any image in the affine transformation space, determine a target image area occupied by all image contents of the target image in the any image according to positions of each target boundary corner point in the any image; Traversing each region boundary line of the target image region, and for a current region boundary line currently traversed, drawing a new region boundary line in the target image region that is parallel to the current region boundary line according to a preset boundary distance value; After all the region boundary lines are traversed, the region formed by the new region boundary lines drawn is determined as the valid image region of any one of the images.
12. The method according to claim 1, characterized in that The target image refers to any one of the two frames of images in the large viewing angle sequence image that need to perform feature point matching, and the large viewing angle sequence image refers to an image that meets the following conditions: it contains multiple frames of images arranged in sequence, and the viewing angle difference between two adjacent frames of images is greater than the target threshold; The method further comprises: Obtain a binary feature descriptor of a target feature point of another image other than the target image in the two frames of images; According to the similarity between the binary feature descriptor of the target image and the binary feature descriptor of the other image, a matching process is performed on the target feature points of the target image and the target feature points of the other image to obtain a feature point matching result between the target image and the other image.
13. An image processing device, characterized in that: include: An acquisition unit, configured to acquire a reference image from an affine transformation space of a target image, wherein the affine transformation space includes: one or more images obtained by simulating a change in viewing angle of the target image, wherein the reference image is one of the images in the affine transformation space; A processing unit, configured to perform feature point detection on the reference image to obtain reference feature points; and perform pixel sampling in the neighborhood of the reference feature points to obtain N pixel pairs of the reference feature points, where N is a positive integer; The processing unit is further configured to describe the reference feature point according to the attribute information of each pixel point pair of the reference feature point under multiple feature point description dimensions to obtain H binary descriptors of the reference feature point, where H is a positive integer; The processing unit is further used to integrate the H binary descriptors of the reference feature point to obtain the binary feature descriptor of the reference feature point; wherein, when the attribute information of any pixel pair includes: the gradient of each pixel in any pixel pair in a preset direction, the process of obtaining the H binary descriptors of the reference feature point includes: under the third feature point description dimension, traversing each pixel pair of the reference feature point, and determining the i-th pixel pair currently traversed, i∈[1,N]; performing direction detection on the gradient of each pixel in the i-th pixel pair in a preset direction to obtain the gradient direction indication information of each pixel in the i-th pixel pair in the preset direction; performing consistency detection on the obtained gradient direction indication information, and determining a third binary character according to the consistency detection result; after all pixel pairs of the reference feature point are traversed, using the determined N third binary characters to construct a character string to obtain a third binary character string, and determining a binary descriptor of the reference feature point by the third binary character string; The processing unit is also used to map the reference feature points to the target image by performing inverse perspective transformation on the reference feature points to obtain target feature points of the target image; and use the binary feature descriptors of the reference feature points as the binary feature descriptors of the target feature points to perform feature point matching on the target image based on the binary feature descriptors.
14. A computer device comprising an input interface and an output interface, characterized in that: Also includes: a processor adapted to implement one or more instructions; as well as, A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the image processing method according to any one of claims 1 to 12.
15. A computer storage medium, characterized in that The computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the image processing method according to any one of claims 1-12.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the image processing method according to any one of claims 1 to 12 is implemented.
