Image processing methods, apparatus, electronic devices and readable storage media
By dynamically adjusting the number of feature points to adapt to the current scene, the problem of mismatch in the number of matching pairs in image processing is solved, thus improving processing speed and quality.
Patent Information
- Application Number
- CN202210307240.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-03-25
AI Technical Summary
In existing image processing technologies, the number of matching pairs is often too large or too small during feature point extraction and matching, which affects processing speed and quality.
By obtaining the number of matching pairs and feature points of historical image pairs that have completed image matching in the target image sequence, the number of feature points is adjusted according to a preset range, and the feature point extraction method is dynamically adjusted to adapt to the current scene and reduce the number of matching pairs being too many or too few.
It achieves improved processing speed while ensuring the quality of matching results, adapts to feature point extraction and matching in different scenarios, and reduces the mismatch in the number of matching pairs.
Smart Images

Figure CN114663813B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to an image processing method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] In some image processing tasks, feature point extraction and matching are performed on image pairs within a video or image pairs from multiple captured frames to obtain matching pairs. These matching pairs are then used for target tracking or 3D reconstruction. Currently, for image sets, feature point extraction and matching typically involves extracting feature points based on a fixed value or maximizing the number of feature points for the current image pair, and then performing matching based on the extracted feature points. This approach can easily result in too many or too few matching pairs. Too many matching pairs indicate a large workload for feature point extraction and can negatively impact subsequent processing speed; too few matching pairs result in poor matching results, affecting the quality of the final processing outcome. Therefore, reducing the number of matching pairs has become a pressing technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0003] This application provides an image processing method, apparatus, electronic device, and readable storage medium that can reduce the number of matching pairs being too many or too few compared to the current scene, so as to ensure both the quality of the matching results and the speed at which the matching results are obtained.
[0004] The embodiments of this application can be implemented as follows:
[0005] In a first aspect, embodiments of this application provide an image processing method, the method comprising:
[0006] The number of historical matching pairs corresponding to at least one historical image pair that has completed image matching in the target image sequence is obtained, and the number of first feature points corresponding to the last frame historical image in the historical image pair is obtained.
[0007] Based on whether the number of each historical matching pair is within the preset number of matching pairs, the target processing method corresponding to the number of the first feature points is determined, wherein the number of matching pairs that the target processing method expects to obtain is within the preset number of matching pairs.
[0008] The number of second feature points is determined based on the target processing method and the number of the first feature points;
[0009] Based on the second number of feature points, feature points are extracted from the image pair to be processed, and feature point matching is performed to obtain a target matching pair, wherein the image pair to be processed is an image in the target image sequence.
[0010] Secondly, embodiments of this application provide an image processing apparatus, the apparatus comprising:
[0011] The information acquisition module is used to obtain the number of historical matching pairs corresponding to at least one historical image pair that has completed image matching in the target image sequence, and to obtain the number of first feature points corresponding to the last frame historical image in the historical image pair.
[0012] The method determination module is used to determine the target processing method corresponding to the number of the first feature points based on whether the number of each historical matching pair is within a preset number of matching pairs, wherein the number of matching pairs that the target processing method expects to obtain is within the preset number of matching pairs.
[0013] The quantity determination module is used to determine the quantity of the second feature points based on the target processing method and the quantity of the first feature points;
[0014] The first processing module is used to extract feature points from the image pair to be processed according to the second number of feature points, and to perform feature point matching to obtain a target matching pair, wherein the image pair to be processed is an image in the target image sequence.
[0015] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the image processing method described in the foregoing embodiments.
[0016] Fourthly, embodiments of this application provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image processing method as described in the foregoing embodiments.
[0017] The image processing method, apparatus, electronic device, and readable storage medium provided in this application embodiment, for historical image pairs in a target image sequence where image matching has been completed, obtains the number of historical matching pairs corresponding to each historical image pair in at least one historical image pair, and obtains the number of first feature points corresponding to the last frame historical image in the at least one historical image pair; based on whether the obtained number of each historical matching pair is within a preset number of matching pairs, determines the target processing method corresponding to the number of first feature points, wherein the number of matching pairs expected to be obtained by the target processing method is within the preset number of matching pairs, and then determines the number of second feature points based on the target processing method and the number of first feature points; then, based on the number of second feature points, performs feature point extraction and matching on the image pairs to be processed in the target image sequence, thereby obtaining the target matching pairs corresponding to the image pairs to be processed. In this way, based on the number of significant features in the current scene as reflected by at least one number of historical matching pairs, the number of first feature points used in the acquisition process of the last number of historical matching pairs can be processed to obtain the number of feature points determined based on the current scene. Then, feature point extraction and matching can be performed based on this number of feature points, thereby reducing the situation where the number of matching pairs is too high or too low compared to the current scene. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A block diagram illustrating an electronic device provided in an embodiment of this application;
[0020] Figure 2 This is one of the schematic flowcharts of the image processing method provided in the embodiments of this application;
[0021] Figure 3 for Figure 2 A flowchart illustrating one of the sub-steps included in step S120;
[0022] Figure 4 for Figure 2 A flowchart illustrating one of the sub-steps included in step S140;
[0023] Figure 5 A second schematic flowchart illustrating the image processing method provided in this application embodiment;
[0024] Figure 6The third schematic flowchart of the image processing method provided in the embodiments of this application;
[0025] Figure 7 This is one of the block diagrams of an image processing apparatus provided in an embodiment of this application;
[0026] Figure 8 This is a second block diagram of an image processing apparatus provided in an embodiment of this application.
[0027] Icons: 100 - Electronic device; 110 - Memory; 120 - Processor; 130 - Communication unit; 200 - Image processing device; 210 - Information acquisition module; 220 - Mode determination module; 230 - Quantity determination module; 240 - First processing module; 250 - Second processing module. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0029] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0030] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0031] Currently, when performing target tracking or 3D reconstruction tasks on image sequences, feature point extraction and matching are required to obtain matching pairs. Then, tracking or 3D reconstruction is performed based on these matching pairs. In particular, 3D reconstruction tasks typically involve extracting image feature points from the input image data, then performing inter-frame feature matching to build data associations between frames, and finally constructing motion constraints and reconstructing the 3D structure based on these data associations.
[0032] In practical tasks, the number of image feature points is set once before the task begins and remains unchanged during the task. That is, after feature point extraction for one image pair, the number of feature points to use for feature extraction on another image pair is not set separately. In offline tasks, a default number of feature points is typically used, maximizing the number of feature points; that is, all extractable feature points from the image pair are extracted. In real-time tasks, multiple scene types are usually tested to select a reasonable threshold K that is effective for as many scenarios as possible. Then, during task execution, K feature points are extracted each time.
[0033] The above methods extract feature points based on either a default number of feature points or a preset fixed threshold K. For real-time tasks, using the default number of feature points is wasteful. While it ensures smooth task execution, it is extremely time-consuming, significantly impacting real-time performance and potentially leading to an excessive number of matching pairs. Extracting feature points based on a preset fixed threshold K (i.e., extracting K feature points) is difficult to achieve across all scenarios. Using a larger threshold, while ensuring the quality of the task results, significantly impacts computational efficiency and can easily result in an excessive number of matching pairs. Conversely, using a smaller threshold can achieve higher computational efficiency but may result in too few matching pairs, leading to suboptimal task execution results.
[0034] To address the above situation, embodiments of this application provide an image processing method, apparatus, electronic device, and readable storage medium. Based on at least one number of historical matching pairs, it determines whether to increase or decrease the number of feature points used in the acquisition process of the last historical matching pair in the at least one number of historical matching pairs, thereby achieving adaptive dynamic adjustment of the number of feature points across the entire scene. This reduces the situation where the number of matching pairs is too large or too small compared to the current scene due to the mismatch between the number of feature points and the current scene.
[0035] It is worth noting that the defects of the above solutions are the result of the inventors' practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the inventors in the embodiments of this application below are all contributions made by the inventors to this application.
[0036] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0037] Please refer to Figure 1 , Figure 1 This is a block diagram of an electronic device 100 provided in an embodiment of this application. The electronic device 100 may be, but is not limited to, a computer, a server, a ground station for processing data from a drone, etc. The electronic device 100 may include a memory 110, a processor 120, and a communication unit 130. The memory 110, processor 120, and communication unit 130 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0038] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0039] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, the memory 110 stores an image processing device 200, which includes at least one software function module that can be stored in the memory 110 in the form of software or firmware. The processor 120 executes various functional applications and data processing by running the software programs and modules stored in the memory 110, such as the image processing device 200 in the embodiments of this application, thereby implementing the image processing method in the embodiments of this application.
[0040] The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through the network, and to send and receive data through the network.
[0041] It should be understood that, Figure 1 The structure shown is only a schematic diagram of the electronic device 100. The electronic device 100 may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.
[0042] Please refer to Figure 2 , Figure 2 This is one of the schematic flowcharts of an image processing method provided in an embodiment of this application. The method can be applied to the aforementioned electronic device 100. The specific flow of the image processing method is described in detail below. In this embodiment, the image processing method may include steps S110 to S140.
[0043] Step S110: Obtain the number of historical matching pairs corresponding to at least one historical image pair that has completed image matching in the target image sequence, and obtain the number of first feature points corresponding to the last frame of the historical image pair.
[0044] In this embodiment, the target image sequence can be the image sequence to be processed corresponding to a certain image processing task. The target image sequence may include multiple frames of images. The target video can be real-time video, a complete video that has been obtained in advance, multiple frames of images extracted from a video, or multiple frames of images obtained through shooting, etc. It is understood that when the target image sequence is a real-time video or includes images captured in real time, the image processing task is a real-time task; when the target video is a complete video that has been obtained in advance or includes images that have already been acquired, the image processing task is an offline task. For example, when the image processing task is a 3D reconstruction task, a drone can be used to acquire video of the scene to be reconstructed in real time, and the 3D reconstruction task is a real-time 3D reconstruction task; when the target image sequence is a complete video acquired in advance by a drone, the 3D reconstruction task is an offline 3D reconstruction task. The specific details of the target image sequence can be set according to actual needs.
[0045] During the execution of the image processing task (i.e., processing the target image sequence), the number of historical matching pairs corresponding to at least one historical image pair that has completed image matching in the target image sequence during this process can be obtained. The historical image pair refers to the image pairs in the target image sequence that have completed image matching. The at least one historical image pair is at least a subset of the image pairs in the target image sequence that have completed image matching. The specific number of the at least one historical image pair can be set according to actual needs; for example, setting it to 3 means that 3 matching pairs can be obtained from the multiple matching pairs obtained through image matching corresponding to the target image sequence as the 3 historical matching pairs. In this way, at least one historical matching pair can be obtained.
[0046] Image matching includes feature point extraction and matching. Feature point extraction and matching is used to extract image feature points from a pair of images and then perform feature point matching based on the extracted feature points to obtain matched feature point pairs (i.e., matching pairs). The feature points can be, but are not limited to, SIFT (Scale-Invariant Feature Transform) feature points, SURF (Speeded-Up Robust Features) feature points, ORB (Oriented FAST and Rotated BRIEF) feature points, HOG (Histogram of Oriented Gradient) feature points, or LBP (Local Binary Patterns) feature points, etc., which can be set according to actual needs. It is understood that when performing feature point extraction and matching on a pair of images, the number of corresponding feature points in the two images of that pair is the same during the feature point extraction process; that is, the number of feature points extracted from the two images of the pair is the same.
[0047] It is also possible to obtain the number of first feature points corresponding to the last frame of the at least one historical image pair. Here, the number of first feature points represents the number of feature points used when extracting feature points from the last frame of the at least one historical image pair, that is, the number of feature points corresponding to the last historical image pair in the at least one historical image pair.
[0048] For example, according to the order of the image pairs in the target image sequence, the number of historical matching pairs for each of the three historical image pairs n, n+1, and n+2 can be obtained. The number of feature points used in the feature point extraction process of the last historical image pair n+2 among these three historical image pairs can also be used as the first number of feature points.
[0049] Step S120: Determine the target processing method corresponding to the number of the first feature points based on whether the number of each historical matching pair is within the preset number of matching pairs.
[0050] The system can determine whether the number of historical matching pairs reflects too many or too few historical matching pairs based on whether the number of each historical matching pair is within the preset range of the number of matching pairs. Then, the target processing method corresponding to the number of the first feature points can be determined based on the determination result.
[0051] The preset range of matching pairs can be set based on experimental results from multiple scenarios, taking into account both real-time performance and the quality of image processing results. The upper limit of this preset range can be less than the number of feature points obtained by maximizing the number of feature points. If the historical matching pair count is too high, it indicates that there are many significant features in the current scene; if the historical matching pair count is too low, it indicates that there are few significant features in the current scene. The specific method for determining the judgment result can be set according to actual needs. The target processing method expects to obtain a number of matching pairs within the preset range.
[0052] If the judgment result does not indicate that the number of matching pairs is too large or too small, it can be considered that the number of the first feature points is suitable for the current scene. In this case, it can be assumed that the target processing method corresponding to the number of the first feature points remains unchanged, that is, it is not necessary to increase or decrease the number of the first feature points.
[0053] If the judgment result indicates that the number of matching pairs is too large or too small, it can be considered that the number of the first feature points is not suitable for the current scene. In this case, the target processing method corresponding to the number of the first feature points can be considered to be increasing or decreasing, that is, the number of the first feature points needs to be increased or decreased so that feature point extraction and matching can be performed based on the adjusted number of the first feature points, thereby reducing the occurrence of too many or too few matching pairs in the future.
[0054] Step S130: Determine the number of second feature points based on the target processing method and the number of the first feature points.
[0055] Step S140: Extract feature points from the image pair to be processed according to the second number of feature points, and perform feature point matching to obtain the target matching pair.
[0056] Based on the target processing method and the number of the first feature points, a second number of feature points determined according to the current scene can be obtained. Then, in this feature point extraction and matching, feature point extraction and matching can be performed on the image pair to be processed according to the second number of feature points to obtain the target matching pair of the image pair to be processed. The image pair to be processed is an image from the target image sequence.
[0057] This application embodiment can process the number of first feature points used in the acquisition process of the last historical matching pair in the obtained historical matching pair number based on the number of significant features in the current scene reflected by at least one historical matching pair number, thereby obtaining the number of feature points determined based on the current scene, and then performing feature point extraction and matching based on the number of feature points, thereby reducing the situation where the number of matching pairs is too large or too small compared to the current scene's requirement for the number of matching pairs.
[0058] Optionally, in step S110, the number of at least one historical matching pairs obtained may include multiple historical matching pairs or only one historical matching pair. This number of at least one historical matching pairs may include the number of matching pairs obtained in the previous image matching, where the first feature point count is the number of feature points used during feature point extraction in the previous image matching. The previous image matching refers to the image matching of the target image sequence that is most recent to the present and whose start time is before the present, and that image matching has been completed. This facilitates timely determination of the feature point count based on the scene.
[0059] Optionally, the number of matching pairs obtained in each of the n1 consecutive feature point extractions and matchings can be used as the number of at least one historical matching pairs obtained in step S110. Alternatively, the number of at least one historical matching pairs can be obtained through sampling. The number of at least one historical matching pairs and the specific selection (i.e., which historical matching pairs to select) can be set according to actual needs. For example, the number of matching pairs obtained in the most recent multiple completed image matchings can be selected as the number of at least one historical matching pairs.
[0060] Alternatively, as a possible implementation, the target processing method can be quickly determined in the following manner.
[0061] The number of at least one historical matching pair is one, for example, the number of matching pairs obtained in the previous feature point extraction and matching (i.e., the current previous image matching). The upper limit of the preset matching pair number range is the preset maximum matching pair number Matches_Max, and the lower limit of the preset matching pair number range is the preset minimum matching pair number Matches_Min. The number of historical matching pairs can be compared with the preset maximum matching pair number Matches_Max and the preset minimum matching pair number Matches_Min, respectively.
[0062] If the number of historical matching pairs is greater than the preset maximum number of matching pairs Matches_Max, it can be considered that the number of matching pairs is too large compared to the current scene. The current scene has many significant features. In order to reduce the amount of computation, it is necessary to reduce the number of feature points. At this time, it can be determined that the target processing method corresponding to the first number of feature points is to reduce.
[0063] If the number of historical matching pairs is less than the preset minimum number of matching pairs Matches_Min, it can be considered that the number of matching pairs is too small compared to the current scene, and there are no significant features in the current scene. In order to ensure the smooth progress of the image processing task, it is necessary to increase the number of feature points. At this time, it can be determined that the target processing method corresponding to the first number of feature points is to increase.
[0064] If the number of historical matching pairs is between the preset minimum number of matching pairs Matches_Min and the preset maximum number of matching pairs Matches_Max, then it can be considered that the number of matching pairs is neither too much nor too little compared to the current scenario, and it can be determined that the target processing method corresponding to the number of the first feature points remains unchanged.
[0065] Alternatively, to enhance robustness, the target processing method can also be determined in another possible manner as follows. Please refer to... Figure 3 , Figure 3 for Figure 2 A flowchart illustrating one sub-step included in step S120. In this embodiment, the at least one number of historical matching pairs includes multiple numbers of historical matching pairs, that is, the number of historical matching pairs obtained in step S110 is multiple, and step S120 may include sub-steps S121 to S124.
[0066] Sub-step S121: Based on the preset maximum number of matching pairs, the preset minimum number of matching pairs, and the obtained number of historical matching pairs, obtain the first number of times the number of historical matching pairs is continuously greater than the preset maximum number of matching pairs and the second number of times the number of historical matching pairs is continuously less than the preset minimum number of matching pairs.
[0067] The obtained number of historical matching pairs includes multiple historical matching pairs arranged in chronological order. Each historical matching pair can be compared sequentially with the preset maximum number of matching pairs (Matches_Max) and the preset minimum number of matching pairs (Matches_Min) to obtain a comparison result. Then, based on the comparison results corresponding to each historical matching pair, the first number of times the number of historical matching pairs is consecutively greater than the preset maximum number of matching pairs (Matches_Max) and the second number of times the number of historical matching pairs is consecutively less than the preset minimum number of matching pairs (Matches_Min) are obtained.
[0068] For example, the number of historical matching pairs arranged in chronological order are: A1, A2, A3, and A4, where the feature point extraction time corresponding to A4 is closest to the current time, and the feature point extraction time corresponding to A1 is furthest from the current time. If only A4 of the above four historical matching pairs is greater than the preset maximum number of matching pairs Matches_Max, then the first count can be determined to be 1; if A3 and A4 are both greater than the preset maximum number of matching pairs Matches_Max, then the first count can be determined to be 2.
[0069] Sub-step S122: If the first number of times reaches a preset number of times, determine that the target processing method corresponding to the number of the first feature points is to reduce.
[0070] The preset number of times K is equal to the number of historical matching pairs obtained. For example, if 3 historical matching pairs are obtained in step S110, the preset number of times K can be set to 3.
[0071] Sub-step S123: When the second number of times reaches the preset number of times, determine that the target processing method corresponding to the number of the first feature points is to increase.
[0072] Sub-step S124: If neither the first count nor the second count reaches the preset count, determine that the target processing method corresponding to the number of the first feature points remains unchanged.
[0073] Based on the number of K historical matching pairs, if it is determined that the number of matching pairs detected is less than the preset minimum number of matching pairs (Features_Min) or greater than the preset maximum number of matching pairs (Features_Max) for K consecutive times, then the number of the first feature points needs to be increased or decreased. Conversely, it can be determined that the number of the first feature points does not need to be adjusted.
[0074] If the target processing method is determined to remain unchanged, the number of the first feature points can be directly used as the number of the second feature points. If the processing method is to increase or decrease, the number of the second feature points can be determined according to the corresponding adjustment method and the number of the first feature points.
[0075] Optionally, as a possible implementation, if the target processing method is reduction, the number of the first feature points can be reduced by a first preset step size to obtain the number of the second feature points. The first preset step size can be set according to actual needs. This allows for a gradual reduction of the number of the first feature points, avoiding poor quality of subsequent processing results due to a too rapid reduction in the number of the first feature points.
[0076] Alternatively, the number of first feature points can be quickly reduced based on data differences in the actual scenario to achieve the adjustment goal rapidly. For example, based on the difference between the number of the last historical matching pair among the obtained at least one historical matching pair counts and the preset range of matching pair counts, the number of first feature points can be reduced to obtain the number of second feature points. The specific degree of reduction can be set according to actual needs. For example, different reduction values corresponding to different difference ranges can be preset, with larger differences resulting in larger reduction values. The target reduction value can be determined based on the difference between the number of the last historical matching pair at this time and the maximum value of the preset range of matching pair counts. Then, the number of first feature points can be reduced based on this target reduction value to obtain the second feature points.
[0077] Similarly, the number of the first feature points can be reduced based on the difference between the first number of feature points and a preset range of feature point numbers to obtain the second number of feature points. The preset range of feature point numbers can be a value pre-set based on requirements. For example, the reduction value used to reduce the number of the first feature points can be determined based on the difference between the first number of feature points and the minimum value of the preset range of feature point numbers. The greater the difference between the first number of feature points and the minimum value of the preset range of feature point numbers, the greater the reduction in the number of the first feature points.
[0078] Optionally, as a possible implementation, if the target processing method is to increase, the number of the first feature points can be increased by a second preset step size to obtain the second number of feature points. The second preset step size is greater than the first preset step size. In this way, by rapidly increasing the number of feature points, a sufficient number of matching pairs can be quickly obtained, avoiding poor quality of subsequent processing results due to an insufficient number of matching pairs.
[0079] Similarly, the number of first feature points can be quickly increased based on data differences in the actual scenario to achieve the adjustment goal quickly. For example, the number of first feature points can be increased based on the difference between the number of the last historical matching pairs and the preset range of matching pairs, or based on the difference between the number of first feature points and the preset range of feature points, to obtain the number of second feature points.
[0080] For example, the increase in the number of the first feature points can be determined based on the difference between the number of the last historical matching pairs and the minimum value of the preset range of matching pairs, or based on the difference between the number of the first feature points and the maximum value of the preset range of feature points, thereby determining the number of the second feature points. The greater the difference, the greater the increase.
[0081] To avoid situations where feature point extraction becomes excessively time-consuming or results in an insufficient number of extracted feature points, negatively impacting subsequent processing, a preset range for the number of feature points can be set in advance, based on experimental results from multiple scenarios, while balancing real-time performance and the quality of image processing results. The upper limit of this preset range is the maximum preset number of feature points (Features_Max), and the lower limit is the minimum preset number of feature points (Features_Min).
[0082] When the target processing method indicates that the number of the first feature points needs to be adjusted, i.e., when the target processing method is to increase or decrease, it can be determined whether the number of the first feature points is adjustable based on the preset feature point number range. If the number of the first feature points is adjustable, within the preset feature point number range, the number of the first feature points is increased or decreased according to the target processing method to obtain the second feature point number, wherein both the first and second feature point numbers are within the preset feature point number range. This avoids situations where feature point extraction is extremely time-consuming or results in an insufficient number of extracted feature points, affecting subsequent processing.
[0083] Specifically, when the target processing method is to increase, if the number of the first feature points is equal to the preset maximum number of feature points (Features_Max), then the number of the first feature points is determined to be fixed, and the current number of the first feature points (i.e., the preset maximum number of feature points (Features_Max)) can be directly used as the number of the second feature points. When the target processing method is to increase, if the number of the first feature points is less than the preset maximum number of feature points (Features_Max), then the number of the first feature points is determined to be adjustable, and the increased value is calculated. If the increased value is greater than the preset maximum number of feature points (Features_Max), then the preset maximum number of feature points (Features_Max) is used as the number of the second feature points; if the increased value is not greater than the preset maximum number of feature points (Features_Max), then the increased value is used as the number of the second feature points.
[0084] Similarly, when the target processing method is reduction, if the number of the first feature points is the preset minimum number of feature points (Features_Min), it can be determined that the number of the first feature points is not adjustable, and the number of the first feature points at this time (i.e., the preset maximum number of feature points (Features_Max)) can be directly used as the number of the second feature points. When the target processing method is reduction, if the number of the first feature points is greater than the preset minimum number of feature points (Features_Min), it can be determined that the number of the first feature points is adjustable, and the reduced value is calculated. If the reduced value is less than the preset minimum number of feature points (Features_Min), then the preset minimum number of feature points (Features_Min) is used as the number of the second feature points; if the reduced value is not less than the preset minimum number of feature points (Features_Min), then the reduced value is used as the number of the second feature points.
[0085] Wherein, within the range of the preset number of feature points, when the number of second feature points is obtained according to the first preset step size or the second preset step size, the first preset step size and the second preset step size can be set according to the range of the preset number of feature points. For example, the first preset step size is: The second preset step size is:
[0086] Optionally, in one possible implementation, feature point extraction can be performed using a pre-defined multi-level feature extractor. This multi-level feature extractor includes multiple levels of feature extractors, each level capable of extracting a corresponding number of feature points. Each level of feature extractor corresponds to a specific number of feature points, with different levels yielding different numbers. For example, a level 1 feature extractor might extract 1000 feature points, while a level 2 feature extractor might extract 2000 feature points. The first number of feature points can be the number of feature points extracted by a particular level of feature extractor, i.e., the number of feature points that a particular level of feature extractor can extract.
[0087] The number of feature points extracted by each level of the multi-level feature extractor can be determined based on the preset range of feature point numbers. For example, if the multi-level feature extractor is a 5-level feature extractor and the preset range of feature point numbers is 6000 to 10000, then the feature point extraction numbers for the 5 levels can be set as follows: 6000, 7000, 8000, 9000, and 10000, respectively. That is, the difference in the number of feature points extracted between adjacent levels is:
[0088] In the method of feature point extraction using the multi-level feature extractor, the first level of the feature extractor corresponding to the last historical image in the historical image pair can be obtained from the multi-level feature extractor. The number of feature points that the first-level feature extractor can extract is the first number of feature points. That is, the level at which the multi-level feature extractor is used is obtained in the process of obtaining the number of the last historical matching pair in the at least one number of historical matching pairs. Then, a second-level feature extractor can be selected from the multi-level feature extractor according to the target processing method. The number of feature points that the second-level feature extractor can extract is the second number of feature points. Subsequently, feature points can be extracted from the image pair to be processed using the second-level feature extractor.
[0089] Optionally, when the first level is the optimal level corresponding to the target processing method, the first level is used as the second level; when the first level is not the optimal level corresponding to the target processing method, a level different from the first level is selected from the multi-level feature extractor as the second level according to the target processing method. The optimal level corresponding to the target processing method can be determined based on that target processing method.
[0090] For example, when the target processing method is to increase, the optimal level corresponding to the target processing method is the level of the feature extractor with the highest number of feature points extracted among the multi-level feature extractors. In this case, if the first level is not the optimal level corresponding to the target processing method, that is, it is not the level of the feature extractor with the highest number of feature points extracted, then the level of a feature extractor with a greater number of feature points extracted than the first feature point can be used as the second level. Conversely, if the first level is the level of the feature extractor with the highest number of feature points extracted, then the first level is used as the second level.
[0091] When the target processing method is reduction, the optimal level corresponding to the target processing method is the level of the feature extractor with the fewest feature points extracted among the multi-level feature extractors. In this case, if the first level is not the optimal level corresponding to the target processing method, that is, it is not the level of the feature extractor with the fewest feature points extracted, then the level of a feature extractor with fewer feature points extracted than the first feature point can be used as the second level. Conversely, if the first level is the level of the feature extractor with the fewest feature points extracted, then the first level is used as the second level.
[0092] When the target processing method remains unchanged, the first level can be directly used as the second level.
[0093] Alternatively, as a possible implementation, if the target processing method indicates that the number of the first feature points needs to be increased or decreased, the second level can be determined in the following manner.
[0094] When the target processing method is reduction, it can be determined whether the first level is the smallest level in the multi-level feature extraction to determine whether the first level can be reduced. If the first level is not the smallest level in the multi-level feature extraction, it can be determined that the first level can be reduced, and the next level after the first level in the multi-level feature extractor is taken as the second level. In this case, the number of feature points that the feature extractor of the second level can extract is less than the number of feature points of the first level. If the first level is the smallest level in the multi-level feature extraction, it can be determined that the first level cannot be reduced, and the first level can be directly taken as the second level. Thus, the aggressive feature point extraction of the second level of the multi-level feature extractor can be used subsequently.
[0095] When the target processing method is increased, the level to which the first level belongs can be determined based on the correspondence between the multiple levels included in the multi-level feature extractor and the corresponding levels, and the level to which the first level belongs can be used as the first level. Each level includes at least one level, and at least one level includes multiple levels. Each level corresponds to a target level, which is one of the at least one levels included in that level. The total number of levels can be set according to requirements.
[0096] The basic principle regarding the relationship between grade and level can be expressed by the following formula:
[0097]
[0098] Where i represents the first level corresponding to the first number of feature points, N represents the number of levels of the multi-level feature selector, and K1 represents the number of feature points extracted corresponding to the target level.
[0099] The following examples illustrate the relationship between grade and level.
[0100] For example, an N-level feature extractor includes three levels. Assuming that as the level ID of the feature extractor increases, the number of feature points that the corresponding ID can extract increases, level 1 includes level IDs ID1 and ID2, with a target level of ID1; level 2 includes level IDs ID3 and ID4, with a target level of ID4; and level 3 includes level IDs ID5 and ID6, with a target level of ID6. The number of feature points that ID1 can extract can be a preset minimum number of feature points (Features_Min), and the number of feature points that ID6 can extract can be a preset maximum number of feature points (Features_Max).
[0101] When the target processing method is to increase, it can be first determined whether the first level is the highest level in the multi-level feature extractor. If the first level is not the highest level in the multi-level feature extractor, the target level corresponding to the level above the first level can be taken as the second level. In this case, the number of feature points that the feature extractor of the second level can extract is greater than the number of feature points of the first level.
[0102] For example, continuing with the above example regarding tiers, if the first level is ID1, belonging to tier 1, and since tier 1 is not the highest tier 3, then the target level of tier 2, which is the tier above tier 1, can be used as the second level, i.e., ID4. This increases the number of first feature points to the number of feature points that the feature extractor of ID4 can extract. If the first level is ID3, belonging to tier 2, then the target level of tier 3, which is the tier above tier 2, can be used as the third level, i.e., ID6. This increases the number of first feature points to the number of feature points that the feature extractor of ID6 can extract.
[0103] When the target processing method is to increase, and the first level is the highest level in the multi-level feature extractor, the target level corresponding to the first level can be used as the second level. At this time, the number of feature points that the feature extractor of the second level can extract may be greater than the number of the first feature points, or it may be equal to the number of the first feature points.
[0104] For example, following the example of the tiers above, if the first level is ID5 or ID6, which belongs to tier 3, and since tier 3 is already the highest tier, then the target level ID3 corresponding to tier 3 can be used as the second level.
[0105] Once the number of the second feature points is determined, a historical image pair can be used as the image pair to be processed. For example, the historical image pair corresponding to the last number of historical matching pairs obtained in step S110 can be used as the image pair to be processed. This helps to ensure the quality of image processing.
[0106] Optionally, image pairs in the target image sequence that have not undergone feature point extraction can also be used as the image pairs to be processed. For example, according to the image order, an image pair in the target image sequence that has not undergone feature point extraction and matching can be used as the image pair to be processed, and feature point extraction can be performed on the image pair to be processed based on the second number of feature points. For example, if images 1-7 and images 1-5 have already undergone feature point extraction and matching, then images 5 and 6 can be used as the image pair to be processed, or images 6 and 7 can be used as the image pair to be processed. In this way, the time consumption for processing the target image sequence can be avoided due to reprocessing image pairs that have already undergone feature point extraction and matching based on the second number of feature points.
[0107] After extracting feature points, feature point matching can be performed. Feature point matching requires a similarity threshold, and matching pairs are found based on this threshold. If the target processing method remains unchanged, the first similarity used in image matching for the last historical image frame can be retained and directly used as the second similarity. Feature point matching is then performed on the feature points extracted based on the second number of feature points according to this second similarity.
[0108] Optionally, in this embodiment, in order to increase the probability of obtaining a suitable number of matching pairs based on the number of second feature points, when the target processing method is adjusted, a second similarity can also be determined based on the target processing method and the first similarity, and feature point matching can be performed based on the second similarity.
[0109] Please refer to Figure 4 , Figure 5 for Figure 4 A flowchart illustrating one of the sub-steps included in step S140. In this embodiment, step S140 may include sub-steps S141 to S143.
[0110] Sub-step S141: If the target processing method indicates that the number of the first feature points needs to be adjusted, determine whether the first similarity value used in image matching of the last frame of historical image is adjustable according to the preset similarity range.
[0111] Sub-step S142: If the first similarity value is adjustable, the first similarity value is increased or decreased to obtain the second similarity value.
[0112] If the target processing method is to increase or decrease, it indicates that the number of the first feature points needs to be adjusted. A higher similarity threshold used in the matching process indicates more stringent matching conditions; a lower similarity threshold indicates more lenient matching conditions. When the scene has no significant features, the matching conditions need to be appropriately relaxed to ensure the task proceeds smoothly; when the scene has many significant features, the matching conditions need to be appropriately tightened to ensure higher task accuracy.
[0113] If the target processing method is to decrease it, it indicates that the scene has no significant features, and the matching conditions need to be relaxed appropriately. In this case, the first similarity needs to be increased. Similarly, if the target processing method is to increase it, it indicates that the scene has many significant features, and the matching conditions need to be tightened appropriately to ensure higher task accuracy.
[0114] Optionally, a preset similarity range can be set based on experimental results from multiple scenarios, while taking into account both real-time performance and the quality of image processing results. The upper limit of this preset similarity range is the preset maximum similarity Ratio_Max, and the lower limit of this preset similarity range is the preset minimum similarity Ratio_Min.
[0115] When the target processing method is reduction, it can be determined whether the first similarity is less than the preset maximum similarity Ratio_Max. If the first similarity is less than the preset maximum similarity Ratio_Max, it can be determined that the first similarity can be increased. When the target processing method is reduction and the first similarity can be increased, the first similarity can be increased within the preset similarity range, and the increased first similarity is used as the second similarity.
[0116] Optionally, similar to the method of slowly reducing the number of feature points, when the target processing method is to reduce and the first similarity can be increased, the first similarity can be increased within the preset similarity range by a third preset step size to obtain the second similarity. The difference between the second similarity and the first similarity is the third preset step size. The third preset step size is: N3 represents the value used when calculating the first preset step size based on the preset range of feature point numbers, where the first preset step size is:
[0117] If the target processing method is to reduce the similarity, and the first similarity is the preset maximum similarity Ratio_Max, then it can be determined that the first similarity cannot be increased. In this case, the first similarity can be directly used as the second similarity.
[0118] When the target processing method is to increase, it can be determined whether the first similarity is greater than the preset minimum similarity Ratio_Min. If the first similarity is greater than the preset minimum similarity Ratio_Min, it can be determined that the first similarity can be reduced. When the target processing method is to increase and the first similarity can be reduced, the first similarity can be reduced within the preset similarity range, and the reduced first similarity can be used as the second similarity.
[0119] Optionally, to quickly reduce the similarity to achieve a suitable number of matching pairs, the similarity can be adjusted in two tiers. The principle behind this method can be expressed by the following formula:
[0120]
[0121] In the above formula, R1 on the left side represents the similarity before adjustment, and R1 on the right side represents the similarity after adjustment.
[0122] When the target processing method is to increase and the first similarity can be decreased, it can be determined whether the first similarity is greater than the median of the preset similarity range. If the first similarity is greater than the median of the preset similarity range, half the difference between the preset maximum similarity and the preset minimum similarity is subtracted from the first similarity to obtain the second similarity. Here, the preset maximum similarity is the upper limit of the preset similarity range, and the preset minimum similarity is the lower limit of the preset similarity range.
[0123] If the first similarity is not greater than the median of the preset similarity range, the preset minimum similarity is taken as the second similarity.
[0124] Thus, when it is necessary to increase the number of first matching feature points, by appropriately relaxing the similarity threshold to obtain more matching pairs, the smooth execution of the task can be guaranteed, and the situation where the task execution effect is poor due to too few matching pairs can be reduced.
[0125] Optionally, similar to increasing or decreasing the number of first feature points based on data differences in actual scenarios, the first similarity can also be increased or decreased within the preset similarity range based on the difference between the number of the last historical matching pair among the obtained historical matching pairs and the preset range of matching pairs, or based on the difference between the number of first feature points and the preset range of feature points. Wherein, the greater the difference, the greater the similarity change value, and the similarity change value represents the difference in similarity before and after adjustment.
[0126] For example, when the target processing method indicates a decrease, the similarity increase value corresponding to the first similarity can be determined based on the difference between the number of the last historical matching pairs and the maximum value of the preset range of matching pairs. Then, the first similarity is increased based on this similarity increase value to obtain the second similarity. The greater the difference, the greater the similarity increase value.
[0127] In this embodiment, the number of feature points and the similarity threshold can be dynamically adjusted according to the scene to achieve multi-scene adaptation.
[0128] Sub-step S143: Perform feature point matching based on the second similarity to obtain the target matching pair.
[0129] Please refer to Figure 5 , Figure 5 This is a second schematic flowchart of the image processing method provided in this application embodiment. In this embodiment, after step S140, the method may further include step S150.
[0130] Step S150: Reconstruct the image based on the obtained target matching pair.
[0131] Optionally, in the 3D reconstruction task, each image pair to be processed in the target image sequence corresponding to the 3D reconstruction task can be processed based on steps S110 to S140, and 3D image reconstruction can be performed after each matching pair is obtained, until the 3D reconstruction task is completed.
[0132] In this embodiment, when extracting feature points based on a multi-level feature extractor, the number of feature points can be granularly controlled according to scene changes, improving the efficiency of 3D reconstruction while ensuring reconstruction quality. Simultaneously, to ensure reliability, in the absence of salient features, the feature selector can perform only three levels of feature point selection (i.e., selecting one from three feature point quantities), thereby quickly obtaining a sufficient number of matching pairs and preventing 3D reconstruction failure due to tracking loss. In scenarios with many salient features, the feature selector can be controlled to gradually reduce the number of feature points, performing robust feature point quantity control to prevent reconstruction failure due to a too rapid reduction in the number of feature points.
[0133] Please refer to Figure 6 , Figure 6 This is a third schematic flowchart of the image processing method provided in this application embodiment. In this embodiment, before step S110, the method may further include step S101.
[0134] Step S101: When initially performing image matching on the target image sequence, image matching is performed based on the preset number of feature points and the preset similarity.
[0135] In this embodiment, when initially processing the target image sequence, such as during the first processing of image pairs in the target image sequence, or during the first to nth processing of image pairs in the target image sequence, initial feature point extraction and matching can be performed based on a pre-set preset number of feature points and a preset similarity. Specifically, the preset number of feature points can be set based on the median of the preset feature point range, and the preset similarity can be set based on the median of the preset similarity range. For example, the median of the preset feature point range can be set as the preset number of feature points, and the median of the preset similarity range can be set as the preset similarity. In this way, initial feature point extraction and matching can be performed while balancing processing speed and processing quality.
[0136] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of the image processing apparatus 200 is given below. Optionally, the image processing apparatus 200 can adopt the above-described... Figure 1 The device structure of the electronic device 100 shown. Further, please refer to... Figure 7 , Figure 7 This is one of the block diagrams of the image processing apparatus 200 provided in the embodiments of this application. It should be noted that the image processing apparatus 200 provided in this embodiment has the same basic principle and technical effects as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The image processing apparatus 200 may include: an information acquisition module 210, a mode determination module 220, a quantity determination module 230, and a first processing module 240.
[0137] The information acquisition module 210 is used to obtain the number of historical matching pairs corresponding to at least one historical image pair that has completed image matching in the target image sequence, and to obtain the number of first feature points corresponding to the last frame historical image in the historical image pair.
[0138] The method determination module 220 is used to determine the target processing method corresponding to the number of the first feature points based on whether the number of each historical matching pair is within a preset number of matching pairs. The target processing method is expected to obtain a number of matching pairs within the preset number of matching pairs.
[0139] The quantity determination module 230 is used to determine the number of second feature points based on the target processing method and the number of the first feature points;
[0140] The first processing module 240 is used to extract feature points from the image pair to be processed according to the second number of feature points, and to perform feature point matching to obtain a target matching pair. The image pair to be processed is an image from the target image sequence.
[0141] Optionally, in this embodiment, the first processing module 240 is further configured to perform image matching based on a preset number of feature points and a preset similarity when initially performing image matching on the target image sequence. The preset number of feature points is set according to the median of the preset feature point number range.
[0142] Please refer to Figure 8 , Figure 8 This is a second block diagram of the image processing apparatus 200 provided in an embodiment of this application. In this embodiment, the image processing apparatus 200 may further include a second processing module 250.
[0143] The second processing module 250 is used to perform image reconstruction based on the obtained target matching pair.
[0144] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory 110 shown is either stored in or embedded in the operating system (OS) of the electronic device 100, and can be used by... Figure 1 The processor 120 executes the program. Meanwhile, the data and program code required to execute the above modules can be stored in the memory 110.
[0145] This application also provides a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the image processing method described above.
[0146] In summary, embodiments of this application provide an image processing method, apparatus, electronic device, and readable storage medium. For historical image pairs in a target image sequence where image matching has been completed, the method obtains the number of historical matching pairs corresponding to each historical image pair in at least one of the historical image pairs, and obtains the number of first feature points corresponding to the last frame of the historical image in the at least one historical image pair. Based on whether the obtained number of historical matching pairs is within a preset range of matching pairs, a target processing method corresponding to the number of first feature points is determined, where the target processing method is expected to obtain a number of matching pairs within the preset range of matching pairs. Then, a second feature point number is determined based on the target processing method and the number of first feature points. Finally, feature point extraction and matching are performed on the image pairs to be processed in the target image sequence based on the second feature point number, thereby obtaining the target matching pairs corresponding to the image pairs to be processed. In this way, based on the number of significant features in the current scene as reflected by at least one number of historical matching pairs, the number of first feature points used in the acquisition process of the last number of historical matching pairs can be processed to obtain the number of feature points determined based on the current scene. Then, feature point extraction and matching can be performed based on this number of feature points, thereby reducing the situation where the number of matching pairs is too high or too low compared to the current scene.
[0147] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0148] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0149] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0150] The above description is merely an optional embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An image processing method, characterized in that, The method includes: The number of historical matching pairs corresponding to at least one historical image pair that has completed image matching in the target image sequence is obtained, and the number of first feature points corresponding to the last frame historical image in the historical image pair is obtained, wherein the number of historical matching pairs corresponding to a historical image pair is the number of matching feature point pairs obtained by performing feature point matching on the feature points of multiple images included in the historical image pair. Based on whether the number of each historical matching pair is within the preset number of matching pairs, the target processing method corresponding to the number of the first feature points is determined, wherein the number of matching pairs expected to be obtained by the target processing method is within the preset number of matching pairs, and the target processing method is to keep it unchanged, increase it, or decrease it. The number of second feature points is determined based on the target processing method and the number of the first feature points; Based on the second number of feature points, feature points are extracted from the image pair to be processed, and feature point matching is performed to obtain a target matching pair, wherein the image pair to be processed is an image in the target image sequence.
2. The method according to claim 1, characterized in that, Determining the number of second feature points based on the target processing method and the number of the first feature points includes: When the target processing method is to reduce, the number of the first feature points is reduced according to the first preset step size, or according to the difference between the number of the last historical matching pair among the obtained number of historical matching pairs and the preset range of the number of matching pairs, or according to the difference between the number of the first feature points and the preset range of the number of feature points, to obtain the number of the second feature points.
3. The method according to claim 2, characterized in that, The step of determining the number of second feature points based on the target processing method and the number of the first feature points further includes: When the target processing method is to increase, the number of the first feature points is increased according to the second preset step size, or according to the difference between the number of the last historical matching pairs and the preset number of matching pairs, or according to the difference between the number of the first feature points and the preset number of feature points, to obtain the second number of feature points, wherein the second preset step size is greater than the first preset step size.
4. The method according to any one of claims 1-3, characterized in that, Determining the number of second feature points based on the target processing method and the number of the first feature points includes: When the target processing method indicates that the number of the first feature points needs to be adjusted, it is determined whether the number of the first feature points is adjustable according to the preset range of the number of feature points. When the number of the first feature points is adjustable, within the preset number of feature points, the number of the first feature points is increased or decreased according to the target processing method to obtain the number of the second feature points, wherein both the number of the first feature points and the number of the second feature points are within the preset number of feature points.
5. The method according to claim 1, characterized in that, The step of obtaining the number of first feature points corresponding to the last frame of the historical image in the historical image pair includes: The first level of the feature extractor corresponding to the last frame of the historical image in the historical image pair is obtained from the multi-level feature extractor. The multi-level feature extractor includes multiple levels of feature extractors. The number of feature points extracted by the feature extractors at different levels is different. The number of feature points that the first level of feature extractor can extract is the first number of feature points. Determining the number of second feature points based on the target processing method and the number of the first feature points includes: According to the target processing method, a second-level feature extractor is selected from the multi-level feature extractors, wherein the number of feature points that the second-level feature extractor can extract is the number of the second feature points.
6. The method according to claim 5, characterized in that, The step of selecting a second-level feature extractor from the multi-level feature extractors according to the target processing method includes: When the first level is the optimal level corresponding to the target processing method, the first level is used as the second level; When the first level is not the optimal level corresponding to the target processing method, a level different from the first level is selected from the multi-level feature extractor as the second level according to the target processing method.
7. The method according to any one of claims 1-3 and 5-6, characterized in that, The number of historical matching pairs obtained is multiple. The step of determining the target processing method corresponding to the number of the first feature points based on whether the number of each historical matching pair is within a preset range includes: Based on the preset maximum number of matching pairs, the preset minimum number of matching pairs, and the obtained historical number of matching pairs, the first number of times the historical number of matching pairs is continuously greater than the preset maximum number of matching pairs and the second number of times the historical number of matching pairs is continuously less than the preset minimum number of matching pairs are obtained, wherein the preset maximum number of matching pairs and the preset minimum number of matching pairs are the upper and lower limits of the preset number of matching pairs range. If the first number of times reaches a preset number of times, the target processing method corresponding to the number of the first feature points is determined to be reduction, wherein the preset number of times is the number of the number of historical matching pairs obtained; If the second number of times reaches the preset number of times, the target processing method corresponding to the number of the first feature points is determined to be increasing; If neither the first count nor the second count reaches the preset number, the target processing method corresponding to the number of the first feature points is determined to remain unchanged.
8. The method according to any one of claims 1-3 and 5-6, characterized in that, The step of performing feature point matching to obtain target matching pairs includes: When the target processing method indicates that the number of the first feature points needs to be adjusted, it is determined whether the first similarity value used in image matching of the last frame of historical image is adjustable according to the preset similarity range; When the first similarity value is adjustable, the first similarity value is increased or decreased to obtain the second similarity value. Feature point matching is performed based on the second similarity to obtain the target matching pair.
9. The method according to claim 8, characterized in that, The step of increasing the first similarity to obtain a second similarity, when the first similarity value is adjustable, includes: When the target processing method is to reduce and the first similarity can be increased, the first similarity is increased within the preset similarity range by a third preset step size to obtain the second similarity.
10. The method according to claim 8, characterized in that, The step of reducing the first similarity to obtain a second similarity when the first similarity value is adjustable includes: When the target processing method is to increase and the first similarity can be decreased, it is determined whether the first similarity is greater than the median of the preset similarity range; If the first similarity is greater than the median of the preset similarity range, the second similarity is obtained by subtracting half of the difference between the preset maximum similarity and the preset minimum similarity from the first similarity, wherein the preset maximum similarity is the upper limit of the preset similarity range and the preset minimum similarity is the lower limit of the preset similarity range. If the first similarity is not greater than the median of the preset similarity range, the preset minimum similarity is taken as the second similarity.
11. The method according to any one of claims 1-3 and 5-6, characterized in that, The step of extracting feature points from the image pair to be processed based on the second number of feature points includes: The image pairs in the target image sequence that have not undergone feature point extraction are taken as the image pairs to be processed, and feature points are extracted from the image pairs to be processed according to the second number of feature points.
12. The method according to any one of claims 1-3 and 5-6, characterized in that, The method further includes: Image reconstruction is performed based on the obtained target matching pairs.
13. An image processing apparatus, characterized in that, The device includes: The information acquisition module is used to obtain the number of historical matching pairs corresponding to at least one historical image pair that has completed image matching in the target image sequence, and to obtain the number of first feature points corresponding to the last frame historical image in the historical image pair, wherein the number of historical matching pairs corresponding to a historical image pair is the number of matching feature point pairs obtained by performing feature point matching on the feature points of multiple images included in the historical image pair. The method determination module is used to determine the target processing method corresponding to the number of the first feature points based on whether the number of each historical matching pair is within a preset number of matching pairs. The number of matching pairs that the target processing method expects to obtain is within the preset number of matching pairs. The target processing method is to keep it unchanged, increase it, or decrease it. The quantity determination module is used to determine the quantity of the second feature points based on the target processing method and the quantity of the first feature points; The first processing module is used to extract feature points from the image pair to be processed according to the second number of feature points, and to perform feature point matching to obtain a target matching pair, wherein the image pair to be processed is an image in the target image sequence.
14. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor to implement the image processing method according to any one of claims 1-12.
15. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the image processing method as described in any one of claims 1-12.
Citation Information
Patent Citations
Pipeline change detection method based on deep learning and unmanned aerial vehicle images
CN111967337A
Weak texture and dynamic scene visual SLAM positioning method based on RGBD camera
CN113379842A
Mapping method and device, computer readable storage medium and electronic equipment
CN113409368A